aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/fsm.h
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-02-26 21:28:14 +0000
committerBrian Somers <brian@FreeBSD.org>1999-02-26 21:28:14 +0000
commit479508cf28814ea9a3826a41dc0fce319bcde1c8 (patch)
tree28c53bc887f60921fa5578c81fa9d060bf2241b7 /usr.sbin/ppp/fsm.h
parent617f28f74418f6ecc2a4d7d741daff5709721963 (diff)
downloadsrc-479508cf28814ea9a3826a41dc0fce319bcde1c8.tar.gz
src-479508cf28814ea9a3826a41dc0fce319bcde1c8.zip
Allow control over the number of ConfigREQ & TermREQ attempts
that are made in each of the FSMs (LCP, CCP & IPCP) and the number of REQs/Challenges for PAP/CHAP by accepting more arguments in the ``set {c,ip,l}cpretry'' and ``set {ch,p}apretry'' commands. Change the non-convergence thresholds to 3 times the number of configured REQ tries (rather than the previous fixed ``10''). We now notice repeated NAKs and REJs rather than just REQs. Don't suggest that CHAP 0x05 isn't supported when it's not configured. Fix some bugs that expose themselves with smaller numbers of retries: o Handle instantaneous disconnects (set device /dev/null) correctly by stopping all fsm timers in fsm2initial. o Don't forget to uu_unlock() devices that are files but are not ttys (set device /dev/zero). Fix a *HORRENDOUS* bug in RFC1661 (already fixed for an Open event in state ``Closed''): According to the state transition table, a RCR+ or RCR- received in the ``Stopped'' state are supposed to InitRestartCounter, SendConfigReq and SendConfig{Ack,Nak}. However, in ``Stopped'', we haven't yet done a TLS (or the last thing we did is a TLF). We must therefore do the TLS at this point ! This was never noticed before because LCP and CCP used not use LayerStart() for anything interesting, and IPCP tends to go into Stopped then get a Down because of an LCP RTR rather than getting a RCR again.
Notes
Notes: svn path=/head/; revision=44305
Diffstat (limited to 'usr.sbin/ppp/fsm.h')
-rw-r--r--usr.sbin/ppp/fsm.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/usr.sbin/ppp/fsm.h b/usr.sbin/ppp/fsm.h
index 6a047ba9e95c..c25a6ba87706 100644
--- a/usr.sbin/ppp/fsm.h
+++ b/usr.sbin/ppp/fsm.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: fsm.h,v 1.18 1998/06/20 00:19:38 brian Exp $
+ * $Id: fsm.h,v 1.19 1998/06/25 22:33:24 brian Exp $
*
* TODO:
*/
@@ -45,8 +45,17 @@
#define OPEN_PASSIVE -1
+#define FSM_REQ_TIMER 1
+#define FSM_TRM_TIMER 2
+
struct fsm;
+struct fsm_retry {
+ u_int timeout; /* FSM retry frequency */
+ u_int maxreq; /* Max Config REQ retries */
+ u_int maxtrm; /* Max Term REQ retries */
+};
+
struct fsm_decode {
u_char ack[100], *ackend;
u_char nak[100], *nakend;
@@ -58,7 +67,7 @@ struct fsm_callbacks {
void (*LayerDown) (struct fsm *); /* About to come down (tld) */
void (*LayerStart) (struct fsm *); /* Layer about to start up (tls) */
void (*LayerFinish) (struct fsm *); /* Layer now down (tlf) */
- void (*InitRestartCounter) (struct fsm *); /* Set fsm timer load */
+ void (*InitRestartCounter) (struct fsm *, int); /* Set fsm timer load */
void (*SendConfigReq) (struct fsm *); /* Send REQ please */
void (*SentTerminateReq) (struct fsm *); /* Term REQ just sent */
void (*SendTerminateAck) (struct fsm *, u_char); /* Send Term ACK please */
@@ -88,7 +97,12 @@ struct fsm {
int state; /* State of the machine */
u_char reqid; /* Next request id */
int restart; /* Restart counter value */
- int maxconfig; /* Max config REQ before a close() */
+
+ struct {
+ int reqs; /* Max config REQs before a close() */
+ int naks; /* Max config NAKs before a close() */
+ int rejs; /* Max config REJs before a close() */
+ } more;
struct pppTimer FsmTimer; /* Restart Timer */
struct pppTimer OpenTimer; /* Delay before opening */
@@ -143,7 +157,7 @@ struct fsmconfig {
u_char length;
};
-extern void fsm_Init(struct fsm *, const char *, u_short, int, int, int, int,
+extern void fsm_Init(struct fsm *, const char *, u_short, int, int, int,
struct bundle *, struct link *, const struct fsm_parent *,
struct fsm_callbacks *, const char *[3]);
extern void fsm_Output(struct fsm *, u_int, u_int, u_char *, int);