PPP, CORE, ppp_close() and ppp_sighup() ended up sharing almost everything, merged

Merged ppp_sighup() to ppp_close() using an optional argument  "nocarrier"
on ppp_close().
This commit is contained in:
Sylvain Rochet
2015-02-22 14:25:36 +01:00
parent b040ace4c2
commit 4be7fccad3
5 changed files with 38 additions and 76 deletions

View File

@@ -92,6 +92,9 @@ struct pppapi_msg_msg {
struct {
u16_t holdoff;
} open;
struct {
u8_t nocarrier;
} close;
struct {
u8_t cmd;
void *arg;
@@ -134,8 +137,7 @@ ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_add
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
#endif /* PPPOL2TP_SUPPORT */
err_t pppapi_open(ppp_pcb *pcb, u16_t holdoff);
err_t pppapi_close(ppp_pcb *pcb);
void pppapi_sighup(ppp_pcb *pcb);
err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier);
err_t pppapi_free(ppp_pcb *pcb);
err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
#if LWIP_NETIF_STATUS_CALLBACK

View File

@@ -467,13 +467,13 @@ err_t ppp_open(ppp_pcb *pcb, u16_t holdoff);
* Initiate the end of a PPP connection.
* Any outstanding packets in the queues are dropped.
* Return 0 on success, an error code on failure.
*
* Setting nocarrier to 1 close the PPP connection without initiating the
* shutdown procedure. Always using nocarrier = 0 is still recommended,
* this is going to take a little longer time if your link is down, but
* is a safer choice for the PPP state machine.
*/
err_t ppp_close(ppp_pcb *pcb);
/*
* Indicate to the PPP stack that the line has disconnected.
*/
void ppp_sighup(ppp_pcb *pcb);
err_t ppp_close(ppp_pcb *pcb, u8_t nocarrier);
/*
* Release the control block.