blob: 6948f623f979da5a1af54de17932f59c0641b99d [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * lcp.h - Link Control Protocol definitions.
3 *
4 * Copyright (c) 1989 Carnegie Mellon University.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by Carnegie Mellon University. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 * $Id: lcp.h,v 1.1 2008-08-04 06:11:51 winfred Exp $
20 */
21
22/*
23 * Options.
24 */
25#define CI_MRU 1 /* Maximum Receive Unit */
26#define CI_ASYNCMAP 2 /* Async Control Character Map */
27#define CI_AUTHTYPE 3 /* Authentication Type */
28#define CI_QUALITY 4 /* Quality Protocol */
29#define CI_MAGICNUMBER 5 /* Magic Number */
30#define CI_PCOMPRESSION 7 /* Protocol Field Compression */
31#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
32#define CI_CALLBACK 13 /* callback */
33#define CI_MRRU 17 /* max reconstructed receive unit; multilink */
34#define CI_SSNHF 18 /* short sequence numbers for multilink */
35#define CI_EPDISC 19 /* endpoint discriminator */
36
37/*
38 * LCP-specific packet types.
39 */
40#define PROTREJ 8 /* Protocol Reject */
41#define ECHOREQ 9 /* Echo Request */
42#define ECHOREP 10 /* Echo Reply */
43#define DISCREQ 11 /* Discard Request */
44#define CBCP_OPT 6 /* Use callback control protocol */
45
46/*
47 * The state of options is described by an lcp_options structure.
48 */
49typedef struct lcp_options {
50 bool passive; /* Don't die if we don't get a response */
51 bool silent; /* Wait for the other end to start first */
52 bool restart; /* Restart vs. exit after close */
53 bool neg_mru; /* Negotiate the MRU? */
54 bool neg_asyncmap; /* Negotiate the async map? */
55 bool neg_upap; /* Ask for UPAP authentication? */
56 bool neg_chap; /* Ask for CHAP authentication? */
57 bool neg_magicnumber; /* Ask for magic number? */
58 bool neg_pcompression; /* HDLC Protocol Field Compression? */
59 bool neg_accompression; /* HDLC Address/Control Field Compression? */
60 bool neg_lqr; /* Negotiate use of Link Quality Reports */
61 bool neg_cbcp; /* Negotiate use of CBCP */
62 bool use_digest;
63 bool use_chapms;
64 bool use_chapms_v2;
65 bool neg_mrru; /* negotiate multilink MRRU */
66 bool neg_ssnhf; /* negotiate short sequence numbers */
67 bool neg_endpoint; /* negotiate endpoint discriminator */
68 int mru; /* Value of MRU */
69 int mrru; /* Value of MRRU, and multilink enable */
70 u_char chap_mdtype; /* which MD type (hashing algorithm) */
71 u_int32_t asyncmap; /* Value of async map */
72 u_int32_t magicnumber;
73 int numloops; /* Number of loops during magic number neg. */
74 u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */
75 struct epdisc endpoint; /* endpoint discriminator */
76} lcp_options;
77
78extern fsm lcp_fsm[];
79extern lcp_options lcp_wantoptions[];
80extern lcp_options lcp_gotoptions[];
81extern lcp_options lcp_allowoptions[];
82extern lcp_options lcp_hisoptions[];
83
84#define DEFMRU 1500 /* Try for this */
85#define MINMRU 128 /* No MRUs below this */
86#define MAXMRU 16384 /* Normally limit MRU to this */
87
88void lcp_open __P((int));
89void lcp_close __P((int, char *));
90void lcp_lowerup __P((int));
91void lcp_lowerdown __P((int));
92void lcp_sprotrej __P((int, u_char *, int)); /* send protocol reject */
93
94extern struct protent lcp_protent;
95
96/* Default number of times we receive our magic number from the peer
97 before deciding the link is looped-back. */
98#define DEFLOOPBACKFAIL 10