ccp.h (78189) | ccp.h (78411) |
---|---|
1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/usr.sbin/ppp/ccp.h 78189 2001-06-13 21:52:19Z brian $ | 28 * $FreeBSD: head/usr.sbin/ppp/ccp.h 78411 2001-06-18 15:00:22Z brian $ |
29 */ 30 31#define CCP_MAXCODE CODE_RESETACK 32 33#define TY_OUI 0 /* OUI */ 34#define TY_PRED1 1 /* Predictor type 1 */ 35#define TY_PRED2 2 /* Predictor type 2 */ 36#define TY_PUDDLE 3 /* Puddle Jumper */ --- 12 unchanged lines hidden (view full) --- 49#define CCP_NEG_DEFLATE24 2 50#ifdef HAVE_DES 51#define CCP_NEG_MPPE 3 52#define CCP_NEG_TOTAL 4 53#else 54#define CCP_NEG_TOTAL 3 55#endif 56 | 29 */ 30 31#define CCP_MAXCODE CODE_RESETACK 32 33#define TY_OUI 0 /* OUI */ 34#define TY_PRED1 1 /* Predictor type 1 */ 35#define TY_PRED2 2 /* Predictor type 2 */ 36#define TY_PUDDLE 3 /* Puddle Jumper */ --- 12 unchanged lines hidden (view full) --- 49#define CCP_NEG_DEFLATE24 2 50#ifdef HAVE_DES 51#define CCP_NEG_MPPE 3 52#define CCP_NEG_TOTAL 4 53#else 54#define CCP_NEG_TOTAL 3 55#endif 56 |
57#ifdef HAVE_DES 58enum mppe_negstate { 59 MPPE_ANYSTATE, 60 MPPE_STATELESS, 61 MPPE_STATEFUL 62}; 63#endif 64 |
|
57struct mbuf; 58struct link; 59 60struct ccp_config { 61 struct { 62 struct { 63 int winsize; 64 } in, out; 65 } deflate; 66#ifdef HAVE_DES 67 struct { 68 int keybits; | 65struct mbuf; 66struct link; 67 68struct ccp_config { 69 struct { 70 struct { 71 int winsize; 72 } in, out; 73 } deflate; 74#ifdef HAVE_DES 75 struct { 76 int keybits; |
77 enum mppe_negstate state; 78 unsigned required : 1; |
|
69 } mppe; 70#endif 71 struct fsm_retry fsm; /* How often/frequently to resend requests */ 72 unsigned neg[CCP_NEG_TOTAL]; 73}; 74 75struct ccp_opt { 76 struct ccp_opt *next; --- 33 unchanged lines hidden (view full) --- 110 111#define fsm2ccp(fp) (fp->proto == PROTO_CCP ? (struct ccp *)fp : NULL) 112 113struct ccp_algorithm { 114 int id; 115 int Neg; /* ccp_config neg array item */ 116 const char *(*Disp)(struct lcp_opt *); /* Use result immediately ! */ 117 int (*Usable)(struct fsm *); /* Ok to negotiate ? */ | 79 } mppe; 80#endif 81 struct fsm_retry fsm; /* How often/frequently to resend requests */ 82 unsigned neg[CCP_NEG_TOTAL]; 83}; 84 85struct ccp_opt { 86 struct ccp_opt *next; --- 33 unchanged lines hidden (view full) --- 120 121#define fsm2ccp(fp) (fp->proto == PROTO_CCP ? (struct ccp *)fp : NULL) 122 123struct ccp_algorithm { 124 int id; 125 int Neg; /* ccp_config neg array item */ 126 const char *(*Disp)(struct lcp_opt *); /* Use result immediately ! */ 127 int (*Usable)(struct fsm *); /* Ok to negotiate ? */ |
128 int (*Required)(struct fsm *); /* Must negotiate ? */ |
|
118 struct { 119 int (*Set)(struct lcp_opt *, const struct ccp_config *); 120 void *(*Init)(struct lcp_opt *); 121 void (*Term)(void *); 122 void (*Reset)(void *); 123 struct mbuf *(*Read)(void *, struct ccp *, u_short *, struct mbuf *); 124 void (*DictSetup)(void *, struct ccp *, u_short, struct mbuf *); 125 } i; 126 struct { 127 void (*OptInit)(struct lcp_opt *, const struct ccp_config *); | 129 struct { 130 int (*Set)(struct lcp_opt *, const struct ccp_config *); 131 void *(*Init)(struct lcp_opt *); 132 void (*Term)(void *); 133 void (*Reset)(void *); 134 struct mbuf *(*Read)(void *, struct ccp *, u_short *, struct mbuf *); 135 void (*DictSetup)(void *, struct ccp *, u_short, struct mbuf *); 136 } i; 137 struct { 138 void (*OptInit)(struct lcp_opt *, const struct ccp_config *); |
128 int (*Set)(struct lcp_opt *); | 139 int (*Set)(struct lcp_opt *, const struct ccp_config *); |
129 void *(*Init)(struct lcp_opt *); 130 void (*Term)(void *); | 140 void *(*Init)(struct lcp_opt *); 141 void (*Term)(void *); |
131 void (*Reset)(void *); | 142 int (*Reset)(void *); |
132 struct mbuf *(*Write)(void *, struct ccp *, struct link *, int, u_short *, 133 struct mbuf *); 134 } o; 135}; 136 137extern void ccp_Init(struct ccp *, struct bundle *, struct link *, 138 const struct fsm_parent *); 139extern void ccp_Setup(struct ccp *); | 143 struct mbuf *(*Write)(void *, struct ccp *, struct link *, int, u_short *, 144 struct mbuf *); 145 } o; 146}; 147 148extern void ccp_Init(struct ccp *, struct bundle *, struct link *, 149 const struct fsm_parent *); 150extern void ccp_Setup(struct ccp *); |
151extern int ccp_Required(struct ccp *); |
|
140 141extern void ccp_SendResetReq(struct fsm *); 142extern struct mbuf *ccp_Input(struct bundle *, struct link *, struct mbuf *); 143extern int ccp_ReportStatus(struct cmdargs const *); 144extern u_short ccp_Proto(struct ccp *); 145extern void ccp_SetupCallbacks(struct ccp *); 146extern int ccp_SetOpenMode(struct ccp *); | 152 153extern void ccp_SendResetReq(struct fsm *); 154extern struct mbuf *ccp_Input(struct bundle *, struct link *, struct mbuf *); 155extern int ccp_ReportStatus(struct cmdargs const *); 156extern u_short ccp_Proto(struct ccp *); 157extern void ccp_SetupCallbacks(struct ccp *); 158extern int ccp_SetOpenMode(struct ccp *); |
147extern int ccp_IsUsable(struct fsm *); | 159extern int ccp_DefaultUsable(struct fsm *); 160extern int ccp_DefaultRequired(struct fsm *); |
148 149extern struct layer ccplayer; | 161 162extern struct layer ccplayer; |