mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-12 09:24:39 +08:00
added LCP adaptive echo from Debian patches, I like the idea
This commit is contained in:
parent
eb75ae05c6
commit
54d5ee5562
@ -75,6 +75,9 @@ static void lcp_delayed_up __P((void *));
|
|||||||
*/
|
*/
|
||||||
int lcp_echo_interval = 0; /* Interval between LCP echo-requests */
|
int lcp_echo_interval = 0; /* Interval between LCP echo-requests */
|
||||||
int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */
|
int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */
|
||||||
|
#if PPP_LCP_ADAPTIVE
|
||||||
|
bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */
|
||||||
|
#endif
|
||||||
bool lax_recv = 0; /* accept control chars in asyncmap */
|
bool lax_recv = 0; /* accept control chars in asyncmap */
|
||||||
bool noendpoint = 0; /* don't send/accept endpoint discriminator */
|
bool noendpoint = 0; /* don't send/accept endpoint discriminator */
|
||||||
|
|
||||||
@ -153,6 +156,10 @@ static option_t lcp_option_list[] = {
|
|||||||
OPT_PRIO },
|
OPT_PRIO },
|
||||||
{ "lcp-echo-interval", o_int, &lcp_echo_interval,
|
{ "lcp-echo-interval", o_int, &lcp_echo_interval,
|
||||||
"Set time in seconds between LCP echo requests", OPT_PRIO },
|
"Set time in seconds between LCP echo requests", OPT_PRIO },
|
||||||
|
#if PPP_LCP_ADAPTIVE
|
||||||
|
{ "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive,
|
||||||
|
"Suppress LCP echo requests if traffic was received", 1 },
|
||||||
|
#endif
|
||||||
{ "lcp-restart", o_int, &lcp_fsm[0].timeouttime,
|
{ "lcp-restart", o_int, &lcp_fsm[0].timeouttime,
|
||||||
"Set time in seconds between LCP retransmissions", OPT_PRIO },
|
"Set time in seconds between LCP retransmissions", OPT_PRIO },
|
||||||
{ "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits,
|
{ "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits,
|
||||||
@ -2325,6 +2332,24 @@ LcpSendEchoRequest (f)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PPP_LCP_ADAPTIVE
|
||||||
|
/*
|
||||||
|
* If adaptive echos have been enabled, only send the echo request if
|
||||||
|
* no traffic was received since the last one.
|
||||||
|
*/
|
||||||
|
if (lcp_echo_adaptive) {
|
||||||
|
static unsigned int last_pkts_in = 0;
|
||||||
|
|
||||||
|
update_link_stats(f->unit);
|
||||||
|
link_stats_valid = 0;
|
||||||
|
|
||||||
|
if (link_stats.pkts_in != last_pkts_in) {
|
||||||
|
last_pkts_in = link_stats.pkts_in;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make and send the echo request frame.
|
* Make and send the echo request frame.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user