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
24 * This file is part of the lwIP TCP/IP stack.
28 #ifndef LWIP_PPP_OPTS_H
29 #define LWIP_PPP_OPTS_H
34 * PPP_SUPPORT==1: Enable PPP.
41 * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
44 #define PPPOE_SUPPORT 0
48 * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP
50 #ifndef PPPOL2TP_SUPPORT
51 #define PPPOL2TP_SUPPORT 0
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
62 * PPPOS_SUPPORT==1: Enable PPP Over Serial
65 #define PPPOS_SUPPORT PPP_SUPPORT
69 * LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
72 #define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0))
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
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
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
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
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
117 * PPP_DEBUG: Enable debugging for PPP.
120 #define PPP_DEBUG LWIP_DBG_OFF
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
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
142 * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support
144 #ifndef PPP_IPV4_SUPPORT
145 #define PPP_IPV4_SUPPORT (LWIP_IPV4)
149 * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support
151 #ifndef PPP_IPV6_SUPPORT
152 #define PPP_IPV6_SUPPORT (LWIP_IPV6)
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
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
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
190 * PAP_SUPPORT==1: Support PAP.
193 #define PAP_SUPPORT 0
197 * CHAP_SUPPORT==1: Support CHAP.
200 #define CHAP_SUPPORT 0
204 * MSCHAP_SUPPORT==1: Support MSCHAP.
206 #ifndef MSCHAP_SUPPORT
207 #define MSCHAP_SUPPORT 0
210 /* MSCHAP requires CHAP support */
212 #define CHAP_SUPPORT 1
213 #endif /* MSCHAP_SUPPORT */
216 * EAP_SUPPORT==1: Support EAP.
219 #define EAP_SUPPORT 0
223 * CCP_SUPPORT==1: Support CCP.
226 #define CCP_SUPPORT 0
230 * MPPE_SUPPORT==1: Support MPPE.
233 #define MPPE_SUPPORT 0
236 /* MPPE requires 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 */
244 #define CHAP_SUPPORT 1
245 #endif /* MPPE_SUPPORT */
248 * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
251 #define CBCP_SUPPORT 0
255 * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET!
258 #define ECP_SUPPORT 0
262 * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET!
264 #ifndef DEMAND_SUPPORT
265 #define DEMAND_SUPPORT 0
269 * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets.
272 #define LQR_SUPPORT 0
276 * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session).
278 * Currently only supported for PPPoS.
286 * PPP_OUR_NAME: Our name for authentication purposes
289 #define PPP_OUR_NAME "lwIP"
291 #endif /* PPP_SERVER */
294 * VJ_SUPPORT==1: Support VJ header compression.
299 /* VJ compression is only supported for TCP over IPv4 over PPPoS. */
300 #if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP
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)
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
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
343 * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library
345 #ifndef LWIP_USE_EXTERNAL_MBEDTLS
346 #define LWIP_USE_EXTERNAL_MBEDTLS 0
354 * FSM_DEFTIMEOUT: Timeout time in seconds
356 #ifndef FSM_DEFTIMEOUT
357 #define FSM_DEFTIMEOUT 6
361 * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions
363 #ifndef FSM_DEFMAXTERMREQS
364 #define FSM_DEFMAXTERMREQS 2
368 * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions
370 #ifndef FSM_DEFMAXCONFREQS
371 #define FSM_DEFMAXCONFREQS 10
375 * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops
377 #ifndef FSM_DEFMAXNAKLOOPS
378 #define FSM_DEFMAXNAKLOOPS 5
382 * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
384 #ifndef UPAP_DEFTIMEOUT
385 #define UPAP_DEFTIMEOUT 6
389 * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send
391 #ifndef UPAP_DEFTRANSMITS
392 #define UPAP_DEFTRANSMITS 10
397 * UPAP_DEFREQTIME: Time to wait for auth-req from peer
399 #ifndef UPAP_DEFREQTIME
400 #define UPAP_DEFREQTIME 30
402 #endif /* PPP_SERVER */
405 * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
407 #ifndef CHAP_DEFTIMEOUT
408 #define CHAP_DEFTIMEOUT 6
412 * CHAP_DEFTRANSMITS: max # times to send challenge
414 #ifndef CHAP_DEFTRANSMITS
415 #define CHAP_DEFTRANSMITS 10
420 * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds
422 #ifndef CHAP_DEFRECHALLENGETIME
423 #define CHAP_DEFRECHALLENGETIME 0
425 #endif /* PPP_SERVER */
428 * EAP_DEFREQTIME: Time to wait for peer request
430 #ifndef EAP_DEFREQTIME
431 #define EAP_DEFREQTIME 6
435 * EAP_DEFALLOWREQ: max # times to accept requests
437 #ifndef EAP_DEFALLOWREQ
438 #define EAP_DEFALLOWREQ 10
443 * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit
445 #ifndef EAP_DEFTIMEOUT
446 #define EAP_DEFTIMEOUT 6
450 * EAP_DEFTRANSMITS: max # times to transmit
452 #ifndef EAP_DEFTRANSMITS
453 #define EAP_DEFTRANSMITS 10
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
466 * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable.
468 #ifndef LCP_ECHOINTERVAL
469 #define LCP_ECHOINTERVAL 0
473 * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure.
475 #ifndef LCP_MAXECHOFAILS
476 #define LCP_MAXECHOFAILS 3
480 * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char.
482 #ifndef PPP_MAXIDLEFLAG
483 #define PPP_MAXIDLEFLAG 100
491 * PPP_MRU: Default MRU
498 * PPP_DEFMRU: Default MRU to try
501 #define PPP_DEFMRU 1500
505 * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384)
508 #define PPP_MAXMRU 1500
512 * PPP_MINMRU: No MRUs below this
515 #define PPP_MINMRU 128
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)
524 #ifndef PPPOL2TP_DEFMRU
525 #define PPPOL2TP_DEFMRU 1450
527 #endif /* PPPOL2TP_SUPPORT */
530 * MAXNAMELEN: max length of hostname or name for auth
533 #define MAXNAMELEN 256
537 * MAXSECRETLEN: max length of password or secret
540 #define MAXSECRETLEN 256
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 */
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 */
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 */