TuyaOS
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
75#if PPP_SUPPORT
76
81#ifndef MEMP_NUM_PPP_PCB
82#define MEMP_NUM_PPP_PCB 1
83#endif
84
90#ifndef PPP_NUM_TIMEOUTS_PER_PCB
91#define PPP_NUM_TIMEOUTS_PER_PCB (1 + PPP_IPV4_SUPPORT + PPP_IPV6_SUPPORT + CCP_SUPPORT)
92#endif
93
94/* The number of sys_timeouts required for the PPP module */
95#define PPP_NUM_TIMEOUTS (PPP_SUPPORT * PPP_NUM_TIMEOUTS_PER_PCB * MEMP_NUM_PPP_PCB)
96
101#ifndef MEMP_NUM_PPPOS_INTERFACES
102#define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB
103#endif
104
109#ifndef MEMP_NUM_PPPOE_INTERFACES
110#define MEMP_NUM_PPPOE_INTERFACES 1
111#endif
112
117#ifndef MEMP_NUM_PPPOL2TP_INTERFACES
118#define MEMP_NUM_PPPOL2TP_INTERFACES 1
119#endif
120
124#ifndef MEMP_NUM_PPP_API_MSG
125#define MEMP_NUM_PPP_API_MSG 5
126#endif
127
131#ifndef PPP_DEBUG
132#define PPP_DEBUG LWIP_DBG_OFF
133#endif
134
140#ifndef PPP_INPROC_IRQ_SAFE
141#define PPP_INPROC_IRQ_SAFE 0
142#endif
143
149#ifndef PRINTPKT_SUPPORT
150#define PRINTPKT_SUPPORT 0
151#endif
152
156#ifndef PPP_IPV4_SUPPORT
157#define PPP_IPV4_SUPPORT (LWIP_IPV4)
158#endif
159
163#ifndef PPP_IPV6_SUPPORT
164#define PPP_IPV6_SUPPORT (LWIP_IPV6)
165#endif
166
176#ifndef PPP_NOTIFY_PHASE
177#define PPP_NOTIFY_PHASE 0
178#endif
179
190#ifndef PPP_USE_PBUF_RAM
191#define PPP_USE_PBUF_RAM 0
192#endif
193
197#ifndef PPP_FCS_TABLE
198#define PPP_FCS_TABLE 1
199#endif
200
204#ifndef PAP_SUPPORT
205#define PAP_SUPPORT 0
206#endif
207
211#ifndef CHAP_SUPPORT
212#define CHAP_SUPPORT 0
213#endif
214
218#ifndef MSCHAP_SUPPORT
219#define MSCHAP_SUPPORT 0
220#endif
221#if MSCHAP_SUPPORT
222/* MSCHAP requires CHAP support */
223#undef CHAP_SUPPORT
224#define CHAP_SUPPORT 1
225#endif /* MSCHAP_SUPPORT */
226
230#ifndef EAP_SUPPORT
231#define EAP_SUPPORT 0
232#endif
233
237#ifndef CCP_SUPPORT
238#define CCP_SUPPORT 0
239#endif
240
244#ifndef MPPE_SUPPORT
245#define MPPE_SUPPORT 0
246#endif
247#if MPPE_SUPPORT
248/* MPPE requires CCP support */
249#undef CCP_SUPPORT
250#define CCP_SUPPORT 1
251/* MPPE requires MSCHAP support */
252#undef MSCHAP_SUPPORT
253#define MSCHAP_SUPPORT 1
254/* MSCHAP requires CHAP support */
255#undef CHAP_SUPPORT
256#define CHAP_SUPPORT 1
257#endif /* MPPE_SUPPORT */
258
262#ifndef CBCP_SUPPORT
263#define CBCP_SUPPORT 0
264#endif
265
269#ifndef ECP_SUPPORT
270#define ECP_SUPPORT 0
271#endif
272
276#ifndef DEMAND_SUPPORT
277#define DEMAND_SUPPORT 0
278#endif
279
283#ifndef LQR_SUPPORT
284#define LQR_SUPPORT 0
285#endif
286
292#ifndef PPP_SERVER
293#define PPP_SERVER 0
294#endif
295
296#if PPP_SERVER
297/*
298 * PPP_OUR_NAME: Our name for authentication purposes
299 */
300#ifndef PPP_OUR_NAME
301#define PPP_OUR_NAME "lwIP"
302#endif
303#endif /* PPP_SERVER */
304
308#ifndef VJ_SUPPORT
309#define VJ_SUPPORT 1
310#endif
311/* VJ compression is only supported for TCP over IPv4 over PPPoS. */
312#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP
313#undef VJ_SUPPORT
314#define VJ_SUPPORT 0
315#endif /* !PPPOS_SUPPORT */
316
321#ifndef PPP_MD5_RANDM
322#define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)
323#endif
324
350#ifndef LWIP_USE_EXTERNAL_POLARSSL
351#define LWIP_USE_EXTERNAL_POLARSSL 0
352#endif
353
357#ifndef LWIP_USE_EXTERNAL_MBEDTLS
358#define LWIP_USE_EXTERNAL_MBEDTLS 0
359#endif
360
361/*
362 * PPP Timeouts
363 */
364
368#ifndef FSM_DEFTIMEOUT
369#define FSM_DEFTIMEOUT 6
370#endif
371
375#ifndef FSM_DEFMAXTERMREQS
376#define FSM_DEFMAXTERMREQS 2
377#endif
378
382#ifndef FSM_DEFMAXCONFREQS
383#define FSM_DEFMAXCONFREQS 10
384#endif
385
389#ifndef FSM_DEFMAXNAKLOOPS
390#define FSM_DEFMAXNAKLOOPS 5
391#endif
392
396#ifndef UPAP_DEFTIMEOUT
397#define UPAP_DEFTIMEOUT 6
398#endif
399
403#ifndef UPAP_DEFTRANSMITS
404#define UPAP_DEFTRANSMITS 10
405#endif
406
407#if PPP_SERVER
411#ifndef UPAP_DEFREQTIME
412#define UPAP_DEFREQTIME 30
413#endif
414#endif /* PPP_SERVER */
415
419#ifndef CHAP_DEFTIMEOUT
420#define CHAP_DEFTIMEOUT 6
421#endif
422
426#ifndef CHAP_DEFTRANSMITS
427#define CHAP_DEFTRANSMITS 10
428#endif
429
430#if PPP_SERVER
434#ifndef CHAP_DEFRECHALLENGETIME
435#define CHAP_DEFRECHALLENGETIME 0
436#endif
437#endif /* PPP_SERVER */
438
442#ifndef EAP_DEFREQTIME
443#define EAP_DEFREQTIME 6
444#endif
445
449#ifndef EAP_DEFALLOWREQ
450#define EAP_DEFALLOWREQ 10
451#endif
452
453#if PPP_SERVER
457#ifndef EAP_DEFTIMEOUT
458#define EAP_DEFTIMEOUT 6
459#endif
460
464#ifndef EAP_DEFTRANSMITS
465#define EAP_DEFTRANSMITS 10
466#endif
467#endif /* PPP_SERVER */
468
473#ifndef LCP_DEFLOOPBACKFAIL
474#define LCP_DEFLOOPBACKFAIL 10
475#endif
476
480#ifndef LCP_ECHOINTERVAL
481#define LCP_ECHOINTERVAL 0
482#endif
483
487#ifndef LCP_MAXECHOFAILS
488#define LCP_MAXECHOFAILS 3
489#endif
490
494#ifndef PPP_MAXIDLEFLAG
495#define PPP_MAXIDLEFLAG 100
496#endif
497
505#ifndef PPP_MRU
506#define PPP_MRU 1500
507#endif
508
512#ifndef PPP_DEFMRU
513#define PPP_DEFMRU 1500
514#endif
515
519#ifndef PPP_MAXMRU
520#define PPP_MAXMRU 1500
521#endif
522
526#ifndef PPP_MINMRU
527#define PPP_MINMRU 128
528#endif
529
535#if PPPOL2TP_SUPPORT
536#ifndef PPPOL2TP_DEFMRU
537#define PPPOL2TP_DEFMRU 1450
538#endif
539#endif /* PPPOL2TP_SUPPORT */
540
544#ifndef MAXNAMELEN
545#define MAXNAMELEN 256
546#endif
547
551#ifndef MAXSECRETLEN
552#define MAXSECRETLEN 256
553#endif
554
555/* ------------------------------------------------------------------------- */
556
557/*
558 * Build triggers for embedded PolarSSL
559 */
560#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS
561
562/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
563#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
564#define LWIP_INCLUDED_POLARSSL_MD5 1
565#endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */
566
567#if MSCHAP_SUPPORT
568
569/* MSCHAP require MD4 support */
570#define LWIP_INCLUDED_POLARSSL_MD4 1
571/* MSCHAP require SHA1 support */
572#define LWIP_INCLUDED_POLARSSL_SHA1 1
573/* MSCHAP require DES support */
574#define LWIP_INCLUDED_POLARSSL_DES 1
575
576/* MS-CHAP support is required for MPPE */
577#if MPPE_SUPPORT
578/* MPPE require ARC4 support */
579#define LWIP_INCLUDED_POLARSSL_ARC4 1
580#endif /* MPPE_SUPPORT */
581
582#endif /* MSCHAP_SUPPORT */
583
584#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */
585
586/* Default value if unset */
587#ifndef LWIP_INCLUDED_POLARSSL_MD4
588#define LWIP_INCLUDED_POLARSSL_MD4 0
589#endif /* LWIP_INCLUDED_POLARSSL_MD4 */
590#ifndef LWIP_INCLUDED_POLARSSL_MD5
591#define LWIP_INCLUDED_POLARSSL_MD5 0
592#endif /* LWIP_INCLUDED_POLARSSL_MD5 */
593#ifndef LWIP_INCLUDED_POLARSSL_SHA1
594#define LWIP_INCLUDED_POLARSSL_SHA1 0
595#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
596#ifndef LWIP_INCLUDED_POLARSSL_DES
597#define LWIP_INCLUDED_POLARSSL_DES 0
598#endif /* LWIP_INCLUDED_POLARSSL_DES */
599#ifndef LWIP_INCLUDED_POLARSSL_ARC4
600#define LWIP_INCLUDED_POLARSSL_ARC4 0
601#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */
602
603#endif /* PPP_SUPPORT */
604
605/* Default value if unset */
606#ifndef PPP_NUM_TIMEOUTS
607#define PPP_NUM_TIMEOUTS 0
608#endif /* PPP_NUM_TIMEOUTS */
609
610#endif /* LWIP_PPP_OPTS_H */