Hi everybody

I know I am number 748 posting this question but looking at postings having the 
similar question as me, I didn't find any programming examples.

I plan to take the lwIP with PPP to a single threaded context, because our 
braindead Operating System OSE has such specific mailbox handling and process 
creation, that I seems to me it would be the best to use the tcp callback api.

However the pppOpen requires creating a thread. In my opinion even this could 
be managed in a workaround (has somebody an idea how to do it and how the while 
loop in the pppMain could be broken up?).

The key question is: What should I do with the callback functions in ppp.c if 
there is no tcpip thread pending on a mailbox? Why is there the comment in 
ppp.c:

/* these callbacks are necessary because lcp_* functions
   must be called in the same context as pppInput(),
   namely the tcpip_thread(), essentially because
   they manipulate timeouts which are thread-private
*/
static void
pppStartCB(void *arg)
{

static void
pppStopCB(void *arg)
{

Could there something go wrong if I just call the client callback functions 
directly instead of being synchronized with the tcpip thread through a mailbox 
(I wont have a tcpip thread in my context)? In a single threaded context I am 
in the same thread context as the tcpip thread afaik.

Thus something in the ppp.c like:

static void pppInProc(int pd, u_char *s, int l)
{
   //some stuff

   //instead of registering pppInput as a callback
   //and sending a message to the tcpip thread
   //(that doesnt exist in my context) .....

      /* Dispatch the packet thereby consuming it. */
      if(tcpip_callback(pppInput, pc->inHead) != ERR_OK) {

   //.... can I just call the callback function directly?
   //like
      
      pppInput(pc->inHead);


TIA
George
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to