diff options
author | brian <brian@FreeBSD.org> | 2002-04-16 23:57:09 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2002-04-16 23:57:09 +0000 |
commit | b86a2d03f8a98e438b3c78ca9fb2a04a1565f133 (patch) | |
tree | 5b0847031a0b3f8cbd6098a3ecd67ce4673d2eca /usr.sbin/ppp/pred.c | |
parent | a9db9e22216eec27a36b64873a2eeb434586b0dd (diff) | |
download | FreeBSD-src-b86a2d03f8a98e438b3c78ca9fb2a04a1565f133.zip FreeBSD-src-b86a2d03f8a98e438b3c78ca9fb2a04a1565f133.tar.gz |
Make the way FSM options are processed easier to read by using structures
instead of u_char *.
The changes are cosmetic except:
RecvConfigAck() now displays the options that are being ACK'd
Huge (bogus) options sent from the peer won't cause an infinite loop
SendIdent and ReceiveIdent are displayed consistenlty with other FSM data
LCP AUTHPROTO options that aren't understood are NAK'd, not REJ'd
Diffstat (limited to 'usr.sbin/ppp/pred.c')
-rw-r--r-- | usr.sbin/ppp/pred.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/usr.sbin/ppp/pred.c b/usr.sbin/ppp/pred.c index d1a5b53..d286a97 100644 --- a/usr.sbin/ppp/pred.c +++ b/usr.sbin/ppp/pred.c @@ -151,7 +151,7 @@ Pred1ResetOutput(void *v) } static void * -Pred1InitInput(struct lcp_opt *o) +Pred1InitInput(struct fsm_opt *o) { struct pred1_state *state; state = (struct pred1_state *)malloc(sizeof(struct pred1_state)); @@ -161,7 +161,7 @@ Pred1InitInput(struct lcp_opt *o) } static void * -Pred1InitOutput(struct lcp_opt *o) +Pred1InitOutput(struct fsm_opt *o) { struct pred1_state *state; state = (struct pred1_state *)malloc(sizeof(struct pred1_state)); @@ -294,32 +294,22 @@ Pred1DictSetup(void *v, struct ccp *ccp, u_short proto, struct mbuf *bp) } static const char * -Pred1DispOpts(struct lcp_opt *o) +Pred1DispOpts(struct fsm_opt *o) { return NULL; } static void -Pred1InitOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg) +Pred1InitOptsOutput(struct fsm_opt *o, const struct ccp_config *cfg) { - o->len = 2; + o->hdr.len = 2; } static int -Pred1SetOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg) +Pred1SetOpts(struct fsm_opt *o, const struct ccp_config *cfg) { - if (o->len != 2) { - o->len = 2; - return MODE_NAK; - } - return MODE_ACK; -} - -static int -Pred1SetOptsInput(struct lcp_opt *o, const struct ccp_config *cfg) -{ - if (o->len != 2) { - o->len = 2; + if (o->hdr.len != 2) { + o->hdr.len = 2; return MODE_NAK; } return MODE_ACK; @@ -332,7 +322,7 @@ const struct ccp_algorithm Pred1Algorithm = { ccp_DefaultUsable, ccp_DefaultRequired, { - Pred1SetOptsInput, + Pred1SetOpts, Pred1InitInput, Pred1Term, Pred1ResetInput, @@ -342,7 +332,7 @@ const struct ccp_algorithm Pred1Algorithm = { { 0, Pred1InitOptsOutput, - Pred1SetOptsOutput, + Pred1SetOpts, Pred1InitOutput, Pred1Term, Pred1ResetOutput, |