lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] PPP stack


From: tbutler
Subject: Re: [lwip-users] PPP stack
Date: Wed, 20 Apr 2005 11:41:13 +0200




Hello Reinhard,

>Is there any documentation or example code avilable, explaining how to use
>ppp on the server side ? What is the interface point between my sio device
>and the ppp stack ?

As far as I know, there isn't any documentation about this. You must
implement the interface defined in <sio.h> over your particular serial
hardware. PPP doesn't perform sio_open(); rather, you must do that in your
own code and pass the corresponding handle of type sio_fd_t when you call
pppOpen(). This call will launch an input thread which uses sio_read() and
sio_read_abort().The abort function is necessary to wake up the input
thread from another thread context, notably the calls pppClose() and
pppSigHUP(). If you don't have such a need, you might get by without this,
although I couldn't say for sure. On the transmit side, all outgoing PPP
frames are sent from within the tcpip thread, which will call sio_write().

Along these lines, I'll take this opportunity to note what I feel is a
shortcoming in the current PPP implementation. When the PPP input thread is
launched in pppOpen(), the code uses sys_thread_new() to create the thread.
Later, when the thread exits, there is no corresponding call to release the
resource. In the majority of implementations, this may not be a problem,
assuming that sys_thread_new() is nothing more than a passthrough to a
corresponding OS function, and later everything gets cleaned up when the
thread hits its return point.

However, if the implementation's sys_thread_new() actually manages
preallocated resources (as does mine), this is a problem. So I added the
function sys_thread_free() to the system architecture interface, and call
it in the PPP input thread just before exiting.

Regards,
Tim Butler





reply via email to

[Prev in Thread] Current Thread [Next in Thread]