PPP, rename ppp_clear function to ppp_link_start

This function does not clear anything anymore. What it is now is an
optional way to notify PPP that link layer is started, changing the
PPP state from "dead" to "initialize". Rename it accordingly to what
the function really is.
This commit is contained in:
Sylvain Rochet 2016-06-20 00:32:54 +02:00
parent 1d108b400f
commit 7b4bd3343b
5 changed files with 8 additions and 8 deletions

View File

@ -394,8 +394,8 @@ int ppp_init(void);
ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, void *link_ctx_cb,
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
/* Set a PPP PCB to its initial state */
void ppp_clear(ppp_pcb *pcb);
/* Called when link is starting */
void ppp_link_start(ppp_pcb *pcb);
/* Initiate LCP open request */
void ppp_start(ppp_pcb *pcb);

View File

@ -700,8 +700,8 @@ ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, vo
return pcb;
}
/* Set a PPP PCB to its initial state */
void ppp_clear(ppp_pcb *pcb) {
/** Called when link is starting */
void ppp_link_start(ppp_pcb *pcb) {
LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF", pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF);
new_phase(pcb, PPP_PHASE_INITIALIZE);
}

View File

@ -921,7 +921,7 @@ pppoe_connect(ppp_pcb *ppp, void *ctx)
}
#endif
ppp_clear(ppp);
ppp_link_start(ppp);
lcp_wo = &ppp->lcp_wantoptions;
lcp_wo->mru = sc->sc_ethif->mtu-PPPOE_HEADERLEN-2; /* two byte PPP protocol discriminator, then IP data */

View File

@ -270,7 +270,7 @@ static err_t pppol2tp_connect(ppp_pcb *ppp, void *ctx) {
pppol2tp_clear(l2tp);
ppp_clear(ppp);
ppp_link_start(ppp);
lcp_wo = &ppp->lcp_wantoptions;
lcp_wo->mru = PPPOL2TP_DEFMRU;

View File

@ -308,7 +308,7 @@ pppos_connect(ppp_pcb *ppp, void *ctx)
pppos_input_free_current_packet(pppos);
#endif /* PPP_INPROC_IRQ_SAFE */
ppp_clear(ppp);
ppp_link_start(ppp);
/* reset PPPoS control block to its initial state */
memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - ( (char*)&((pppos_pcb*)0)->last_xmit - (char*)0 ) );
@ -346,7 +346,7 @@ pppos_listen(ppp_pcb *ppp, void *ctx, const struct ppp_addrs *addrs)
pppos_input_free_current_packet(pppos);
#endif /* PPP_INPROC_IRQ_SAFE */
ppp_clear(ppp);
ppp_link_start(ppp);
/* reset PPPoS control block to its initial state */
memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - ( (char*)&((pppos_pcb*)0)->last_xmit - (char*)0 ) );