Deleted Added
full compact
lcp.h (31538) lcp.h (32439)
1/*
2 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
3 *
4 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the Internet Initiative Japan. The name of the
12 * IIJ may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
1/*
2 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
3 *
4 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the Internet Initiative Japan. The name of the
12 * IIJ may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * $Id: lcp.h,v 1.14 1997/12/03 10:23:49 brian Exp $
18 * $Id: lcp.h,v 1.15 1997/12/04 18:49:28 brian Exp $
19 *
20 * TODO:
21 */
22
23#define REJECTED(p, x) ((p)->his_reject & (1<<(x)))
24
25struct lcpstate {
19 *
20 * TODO:
21 */
22
23#define REJECTED(p, x) ((p)->his_reject & (1<<(x)))
24
25struct lcpstate {
26 u_long his_mru;
27 u_long his_accmap;
28 u_long his_magic;
29 u_long his_lqrperiod;
26 u_int16_t his_mru;
27 u_int32_t his_accmap;
28 u_int32_t his_magic;
29 u_int32_t his_lqrperiod;
30 u_char his_protocomp;
31 u_char his_acfcomp;
32 u_short his_auth;
33
30 u_char his_protocomp;
31 u_char his_acfcomp;
32 u_short his_auth;
33
34 u_long want_mru;
35 u_long want_accmap;
36 u_long want_magic;
37 u_long want_lqrperiod;
34 u_short want_mru;
35 u_int32_t want_accmap;
36 u_int32_t want_magic;
37 u_int32_t want_lqrperiod;
38 u_char want_protocomp;
39 u_char want_acfcomp;
40 u_short want_auth;
41
38 u_char want_protocomp;
39 u_char want_acfcomp;
40 u_short want_auth;
41
42 u_long his_reject; /* Request codes rejected by peer */
43 u_long my_reject; /* Request codes I have rejected */
42 u_int32_t his_reject; /* Request codes rejected by peer */
43 u_int32_t my_reject; /* Request codes I have rejected */
44
45 u_short auth_iwait;
46 u_short auth_ineed;
47};
48
49#define LCP_MAXCODE CODE_DISCREQ
50
51#define TY_MRU 1 /* Maximum-Receive-Unit */
52#define TY_ACCMAP 2 /* Async-Control-Character-Map */
53#define TY_AUTHPROTO 3 /* Authentication-Protocol */
54#define TY_QUALPROTO 4 /* Quality-Protocol */
55#define TY_MAGICNUM 5 /* Magic-Number */
56#define TY_RESERVED 6 /* RESERVED */
57#define TY_PROTOCOMP 7 /* Protocol-Field-Compression */
58#define TY_ACFCOMP 8 /* Address-and-Control-Field-Compression */
59#define TY_FCSALT 9 /* FCS-Alternatives */
60#define TY_SDP 10 /* Self-Describing-Padding */
61
62#define MAX_LCP_OPT_LEN 10
63struct lcp_opt {
64 u_char id;
65 u_char len;
66 u_char data[MAX_LCP_OPT_LEN-2];
67};
68
69
70extern struct lcpstate LcpInfo;
71extern struct fsm LcpFsm;
72
73extern void LcpInit(void);
74extern void LcpUp(void);
75extern void LcpSendProtoRej(u_char *, int);
76extern void LcpOpen(int);
77extern void LcpClose(void);
78extern void LcpDown(void);
79extern int LcpPutConf(int, u_char *, const struct lcp_opt *, const char *,
80 const char *, ...);
81extern int ReportLcpStatus(struct cmdargs const *);
82extern void LcpInput(struct mbuf *);
44
45 u_short auth_iwait;
46 u_short auth_ineed;
47};
48
49#define LCP_MAXCODE CODE_DISCREQ
50
51#define TY_MRU 1 /* Maximum-Receive-Unit */
52#define TY_ACCMAP 2 /* Async-Control-Character-Map */
53#define TY_AUTHPROTO 3 /* Authentication-Protocol */
54#define TY_QUALPROTO 4 /* Quality-Protocol */
55#define TY_MAGICNUM 5 /* Magic-Number */
56#define TY_RESERVED 6 /* RESERVED */
57#define TY_PROTOCOMP 7 /* Protocol-Field-Compression */
58#define TY_ACFCOMP 8 /* Address-and-Control-Field-Compression */
59#define TY_FCSALT 9 /* FCS-Alternatives */
60#define TY_SDP 10 /* Self-Describing-Padding */
61
62#define MAX_LCP_OPT_LEN 10
63struct lcp_opt {
64 u_char id;
65 u_char len;
66 u_char data[MAX_LCP_OPT_LEN-2];
67};
68
69
70extern struct lcpstate LcpInfo;
71extern struct fsm LcpFsm;
72
73extern void LcpInit(void);
74extern void LcpUp(void);
75extern void LcpSendProtoRej(u_char *, int);
76extern void LcpOpen(int);
77extern void LcpClose(void);
78extern void LcpDown(void);
79extern int LcpPutConf(int, u_char *, const struct lcp_opt *, const char *,
80 const char *, ...);
81extern int ReportLcpStatus(struct cmdargs const *);
82extern void LcpInput(struct mbuf *);