sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
lcp.h
Go to the documentation of this file.
1/*
2 * lcp.h - Link Control Protocol definitions.
3 *
4 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
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
16 * distribution.
17 *
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
24 * 5000 Forbes Avenue
25 * Pittsburgh, PA 15213-3890
26 * (412) 268-4387, fax: (412) 268-7395
27 * tech-transfer@andrew.cmu.edu
28 *
29 * 4. Redistributions of any form whatsoever must retain the following
30 * acknowledgment:
31 * "This product includes software developed by Computing Services
32 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
33 *
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.
41 *
42 * $Id: lcp.h,v 1.20 2004/11/14 22:53:42 carlsonj Exp $
43 */
44
49#include "netif/ppp/ppp_opts.h"
50#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
51
52#ifndef LCP_H
53#define LCP_H
54
55#include "ppp.h"
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61/*
62 * Options.
63 */
64#define CI_VENDOR 0 /* Vendor Specific */
65#define CI_MRU 1 /* Maximum Receive Unit */
66#define CI_ASYNCMAP 2 /* Async Control Character Map */
67#define CI_AUTHTYPE 3 /* Authentication Type */
68#define CI_QUALITY 4 /* Quality Protocol */
69#define CI_MAGICNUMBER 5 /* Magic Number */
70#define CI_PCOMPRESSION 7 /* Protocol Field Compression */
71#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
72#define CI_FCSALTERN 9 /* FCS-Alternatives */
73#define CI_SDP 10 /* Self-Describing-Pad */
74#define CI_NUMBERED 11 /* Numbered-Mode */
75#define CI_CALLBACK 13 /* callback */
76#define CI_MRRU 17 /* max reconstructed receive unit; multilink */
77#define CI_SSNHF 18 /* short sequence numbers for multilink */
78#define CI_EPDISC 19 /* endpoint discriminator */
79#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */
80#define CI_LDISC 23 /* Link-Discriminator */
81#define CI_LCPAUTH 24 /* LCP Authentication */
82#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */
83#define CI_PREFELIS 26 /* Prefix Elision */
84#define CI_MPHDRFMT 27 /* MP Header Format */
85#define CI_I18N 28 /* Internationalization */
86#define CI_SDL 29 /* Simple Data Link */
87
88/*
89 * LCP-specific packet types (code numbers).
90 */
91#define PROTREJ 8 /* Protocol Reject */
92#define ECHOREQ 9 /* Echo Request */
93#define ECHOREP 10 /* Echo Reply */
94#define DISCREQ 11 /* Discard Request */
95#define IDENTIF 12 /* Identification */
96#define TIMEREM 13 /* Time Remaining */
97
98/* Value used as data for CI_CALLBACK option */
99#define CBCP_OPT 6 /* Use callback control protocol */
100
101#if 0 /* moved to ppp_opts.h */
102#define DEFMRU 1500 /* Try for this */
103#define MINMRU 128 /* No MRUs below this */
104#define MAXMRU 16384 /* Normally limit MRU to this */
105#endif /* moved to ppp_opts.h */
106
107/* An endpoint discriminator, used with multilink. */
108#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */
109struct epdisc {
110 unsigned char class_; /* -- The word "class" is reserved in C++. */
111 unsigned char length;
112 unsigned char value[MAX_ENDP_LEN];
113};
114
115/*
116 * The state of options is described by an lcp_options structure.
117 */
118typedef struct lcp_options {
119 unsigned int passive :1; /* Don't die if we don't get a response */
120 unsigned int silent :1; /* Wait for the other end to start first */
121#if 0 /* UNUSED */
122 unsigned int restart :1; /* Restart vs. exit after close */
123#endif /* UNUSED */
124 unsigned int neg_mru :1; /* Negotiate the MRU? */
125 unsigned int neg_asyncmap :1; /* Negotiate the async map? */
126#if PAP_SUPPORT
127 unsigned int neg_upap :1; /* Ask for UPAP authentication? */
128#endif /* PAP_SUPPORT */
129#if CHAP_SUPPORT
130 unsigned int neg_chap :1; /* Ask for CHAP authentication? */
131#endif /* CHAP_SUPPORT */
132#if EAP_SUPPORT
133 unsigned int neg_eap :1; /* Ask for EAP authentication? */
134#endif /* EAP_SUPPORT */
135 unsigned int neg_magicnumber :1; /* Ask for magic number? */
136 unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */
137 unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */
138#if LQR_SUPPORT
139 unsigned int neg_lqr :1; /* Negotiate use of Link Quality Reports */
140#endif /* LQR_SUPPORT */
141 unsigned int neg_cbcp :1; /* Negotiate use of CBCP */
142#ifdef HAVE_MULTILINK
143 unsigned int neg_mrru :1; /* negotiate multilink MRRU */
144#endif /* HAVE_MULTILINK */
145 unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */
146 unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */
147
148 u16_t mru; /* Value of MRU */
149#ifdef HAVE_MULTILINK
150 u16_t mrru; /* Value of MRRU, and multilink enable */
151#endif /* MULTILINK */
152#if CHAP_SUPPORT
153 u8_t chap_mdtype; /* which MD types (hashing algorithm) */
154#endif /* CHAP_SUPPORT */
155 u32_t asyncmap; /* Value of async map */
156 u32_t magicnumber;
157 u8_t numloops; /* Number of loops during magic number neg. */
158#if LQR_SUPPORT
159 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
160#endif /* LQR_SUPPORT */
161 struct epdisc endpoint; /* endpoint discriminator */
162} lcp_options;
163
164void lcp_open(ppp_pcb *pcb);
165void lcp_close(ppp_pcb *pcb, const char *reason);
166void lcp_lowerup(ppp_pcb *pcb);
167void lcp_lowerdown(ppp_pcb *pcb);
168void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len); /* send protocol reject */
169
170extern const struct protent lcp_protent;
171
172#if 0 /* moved to ppp_opts.h */
173/* Default number of times we receive our magic number from the peer
174 before deciding the link is looped-back. */
175#define DEFLOOPBACKFAIL 10
176#endif /* moved to ppp_opts.h */
177
178#ifdef __cplusplus
179}
180#endif
181
182#endif /* LCP_H */
183#endif /* PPP_SUPPORT */