mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 17:13:49 +08:00
PPP: introduce ppp_set_passive and ppp_set_silent
There is two passive modes for PPPoS, passive more, for which we will try to connect and then listen silently, and silent mode, for which we will listen silently from the beginning. Introduce ppp_set_passive and ppp_set_silent so the mode can be chosen before connecting/listening.
This commit is contained in:
@@ -288,18 +288,12 @@ err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff) {
|
||||
* established before calling this.
|
||||
*/
|
||||
err_t ppp_listen(ppp_pcb *pcb) {
|
||||
lcp_options *lcp_wo;
|
||||
|
||||
if (pcb->phase != PPP_PHASE_DEAD) {
|
||||
return ERR_ALREADY;
|
||||
}
|
||||
|
||||
PPPDEBUG(LOG_DEBUG, ("ppp_listen[%d]\n", pcb->netif->num));
|
||||
|
||||
/* Wait passively */
|
||||
lcp_wo = &pcb->lcp_wantoptions;
|
||||
lcp_wo->silent = 1;
|
||||
|
||||
if (pcb->link_cb->listen) {
|
||||
return pcb->link_cb->listen(pcb, pcb->link_ctx_cb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user