The Pedigree Project  0.1
ppp_opts.h
1 /*
2  * Redistribution and use in source and binary forms, with or without modification,
3  * are permitted provided that the following conditions are met:
4  *
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.
12  *
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.
23  *
24  * This file is part of the lwIP TCP/IP stack.
25  *
26  */
27 
28 #ifndef LWIP_PPP_OPTS_H
29 #define LWIP_PPP_OPTS_H
30 
31 #include "lwip/opt.h"
32 
36 #ifndef PPP_SUPPORT
37 #define PPP_SUPPORT 0
38 #endif
39 
43 #ifndef PPPOE_SUPPORT
44 #define PPPOE_SUPPORT 0
45 #endif
46 
50 #ifndef PPPOL2TP_SUPPORT
51 #define PPPOL2TP_SUPPORT 0
52 #endif
53 
57 #ifndef PPPOL2TP_AUTH_SUPPORT
58 #define PPPOL2TP_AUTH_SUPPORT PPPOL2TP_SUPPORT
59 #endif
60 
64 #ifndef PPPOS_SUPPORT
65 #define PPPOS_SUPPORT PPP_SUPPORT
66 #endif
67 
71 #ifndef LWIP_PPP_API
72 #define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0))
73 #endif
74 
79 #ifndef MEMP_NUM_PPP_PCB
80 #define MEMP_NUM_PPP_PCB 1
81 #endif
82 
83 #if PPP_SUPPORT
84 
89 #ifndef MEMP_NUM_PPPOS_INTERFACES
90 #define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB
91 #endif
92 
97 #ifndef MEMP_NUM_PPPOE_INTERFACES
98 #define MEMP_NUM_PPPOE_INTERFACES 1
99 #endif
100 
105 #ifndef MEMP_NUM_PPPOL2TP_INTERFACES
106 #define MEMP_NUM_PPPOL2TP_INTERFACES 1
107 #endif
108 
112 #ifndef MEMP_NUM_PPP_API_MSG
113 #define MEMP_NUM_PPP_API_MSG 5
114 #endif
115 
119 #ifndef PPP_DEBUG
120 #define PPP_DEBUG LWIP_DBG_OFF
121 #endif
122 
128 #ifndef PPP_INPROC_IRQ_SAFE
129 #define PPP_INPROC_IRQ_SAFE 0
130 #endif
131 
137 #ifndef PRINTPKT_SUPPORT
138 #define PRINTPKT_SUPPORT 0
139 #endif
140 
144 #ifndef PPP_IPV4_SUPPORT
145 #define PPP_IPV4_SUPPORT (LWIP_IPV4)
146 #endif
147 
151 #ifndef PPP_IPV6_SUPPORT
152 #define PPP_IPV6_SUPPORT (LWIP_IPV6)
153 #endif
154 
164 #ifndef PPP_NOTIFY_PHASE
165 #define PPP_NOTIFY_PHASE 0
166 #endif
167 
178 #ifndef PPP_USE_PBUF_RAM
179 #define PPP_USE_PBUF_RAM 0
180 #endif
181 
185 #ifndef PPP_FCS_TABLE
186 #define PPP_FCS_TABLE 1
187 #endif
188 
192 #ifndef PAP_SUPPORT
193 #define PAP_SUPPORT 0
194 #endif
195 
199 #ifndef CHAP_SUPPORT
200 #define CHAP_SUPPORT 0
201 #endif
202 
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 */
214 
218 #ifndef EAP_SUPPORT
219 #define EAP_SUPPORT 0
220 #endif
221 
225 #ifndef CCP_SUPPORT
226 #define CCP_SUPPORT 0
227 #endif
228 
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 */
246 
250 #ifndef CBCP_SUPPORT
251 #define CBCP_SUPPORT 0
252 #endif
253 
257 #ifndef ECP_SUPPORT
258 #define ECP_SUPPORT 0
259 #endif
260 
264 #ifndef DEMAND_SUPPORT
265 #define DEMAND_SUPPORT 0
266 #endif
267 
271 #ifndef LQR_SUPPORT
272 #define LQR_SUPPORT 0
273 #endif
274 
280 #ifndef PPP_SERVER
281 #define PPP_SERVER 0
282 #endif
283 
284 #if PPP_SERVER
285 /*
286  * PPP_OUR_NAME: Our name for authentication purposes
287  */
288 #ifndef PPP_OUR_NAME
289 #define PPP_OUR_NAME "lwIP"
290 #endif
291 #endif /* PPP_SERVER */
292 
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 */
304 
309 #ifndef PPP_MD5_RANDM
310 #define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)
311 #endif
312 
338 #ifndef LWIP_USE_EXTERNAL_POLARSSL
339 #define LWIP_USE_EXTERNAL_POLARSSL 0
340 #endif
341 
345 #ifndef LWIP_USE_EXTERNAL_MBEDTLS
346 #define LWIP_USE_EXTERNAL_MBEDTLS 0
347 #endif
348 
349 /*
350  * PPP Timeouts
351  */
352 
356 #ifndef FSM_DEFTIMEOUT
357 #define FSM_DEFTIMEOUT 6
358 #endif
359 
363 #ifndef FSM_DEFMAXTERMREQS
364 #define FSM_DEFMAXTERMREQS 2
365 #endif
366 
370 #ifndef FSM_DEFMAXCONFREQS
371 #define FSM_DEFMAXCONFREQS 10
372 #endif
373 
377 #ifndef FSM_DEFMAXNAKLOOPS
378 #define FSM_DEFMAXNAKLOOPS 5
379 #endif
380 
384 #ifndef UPAP_DEFTIMEOUT
385 #define UPAP_DEFTIMEOUT 6
386 #endif
387 
391 #ifndef UPAP_DEFTRANSMITS
392 #define UPAP_DEFTRANSMITS 10
393 #endif
394 
395 #if PPP_SERVER
396 
399 #ifndef UPAP_DEFREQTIME
400 #define UPAP_DEFREQTIME 30
401 #endif
402 #endif /* PPP_SERVER */
403 
407 #ifndef CHAP_DEFTIMEOUT
408 #define CHAP_DEFTIMEOUT 6
409 #endif
410 
414 #ifndef CHAP_DEFTRANSMITS
415 #define CHAP_DEFTRANSMITS 10
416 #endif
417 
418 #if PPP_SERVER
419 
422 #ifndef CHAP_DEFRECHALLENGETIME
423 #define CHAP_DEFRECHALLENGETIME 0
424 #endif
425 #endif /* PPP_SERVER */
426 
430 #ifndef EAP_DEFREQTIME
431 #define EAP_DEFREQTIME 6
432 #endif
433 
437 #ifndef EAP_DEFALLOWREQ
438 #define EAP_DEFALLOWREQ 10
439 #endif
440 
441 #if PPP_SERVER
442 
445 #ifndef EAP_DEFTIMEOUT
446 #define EAP_DEFTIMEOUT 6
447 #endif
448 
452 #ifndef EAP_DEFTRANSMITS
453 #define EAP_DEFTRANSMITS 10
454 #endif
455 #endif /* PPP_SERVER */
456 
461 #ifndef LCP_DEFLOOPBACKFAIL
462 #define LCP_DEFLOOPBACKFAIL 10
463 #endif
464 
468 #ifndef LCP_ECHOINTERVAL
469 #define LCP_ECHOINTERVAL 0
470 #endif
471 
475 #ifndef LCP_MAXECHOFAILS
476 #define LCP_MAXECHOFAILS 3
477 #endif
478 
482 #ifndef PPP_MAXIDLEFLAG
483 #define PPP_MAXIDLEFLAG 100
484 #endif
485 
493 #ifndef PPP_MRU
494 #define PPP_MRU 1500
495 #endif
496 
500 #ifndef PPP_DEFMRU
501 #define PPP_DEFMRU 1500
502 #endif
503 
507 #ifndef PPP_MAXMRU
508 #define PPP_MAXMRU 1500
509 #endif
510 
514 #ifndef PPP_MINMRU
515 #define PPP_MINMRU 128
516 #endif
517 
523 #if PPPOL2TP_SUPPORT
524 #ifndef PPPOL2TP_DEFMRU
525 #define PPPOL2TP_DEFMRU 1450
526 #endif
527 #endif /* PPPOL2TP_SUPPORT */
528 
532 #ifndef MAXNAMELEN
533 #define MAXNAMELEN 256
534 #endif
535 
539 #ifndef MAXSECRETLEN
540 #define MAXSECRETLEN 256
541 #endif
542 
543 /* ------------------------------------------------------------------------- */
544 
545 /*
546  * Build triggers for embedded PolarSSL
547  */
548 #if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS
549 
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 */
554 
555 #if MSCHAP_SUPPORT
556 
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
563 
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 */
569 
570 #endif /* MSCHAP_SUPPORT */
571 
572 #endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */
573 
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 */
590 
591 #endif /* PPP_SUPPORT */
592 
593 #endif /* LWIP_PPP_OPTS_H */