mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-15 12:47:08 +08:00
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:
@@ -205,6 +205,27 @@ int pppapi_over_l2tp_open(ppp_pcb *pcb, struct netif *netif, ip_addr_t *ipaddr,
|
||||
#endif /* PPPOL2TP_SUPPORT */
|
||||
|
||||
|
||||
/**
|
||||
* Call ppp_reopen() inside the tcpip_thread context.
|
||||
*/
|
||||
static void pppapi_do_ppp_reopen(struct pppapi_msg_msg *msg) {
|
||||
ppp_reopen(msg->ppp, msg->msg.reopen.holdoff);
|
||||
TCPIP_PPPAPI_ACK(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call ppp_reopen() in a thread-safe way by running that function inside the
|
||||
* tcpip_thread context.
|
||||
*/
|
||||
void pppapi_reopen(ppp_pcb *pcb, u16_t holdoff) {
|
||||
struct pppapi_msg msg;
|
||||
msg.function = pppapi_do_ppp_reopen;
|
||||
msg.msg.ppp = pcb;
|
||||
msg.msg.msg.reopen.holdoff = holdoff;
|
||||
TCPIP_PPPAPI(&msg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call ppp_close() inside the tcpip_thread context.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user