PPP, using timeouts values defined in opt.h instead of values defined in PPP headers or statically assigned values

This commit is contained in:
Sylvain Rochet 2012-12-09 18:42:06 +01:00
parent 07e72d2ac8
commit c68e1ceb64
4 changed files with 9 additions and 7 deletions

View File

@ -152,10 +152,12 @@ typedef struct fsm_callbacks {
/* /*
* Timeouts. * Timeouts.
*/ */
#if 0 /* moved to opt.h */
#define DEFTIMEOUT 3 /* Timeout time in seconds */ #define DEFTIMEOUT 3 /* Timeout time in seconds */
#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ #define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ #define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
#endif /* moved to opt.h */
/* /*

View File

@ -90,8 +90,8 @@
*/ */
#if 0 /* moved to opt.h */ #if 0 /* moved to opt.h */
#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ #define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */
#endif /* moved to opt.h */
#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 /* moved to opt.h */
/* /*
* Each interface is described by upap structure. * Each interface is described by upap structure.

View File

@ -79,10 +79,10 @@ void fsm_init(fsm *f) {
f->state = PPP_FSM_INITIAL; f->state = PPP_FSM_INITIAL;
f->flags = 0; f->flags = 0;
f->id = 0; /* XXX Start with random id? */ f->id = 0; /* XXX Start with random id? */
f->timeouttime = DEFTIMEOUT; f->timeouttime = FSM_DEFTIMEOUT;
f->maxconfreqtransmits = DEFMAXCONFREQS; f->maxconfreqtransmits = FSM_DEFMAXCONFREQS;
f->maxtermtransmits = DEFMAXTERMREQS; f->maxtermtransmits = FSM_DEFMAXTERMREQS;
f->maxnakloops = DEFMAXNAKLOOPS; f->maxnakloops = FSM_DEFMAXNAKLOOPS;
f->term_reason_len = 0; f->term_reason_len = 0;
} }

View File

@ -258,8 +258,8 @@ ppp_pcb *ppp_new(void) {
/* default configuration */ /* default configuration */
pcb->settings.usepeerdns = 1; pcb->settings.usepeerdns = 1;
#if CHAP_SUPPORT #if CHAP_SUPPORT
pcb->settings.chap_timeout_time = 3; pcb->settings.chap_timeout_time = CHAP_DEFTIMEOUT;
pcb->settings.chap_max_transmits = 10; pcb->settings.chap_max_transmits = CHAP_DEFTRANSMITS;
#endif /* CHAP_SUPPPORT */ #endif /* CHAP_SUPPPORT */
pcb->settings.lcp_loopbackfail = DEFLOOPBACKFAIL; pcb->settings.lcp_loopbackfail = DEFLOOPBACKFAIL;
pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL; pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL;