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

@@ -509,6 +509,20 @@ void ppp_set_mppe(ppp_pcb *pcb, u8_t flags);
*/
#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval)
/*
* Enables the "passive" option in the LCP. With this option, we will attempt
* to initiate a connection; if no reply is received from the peer, we will
* then just wait passively for a valid LCP packet from the peer.
*/
#define ppp_set_passive(ppp, boolval) (ppp->lcp_wantoptions.passive = boolval)
/*
* With this option, we will not transmit LCP packets to initiate a connection
* until a valid LCP packet is received from the peer. This is what we usually
* call the server mode.
*/
#define ppp_set_silent(ppp, boolval) (ppp->lcp_wantoptions.silent = boolval)
/*
* Set a PPP interface as the default network interface
* (used to output all packets for which no specific route is found).