improved PPP default interface management, added ppp_set_default() API call

This commit is contained in:
Sylvain Rochet
2012-07-14 17:25:24 +02:00
parent 78565026ac
commit 9e021cd1a8
7 changed files with 45 additions and 42 deletions

View File

@@ -58,6 +58,26 @@ ppp_pcb *pppapi_new(void) {
}
/**
* Call ppp_set_default() inside the tcpip_thread context.
*/
static void pppapi_do_ppp_set_default(struct pppapi_msg_msg *msg) {
ppp_set_default(msg->ppp);
TCPIP_PPPAPI_ACK(msg);
}
/**
* Call ppp_set_default() in a thread-safe way by running that function inside the
* tcpip_thread context.
*/
void pppapi_set_default(ppp_pcb *pcb) {
struct pppapi_msg msg;
msg.function = pppapi_do_ppp_set_default;
msg.msg.ppp = pcb;
TCPIP_PPPAPI(&msg);
}
/**
* Call ppp_set_auth() inside the tcpip_thread context.
*/