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:
Sylvain Rochet
2016-07-02 20:59:50 +02:00
parent b97c4d96e2
commit e7069d6e82
3 changed files with 25 additions and 6 deletions

View File

@@ -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);
}