2 * lcp.h - Link Control Protocol definitions.
4 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
18 * 3. The name "Carnegie Mellon University" must not be used to
19 * endorse or promote products derived from this software without
20 * prior written permission. For permission or any legal
21 * details, please contact
22 * Office of Technology Transfer
23 * Carnegie Mellon University
25 * Pittsburgh, PA 15213-3890
26 * (412) 268-4387, fax: (412) 268-7395
27 * tech-transfer@andrew.cmu.edu
29 * 4. Redistributions of any form whatsoever must retain the following
31 * "This product includes software developed by Computing Services
32 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
34 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
35 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
37 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
38 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
39 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
40 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
47 #define CI_VENDOR 0 /* Vendor Specific */
48 #define CI_MRU 1 /* Maximum Receive Unit */
49 #define CI_ASYNCMAP 2 /* Async Control Character Map */
50 #define CI_AUTHTYPE 3 /* Authentication Type */
51 #define CI_QUALITY 4 /* Quality Protocol */
52 #define CI_MAGICNUMBER 5 /* Magic Number */
53 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
54 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
55 #define CI_FCSALTERN 9 /* FCS-Alternatives */
56 #define CI_SDP 10 /* Self-Describing-Pad */
57 #define CI_NUMBERED 11 /* Numbered-Mode */
58 #define CI_CALLBACK 13 /* callback */
59 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
60 #define CI_SSNHF 18 /* short sequence numbers for multilink */
61 #define CI_EPDISC 19 /* endpoint discriminator */
62 #define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */
63 #define CI_LDISC 23 /* Link-Discriminator */
64 #define CI_LCPAUTH 24 /* LCP Authentication */
65 #define CI_COBS 25 /* Consistent Overhead Byte Stuffing */
66 #define CI_PREFELIS 26 /* Prefix Elision */
67 #define CI_MPHDRFMT 27 /* MP Header Format */
68 #define CI_I18N 28 /* Internationalization */
69 #define CI_SDL 29 /* Simple Data Link */
72 * LCP-specific packet types (code numbers).
74 #define PROTREJ 8 /* Protocol Reject */
75 #define ECHOREQ 9 /* Echo Request */
76 #define ECHOREP 10 /* Echo Reply */
77 #define DISCREQ 11 /* Discard Request */
78 #define IDENTIF 12 /* Identification */
79 #define TIMEREM 13 /* Time Remaining */
81 /* Value used as data for CI_CALLBACK option */
82 #define CBCP_OPT 6 /* Use callback control protocol */
85 * The state of options is described by an lcp_options structure.
87 typedef struct lcp_options {
88 bool passive; /* Don't die if we don't get a response */
89 bool silent; /* Wait for the other end to start first */
90 bool restart; /* Restart vs. exit after close */
91 bool neg_mru; /* Negotiate the MRU? */
92 bool neg_asyncmap; /* Negotiate the async map? */
93 bool neg_upap; /* Ask for UPAP authentication? */
94 bool neg_chap; /* Ask for CHAP authentication? */
95 bool neg_eap; /* Ask for EAP authentication? */
96 bool neg_magicnumber; /* Ask for magic number? */
97 bool neg_pcompression; /* HDLC Protocol Field Compression? */
98 bool neg_accompression; /* HDLC Address/Control Field Compression? */
99 bool neg_lqr; /* Negotiate use of Link Quality Reports */
100 bool neg_cbcp; /* Negotiate use of CBCP */
101 bool neg_mrru; /* negotiate multilink MRRU */
102 bool neg_ssnhf; /* negotiate short sequence numbers */
103 bool neg_endpoint; /* negotiate endpoint discriminator */
104 int mru; /* Value of MRU */
105 int mrru; /* Value of MRRU, and multilink enable */
106 u_char chap_mdtype; /* which MD types (hashing algorithm) */
107 u_int32_t asyncmap; /* Value of async map */
108 u_int32_t magicnumber;
109 int numloops; /* Number of loops during magic number neg. */
110 u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */
111 struct epdisc endpoint; /* endpoint discriminator */
114 extern fsm lcp_fsm[];
115 extern lcp_options lcp_wantoptions[];
116 extern lcp_options lcp_gotoptions[];
117 extern lcp_options lcp_allowoptions[];
118 extern lcp_options lcp_hisoptions[];
120 #define DEFMRU 1500 /* Try for this */
121 #define MINMRU 128 /* No MRUs below this */
122 #define MAXMRU 16384 /* Normally limit MRU to this */
125 void lcp_close(int, char *);
126 void lcp_lowerup(int);
127 void lcp_lowerdown(int);
128 void lcp_sprotrej(int, u_char *, int); /* send protocol reject */
130 extern struct protent lcp_protent;
132 /* Default number of times we receive our magic number from the peer
133 before deciding the link is looped-back. */
134 #define DEFLOOPBACKFAIL 10