PPP, improved PAP and CHAP timeout/request/maxrequests configuration values

This commit is contained in:
Sylvain Rochet 2012-12-09 20:24:22 +01:00
parent 63459f65fb
commit defef2222a
5 changed files with 26 additions and 5 deletions

View File

@ -1888,18 +1888,30 @@
#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
#endif #endif
#ifndef UPAP_DEFTRANSMITS
#define UPAP_DEFTRANSMITS 10 /* Maximum number of auth-reqs to send */
#endif
#if PPP_SERVER
#ifndef UPAP_DEFREQTIME #ifndef UPAP_DEFREQTIME
#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
#endif #endif
#endif /* PPP_SERVER */
#ifndef CHAP_DEFTIMEOUT #ifndef CHAP_DEFTIMEOUT
#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ #define CHAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
#endif #endif
#ifndef CHAP_DEFTRANSMITS #ifndef CHAP_DEFTRANSMITS
#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */
#endif #endif
#if PPP_SERVER
#ifndef CHAP_DEFREQTIME
#define CHAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
#endif
#endif /* PPP_SERVER */
/* Default number of times we receive our magic number from the peer /* Default number of times we receive our magic number from the peer
before deciding the link is looped-back. */ before deciding the link is looped-back. */
#ifndef LCP_DEFLOOPBACKFAIL #ifndef LCP_DEFLOOPBACKFAIL

View File

@ -225,9 +225,11 @@ typedef struct ppp_settings_s {
#endif /* PPP_REMOTENAME */ #endif /* PPP_REMOTENAME */
#if CHAP_SUPPORT #if CHAP_SUPPORT
u8_t chap_timeout_time; u8_t chap_timeout_time; /* Timeout (seconds) for retransmitting req */
u8_t chap_max_transmits; u8_t chap_max_transmits; /* max # times to send challenge */
u8_t chap_rechallenge_time; #if PPP_SERVER
u8_t chap_rechallenge_time; /* Time to wait for auth-req from peer */
#endif /* PPP_SERVER */
#endif /* CHAP_SUPPPORT */ #endif /* CHAP_SUPPPORT */
u8_t lcp_loopbackfail; /* Number of times we receive our magic number from the peer u8_t lcp_loopbackfail; /* Number of times we receive our magic number from the peer

View File

@ -110,7 +110,9 @@ typedef struct upap_state {
u8_t us_timeouttime; /* Timeout (seconds) for auth-req retrans. */ u8_t us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
u8_t us_transmits; /* Number of auth-reqs sent */ u8_t us_transmits; /* Number of auth-reqs sent */
u8_t us_maxtransmits; /* Maximum number of auth-reqs to send */ u8_t us_maxtransmits; /* Maximum number of auth-reqs to send */
#if PPP_SERVER
u8_t us_reqtimeout; /* Time to wait for auth-req from peer */ u8_t us_reqtimeout; /* Time to wait for auth-req from peer */
#endif /* PPP_SERVER */
} upap_state; } upap_state;
#endif /* PAP_SUPPORT */ #endif /* PAP_SUPPORT */

View File

@ -260,6 +260,9 @@ ppp_pcb *ppp_new(void) {
#if CHAP_SUPPORT #if CHAP_SUPPORT
pcb->settings.chap_timeout_time = CHAP_DEFTIMEOUT; pcb->settings.chap_timeout_time = CHAP_DEFTIMEOUT;
pcb->settings.chap_max_transmits = CHAP_DEFTRANSMITS; pcb->settings.chap_max_transmits = CHAP_DEFTRANSMITS;
#if PPP_SERVER
pcb->settings.chap_rechallenge_time = CHAP_DEFREQTIME;
#endif /* PPP_SERVER */
#endif /* CHAP_SUPPPORT */ #endif /* CHAP_SUPPPORT */
pcb->settings.lcp_loopbackfail = LCP_DEFLOOPBACKFAIL; pcb->settings.lcp_loopbackfail = LCP_DEFLOOPBACKFAIL;
pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL; pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL;

View File

@ -144,8 +144,10 @@ static void upap_init(ppp_pcb *pcb) {
#endif /* PPP_SERVER */ #endif /* PPP_SERVER */
pcb->upap.us_id = 0; pcb->upap.us_id = 0;
pcb->upap.us_timeouttime = UPAP_DEFTIMEOUT; pcb->upap.us_timeouttime = UPAP_DEFTIMEOUT;
pcb->upap.us_maxtransmits = 10; pcb->upap.us_maxtransmits = UPAP_DEFTRANSMITS;
#if PPP_SERVER
pcb->upap.us_reqtimeout = UPAP_DEFREQTIME; pcb->upap.us_reqtimeout = UPAP_DEFREQTIME;
#endif /* PPP_SERVER */
} }