PPP, SERVER: added PPPoS server support

New function: ppp_listen(), listen for an incoming PPP connection.
This commit is contained in:
Sylvain Rochet
2015-02-28 22:41:18 +01:00
parent 89771de6d0
commit 371bc91d73
9 changed files with 166 additions and 1 deletions

View File

@@ -463,6 +463,21 @@ void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_p
*/
err_t ppp_open(ppp_pcb *pcb, u16_t holdoff);
#if PPP_SERVER
/*
* Listen for an incoming PPP connection.
*
* This can only be called if PPP is in the dead phase.
*
* Local and remote interface IP addresses, as well as DNS are
* provided through a previously filled struct ppp_addrs.
*
* If this port connects to a modem, the modem connection must be
* established before calling this.
*/
err_t ppp_listen(ppp_pcb *pcb, struct ppp_addrs *addrs);
#endif /* PPP_SERVER */
/*
* Initiate the end of a PPP connection.
* Any outstanding packets in the queues are dropped.

View File

@@ -143,6 +143,10 @@
struct link_callbacks {
/* Start a connection (e.g. Initiate discovery phase) */
err_t (*connect) (ppp_pcb *pcb, void *ctx);
#if PPP_SERVER
/* Listen for an incoming connection (Passive mode) */
err_t (*listen) (ppp_pcb *pcb, void *ctx, struct ppp_addrs *addrs);
#endif /* PPP_SERVER */
/* End a connection (i.e. initiate disconnect phase) */
void (*disconnect) (ppp_pcb *pcb, void *ctx);
/* Free lower protocol control block */