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/deflate.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/deflate.c')
-rw-r--r-- | usr.sbin/ppp/deflate.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/ppp/deflate.c b/usr.sbin/ppp/deflate.c index ef04c27..7e9c77d 100644 --- a/usr.sbin/ppp/deflate.c +++ b/usr.sbin/ppp/deflate.c @@ -436,7 +436,7 @@ DeflateDictSetup(void *v, struct ccp *ccp, u_short proto, struct mbuf *mi) } static const char * -DeflateDispOpts(struct lcp_opt *o) +DeflateDispOpts(struct fsm_opt *o) { static char disp[7]; /* Must be used immediately */ @@ -445,17 +445,17 @@ DeflateDispOpts(struct lcp_opt *o) } static void -DeflateInitOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg) +DeflateInitOptsOutput(struct fsm_opt *o, const struct ccp_config *cfg) { - o->len = 4; + o->hdr.len = 4; o->data[0] = ((cfg->deflate.out.winsize - 8) << 4) + 8; o->data[1] = '\0'; } static int -DeflateSetOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg) +DeflateSetOptsOutput(struct fsm_opt *o, const struct ccp_config *cfg) { - if (o->len != 4 || (o->data[0] & 15) != 8 || o->data[1] != '\0') + if (o->hdr.len != 4 || (o->data[0] & 15) != 8 || o->data[1] != '\0') return MODE_REJ; if ((o->data[0] >> 4) + 8 > 15) { @@ -467,11 +467,11 @@ DeflateSetOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg) } static int -DeflateSetOptsInput(struct lcp_opt *o, const struct ccp_config *cfg) +DeflateSetOptsInput(struct fsm_opt *o, const struct ccp_config *cfg) { int want; - if (o->len != 4 || (o->data[0] & 15) != 8 || o->data[1] != '\0') + if (o->hdr.len != 4 || (o->data[0] & 15) != 8 || o->data[1] != '\0') return MODE_REJ; want = (o->data[0] >> 4) + 8; @@ -488,7 +488,7 @@ DeflateSetOptsInput(struct lcp_opt *o, const struct ccp_config *cfg) } static void * -DeflateInitInput(struct lcp_opt *o) +DeflateInitInput(struct fsm_opt *o) { struct deflate_state *state; @@ -511,7 +511,7 @@ DeflateInitInput(struct lcp_opt *o) } static void * -DeflateInitOutput(struct lcp_opt *o) +DeflateInitOutput(struct fsm_opt *o) { struct deflate_state *state; |