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

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

Reply via email to