On Thu, 17 Feb 2000, Sarel J. Botha wrote:

> On Wed, Feb 16, 2000 at 10:53:41PM +0100, Emmanuel Roger wrote:
> > you should look at mgetty as a reference, it is  already doing autoppp
> > and "login:" fallback.
> 
> I know how they do it. They read() about 7 bytes to figure out if it's
> AutoPPP, then fire off pppd. Then pppd needs to wait for the peer to send
> it's LCP packet again. This slows down authentication quite a bit.

About three seconds with your average client.

> One way of doing it that I thought of: read() a few characters, if we
> detect PPP, fire off pppd using popen(), send the characters we read and
> then send everything we read() in future straight to pppd.

The way I successfully made it (using portslave):

Detect the beginning of the package the normal way. Then you just
select() and read until the end of the PPP frame (0x7e) arrives. Of course
you timeout on a ~1 second pause or if the frame seems to be too big.

Then you fire pppd with a new option and pass on the PPP data.

pppd then reads the new option and shovels the data into its read-queue (this
was not hard to do in the linux 2.2 ppp NI at least). Then the first
read() pppd does will read the already received data.

> Is there really no better way?

At least I made it differently. The kernel 2.3 ppp-drivers are a bit
different, but...

-- 
   Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol


-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [EMAIL PROTECTED]

Reply via email to