PPP: removed PPPoE and PPPoL2TP callback status notifier

Added necessary PPP core functions for PPPoE and PPPoL2TP status
notificaton (ppp_link_failed and ppp_link_end), removed callback,
low level protocol are now calling PPP core "link" functions.
This commit is contained in:
Sylvain Rochet
2015-02-15 00:35:45 +01:00
parent 74fd2dc9ad
commit 808098413c
6 changed files with 33 additions and 100 deletions

View File

@@ -370,6 +370,15 @@ ppp_pcb *ppp_new(struct netif *pppif, ppp_link_status_cb_fn link_status_cb, void
/* initialize the PPP subsystem */
int ppp_init(void);
/* Initiate LCP open request */
void ppp_start(ppp_pcb *pcb);
/* Called when link failed to setup */
void ppp_link_failed(ppp_pcb *pcb);
/* Called when link is normally down (i.e. it was asked to end) */
void ppp_link_end(ppp_pcb *pcb);
/* function called by pppoe.c */
void ppp_input(ppp_pcb *pcb, struct pbuf *pb);

View File

@@ -112,10 +112,6 @@ PACK_STRUCT_END
/* passive */
#define PPPOE_STATE_PADO_SENT 1
#define PPPOE_CB_STATE_UP 0 /* PPPoE link is UP */
#define PPPOE_CB_STATE_DOWN 1 /* PPPoE link is DOWN - normal condition */
#define PPPOE_CB_STATE_FAILED 2 /* Failed to setup PPPoE link */
#define PPPOE_HEADERLEN sizeof(struct pppoehdr)
#define PPPOE_VERTYPE 0x11 /* VER=1, TYPE = 1 */
@@ -144,7 +140,6 @@ struct pppoe_softc {
struct pppoe_softc *next;
struct netif *sc_ethif; /* ethernet interface we are using */
ppp_pcb *pcb; /* PPP PCB */
void (*sc_link_status_cb)(ppp_pcb *pcb, int up);
struct eth_addr sc_dest; /* hardware address of concentrator */
u16_t sc_session; /* PPPoE session id */
@@ -168,7 +163,6 @@ struct pppoe_softc {
#define pppoe_init() /* compatibility define, no initialization needed */
ppp_pcb *pppoe_create(struct netif *pppif,
void (*link_status_cb_ll)(ppp_pcb *pcb, int up),
struct netif *ethif,
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
err_t pppoe_destroy(struct pppoe_softc *sc);

View File

@@ -155,10 +155,6 @@
#define PPPOL2TP_STATE_ICCN_SENT 3
#define PPPOL2TP_STATE_DATA 4
#define PPPOL2TP_CB_STATE_UP 0 /* PPPoL2TP link is UP */
#define PPPOL2TP_CB_STATE_DOWN 1 /* PPPo2TP link is DOWN - normal condition */
#define PPPOL2TP_CB_STATE_FAILED 2 /* Failed to setup PPPo2TP link */
#define PPPOL2TP_OUTPUT_DATA_HEADER_LEN 6 /* Our data header len */
/*
@@ -168,7 +164,6 @@ typedef struct pppol2tp_pcb_s pppol2tp_pcb;
struct pppol2tp_pcb_s {
ppp_pcb *ppp; /* PPP PCB */
u8_t phase; /* L2TP phase */
void (*link_status_cb)(ppp_pcb *pcb, int status);
struct udp_pcb *udp; /* UDP L2TP Socket */
struct netif *netif; /* Output interface, used as a default route */
ip_addr_t remote_ip; /* LNS IP Address */
@@ -198,7 +193,6 @@ struct pppol2tp_pcb_s {
/* Create a new L2TP session. */
ppp_pcb *pppol2tp_create(struct netif *pppif,
void (*link_status_cb_ll)(ppp_pcb *pcb, int status),
struct netif *netif, ip_addr_t *ipaddr, u16_t port, u8_t *secret, u8_t secret_len,
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);