summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/fsm.h
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-02-26 21:28:14 +0000
committerbrian <brian@FreeBSD.org>1999-02-26 21:28:14 +0000
commitee13d15d8f4dbbc16f743a3690a6e495279d5559 (patch)
treec5807a2099a7111ab5ef9d2ea6aee114863663ec /usr.sbin/ppp/fsm.h
parent7810a0ea5a45f6d62932ef2f65c9127f4683098e (diff)
downloadFreeBSD-src-ee13d15d8f4dbbc16f743a3690a6e495279d5559.zip
FreeBSD-src-ee13d15d8f4dbbc16f743a3690a6e495279d5559.tar.gz
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.
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 6a047ba..c25a6ba 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);
OpenPOWER on IntegriCloud