improved PPP API, added ppp_reopen()

This is now the user choice to re-establish the session in the link status callback
by either calling the ppp_reopen() to re-establish or ppp_delete() to free the PPP
control block. Without user intervention, the PPP control block now stay in the dead
phase, allowing the user to re-establish or delete the control block later.
This commit is contained in:
Sylvain Rochet
2012-07-22 20:53:54 +02:00
parent a467d21eba
commit 3c122117fc
8 changed files with 218 additions and 178 deletions

View File

@@ -106,11 +106,10 @@ PACK_STRUCT_END
#define PPPOE_STATE_INITIAL 0
#define PPPOE_STATE_HOLDOFF 1
#define PPPOE_STATE_PADI_SENT 2
#define PPPOE_STATE_PADR_SENT 3
#define PPPOE_STATE_SESSION 4
#define PPPOE_STATE_CLOSING 5
#define PPPOE_STATE_PADI_SENT 1
#define PPPOE_STATE_PADR_SENT 2
#define PPPOE_STATE_SESSION 3
#define PPPOE_STATE_CLOSING 4
/* passive */
#define PPPOE_STATE_PADO_SENT 1
@@ -173,7 +172,6 @@ err_t pppoe_create(struct netif *ethif, ppp_pcb *pcb, void (*link_status_cb)(ppp
err_t pppoe_destroy(struct netif *ifp);
int pppoe_connect(struct pppoe_softc *sc);
void pppoe_reconnect(struct pppoe_softc *sc);
void pppoe_disconnect(struct pppoe_softc *sc);
void pppoe_disc_input(struct netif *netif, struct pbuf *p);

View File

@@ -150,12 +150,11 @@
/* L2TP Session state */
#define PPPOL2TP_STATE_INITIAL 0
#define PPPOL2TP_STATE_HOLDOFF 1
#define PPPOL2TP_STATE_SCCRQ_SENT 2
#define PPPOL2TP_STATE_ICRQ_SENT 3
#define PPPOL2TP_STATE_ICCN_SENT 4
#define PPPOL2TP_STATE_DATA 5
#define PPPOL2TP_STATE_CLOSING 6
#define PPPOL2TP_STATE_SCCRQ_SENT 1
#define PPPOL2TP_STATE_ICRQ_SENT 2
#define PPPOL2TP_STATE_ICCN_SENT 3
#define PPPOL2TP_STATE_DATA 4
#define PPPOL2TP_STATE_CLOSING 5
#define PPPOL2TP_CB_STATE_UP 0 /* PPPoL2TP link is UP */
#define PPPOL2TP_CB_STATE_DOWN 1 /* PPPo2TP link is DOWN - normal condition */