Annotation of embedaddon/mpd/src/lcp.h, revision 1.1.1.2.2.1
1.1 misho 1:
2: /*
3: * lcp.h
4: *
5: * Written by Toshiharu OHNO <tony-o@iij.ad.jp>
6: * Copyright (c) 1993, Internet Initiative Japan, Inc. All rights reserved.
7: * See ``COPYRIGHT.iij''
8: *
9: * Rewritten by Archie Cobbs <archie@freebsd.org>
10: * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
11: * See ``COPYRIGHT.whistle''
12: */
13:
14: #ifndef _LCP_H_
15: #define _LCP_H_
16:
17: #include "fsm.h"
18: #include "timer.h"
19: #include "auth.h"
20:
21: /*
22: * DEFINITIONS
23: */
24:
25: /* MRU defs */
26: #define LCP_DEFAULT_MRU 1500 /* Per RFC 1661 */
27: #define LCP_MIN_MRU 296
28:
29: #define LCP_NUM_AUTH_PROTOS 5
30:
31: struct lcpauthproto {
32: ushort proto;
33: u_char alg;
34: u_char conf;
35: };
36: typedef struct lcpauthproto *LcpAuthProto;
37:
38: enum lcp_phase {
39: PHASE_DEAD = 0,
40: PHASE_ESTABLISH,
41: PHASE_AUTHENTICATE,
42: PHASE_NETWORK,
43: PHASE_TERMINATE
44: };
45:
46: /* Link state */
47: struct lcpstate {
48:
49: /* LCP phase of this link */
50: enum lcp_phase phase; /* PPP phase */
51:
52: /* Authorization info */
53: struct auth auth; /* Used during authorization phase */
54:
55: /* Peers negotiated parameters */
56: LcpAuthProto peer_protos[LCP_NUM_AUTH_PROTOS]; /* list of acceptable auth-protos */
57: u_int32_t peer_accmap; /* Characters peer needs escaped */
58: u_int32_t peer_magic; /* Peer's magic number */
59: u_int16_t peer_mru; /* Peer's max reception packet size */
60: u_int16_t peer_auth; /* Auth requested by peer, or zero */
61: u_int16_t peer_mrru; /* MRRU set by peer, or zero */
62: u_char peer_alg; /* Peer's CHAP algorithm */
63:
64: /* My negotiated parameters */
65: u_char want_alg; /* My CHAP algorithm */
66: LcpAuthProto want_protos[LCP_NUM_AUTH_PROTOS]; /* list of requestable auth-protos */
67: u_int32_t want_accmap; /* Control chars I want escaped */
68: u_int32_t want_magic; /* My magic number */
69: u_int16_t want_mru; /* My MRU */
70: u_int16_t want_auth; /* Auth I require of peer, or zero */
71: u_int16_t want_mrru; /* My MRRU, or zero if no MP */
72:
73: /* More params */
74: u_char want_protocomp:1; /* I want protocol compression */
75: u_char want_acfcomp:1; /* I want a&c field compression */
76: u_char want_shortseq:1; /* I want short seq numbers */
77: u_char want_callback:1; /* I want to be called back */
78:
79: u_char peer_protocomp:1; /* Peer wants protocol field comp */
80: u_char peer_acfcomp:1; /* Peer wants addr & ctrl field comp */
81: u_char peer_shortseq:1; /* Peer gets ML short seq numbers */
82:
83: /* Misc */
84: struct discrim peer_discrim; /* Peer's discriminator */
85: char peer_ident[64]; /* Peer's LCP ident string */
86: uint32_t peer_reject; /* Request codes rejected by peer */
87: struct fsm fsm; /* Finite state machine */
1.1.1.2 misho 88:
89: u_char need_reset; /* LCP needs complete reset before ConfReq */
1.1.1.2.2.1! misho 90: u_char resets; /* LCP resets left before failure */
1.1 misho 91: };
92: typedef struct lcpstate *LcpState;
93:
94: #define TY_VENDOR 0 /* Vendor specific */
95: #define TY_MRU 1 /* Maximum-Receive-Unit */
96: #define TY_ACCMAP 2 /* Async-Control-Character-Map */
97: #define TY_AUTHPROTO 3 /* Authentication-Protocol */
98: #define TY_QUALPROTO 4 /* Quality-Protocol */
99: #define TY_MAGICNUM 5 /* Magic-Number */
100: #define TY_RESERVED 6 /* RESERVED */
101: #define TY_PROTOCOMP 7 /* Protocol-Field-Compression */
102: #define TY_ACFCOMP 8 /* Address+Control-Field-Compression */
103: #define TY_FCSALT 9 /* FCS-Alternatives */
104: #define TY_SDP 10 /* Self-Dscribing-Padding */
105: #define TY_NUMMODE 11 /* Numbered-Mode */
106: #define TY_MULTILINK 12 /* Multi-link procedure (?) */
107: #define TY_CALLBACK 13 /* Callback */
108: #define TY_CONNECTTIME 14 /* Connect time */
109: #define TY_COMPFRAME 15 /* Compound-Frames */
110: #define TY_NDS 16 /* Nominal-Data-Encapsulation */
111: #define TY_MRRU 17 /* Multi-link MRRU size */
112: #define TY_SHORTSEQNUM 18 /* Short seq number header format */
113: #define TY_ENDPOINTDISC 19 /* Unique endpoint discrimiator */
114: #define TY_PROPRIETARY 20 /* Proprietary */
115: #define TY_DCEIDENTIFIER 21 /* DCE-Identifier */
116: #define TY_MULTILINKPLUS 22 /* Multi-Link-Plus-Procedure */
117: #define TY_BACP 23 /* Link Discriminator for BACP RFC2125 */
118: #define TY_LCPAUTHOPT 24 /* LCP-Authentication-Option */
119: #define TY_COBS 25 /* Consistent Overhead Byte Stuffing (COBS) */
120: #define TY_PREFIXELISION 26 /* Prefix elision */
121: #define TY_MULTILINKHEADERFMT 27 /* Multilink header format */
122: #define TY_INTERNAT 28 /* Internationalization */
123: #define TY_SDATALINKSONET 29 /* Simple Data Link on SONET/SDH */
124:
125: /*
126: * FUNCTIONS
127: */
128:
129: extern void LcpInit(Link l);
130: extern void LcpInst(Link l, Link lt);
131: extern void LcpShutdown(Link l);
132: extern void LcpInput(Link l, Mbuf bp);
133: extern void LcpUp(Link l);
134: extern void LcpOpen(Link l);
135: extern void LcpClose(Link l);
136: extern void LcpDown(Link l);
1.1.1.2 misho 137: extern int LcpStat(Context ctx, int ac, const char *const av[], const void *arg);
1.1 misho 138: extern void LcpAuthResult(Link l, int success);
139:
140: #endif
141:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>