lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] PPP server without OS support


From: Daniel Vogel
Subject: [lwip-users] PPP server without OS support
Date: Tue, 04 Dec 2012 19:54:42 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0

Hi @all

during the last days I tried to implement a (serial) PPP server on top of lwIP without OS support. Finally I succeeded, but in three aspects I wonder if I did it the "right way". Maybe one of you can give me advice how to do it better?

First I wanted the PPP server to be silent until a request comes in from the remote side. I achieved this by modifying the flag "wo->silent" inside the function lcp_init() by setting it to 1. I think it would be better to do this from outside the library. But since pppOverSerialOpen() calls lcp_init() and then initiates the first request, I did not find out how to do it in between.

Second the server needs fixed IP-addresses and has to pass them over to the remote side. To do it I implemented something like:

  PppHandle = pppOpen(0, LinkStatusProc, NULL);
  if (PppHandle > 0)
  {
     ipcp_wantoptions[PppHandle].ouraddr = ownIp;
     ipcp_wantoptions[PppHandle].hisaddr = remoteIp;
  }

Is it correct to modify the wantoptions directly or is there an API function (or callback) to do it better?

Finally after a link has gone. The PPP server needs to fall back into a state where it is ready to negotiate a new connection. I did a pppClose() -> pppOpen() to reopen the interface. Maybe there is something more efficient to do it?

Thank you in advance!

Best regards,
Daniel



reply via email to

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