Remove building with NOCRYPTO option
[minix3.git] / minix / lib / liblwip / dist / src / include / netif / ppp / ppp_opts.h
blobfa79c090f2570db3e03f0782a5b572c84d0e6e88
1 /*
2 * Redistribution and use in source and binary forms, with or without modification,
3 * are permitted provided that the following conditions are met:
5 * 1. Redistributions of source code must retain the above copyright notice,
6 * this list of conditions and the following disclaimer.
7 * 2. Redistributions in binary form must reproduce the above copyright notice,
8 * this list of conditions and the following disclaimer in the documentation
9 * and/or other materials provided with the distribution.
10 * 3. The name of the author may not be used to endorse or promote products
11 * derived from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
22 * OF SUCH DAMAGE.
24 * This file is part of the lwIP TCP/IP stack.
28 #ifndef LWIP_PPP_OPTS_H
29 #define LWIP_PPP_OPTS_H
31 #include "lwip/opt.h"
33 /**
34 * PPP_SUPPORT==1: Enable PPP.
36 #ifndef PPP_SUPPORT
37 #define PPP_SUPPORT 0
38 #endif
40 /**
41 * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
43 #ifndef PPPOE_SUPPORT
44 #define PPPOE_SUPPORT 0
45 #endif
47 /**
48 * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP
50 #ifndef PPPOL2TP_SUPPORT
51 #define PPPOL2TP_SUPPORT 0
52 #endif
54 /**
55 * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support)
57 #ifndef PPPOL2TP_AUTH_SUPPORT
58 #define PPPOL2TP_AUTH_SUPPORT PPPOL2TP_SUPPORT
59 #endif
61 /**
62 * PPPOS_SUPPORT==1: Enable PPP Over Serial
64 #ifndef PPPOS_SUPPORT
65 #define PPPOS_SUPPORT PPP_SUPPORT
66 #endif
68 /**
69 * LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
71 #ifndef LWIP_PPP_API
72 #define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0))
73 #endif
75 /**
76 * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP
77 * connections (requires the PPP_SUPPORT option)
79 #ifndef MEMP_NUM_PPP_PCB
80 #define MEMP_NUM_PPP_PCB 1
81 #endif
83 #if PPP_SUPPORT
85 /**
86 * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS
87 * interfaces (only used with PPPOS_SUPPORT==1)
89 #ifndef MEMP_NUM_PPPOS_INTERFACES
90 #define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB
91 #endif
93 /**
94 * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
95 * interfaces (only used with PPPOE_SUPPORT==1)
97 #ifndef MEMP_NUM_PPPOE_INTERFACES
98 #define MEMP_NUM_PPPOE_INTERFACES 1
99 #endif
102 * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP
103 * interfaces (only used with PPPOL2TP_SUPPORT==1)
105 #ifndef MEMP_NUM_PPPOL2TP_INTERFACES
106 #define MEMP_NUM_PPPOL2TP_INTERFACES 1
107 #endif
110 * MEMP_NUM_PPP_API_MSG: Number of concurrent PPP API messages (in pppapi.c)
112 #ifndef MEMP_NUM_PPP_API_MSG
113 #define MEMP_NUM_PPP_API_MSG 5
114 #endif
117 * PPP_DEBUG: Enable debugging for PPP.
119 #ifndef PPP_DEBUG
120 #define PPP_DEBUG LWIP_DBG_OFF
121 #endif
124 * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback().
126 * Please read the "PPPoS input path" chapter in the PPP documentation about this option.
128 #ifndef PPP_INPROC_IRQ_SAFE
129 #define PPP_INPROC_IRQ_SAFE 0
130 #endif
133 * PRINTPKT_SUPPORT==1: Enable PPP print packet support
135 * Mandatory for debugging, it displays exchanged packet content in debug trace.
137 #ifndef PRINTPKT_SUPPORT
138 #define PRINTPKT_SUPPORT 0
139 #endif
142 * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support
144 #ifndef PPP_IPV4_SUPPORT
145 #define PPP_IPV4_SUPPORT (LWIP_IPV4)
146 #endif
149 * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support
151 #ifndef PPP_IPV6_SUPPORT
152 #define PPP_IPV6_SUPPORT (LWIP_IPV6)
153 #endif
156 * PPP_NOTIFY_PHASE==1: Support PPP notify phase support
158 * PPP notify phase support allows you to set a callback which is
159 * called on change of the internal PPP state machine.
161 * This can be used for example to set a LED pattern depending on the
162 * current phase of the PPP session.
164 #ifndef PPP_NOTIFY_PHASE
165 #define PPP_NOTIFY_PHASE 0
166 #endif
169 * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets.
171 * Memory allocated must be single buffered for PPP to works, it requires pbuf
172 * that are not going to be chained when allocated. This requires setting
173 * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.
175 * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
176 * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
178 #ifndef PPP_USE_PBUF_RAM
179 #define PPP_USE_PBUF_RAM 0
180 #endif
183 * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS
185 #ifndef PPP_FCS_TABLE
186 #define PPP_FCS_TABLE 1
187 #endif
190 * PAP_SUPPORT==1: Support PAP.
192 #ifndef PAP_SUPPORT
193 #define PAP_SUPPORT 0
194 #endif
197 * CHAP_SUPPORT==1: Support CHAP.
199 #ifndef CHAP_SUPPORT
200 #define CHAP_SUPPORT 0
201 #endif
204 * MSCHAP_SUPPORT==1: Support MSCHAP.
206 #ifndef MSCHAP_SUPPORT
207 #define MSCHAP_SUPPORT 0
208 #endif
209 #if MSCHAP_SUPPORT
210 /* MSCHAP requires CHAP support */
211 #undef CHAP_SUPPORT
212 #define CHAP_SUPPORT 1
213 #endif /* MSCHAP_SUPPORT */
216 * EAP_SUPPORT==1: Support EAP.
218 #ifndef EAP_SUPPORT
219 #define EAP_SUPPORT 0
220 #endif
223 * CCP_SUPPORT==1: Support CCP.
225 #ifndef CCP_SUPPORT
226 #define CCP_SUPPORT 0
227 #endif
230 * MPPE_SUPPORT==1: Support MPPE.
232 #ifndef MPPE_SUPPORT
233 #define MPPE_SUPPORT 0
234 #endif
235 #if MPPE_SUPPORT
236 /* MPPE requires CCP support */
237 #undef CCP_SUPPORT
238 #define CCP_SUPPORT 1
239 /* MPPE requires MSCHAP support */
240 #undef MSCHAP_SUPPORT
241 #define MSCHAP_SUPPORT 1
242 /* MSCHAP requires CHAP support */
243 #undef CHAP_SUPPORT
244 #define CHAP_SUPPORT 1
245 #endif /* MPPE_SUPPORT */
248 * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
250 #ifndef CBCP_SUPPORT
251 #define CBCP_SUPPORT 0
252 #endif
255 * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET!
257 #ifndef ECP_SUPPORT
258 #define ECP_SUPPORT 0
259 #endif
262 * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET!
264 #ifndef DEMAND_SUPPORT
265 #define DEMAND_SUPPORT 0
266 #endif
269 * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets.
271 #ifndef LQR_SUPPORT
272 #define LQR_SUPPORT 0
273 #endif
276 * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session).
278 * Currently only supported for PPPoS.
280 #ifndef PPP_SERVER
281 #define PPP_SERVER 0
282 #endif
284 #if PPP_SERVER
286 * PPP_OUR_NAME: Our name for authentication purposes
288 #ifndef PPP_OUR_NAME
289 #define PPP_OUR_NAME "lwIP"
290 #endif
291 #endif /* PPP_SERVER */
294 * VJ_SUPPORT==1: Support VJ header compression.
296 #ifndef VJ_SUPPORT
297 #define VJ_SUPPORT 1
298 #endif
299 /* VJ compression is only supported for TCP over IPv4 over PPPoS. */
300 #if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP
301 #undef VJ_SUPPORT
302 #define VJ_SUPPORT 0
303 #endif /* !PPPOS_SUPPORT */
306 * PPP_MD5_RANDM==1: Use MD5 for better randomness.
307 * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled.
309 #ifndef PPP_MD5_RANDM
310 #define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)
311 #endif
314 * PolarSSL embedded library
317 * lwIP contains some files fetched from the latest BSD release of
318 * the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption
319 * methods we need for lwIP PPP support.
321 * The PolarSSL files were cleaned to contain only the necessary struct
322 * fields and functions needed for lwIP.
324 * The PolarSSL API was not changed at all, so if you are already using
325 * PolarSSL you can choose to skip the compilation of the included PolarSSL
326 * library into lwIP.
328 * If you are not using the embedded copy you must include external
329 * libraries into your arch/cc.h port file.
331 * Beware of the stack requirements which can be a lot larger if you are not
332 * using our cleaned PolarSSL library.
336 * LWIP_USE_EXTERNAL_POLARSSL: Use external PolarSSL library
338 #ifndef LWIP_USE_EXTERNAL_POLARSSL
339 #define LWIP_USE_EXTERNAL_POLARSSL 0
340 #endif
343 * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library
345 #ifndef LWIP_USE_EXTERNAL_MBEDTLS
346 #define LWIP_USE_EXTERNAL_MBEDTLS 0
347 #endif
350 * PPP Timeouts
354 * FSM_DEFTIMEOUT: Timeout time in seconds
356 #ifndef FSM_DEFTIMEOUT
357 #define FSM_DEFTIMEOUT 6
358 #endif
361 * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions
363 #ifndef FSM_DEFMAXTERMREQS
364 #define FSM_DEFMAXTERMREQS 2
365 #endif
368 * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions
370 #ifndef FSM_DEFMAXCONFREQS
371 #define FSM_DEFMAXCONFREQS 10
372 #endif
375 * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops
377 #ifndef FSM_DEFMAXNAKLOOPS
378 #define FSM_DEFMAXNAKLOOPS 5
379 #endif
382 * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
384 #ifndef UPAP_DEFTIMEOUT
385 #define UPAP_DEFTIMEOUT 6
386 #endif
389 * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send
391 #ifndef UPAP_DEFTRANSMITS
392 #define UPAP_DEFTRANSMITS 10
393 #endif
395 #if PPP_SERVER
397 * UPAP_DEFREQTIME: Time to wait for auth-req from peer
399 #ifndef UPAP_DEFREQTIME
400 #define UPAP_DEFREQTIME 30
401 #endif
402 #endif /* PPP_SERVER */
405 * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
407 #ifndef CHAP_DEFTIMEOUT
408 #define CHAP_DEFTIMEOUT 6
409 #endif
412 * CHAP_DEFTRANSMITS: max # times to send challenge
414 #ifndef CHAP_DEFTRANSMITS
415 #define CHAP_DEFTRANSMITS 10
416 #endif
418 #if PPP_SERVER
420 * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds
422 #ifndef CHAP_DEFRECHALLENGETIME
423 #define CHAP_DEFRECHALLENGETIME 0
424 #endif
425 #endif /* PPP_SERVER */
428 * EAP_DEFREQTIME: Time to wait for peer request
430 #ifndef EAP_DEFREQTIME
431 #define EAP_DEFREQTIME 6
432 #endif
435 * EAP_DEFALLOWREQ: max # times to accept requests
437 #ifndef EAP_DEFALLOWREQ
438 #define EAP_DEFALLOWREQ 10
439 #endif
441 #if PPP_SERVER
443 * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit
445 #ifndef EAP_DEFTIMEOUT
446 #define EAP_DEFTIMEOUT 6
447 #endif
450 * EAP_DEFTRANSMITS: max # times to transmit
452 #ifndef EAP_DEFTRANSMITS
453 #define EAP_DEFTRANSMITS 10
454 #endif
455 #endif /* PPP_SERVER */
458 * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer
459 * before deciding the link is looped-back.
461 #ifndef LCP_DEFLOOPBACKFAIL
462 #define LCP_DEFLOOPBACKFAIL 10
463 #endif
466 * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable.
468 #ifndef LCP_ECHOINTERVAL
469 #define LCP_ECHOINTERVAL 0
470 #endif
473 * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure.
475 #ifndef LCP_MAXECHOFAILS
476 #define LCP_MAXECHOFAILS 3
477 #endif
480 * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char.
482 #ifndef PPP_MAXIDLEFLAG
483 #define PPP_MAXIDLEFLAG 100
484 #endif
487 * PPP Packet sizes
491 * PPP_MRU: Default MRU
493 #ifndef PPP_MRU
494 #define PPP_MRU 1500
495 #endif
498 * PPP_DEFMRU: Default MRU to try
500 #ifndef PPP_DEFMRU
501 #define PPP_DEFMRU 1500
502 #endif
505 * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384)
507 #ifndef PPP_MAXMRU
508 #define PPP_MAXMRU 1500
509 #endif
512 * PPP_MINMRU: No MRUs below this
514 #ifndef PPP_MINMRU
515 #define PPP_MINMRU 128
516 #endif
519 * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP
520 * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8)
521 * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2)
523 #if PPPOL2TP_SUPPORT
524 #ifndef PPPOL2TP_DEFMRU
525 #define PPPOL2TP_DEFMRU 1450
526 #endif
527 #endif /* PPPOL2TP_SUPPORT */
530 * MAXNAMELEN: max length of hostname or name for auth
532 #ifndef MAXNAMELEN
533 #define MAXNAMELEN 256
534 #endif
537 * MAXSECRETLEN: max length of password or secret
539 #ifndef MAXSECRETLEN
540 #define MAXSECRETLEN 256
541 #endif
543 /* ------------------------------------------------------------------------- */
546 * Build triggers for embedded PolarSSL
548 #if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS
550 /* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
551 #if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
552 #define LWIP_INCLUDED_POLARSSL_MD5 1
553 #endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */
555 #if MSCHAP_SUPPORT
557 /* MSCHAP require MD4 support */
558 #define LWIP_INCLUDED_POLARSSL_MD4 1
559 /* MSCHAP require SHA1 support */
560 #define LWIP_INCLUDED_POLARSSL_SHA1 1
561 /* MSCHAP require DES support */
562 #define LWIP_INCLUDED_POLARSSL_DES 1
564 /* MS-CHAP support is required for MPPE */
565 #if MPPE_SUPPORT
566 /* MPPE require ARC4 support */
567 #define LWIP_INCLUDED_POLARSSL_ARC4 1
568 #endif /* MPPE_SUPPORT */
570 #endif /* MSCHAP_SUPPORT */
572 #endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */
574 /* Default value if unset */
575 #ifndef LWIP_INCLUDED_POLARSSL_MD4
576 #define LWIP_INCLUDED_POLARSSL_MD4 0
577 #endif /* LWIP_INCLUDED_POLARSSL_MD4 */
578 #ifndef LWIP_INCLUDED_POLARSSL_MD5
579 #define LWIP_INCLUDED_POLARSSL_MD5 0
580 #endif /* LWIP_INCLUDED_POLARSSL_MD5 */
581 #ifndef LWIP_INCLUDED_POLARSSL_SHA1
582 #define LWIP_INCLUDED_POLARSSL_SHA1 0
583 #endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
584 #ifndef LWIP_INCLUDED_POLARSSL_DES
585 #define LWIP_INCLUDED_POLARSSL_DES 0
586 #endif /* LWIP_INCLUDED_POLARSSL_DES */
587 #ifndef LWIP_INCLUDED_POLARSSL_ARC4
588 #define LWIP_INCLUDED_POLARSSL_ARC4 0
589 #endif /* LWIP_INCLUDED_POLARSSL_ARC4 */
591 #endif /* PPP_SUPPORT */
593 #endif /* LWIP_PPP_OPTS_H */