0bee4e3f5e8d51e28facef4ee85d1b4e90594a12
[mirrors/FD230.git] /
1 /*
2  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
3  * All rights reserved.
4  * Copyright (c) <2013-2020>, <CompanyNameMagicTag>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  *    this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  *    this list of conditions and the following disclaimer in the documentation
14  *    and/or other materials provided with the distribution.
15  * 3. The name of the author may not be used to endorse or promote products
16  *    derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
21  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
23  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
27  * OF SUCH DAMAGE.
28  *
29  * This file is part of the lwIP TCP/IP stack.
30  *
31  * Author: Simon Goldschmidt
32  *
33  */
34
35 #ifndef __LWIPOPTS_H__
36 #define __LWIPOPTS_H__
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 #ifndef LWIP_PLATFORM_PRINT
42 #define LWIP_PLATFORM_PRINT         PRINTK
43 #endif
44
45 #define LWIP_DEFINE_SWITCH 0
46 #define LOSCFG_CONFIG_MQTT 1
47 #define LWIP_LOWPOWER 0
48
49 /* time unit */
50 #define MS_PER_SECOND    1000
51 #define US_PER_MSECOND   1000
52 #define NS_PER_USECOND   1000
53 #define NS_PER_MS        1000000
54
55 #ifndef LWIP_DISABLE_TCP_SANITY_CHECKS
56 #define LWIP_DISABLE_TCP_SANITY_CHECKS  1
57 #endif
58
59 #if 0
60 #define LWIP_DEBUG                      LWIP_DBG_ON
61 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
62 #define SOCKETS_DEBUG                   LWIP_DBG_ON 
63 #define TCP_DEBUG                       LWIP_DBG_ON
64 #define TCP_INPUT_DEBUG                 LWIP_DBG_ON
65 #define TCP_OUTPUT_DEBUG                LWIP_DBG_ON
66 #define TCP_INPKT_DEBUG                 LWIP_DBG_ON
67 #endif
68
69 #ifndef LWIP_SLIP
70 #define LWIP_SLIP 0
71 #endif
72
73 /* ---------- SLIP/PPP Protocol Selection ---------- */
74 /* 
75  * SLIP和PPP协议二选一配置
76  * 通过编译时定义SLIP_MODULE_ENABLED或PPP_MODULE_ENABLED来选择协议
77  * 如果两个都定义或都未定义,则默认使用SLIP
78  */
79
80 #if defined(SLIP_MODULE_ENABLED) && defined(PPP_MODULE_ENABLED)
81 #error "Cannot enable both SLIP and PPP modules simultaneously. Please choose one."
82 #endif
83
84 #if defined(PPP_MODULE_ENABLED) && !defined(SLIP_MODULE_ENABLED)
85 /* PPP模式配置 */
86 #undef LWIP_SLIP
87 #define LWIP_SLIP 0
88
89 /* PPP协议支持 */
90 #ifndef PPP_SUPPORT
91 #define PPP_SUPPORT 1
92 #endif
93
94 #ifndef PPPOS_SUPPORT
95 #define PPPOS_SUPPORT 1
96 #endif
97
98 #ifndef PPP_IPV4_SUPPORT
99 #define PPP_IPV4_SUPPORT 1
100 #endif
101
102 #ifndef PAP_SUPPORT
103 #define PAP_SUPPORT 1
104 #endif
105
106 #ifndef CHAP_SUPPORT
107 #define CHAP_SUPPORT 1
108 #endif
109
110 #ifndef LWIP_PPP_API
111 #define LWIP_PPP_API 1
112 #endif
113
114 #ifndef PPP_NOTIFY_PHASE
115 #define PPP_NOTIFY_PHASE 1
116 #endif
117
118 #ifndef MEMP_NUM_PPP_PCB
119 #define MEMP_NUM_PPP_PCB 2
120 #endif
121
122 #ifndef MEMP_NUM_PPPOS_INTERFACES
123 #define MEMP_NUM_PPPOS_INTERFACES 2
124 #endif
125
126 #ifndef PPP_USE_PBUF_RAM
127 #define PPP_USE_PBUF_RAM 1
128 #endif
129
130 #ifndef PPP_FCS_TABLE
131 #define PPP_FCS_TABLE 1
132 #endif
133
134 #ifndef PRINTPKT_SUPPORT
135 #define PRINTPKT_SUPPORT 1
136 #endif
137
138 #ifndef PPP_DEBUG
139 #define PPP_DEBUG LWIP_DBG_ON
140 #endif
141
142 #ifndef PPP_INPROC_IRQ_SAFE
143 #define PPP_INPROC_IRQ_SAFE 0
144 #endif
145
146 /* PPP MRU配置控制 - 用于防止发送分片 */
147 #ifndef PPP_ENABLE_LARGE_MRU
148 #define PPP_ENABLE_LARGE_MRU        0                   // 0=禁用1500字节MRU(防止分片), 1=启用1500字节MRU
149 #endif
150
151 #if PPP_ENABLE_LARGE_MRU
152 #define PPP_MRU_SIZE                1500                // PPP MRU大小 - 启用大MRU
153 #else
154 #define PPP_MRU_SIZE                1500                 // PPP MRU大小 - 限制为128字节防止分片
155 #endif
156
157 #elif defined(SLIP_MODULE_ENABLED) && !defined(PPP_MODULE_ENABLED)
158 /* SLIP模式配置 */
159 #ifndef LWIP_SLIP
160 #define LWIP_SLIP 1
161 #endif
162
163 /* 确保PPP协议关闭 */
164 #ifndef PPP_SUPPORT
165 #define PPP_SUPPORT 0
166 #endif
167
168 #ifndef PPPOS_SUPPORT
169 #define PPPOS_SUPPORT 0
170 #endif
171
172 #else
173 /* 默认SLIP模式(向后兼容) */
174 #ifndef LWIP_SLIP
175 #define LWIP_SLIP 1
176 #endif
177
178 #ifndef PPP_SUPPORT
179 #define PPP_SUPPORT 0
180 #endif
181
182 #ifndef PPPOS_SUPPORT
183 #define PPPOS_SUPPORT 0
184 #endif
185
186 #endif
187
188 #if LWIP_SLIP
189 /* SLIP UART configuration */
190 // UART_BUS_0 = 0  UART_BUS_1 = 1
191 #ifndef SLIP_IFNUM
192 #define SLIP_IFNUM              0  
193 #endif
194
195 #ifndef SLIP_RX_FROM_ISR
196 #define SLIP_RX_FROM_ISR        1
197 #endif
198
199 #ifndef SLIP_USE_RX_THREAD
200 #define SLIP_USE_RX_THREAD      1    // 启用接收线程作为主线程处理队列
201 #endif
202
203 #ifndef SLIP_DEBUG
204 #define SLIP_DEBUG              LWIP_DBG_ON
205 #endif
206 #endif
207
208
209 /* SIO UART configuration - unified for PPP, SLIP and all serial protocols */
210 #ifndef SIO_UART_BUS
211 #define SIO_UART_BUS           UART_BUS_0
212 #endif
213
214 #ifndef SIO_UART_IRQ_NUM
215 #define SIO_UART_IRQ_NUM       UART_0_IRQN
216 #endif
217
218 #ifndef SIO_UART_BAUDRATE
219 #define SIO_UART_BAUDRATE      921600
220 #endif
221
222 #ifndef SIO_UART_TX_PIN
223 #define SIO_UART_TX_PIN        S_MGPIO19
224 #endif
225
226 #ifndef SIO_UART_RX_PIN
227 #define SIO_UART_RX_PIN        S_MGPIO20
228 #endif
229
230 #ifndef SIO_UART_DATA_BIT
231 #define SIO_UART_DATA_BIT      UART_DATA_BIT_8
232 #endif
233
234 #ifndef SIO_UART_PARITY
235 #define SIO_UART_PARITY        UART_PARITY_NONE
236 #endif
237
238 #ifndef SIO_UART_STOP_BIT
239 #define SIO_UART_STOP_BIT      UART_STOP_BIT_1
240 #endif
241
242 #ifndef SIO_UART_FLOW_CTRL
243 #define SIO_UART_FLOW_CTRL     UART_FLOW_CTRL_NONE
244 #endif
245
246
247 #define LWIP_HTTPC_HAVE_FILE_IO 1
248 /*
249   To support the CMSIS interface, you need to enable this macro.
250   By default, this macro is not supported.
251 */
252 #ifndef LWIP_ALIOS_COMPAT
253 #define LWIP_ALIOS_COMPAT 0
254 #endif
255
256 #ifndef LWIP_CMSIS_SUPPORT
257 #define LWIP_CMSIS_SUPPORT 0
258 #endif
259
260 #ifndef LWIP_FREERTOS_COMPAT
261 #define LWIP_FREERTOS_COMPAT 0
262 #endif
263
264 #ifndef LWIP_GETHOSTBYNAME
265 #define LWIP_GETHOSTBYNAME 1
266 #endif
267
268 #ifndef LWIP_GETPEERNAME
269 #define LWIP_GETPEERNAME 1
270 #endif
271
272 #ifndef LWIP_GETSOCKNAME
273 #define LWIP_GETSOCKNAME 1
274 #endif
275
276 #ifndef LWIP_SMALL_SIZE
277 #define LWIP_SMALL_SIZE 1
278 #endif
279
280 /* only valid when LWIP_SMALL_SIZE is 1, mean small size with MESH function */
281 #ifndef LWIP_SMALL_SIZE_MESH
282 #define LWIP_SMALL_SIZE_MESH 1
283 #endif
284
285 #if LWIP_SMALL_SIZE
286
287 #if LWIP_SMALL_SIZE_MESH
288
289 #ifndef LWIP_L3_EVENT_MSG
290 #define LWIP_L3_EVENT_MSG 1
291 #endif
292
293 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
294 #define LWIP_ENABLE_MESH_SHELL_CMD 1
295 #endif
296
297 #ifndef LWIP_RPL
298 #define LWIP_RPL 0
299 #endif
300
301 #ifndef LWIP_RIPPLE
302 #define LWIP_RIPPLE 0
303 #endif
304
305 #ifndef LWIP_MMBR
306 #define LWIP_MMBR 0
307 #endif
308
309 #ifndef LWIP_NA_PROXY
310 #define LWIP_NA_PROXY    1
311 #endif
312
313 #ifndef LWIP_RA_PREFIX_DYNAMIC
314 #define LWIP_RA_PREFIX_DYNAMIC    1
315 #endif
316
317 #ifndef LWIP_IPV6_MLD
318 #define LWIP_IPV6_MLD 0
319 #endif
320
321 #ifndef LWIP_IPV6_MLD_QUERIER
322 #define LWIP_IPV6_MLD_QUERIER 0
323 #endif
324
325 #ifndef LWIP_MPL
326 #define LWIP_MPL 0
327 #endif
328
329 #ifndef LWIP_MPL_IPV4
330 #define LWIP_MPL_IPV4  0
331 #endif
332
333 #ifndef LWIP_MPL_IPV4_BCAST
334 #define LWIP_MPL_IPV4_BCAST 0
335 #endif
336
337 #ifndef LWIP_6LOWPAN
338 #define LWIP_6LOWPAN 0
339 #endif
340
341 #ifndef ETH_6LOWPAN
342 #define ETH_6LOWPAN 1
343 #endif
344
345 #ifndef LWIP_IPV6_AUTOCONFIG_DEFAULT
346 #define LWIP_IPV6_AUTOCONFIG_DEFAULT    1
347 #endif
348
349 #ifndef LWIP_DHCP_SUBSTITUTE
350 #define LWIP_DHCP_SUBSTITUTE 0
351 #endif
352
353 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
354 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 1
355 #endif
356
357 #ifndef LWIP_NAT64
358 #define LWIP_NAT64    1
359 #endif
360
361 #ifndef LWIP_NAT64_MIN_SUBSTITUTE
362 #define LWIP_NAT64_MIN_SUBSTITUTE 0
363 #endif
364
365 #ifndef LWIP_DNS64
366 #define LWIP_DNS64    1
367 #endif
368
369 #ifndef LWIP_ND6_ROUTER
370 #define LWIP_ND6_ROUTER    1
371 #endif
372
373 #ifndef LWIP_ND6_DAG_PREFIX
374 #define LWIP_ND6_DAG_PREFIX    1
375 #endif
376
377 #ifndef LWIP_USE_L2_METRICS
378 #define LWIP_USE_L2_METRICS 1
379 #endif
380
381 #ifndef LWIP_SO_PRIORITY
382 #define LWIP_SO_PRIORITY 1
383 #endif
384
385 #ifndef LWIP_ENABLE_ROUTER
386 #define LWIP_ENABLE_ROUTER   1
387 #endif
388
389 /* maximum that an AP can associate with others */
390 #ifndef LWIP_AP_ASSOCIATE_NUM
391 #define LWIP_AP_ASSOCIATE_NUM 5
392 #endif
393
394 /* maximum of MBRs */
395 #ifndef LWIP_MULTI_MBR_NUM
396 #define LWIP_MULTI_MBR_NUM 3
397 #endif
398
399 /* number of nodes at Router side */
400 #ifndef LWIP_ROUTER_NBR_NUM
401 #define LWIP_ROUTER_NBR_NUM 11
402 #endif
403
404 #ifndef LWIP_ND6_NUM_DESTINATIONS
405 #define LWIP_ND6_NUM_DESTINATIONS \
406   (LWIP_ND6_NUM_ROUTERS + LWIP_AP_ASSOCIATE_NUM + (LWIP_MULTI_MBR_NUM - 1) + LWIP_ROUTER_NBR_NUM)
407 #endif /* LWIP_ND6_NUM_DESTINATIONS */
408
409 #ifndef LWIP_ND6_NUM_NEIGHBORS
410 #define LWIP_ND6_NUM_NEIGHBORS LWIP_ND6_NUM_DESTINATIONS
411 #endif
412
413 #ifndef LWIP_ND6_DESTINATIONS_OLDTIME
414 #define LWIP_ND6_DESTINATIONS_OLDTIME 180
415 #endif
416
417 #else /* LWIP_SMALL_SIZE_MESH */
418 #undef LWIP_MMBR
419 #define LWIP_MMBR 0
420
421 #endif /* LWIP_SMALL_SIZE_MESH */
422
423 #ifndef LWIP_L3_EVENT_MSG
424 #define LWIP_L3_EVENT_MSG   0
425 #endif
426
427 #if defined (LOSCFG_CONFIG_MQTT)
428 #ifndef CONFIG_NFILE_DESCRIPTORS
429 #define CONFIG_NFILE_DESCRIPTORS 1
430 #endif
431 #endif
432
433 #ifndef LWIP_API_MESH
434 #define LWIP_API_MESH   0
435 #endif
436
437 #ifndef LWIP_API_RICH
438 #define LWIP_API_RICH   0
439 #endif
440
441 #ifndef LWIP_ICMP6_ERR_RT_LMT
442 #define LWIP_ICMP6_ERR_RT_LMT 0
443 #endif
444
445 #ifndef LWIP_DHCPS_AGENT_INFO
446 #define LWIP_DHCPS_AGENT_INFO   0
447 #endif
448
449 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
450 #define LWIP_SOCK_OPT_ICMP6_FILTER   0
451 #endif
452
453 #ifndef LWIP_IPV6_PER_PROTO_CHKSUM
454 #define LWIP_IPV6_PER_PROTO_CHKSUM 0
455 #endif
456
457 #ifndef LWIP_SOCK_OPT_IPV6_UNICAST_HOPS
458 #define LWIP_SOCK_OPT_IPV6_UNICAST_HOPS   0
459 #endif
460
461 #ifndef LWIP_SOCK_OPT_TCP_QUEUE_SEQ
462 #define LWIP_SOCK_OPT_TCP_QUEUE_SEQ   0
463 #endif
464
465 #ifndef LWIP_LINK_MCAST_FILTER
466 #define LWIP_LINK_MCAST_FILTER   0
467 #endif
468
469 #ifndef LWIP_IOCTL_IPV6DPCTD
470 #define LWIP_IOCTL_IPV6DPCTD   0
471 #endif
472
473 #ifndef LWIP_IOCTL_ROUTE
474 #define LWIP_IOCTL_ROUTE   0
475 #endif
476
477 #ifndef LWIP_IOCTL_IF
478 #define LWIP_IOCTL_IF   0
479 #endif
480
481 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
482 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS   0
483 #endif
484
485 #ifndef LWIP_NETIFAPI_DHCPS_IP
486 #define LWIP_NETIFAPI_DHCPS_IP 0
487 #endif
488
489 #ifndef LWIP_NETIFAPI_GET_ADDR
490 #define LWIP_NETIFAPI_GET_ADDR 1
491 #endif
492
493 #ifndef LWIP_DROP_PKT_WHEN_NETIF_DOWN
494 #define LWIP_DROP_PKT_WHEN_NETIF_DOWN 1
495 #endif
496
497 #ifndef LWIP_NETIFAPI_LINK_CALLBACK
498 #define LWIP_NETIFAPI_LINK_CALLBACK 0
499 #endif
500
501 #ifndef LWIP_NETIFAPI_MTU
502 #define LWIP_NETIFAPI_MTU 0
503 #endif
504
505 #ifndef LWIP_NETIFAPI_IF_NUM
506 #define LWIP_NETIFAPI_IF_NUM 0
507 #endif
508
509 #ifndef LWIP_NETIFAPI_IF_INDEX
510 #define LWIP_NETIFAPI_IF_INDEX 0
511 #endif
512
513 #ifndef LWIP_NETIFAPI_IF_HW
514 #define LWIP_NETIFAPI_IF_HW 0
515 #endif
516
517 #ifndef LWIP_NETIFAPI_IP6_ADDR
518 #define LWIP_NETIFAPI_IP6_ADDR 0
519 #endif
520
521 #ifndef LWIP_NETIFAPI_MLD6
522 #define LWIP_NETIFAPI_MLD6 0
523 #endif
524
525 #ifndef LWIP_NETIFAPI_IF_GET_DEFAULT
526 #define LWIP_NETIFAPI_IF_GET_DEFAULT 0
527 #endif
528
529 #ifndef LWIP_IP_FILTER
530 #define LWIP_IP_FILTER        0
531 #endif
532
533 #ifndef LWIP_IPV6_FILTER
534 #define LWIP_IPV6_FILTER        0
535 #endif
536
537 #ifndef LWIP_NETIF_NBR_CACHE_API
538 #define LWIP_NETIF_NBR_CACHE_API 0
539 #endif
540
541 #if defined (CONFIG_NETIF_HOSTNAME)
542
543 #ifndef LWIP_NETIF_HOSTNAME
544 #define LWIP_NETIF_HOSTNAME    1
545 #endif
546
547 #ifndef LWIP_NETIF_GET_HOSTNAME
548 #define LWIP_NETIF_GET_HOSTNAME    0
549 #endif
550
551 #else
552
553 #ifndef LWIP_NETIF_HOSTNAME
554 #define LWIP_NETIF_HOSTNAME    0
555 #endif
556 #endif
557
558 #ifndef LWIP_IFADDRS
559 #define LWIP_IFADDRS                 0
560 #endif
561
562 #ifndef LWIP_ALLOW_SOCKET_CONFIG
563 #define LWIP_ALLOW_SOCKET_CONFIG 0
564 #endif
565
566 #if defined (CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER)
567 #ifndef LWIP_DHCP_VENDOR_CLASS_IDENTIFIER
568 #define LWIP_DHCP_VENDOR_CLASS_IDENTIFIER    1
569 #endif
570
571 #ifndef LWIP_DHCP_GET_VENDOR_CLASS_IDENTIFIER
572 #define LWIP_DHCP_GET_VENDOR_CLASS_IDENTIFIER    0
573 #endif
574
575 #else
576
577 #ifndef LWIP_DHCP_VENDOR_CLASS_IDENTIFIER
578 #define LWIP_DHCP_VENDOR_CLASS_IDENTIFIER    0
579 #endif
580 #endif
581
582 #ifndef LWIP_IPV6_DHCP6
583 #define LWIP_IPV6_DHCP6                 0
584 #endif
585
586 #ifndef LWIP_TCP_TLP_SUPPORT
587 #define LWIP_TCP_TLP_SUPPORT    0
588 #endif
589
590 #ifndef LWIP_WND_SCALE
591 #define LWIP_WND_SCALE    0
592 #endif
593
594 #ifndef LWIP_SOCK_FILTER
595 #define LWIP_SOCK_FILTER        0
596 #endif
597
598 #ifndef DRIVER_STATUS_CHECK
599 #define DRIVER_STATUS_CHECK     0
600 #endif
601
602 #ifndef IP6_DEBUG
603 #define IP6_DEBUG               0
604 #endif
605
606 #ifndef LWIP_DEBUG_TIMERNAMES
607 #define LWIP_DEBUG_TIMERNAMES   0
608 #endif
609
610 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
611 #define ETHARP_SUPPORT_STATIC_ENTRIES 1
612 #endif
613
614 #ifndef LWIP_DHCPS
615 #define LWIP_DHCPS              1
616 #endif
617
618 #ifndef LWIP_STATS
619 #define LWIP_STATS              0
620 #endif
621
622 #ifndef ICMP6_STATS
623 #define ICMP6_STATS             0
624 #endif
625
626 #ifndef LWIP_TCP_INFO
627 #define LWIP_TCP_INFO           0
628 #endif
629
630 #ifndef LWIP_NETIF_ETHTOOL
631 #define LWIP_NETIF_ETHTOOL      0
632 #endif
633
634 #ifndef LWIP_ENABLE_LOS_SHELL_CMD
635 #define LWIP_ENABLE_LOS_SHELL_CMD 0
636 #endif
637
638 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
639 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
640 #endif
641
642 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
643 #define LWIP_ENABLE_MESH_SHELL_CMD 0
644 #endif
645
646 #ifndef LWIP_RIPPLE
647 #define LWIP_RIPPLE 0
648 #endif
649
650 #ifndef LWIP_RA_PREFIX_DYNAMIC
651 #define LWIP_RA_PREFIX_DYNAMIC    0
652 #endif
653
654 #ifndef LWIP_DHCP_COAP_RELAY
655 #define LWIP_DHCP_COAP_RELAY    0
656 #endif
657
658 #ifndef LWIP_MPL_IPV4_BCAST
659 #define LWIP_MPL_IPV4_BCAST 0
660 #endif
661
662 #ifndef LWIP_6LOWPAN
663 #define LWIP_6LOWPAN 0
664 #endif
665
666 #ifndef ETH_6LOWPAN
667 #define ETH_6LOWPAN 0
668 #endif
669
670 #ifndef LWIP_DHCP_SUBSTITUTE
671 #define LWIP_DHCP_SUBSTITUTE 0
672 #endif
673
674 #ifndef LWIP_DHCPS_MAX_LEASE
675 #define LWIP_DHCPS_MAX_LEASE 6
676 #endif
677
678 #ifndef LWIP_NAT64
679 #define LWIP_NAT64    0
680 #endif
681
682 #ifndef LWIP_DNS64
683 #define LWIP_DNS64    0
684 #endif
685
686 #ifndef LWIP_ND6_ROUTER
687 #define LWIP_ND6_ROUTER    0
688 #endif
689
690 #ifndef LWIP_RPL_RS_DAO
691 #define LWIP_RPL_RS_DAO    0
692 #endif
693
694 #ifndef LWIP_SO_BINDTODEVICE
695 #define LWIP_SO_BINDTODEVICE         1
696 #endif
697
698 #ifndef LWIP_SO_DONTROUTE
699 #define LWIP_SO_DONTROUTE         1
700 #endif
701
702 #ifndef LWIP_NUM_SOCKETS_MAX
703 #define LWIP_NUM_SOCKETS_MAX  9
704 #endif
705
706 #ifndef DEFAULT_LWIP_NUM_SOCKETS
707 #define DEFAULT_LWIP_NUM_SOCKETS        12
708 #endif /* DEFAULT_LWIP_NUM_SOCKETS */
709
710 #ifndef MEMP_NUM_PBUF
711 #define MEMP_NUM_PBUF           8
712 #endif
713
714 #ifndef MEMP_NUM_RAW_PCB
715 #define MEMP_NUM_RAW_PCB                1
716 #endif
717
718 #ifndef MEMP_NUM_TCPIP_MSG_API
719 #define MEMP_NUM_TCPIP_MSG_API          16
720 #endif
721
722 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
723 #define MEMP_NUM_TCPIP_MSG_INPKT        32
724 #endif
725
726 #ifndef MEMP_NUM_NETCONN
727 #define MEMP_NUM_NETCONN        LWIP_CONFIG_NUM_SOCKETS
728 #endif
729
730 #ifndef MEMP_NUM_NETBUF
731 #if LWIP_MMBR
732 #define MEMP_NUM_NETBUF         24
733 #else
734 #define MEMP_NUM_NETBUF         24
735 #endif
736 #endif
737
738 #ifndef MEMP_NUM_ARP_QUEUE
739 #define MEMP_NUM_ARP_QUEUE      12
740 #endif
741
742 #ifndef MEMP_NUM_UDP_PCB
743 #define MEMP_NUM_UDP_PCB        (7 + LWIP_MPL)
744 #endif
745
746 #ifndef MEMP_NUM_TCP_PCB
747 #define MEMP_NUM_TCP_PCB        6
748 #endif
749
750 #ifndef MEMP_NUM_TCP_PCB_LISTEN
751 #define MEMP_NUM_TCP_PCB_LISTEN 9
752 #endif
753
754 #ifndef MEMP_NUM_TCP_SEG
755 #define MEMP_NUM_TCP_SEG        32
756 #endif
757
758 #ifndef PBUF_POOL_SIZE
759 #define PBUF_POOL_SIZE          16
760 #endif
761
762 #if defined (CONFIG_LWIP_FOR_WIFI_SIGMA)
763 #ifndef MEMP_NUM_REASSDATA
764 #define MEMP_NUM_REASSDATA  64
765 #endif
766 #if !defined IP_REASS_MAXAGE
767 #define IP_REASS_MAXAGE      1
768 #endif
769 #else
770 #ifndef MEMP_NUM_REASSDATA
771 #define MEMP_NUM_REASSDATA  5
772 #endif
773 #endif
774
775 #ifndef TCP_SND_BUF
776 #define TCP_SND_BUF        (65535 / 3)
777 #endif
778
779 #ifndef TCP_SND_QUEUELEN
780 #define TCP_SND_QUEUELEN       (TCP_SND_BUF / TCP_MSS)
781 #endif
782
783 #ifndef TCP_WND
784 #define TCP_WND            (TCP_SND_BUF * 2 / 6) //改善810的下载速度
785 #endif
786
787 #ifndef LWIP_IGMP
788 #define LWIP_IGMP                       1
789 #endif
790
791 #ifndef LWIP_DNS_REVERSE
792 #define LWIP_DNS_REVERSE 0
793 #endif
794
795 #ifndef PF_PKT_SUPPORT
796 #define PF_PKT_SUPPORT 0
797 #endif
798
799 #ifndef LWIP_SO_RCVBUF
800 #define LWIP_SO_RCVBUF                  0
801 #endif
802
803 #ifndef LWIP_IPV6_MLD
804 #define LWIP_IPV6_MLD 0
805 #endif
806
807 #ifndef LWIP_IPV6_MLD_QUERIER
808 #define LWIP_IPV6_MLD_QUERIER 0
809 #endif
810
811 #ifndef LWIP_ND6_NUM_NEIGHBORS
812 #define LWIP_ND6_NUM_NEIGHBORS 5
813 #endif
814
815 #ifndef LWIP_SO_PRIORITY
816 #define LWIP_SO_PRIORITY 0
817 #endif
818
819 #ifndef LWIP_NETIF_PROMISC
820 #define LWIP_NETIF_PROMISC 0
821 #endif
822
823 #ifndef LWIP_NETBUF_RECVINFO
824 #define LWIP_NETBUF_RECVINFO 0
825 #endif
826
827 #ifndef LWIP_ND6_STATIC_PREFIX
828 #define LWIP_ND6_STATIC_PREFIX 0
829 #endif
830
831 #ifndef LWIP_USE_L2_METRICS
832 #define LWIP_USE_L2_METRICS 0
833 #endif
834
835 #ifndef MEMP_NUM_NETDB
836 #define MEMP_NUM_NETDB                  1
837 #endif
838
839 #ifndef DNS_TABLE_SIZE
840 #define DNS_TABLE_SIZE                  2
841 #endif
842
843 #ifndef DNS_MAX_IPADDR
844 #define DNS_MAX_IPADDR                1
845 #endif
846
847 #ifndef LWIP_DNS_SECURE
848 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)
849 #endif
850
851 #ifndef LWIP_ENABLE_ROUTER
852 #define LWIP_ENABLE_ROUTER   0
853 #endif
854
855 #ifndef LWIP_ND6_NUM_ROUTERS
856 #define LWIP_ND6_NUM_ROUTERS            1
857 #endif
858
859 #endif /* LWIP_SMALL_SIZE */
860
861 #ifndef RPL_CONF_SWITCH_MBR_BY_AUTOLINK
862 #define RPL_CONF_SWITCH_MBR_BY_AUTOLINK LWIP_MMBR
863 #endif
864
865 #ifndef RPL_CONF_MMBR_MNID
866 #define RPL_CONF_MMBR_MNID LWIP_MMBR
867 #endif
868
869 #ifndef LWIP_IP6IN4
870 #define LWIP_IP6IN4 LWIP_MMBR
871 #endif
872
873 #ifndef LWIP_DHCP_SUBSTITUTE_MMBR
874 #if defined(LWIP_DHCP_SUBSTITUTE) && LWIP_DHCP_SUBSTITUTE && LWIP_MMBR
875 #define LWIP_DHCP_SUBSTITUTE_MMBR 1
876 #else
877 #define LWIP_DHCP_SUBSTITUTE_MMBR 0
878 #endif
879 #endif /* LWIP_DHCP_SUBSTITUTE_MMBR */
880
881 #ifndef LWIP_IGMP_REPORT_TIMES
882 #define LWIP_IGMP_REPORT_TIMES 5
883 #endif
884
885 #ifndef LWIP_LIBCOAP
886 #define LWIP_LIBCOAP 0
887 #endif
888
889 #ifndef LWIP_FCNTL
890 #define LWIP_FCNTL 0
891 #endif
892
893 #ifndef LWIP_API_MESH
894 #define LWIP_API_MESH   1
895 #endif
896
897 #ifndef LWIP_L2_NETDEV_STATUS_CALLBACK
898 #define LWIP_L2_NETDEV_STATUS_CALLBACK 1
899 #endif
900
901 #ifndef LWIP_NETIF_STATUS_CALLBACK
902 #define LWIP_NETIF_STATUS_CALLBACK 1
903 #endif
904
905 #ifndef LWIP_TCP_TLP_SUPPORT
906 #define LWIP_TCP_TLP_SUPPORT    0
907 #endif
908
909 #ifndef LWIP_WND_SCALE
910 #define LWIP_WND_SCALE 0
911 #endif
912
913 #ifndef LWIP_TCP_INFO
914 #define LWIP_TCP_INFO           0
915 #endif
916
917 #ifndef LWIP_API_RICH
918 #define LWIP_API_RICH   1
919 #endif
920
921 #ifndef LWIP_DHCPS_AGENT_INFO
922 #define LWIP_DHCPS_AGENT_INFO   1
923 #endif
924
925 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
926 #define LWIP_SOCK_OPT_ICMP6_FILTER   1
927 #endif
928
929 #ifndef LWIP_IPV6_PER_PROTO_CHKSUM
930 #define LWIP_IPV6_PER_PROTO_CHKSUM 1
931 #endif
932
933 #ifndef LWIP_SOCK_OPT_IPV6_UNICAST_HOPS
934 #define LWIP_SOCK_OPT_IPV6_UNICAST_HOPS   1
935 #endif
936
937 #ifndef LWIP_SOCK_OPT_TCP_QUEUE_SEQ
938 #define LWIP_SOCK_OPT_TCP_QUEUE_SEQ   1
939 #endif
940
941 #ifndef LWIP_LINK_MCAST_FILTER
942 #define LWIP_LINK_MCAST_FILTER   1
943 #endif
944
945 #ifndef LWIP_IOCTL_IPV6DPCTD
946 #define LWIP_IOCTL_IPV6DPCTD   1
947 #endif
948
949 #ifndef LWIP_IOCTL_ROUTE
950 #define LWIP_IOCTL_ROUTE   1
951 #endif
952
953 #ifndef LWIP_IOCTL_IF
954 #define LWIP_IOCTL_IF   1
955 #endif
956
957 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
958 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS   1
959 #endif
960
961 #ifndef LWIP_NETIFAPI_DHCPS_IP
962 #define LWIP_NETIFAPI_DHCPS_IP 1
963 #endif
964
965 #ifndef LWIP_NETIFAPI_GET_ADDR
966 #define LWIP_NETIFAPI_GET_ADDR 1
967 #endif
968
969 #ifndef LWIP_NETIFAPI_LINK_CALLBACK
970 #define LWIP_NETIFAPI_LINK_CALLBACK 1
971 #endif
972
973 #ifndef LWIP_NETIFAPI_MTU
974 #define LWIP_NETIFAPI_MTU 1
975 #endif
976
977 #ifndef LWIP_NETIFAPI_IF_NUM
978 #define LWIP_NETIFAPI_IF_NUM 1
979 #endif
980
981 #ifndef LWIP_NETIFAPI_IF_INDEX
982 #define LWIP_NETIFAPI_IF_INDEX 1
983 #endif
984
985 #ifndef LWIP_NETIFAPI_IF_HW
986 #define LWIP_NETIFAPI_IF_HW 1
987 #endif
988
989 #ifndef LWIP_NETIFAPI_IP6_ADDR
990 #define LWIP_NETIFAPI_IP6_ADDR 1
991 #endif
992
993 #ifndef LWIP_NETIFAPI_MLD6
994 #define LWIP_NETIFAPI_MLD6 1
995 #endif
996
997 #ifndef LWIP_NETIFAPI_IF_GET_DEFAULT
998 #define LWIP_NETIFAPI_IF_GET_DEFAULT 1
999 #endif
1000
1001 #ifndef LWIP_IFADDRS
1002 #define LWIP_IFADDRS                 1
1003 #endif
1004
1005 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
1006 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
1007 #endif
1008
1009 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
1010 #define LWIP_ENABLE_MESH_SHELL_CMD 1
1011 #endif
1012
1013 #ifndef LWIP_NETIF_ETHTOOL
1014 #define LWIP_NETIF_ETHTOOL      0
1015 #endif
1016
1017 #ifndef LWIP_RPL_CTX
1018 #define LWIP_RPL_CTX  0
1019 #endif
1020
1021 #ifndef LWIP_TFTP
1022 #define LWIP_TFTP               0
1023 #endif
1024
1025 #ifndef IP_REASSEMBLY
1026 #define IP_REASSEMBLY          1
1027 #endif
1028
1029 #ifndef LWIP_RPL
1030 #define LWIP_RPL 0
1031 #endif
1032
1033 #ifndef LWIP_RIPPLE
1034 #define LWIP_RIPPLE 1
1035 #endif
1036
1037 #ifndef LWIP_LITEOS_TASK
1038 #define LWIP_LITEOS_TASK 1
1039 #endif
1040
1041 #ifndef LWIP_DHCP_COAP_RELAY
1042 #define LWIP_DHCP_COAP_RELAY    0
1043 #endif
1044
1045 #ifndef LWIP_NA_PROXY
1046 #define LWIP_NA_PROXY    1
1047 #endif
1048
1049 #ifndef LWIP_RA_PREFIX_DYNAMIC
1050 #define LWIP_RA_PREFIX_DYNAMIC    1
1051 #endif
1052
1053 #if LWIP_RIPPLE
1054 #if !defined(LWIP_MPL)
1055 #define LWIP_MPL  1
1056 #endif
1057 #else
1058 #if !defined(LWIP_MPL)
1059 #define LWIP_MPL  0
1060 #endif
1061 #endif
1062
1063 #if LWIP_MPL
1064 #if !defined(LWIP_MPL_IPV4)
1065 #define LWIP_MPL_IPV4  1
1066 #endif
1067 #else
1068 #if !defined(LWIP_MPL_IPV4)
1069 #define LWIP_MPL_IPV4  0
1070 #endif
1071 #endif
1072
1073 #ifndef LWIP_MPL_IPV4_BCAST
1074 #define LWIP_MPL_IPV4_BCAST 1
1075 #endif
1076
1077 #ifndef LWIP_6LOWPAN
1078 #define LWIP_6LOWPAN 0
1079 #endif
1080
1081 #ifndef ETH_6LOWPAN
1082 #define ETH_6LOWPAN 1
1083 #endif
1084
1085 #ifndef LWIP_IPV6_AUTOCONFIG_DEFAULT
1086 #define LWIP_IPV6_AUTOCONFIG_DEFAULT    1
1087 #endif
1088 /**
1089  * LWIP_DHCP_SUBSTITUTE==1: Enables MBR Querying IPv4 address for non-mesh IPv6 STA.
1090  */
1091 #ifndef LWIP_DHCP_SUBSTITUTE
1092 #define LWIP_DHCP_SUBSTITUTE 1
1093 #endif
1094
1095 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
1096 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 1
1097 #endif
1098
1099 #ifndef MEM_SIZE
1100 #define MEM_SIZE               (512*1024)
1101 #endif
1102
1103 #ifndef LWIP_PLC
1104 #define LWIP_PLC    0
1105 #endif
1106
1107 #ifndef LWIP_IEEE802154
1108 #define LWIP_IEEE802154 0
1109 #endif
1110
1111 #ifndef LWIP_NAT64
1112 #define LWIP_NAT64    1
1113 #endif
1114
1115 #ifndef LWIP_DNS64
1116 #define LWIP_DNS64    1
1117 #endif
1118
1119 #ifndef LWIP_ND6_ROUTER
1120 #define LWIP_ND6_ROUTER    1
1121 #endif
1122
1123 #ifndef LWIP_ND6_DAG_PREFIX
1124 #define LWIP_ND6_DAG_PREFIX    1
1125 #endif
1126
1127 #ifndef LWIP_ND6_RDNSS_MAX_DNS_SERVERS
1128 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS  2
1129 #endif
1130
1131 #ifndef LWIP_COMPAT_SOCKETS
1132 #define LWIP_COMPAT_SOCKETS 1
1133 #endif
1134
1135 #define LWIP_PLATFORM_BYTESWAP 0
1136
1137
1138 #ifndef LWIP_GETHOSTBYNAME
1139 #define LWIP_GETHOSTBYNAME 1
1140 #endif
1141
1142 #ifndef LWIP_GETPEERNAME
1143 #define LWIP_GETPEERNAME 1
1144 #endif
1145
1146 #ifndef LWIP_GETSOCKNAME
1147 #define LWIP_GETSOCKNAME 1
1148 #endif
1149
1150 #ifndef LWIP_SMALL_SIZE
1151 #define LWIP_SMALL_SIZE 1
1152 #endif
1153 #ifndef LWIP_L2_NETDEV_STATUS_CALLBACK
1154 #define LWIP_L2_NETDEV_STATUS_CALLBACK 1
1155 #endif
1156
1157 #ifndef LWIP_RIPPLE
1158 #define LWIP_RIPPLE 0
1159 #endif
1160
1161 #ifndef LWIP_NAT64
1162 #define LWIP_NAT64    0
1163 #endif
1164
1165 #ifndef LWIP_ND6_ROUTER
1166 #define LWIP_ND6_ROUTER    0
1167 #endif
1168
1169 #ifndef LWIP_ND6_DAG_PREFIX
1170 #define LWIP_ND6_DAG_PREFIX    1
1171 #endif
1172
1173 #ifndef LWIP_USE_L2_METRICS
1174 #define LWIP_USE_L2_METRICS 1
1175 #endif
1176
1177 #ifndef LWIP_ENABLE_ROUTER
1178 #define LWIP_ENABLE_ROUTER   0
1179 #endif
1180
1181 #ifndef LWIP_RPL_RS_DAO
1182 #define LWIP_RPL_RS_DAO    0
1183 #endif
1184
1185 #ifndef LWIP_API_MESH
1186 #define LWIP_API_MESH   1
1187 #endif
1188
1189 #ifndef LWIP_DHCP_SUBSTITUTE
1190 #define LWIP_DHCP_SUBSTITUTE 1
1191 #endif
1192
1193 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
1194 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 0
1195 #endif
1196
1197 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
1198 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
1199 #endif
1200
1201 #ifndef LWIP_NA_PROXY
1202 #define LWIP_NA_PROXY    1
1203 #endif
1204
1205 #ifndef LWIP_LITEOS_COMPAT
1206 #define LWIP_LITEOS_COMPAT  1
1207 #endif
1208
1209 /* Set to 1 if target platform is linux */
1210 #ifndef LWIP_LINUX_COMPAT
1211 #define LWIP_LINUX_COMPAT   0
1212 #endif
1213
1214 /* Set to 1 if target platform provides non-volatile ram APIs via <xx_nv.h> */
1215 #ifndef LWIP_PLATFORM_PROVIDE_NV_API
1216 #define LWIP_PLATFORM_PROVIDE_NV_API 0
1217 #endif
1218
1219 #ifndef LWIP_COMPAT_SOCKETS
1220 #define LWIP_COMPAT_SOCKETS 1
1221 #define LWIP_POSIX_SOCKETS_IO_NAMES 0
1222 #endif
1223
1224
1225 #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1
1226
1227
1228 #define VALUE_TO_STRING(x) #x
1229 #define VALUE(x) VALUE_TO_STRING(x)
1230 #define VAR_NAME_VALUE(var) #var "="  VALUE(var)
1231
1232 #ifndef LWIP_CHKSUM_ALGORITHM
1233 #define LWIP_CHKSUM_ALGORITHM       3
1234 #endif
1235
1236 #ifndef LWIP_NETIF_IFINDEX_MAX
1237 #define LWIP_NETIF_IFINDEX_MAX 0xFE
1238 #endif
1239
1240 #ifndef LWIP_NEIGHBOR_CLEANUP_WHILE_NETIF_LINK_DOWN
1241 #define LWIP_NEIGHBOR_CLEANUP_WHILE_NETIF_LINK_DOWN   LWIP_RIPPLE
1242 #endif
1243
1244 #ifndef LWIP_PROVIDE_ERRNO
1245 #define LWIP_PROVIDE_ERRNO 1
1246 #endif
1247
1248 #ifndef LWIP_COMPAT_MUTEX_ALLOWED
1249 #define LWIP_COMPAT_MUTEX_ALLOWED        1
1250 #endif
1251
1252 /**
1253  * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
1254  * SO_SNDTIMEO processing.
1255  */
1256 #ifndef LWIP_SO_SNDTIMEO
1257 #define LWIP_SO_SNDTIMEO                1
1258 #endif
1259
1260 /**
1261  * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
1262  * SO_RCVTIMEO processing.
1263  */
1264 #ifndef LWIP_SO_RCVTIMEO
1265 #define LWIP_SO_RCVTIMEO                1
1266 #endif
1267
1268 /**
1269  * LWIP_SO_BINDTODEVICE==1: Enable bind sockets/netconns to specific netif
1270  */
1271 #ifndef LWIP_SO_BINDTODEVICE
1272 #define LWIP_SO_BINDTODEVICE         1
1273 #endif
1274
1275 /**
1276  * LWIP_SO_DONTROUTE==1: Enable don't use universal route entry
1277  */
1278 #ifndef LWIP_SO_DONTROUTE
1279 #define LWIP_SO_DONTROUTE         1
1280 #endif
1281
1282 #ifndef LWIP_SACK
1283 #define LWIP_SACK           1
1284 #endif
1285
1286 #if LWIP_SACK
1287 #ifndef LWIP_SACK_PERF_OPT
1288 #define LWIP_SACK_PERF_OPT 1
1289 #endif
1290 #else
1291 #define LWIP_SACK_PERF_OPT 0
1292 #endif
1293
1294 #ifndef LWIP_SACK_CWND_OPT
1295 #define LWIP_SACK_CWND_OPT  LWIP_SACK_PERF_OPT
1296 #endif
1297
1298 #ifndef LWIP_SACK_DATA_SEG_PIGGYBACK
1299 #define LWIP_SACK_DATA_SEG_PIGGYBACK       (LWIP_SACK & 1)
1300 #endif
1301
1302
1303 /*
1304 @page RFC-5827
1305 @par  RFC-5827 Appendix A.  Compliance Information
1306 @par Compliant Sections
1307 <Appendix A. Research Issues in Adjusting the Duplicate ACK Threshold>
1308 @par Behavior Description
1309 <Behavior:  Reducing the number of duplicate acks for fast retransmit has drawback during minor \n
1310   network reordering.\n
1311   Our node do not realize the mitigations proposed. So MITIGATION A.1, MITIGATION A.2 and \n
1312   MITIGATION A.3 are not implemented.>
1313 */
1314 #ifndef LWIP_TCP_ER_SUPPORT
1315 #define LWIP_TCP_ER_SUPPORT           1
1316 #endif
1317
1318 #if LWIP_SACK
1319 #ifndef LWIP_TCP_TLP_SUPPORT
1320 #define LWIP_TCP_TLP_SUPPORT 0
1321 #endif
1322 #else
1323 #define LWIP_TCP_TLP_SUPPORT 0
1324 #endif
1325
1326 #if LWIP_SACK
1327 #ifndef LWIP_FACK_THRESHOLD_BASED_FR
1328 #define LWIP_FACK_THRESHOLD_BASED_FR 1
1329 #endif
1330 #else
1331 #define LWIP_FACK_THRESHOLD_BASED_FR 0
1332 #endif
1333
1334 #ifndef LWIP_WND_SCALE
1335 #define LWIP_WND_SCALE 0
1336 #endif
1337 #ifndef TCP_OOSEQ_MAX_PBUFS
1338 #define TCP_OOSEQ_MAX_PBUFS     8
1339 #endif
1340
1341
1342 /**
1343  * NO_SYS==1: Provides very minimal functionality. Otherwise,
1344  * use lwIP facilities.
1345  */
1346 #define NO_SYS                  0
1347
1348 #ifndef LWIP_NOASSERT
1349 #define LWIP_NOASSERT
1350 #endif
1351
1352 /* ---------- DEBUG options --------- */
1353 /* LWIP_DEBUG_INFO is opened by default. */
1354 #ifndef LWIP_DEBUG_INFO
1355 #define LWIP_DEBUG_INFO
1356 #endif
1357
1358 /**
1359  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1360  * debug messages of certain types.
1361  */
1362 #ifndef LWIP_DBG_TYPES_ON
1363 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
1364 #endif
1365
1366 #ifndef IP_DEBUG
1367 #define IP_DEBUG                        LWIP_DBG_ON
1368 #endif
1369
1370 #ifndef ETHARP_DEBUG
1371 #define ETHARP_DEBUG                    LWIP_DBG_OFF
1372 #endif
1373
1374 #ifndef NETIF_DEBUG
1375 #define NETIF_DEBUG                     LWIP_DBG_ON
1376 #endif
1377
1378 #ifndef L3_EVENT_MSG_DEBUG
1379 #define L3_EVENT_MSG_DEBUG              LWIP_DBG_OFF
1380 #endif
1381
1382 #ifndef MLD6_DEBUG
1383 #define MLD6_DEBUG                      LWIP_DBG_OFF
1384 #endif
1385
1386 #ifndef LWIP_NETIF_PROMISC
1387 #define LWIP_NETIF_PROMISC              0
1388 #endif
1389
1390 /* ---------- Memory options ---------- */
1391
1392 #if LWIP_LITEOS_COMPAT
1393 /**
1394  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
1395  * instead of the lwIP internal allocator. Can save code size if you
1396  * already use it.
1397  */
1398 #define MEM_LIBC_MALLOC         1
1399 #ifndef MEM_SIZE
1400 #define MEM_SIZE                        (4 * 1024 * 1024)
1401 #endif
1402
1403 #ifndef MEM_LIBC_MALLOC_TOTAL_SIZE_LIMIT
1404 #define MEM_LIBC_MALLOC_TOTAL_SIZE_LIMIT 0
1405 #endif
1406
1407 #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1
1408 #else
1409 /* MEM_SIZE: the size of the heap memory. If the application will send
1410 a lot of data that needs to be copied, this should be set high. */
1411 #ifndef MEM_SIZE
1412 #define MEM_SIZE               (512 * 1024)
1413 #endif
1414
1415 #endif
1416
1417 #if MEM_LIBC_MALLOC
1418 #ifndef MEM_PBUF_RAM_SIZE_LIMIT
1419 #define MEM_PBUF_RAM_SIZE_LIMIT   1
1420 #endif
1421 #endif
1422
1423 #ifndef MAX_NUM_PID
1424 #define MAX_NUM_PID            128
1425 #endif
1426
1427 /**
1428  * Defines the align size of the DMA memory. If set to 1, then not using DMA.
1429  */
1430 #ifndef MEM_MALLOC_DMA_ALIGN
1431 #if LWIP_LITEOS_COMPAT
1432 #define MEM_MALLOC_DMA_ALIGN            1
1433 #else
1434 #define MEM_MALLOC_DMA_ALIGN            1
1435 #endif
1436 #endif
1437
1438
1439 /**
1440   *  Attention: Be careful while configure large sockets number, i.e, greater than 128, for that
1441   *  LWIP_NUM_SOCKETS is bind with file system descriptons CONFIG_NFILE_DESCRIPTORS.
1442   *  If socket num is large, file descriptions for file system would be small. See vfs_config.h
1443   *  for detail.
1444   */
1445 #ifndef LWIP_NUM_SOCKETS_MAX
1446 #define LWIP_NUM_SOCKETS_MAX  8 // 128
1447 #endif
1448
1449
1450 /**
1451  * LWIP_NUM_SOCKETS can be used to override DEFAULT_LWIP_NUM_SOCKETS in lwipopts_*.h
1452  */
1453 #ifndef LWIP_NUM_SOCKETS
1454
1455 /**
1456  * DEFAULT_LWIP_NUM_SOCKETS is default number of sockets.
1457  */
1458 #ifndef DEFAULT_LWIP_NUM_SOCKETS
1459 #define DEFAULT_LWIP_NUM_SOCKETS        8
1460 #endif /* DEFAULT_LWIP_NUM_SOCKETS */
1461
1462 #else /* else LWIP_NUM_SOCKETS*/
1463
1464 #ifndef DEFAULT_LWIP_NUM_SOCKETS
1465
1466 #if LWIP_NUM_SOCKETS > 0
1467 #define DEFAULT_LWIP_NUM_SOCKETS        LWIP_NUM_SOCKETS
1468 #else /* else LWIP_NUM_SOCKETS > 0*/
1469 #define DEFAULT_LWIP_NUM_SOCKETS        8
1470 #endif /* LWIP_NUM_SOCKETS*/
1471
1472 #endif /* DEFAULT_LWIP_NUM_SOCKETS*/
1473 #endif /* LWIP_NUM_SOCKETS*/
1474
1475 /*
1476  * Provides flexibility to use configured values to spread across code
1477  */
1478 #ifndef LWIP_ALLOW_SOCKET_CONFIG
1479 #define LWIP_ALLOW_SOCKET_CONFIG 1
1480 #endif
1481
1482 #if LWIP_ALLOW_SOCKET_CONFIG == 0
1483 #ifndef LWIP_CONFIG_NUM_SOCKETS
1484 #define LWIP_CONFIG_NUM_SOCKETS         DEFAULT_LWIP_NUM_SOCKETS
1485 #endif
1486
1487 #else /* LWIP_ALLOW_SOCKET_CONFIG */
1488 #ifndef LWIP_CONFIG_NUM_SOCKETS
1489 extern unsigned int g_lwip_num_sockets;
1490 #define LWIP_CONFIG_NUM_SOCKETS         ((int)g_lwip_num_sockets)
1491 #endif
1492 #endif /* LWIP_ALLOW_SOCKET_CONFIG */
1493
1494 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
1495    sends a lot of data out of ROM (or other static memory), this
1496    should be set high. */
1497 #ifndef MEMP_NUM_PBUF
1498 #define MEMP_NUM_PBUF           LWIP_CONFIG_NUM_SOCKETS*2
1499 #endif
1500
1501 /*
1502  * Defines the number of raw connection PCBs
1503  * (requires the LWIP_RAW option).
1504  */
1505 #ifndef MEMP_NUM_RAW_PCB
1506 #define MEMP_NUM_RAW_PCB                1
1507 #endif
1508
1509 /*
1510  * Defines the number of struct tcpip_msg, which are used
1511  * for callback/timeout API communication.
1512  * (only needed if you use tcpip.c)
1513  */
1514 #ifndef MEMP_NUM_TCPIP_MSG_API
1515 #define MEMP_NUM_TCPIP_MSG_API          64
1516 #endif
1517
1518 /*
1519  * Defines the number of struct tcpip_msg, which are used
1520  * for incoming packets.
1521  * (only needed if you use tcpip.c)
1522  */
1523 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
1524 #define MEMP_NUM_TCPIP_MSG_INPKT        512
1525 #endif
1526
1527 #ifndef MEMP_NUM_NETCONN
1528 #define MEMP_NUM_NETCONN        (LWIP_CONFIG_NUM_SOCKETS * 4)
1529 #endif
1530
1531 /*
1532  * Defines the number of struct netbufs.
1533  * (only needed if you use the sequential API, like api_lib.c)
1534  */
1535 #ifndef MEMP_NUM_NETBUF
1536 #define MEMP_NUM_NETBUF         (65535 * 3 * LWIP_CONFIG_NUM_SOCKETS / (IP_FRAG_MAX_MTU - 20 - 8))
1537 #endif
1538
1539 /*
1540   * Defines the number of simulateously queued outgoing
1541   * packets (pbufs) that are waiting for an ARP request (to resolve
1542   * their destination address) to finish.
1543   * (requires the ARP_QUEUEING option)
1544   */
1545 #ifndef MEMP_NUM_ARP_QUEUE
1546 #define MEMP_NUM_ARP_QUEUE      30
1547 #endif
1548
1549 /** Indicates the number of UDP protocol control blocks. One
1550    per active UDP "connection". */
1551 #ifndef MEMP_NUM_UDP_PCB
1552 #define MEMP_NUM_UDP_PCB        LWIP_CONFIG_NUM_SOCKETS + LWIP_MPL
1553 #endif
1554
1555 /** MEMP_NUM_TCP_PCB: Indicates the number of simultaneously active TCP
1556    connections. */
1557 #ifndef MEMP_NUM_TCP_PCB
1558 #define MEMP_NUM_TCP_PCB        LWIP_CONFIG_NUM_SOCKETS
1559 #endif
1560
1561 /** MEMP_NUM_TCP_PCB_LISTEN: Indicates the number of listening TCP
1562    connections. */
1563 #ifndef MEMP_NUM_TCP_PCB_LISTEN
1564 #define MEMP_NUM_TCP_PCB_LISTEN LWIP_CONFIG_NUM_SOCKETS
1565 #endif
1566
1567 #ifndef IP_FRAG_MAX_MTU
1568 #define IP_FRAG_MAX_MTU         1500
1569 #endif
1570
1571 /* As per RFC 791, "Every internet module must be able to forward a datagram of 68
1572  * octets without further fragmentation.  This is because an internet header
1573  * may be up to 60 octets, and the minimum fragment is 8 octets." */
1574 #ifndef  IP_FRAG_MIN_MTU
1575 #define IP_FRAG_MIN_MTU          68
1576 #endif
1577
1578 #ifndef IP_REASS_MAX_MEM_SIZE
1579 #define IP_REASS_MAX_MEM_SIZE    (MEM_SIZE / 4)
1580 #endif
1581
1582 #ifndef MEMP_NUM_REASSDATA
1583 #define MEMP_NUM_REASSDATA    (IP_REASS_MAX_MEM_SIZE / 65535)
1584 #endif
1585
1586 #ifndef IP_REASS_MAX_PBUFS
1587 #define IP_REASS_MAX_PBUFS   ((65535 * 2 * (LWIP_CONFIG_NUM_SOCKETS)) / ((IP_FRAG_MAX_MTU) - 20 - 8))
1588 #endif
1589 /* Max size(65535 + extra buffer(8192) per MAX MTU) */
1590 #ifndef IP_REASS_MAX_PBUFS_PER_PKT
1591 #define IP_REASS_MAX_PBUFS_PER_PKT   ((65535 + 8192) / (IP_FRAG_MAX_MTU - 20 - 8))
1592 #endif
1593
1594 /* TCP Maximum segment size. */
1595 #ifdef LWIP_TCP_MSS
1596 #undef TCP_MSS      /* ensure TCP_MSS value is overridden by LWIP_TCP_MSS */
1597 #define TCP_MSS                 LWIP_TCP_MSS
1598 #else  /*LWIP_TCP_MSS */
1599 #ifndef TCP_MSS
1600 #define TCP_MSS  (IP_FRAG_MAX_MTU - 20 - 20)
1601 #endif  /*TCP_MSS*/
1602 #endif /* LWIP_TCP_MSS*/
1603
1604 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
1605    segments. */
1606 #ifndef MEMP_NUM_TCP_SEG
1607 #define MEMP_NUM_TCP_SEG        32
1608 #endif
1609
1610 /* ---------- Pbuf options ---------- */
1611 /** PBUF_POOL_SIZE: Indicates the number of buffers in the pbuf pool. */
1612 #ifndef PBUF_POOL_SIZE
1613 #define PBUF_POOL_SIZE          64
1614 #endif
1615
1616 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
1617 #ifndef PBUF_POOL_BUFSIZE
1618 #define PBUF_POOL_BUFSIZE       1550
1619 #endif
1620
1621 #ifndef PBUF_LINK_CHKSUM_LEN
1622 #define PBUF_LINK_CHKSUM_LEN  0
1623 #endif
1624
1625 #ifndef PBUF_ZERO_COPY_RESERVE
1626 #define PBUF_ZERO_COPY_RESERVE 80
1627 #endif
1628
1629 #ifndef PBUF_ZERO_COPY_TAILROOM
1630 #define PBUF_ZERO_COPY_TAILROOM 4
1631 #endif
1632
1633 #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
1634 #define LWIP_TCPIP_CORE_LOCKING_INPUT 1
1635 #endif
1636 /* ---------- ARP options ---------- */
1637 /**
1638  * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
1639  * resolution. By default, only the most recent packet is queued per IP_add
1640  * This is sufficient for most protocols and mainly reduces TCP connection
1641  * startup time. Set this to 1 if you know that your application sends more than one
1642  * packet in a row to an IP_add that is not in the ARP cache.
1643  */
1644 #ifndef ARP_QUEUEING
1645 #define ARP_QUEUEING                    1
1646 #endif
1647
1648 /**
1649  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
1650  * updated with the source MAC and IP address supplied in the packet.
1651  * You may want to disable this if you do not trust LAN peers to have the
1652  * correct addresses, or as a limited approach to attempt to handle
1653  * spoofing. If disabled, lwIP will need to make a new ARP request if
1654  * the peer is not already in the ARP table, adding a little latency.
1655  * The peer is in the ARP table if it requested our address before.
1656  * Also notice that this slows down input processing of every IP packet.
1657  */
1658 #ifndef ETHARP_TRUST_IP_MAC
1659 #define ETHARP_TRUST_IP_MAC             1
1660 #endif
1661
1662 /** Defines the number of bytes added before the ethernet header to ensure
1663  * alignment of payload after that header. Since the header is 14 bytes long,
1664  * without this padding, addresses in the IP header will not be aligned
1665  * on a 32-bit boundary. So setting this to 2 can speed up 32-bit-platforms.
1666  */
1667 #ifndef ETH_PAD_SIZE
1668 #define ETH_PAD_SIZE                    2
1669 #endif
1670
1671 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: Enables code to support static ARP table
1672  * entries (using etharp_add_static_entry/etharp_remove_static_entry).
1673  */
1674 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
1675 #define ETHARP_SUPPORT_STATIC_ENTRIES   1
1676 #endif
1677
1678 /* ---------- TCP options ---------- */
1679
1680 #ifndef LWIP_TCP
1681 #define LWIP_TCP                1
1682 #endif
1683 /* @ingroup Config_TCP
1684 * Defines the TCP TTL value.
1685 */
1686 #ifndef TCP_TTL
1687 #define TCP_TTL                 255
1688 #endif
1689
1690 #define LWIP_ETHERNET               1
1691 #ifndef LWIP_ARP
1692 #define LWIP_ARP                    1
1693 #endif
1694
1695 /**
1696  * Defines the mailbox size for the tcpip thread messages
1697  * The queue size value itself is platform-dependent, but is passed to
1698  * sys_mbox_new() when tcpip_init is called.
1699  */
1700 #ifndef TCPIP_MBOX_SIZE
1701 #define TCPIP_MBOX_SIZE         64
1702 #endif
1703
1704 /**
1705  * Defines the mailbox size for the incoming packets on a
1706  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1707  * to sys_mbox_new() when the recvmbox is created.
1708  */
1709 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1710 #define DEFAULT_TCP_RECVMBOX_SIZE       128
1711 #endif
1712
1713 /**
1714  * Defines the mailbox size for the incoming connections.
1715  * The queue size value itself is platform-dependent, but is passed to
1716  * sys_mbox_new() when the acceptmbox is created.
1717  */
1718 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1719 #define DEFAULT_ACCEPTMBOX_SIZE         32
1720 #endif
1721
1722 #ifndef MEMP_NUM_REASSDATA
1723 #define MEMP_NUM_REASSDATA  (2*LWIP_CONFIG_NUM_SOCKETS)
1724 #endif
1725
1726 #ifdef LWIP_DBG_PREPROCESSOR
1727 #pragma message(VAR_NAME_VALUE(TCP_MSS))
1728 #endif
1729
1730 /* @ingroup Config_TCP
1731 * TCP sender buffer space (bytes). */
1732 #ifndef TCP_SND_BUF
1733 #define TCP_SND_BUF         65535
1734 #endif
1735
1736 /* @ingroup Config_TCP
1737 TCP sender buffer space (pbufs). This must be at least = 2 *
1738    TCP_SND_BUF/TCP_MSS for things to work. */
1739 #ifndef  TCP_SND_QUEUELEN
1740 #define TCP_SND_QUEUELEN        (8 * TCP_SND_BUF) / TCP_MSS
1741 #endif
1742 /**
1743
1744 * Defines the size of a TCP receive window. */
1745
1746 #ifndef TCP_WND
1747 #define TCP_WND            32768
1748 #endif
1749
1750 /**
1751  * Defines the Maximum number of retransmissions of data segments.
1752  */
1753 #ifndef TCP_MAXRTX
1754 #define TCP_MAXRTX                      12
1755 #endif
1756
1757 /**
1758  * User define tcp wnd. default is 0
1759  */
1760 #ifndef LWIP_TCP_USRWND
1761 #define LWIP_TCP_USRWND                 0
1762 #endif /* LWIP_TCP_USRWND */
1763
1764 /* ---------- IP options ---------- */
1765 /**
1766  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
1767  * fragmentation. Otherwise pbufs are allocated and reference the original
1768  * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
1769  * new PBUF_RAM pbufs are used for fragments).
1770  * Note: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs.
1771  */
1772 #ifndef IP_FRAG_USES_STATIC_BUF
1773 #define IP_FRAG_USES_STATIC_BUF         1
1774 #endif
1775
1776 /*
1777  * Defines the assumed maximum MTU on any interface for IP fragment buffer
1778  * (requires IP_FRAG_USES_STATIC_BUF==1)
1779  */
1780 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
1781 #define IP_FRAG_MAX_MTU                 1500
1782 #endif
1783
1784 /* As per RFC 791, "Every internet module must be able to forward a datagram of 68
1785  * octets without further fragmentation.  This is because an internet header
1786  * may be up to 60 octets, and the minimum fragment is 8 octets." */
1787 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MIN_MTU)
1788 #define IP_FRAG_MIN_MTU                 68
1789 #endif
1790
1791 /* ---------- ICMP options ---------- */
1792 /**
1793  * LWIP_ICMP==1: Enables the ICMP module inside the IP stack.
1794  */
1795 #ifndef LWIP_ICMP
1796 #define LWIP_ICMP                       1
1797 #endif
1798
1799 /* ---------- IGMP options ---------- */
1800 #ifndef LWIP_IGMP
1801 #define LWIP_IGMP                       1
1802 #endif
1803
1804 /* ---------- DHCP options ---------- */
1805 /**
1806  * LWIP_DHCP==1: Enables the DHCP module.
1807  */
1808 #ifndef LWIP_DHCP
1809 #define LWIP_DHCP               1
1810 #endif
1811
1812 /* ---------- DNS options ---------- */
1813 /**
1814  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
1815  * transport.
1816  */
1817 #ifndef LWIP_DNS
1818 #define LWIP_DNS                 1
1819 #endif
1820
1821 #if LWIP_DNS
1822 #ifndef LWIP_DNS_REVERSE
1823 #define LWIP_DNS_REVERSE 1
1824 #endif
1825 #else
1826 #undef LWIP_DNS_REVERSE
1827 #define LWIP_DNS_REVERSE 0
1828 #endif
1829
1830 #if !defined DNS_MAX_RETRIES && LWIP_SMALL_SIZE
1831 #define DNS_MAX_RETRIES          2
1832 #endif
1833
1834 /* ---------- UDP options ---------- */
1835 /**
1836  * LWIP_UDP==1: Turns on UDP.
1837  */
1838 #ifndef LWIP_UDP
1839 #define LWIP_UDP                1
1840 #endif
1841
1842 #ifndef UDP_TTL
1843 #define UDP_TTL                 255
1844 #endif
1845
1846 #ifndef MC_TTL
1847 #define MC_TTL   1
1848 #endif
1849
1850 /**
1851  * Defines the mailbox size for the incoming packets on a
1852  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1853  * to sys_mbox_new() when the recvmbox is created.
1854  */
1855
1856
1857 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1858 #define DEFAULT_UDP_RECVMBOX_SIZE       128
1859 #endif
1860
1861 /* -----------RAW options -----------*/
1862 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1863
1864 /**
1865  * LWIP_RAW==1: Enables the application layer to hook into the IP layer itself.
1866  */
1867 #if !defined LWIP_RAW || defined __DOXYGEN__
1868 #define LWIP_RAW                        1
1869 #endif
1870
1871 /**
1872  * Enable to support PF_PACKET RAW sockets
1873 */
1874 #if  defined(LWIP_RAW) && LWIP_RAW
1875 #ifndef PF_PKT_SUPPORT
1876 #define PF_PKT_SUPPORT 1
1877 #endif
1878 #endif
1879
1880 /**
1881  * Defines the mailbox size for the incoming packets on a
1882  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1883  * to sys_mbox_new() when the recvmbox is created.
1884  */
1885
1886 #define DEFAULT_RAW_RECVMBOX_SIZE       128
1887 #endif
1888
1889 #ifndef LWIP_MAX_PF_RAW_SEND_SIZE
1890 #define LWIP_MAX_PF_RAW_SEND_SIZE (0xFFFF - 40) //  - IPv6 header
1891 #endif
1892
1893 /* -----------LOOPIF options -----------*/
1894 #ifndef LWIP_HAVE_LOOPIF
1895 #define LWIP_HAVE_LOOPIF                1
1896 #endif
1897
1898 /* -----------LOOPBACK options -----------*/
1899 #ifndef LWIP_NETIF_LOOPBACK
1900 #define LWIP_NETIF_LOOPBACK             1
1901 #endif
1902
1903 /* ---------- Statistics options ---------- */
1904 /**
1905  * LWIP_STATS==1: Enables statistics gathering in lwip_stats.
1906  */
1907 #ifndef LWIP_STATS
1908 #define LWIP_STATS 1
1909 #endif
1910
1911 /* ---------- TFTP options ---------- */
1912 #ifndef LWIP_TFTP
1913 #define LWIP_TFTP               1
1914 #endif
1915
1916 /* ---------- SNTP options ---------- */
1917 #ifndef LWIP_SNTP
1918 #define LWIP_SNTP                      1
1919 #endif
1920
1921 #if LWIP_SNTP
1922
1923 #define LWIP_DHCP_MAX_NTP_SERVERS       1 
1924 #define SNTP_SERVER_DNS                 1
1925
1926 #if SNTP_SERVER_DNS
1927 #define SNTP_SERVER_ADDRESS "pool.ntp.org" //"pool.ntp.org"
1928 #endif
1929
1930 // 三个服务器
1931
1932 // #define LWIP_DHCP_MAX_NTP_SERVERS       3 
1933 // #define SNTP_SERVER_DNS                 1
1934
1935 // #if SNTP_SERVER_DNS
1936 // #define SNTP_SERVER_ADDRESS "cn.pool.ntp.org" //"pool.ntp.org"
1937 // #define SNTP_SERVER_ADDRESS2 "ntp1.aliyun.com" //"pool.ntp.org"
1938 // #define SNTP_SERVER_ADDRESS3 "pool.ntp.org" //"pool.ntp.org"
1939 // #endif
1940
1941 #endif
1942 /**
1943  * SO_REUSE==1: Enable SO_REUSEADDR option.
1944  */
1945 #ifndef SO_REUSE
1946 #define SO_REUSE                        1
1947 #endif
1948
1949 #define LWIP_ETHERNET               1
1950 #define LWIP_NETCONN                    1
1951 #define LWIP_SOCKET                    1
1952
1953 #ifndef IP_FORWARD
1954 #define IP_FORWARD                      0
1955 #endif
1956
1957 #ifndef LWIP_DHCPS_START_ADDR_OFFSET
1958 #define LWIP_DHCPS_START_ADDR_OFFSET   2
1959 #endif
1960
1961 #define LWIP_DHCPS_DISCOVER_BROADCAST   0
1962
1963 #if defined (CONFIG_DHCPS_GW)
1964 #ifndef LWIP_DHCPS_GW
1965 #define LWIP_DHCPS_GW 1
1966 #endif
1967 #else
1968 #ifndef LWIP_DHCPS_GW
1969 #define LWIP_DHCPS_GW 0
1970 #endif
1971 #endif
1972
1973 #ifndef LWIP_DHCP_REQUEST_UNICAST
1974 #define LWIP_DHCP_REQUEST_UNICAST 0
1975 #endif
1976
1977 #if LWIP_LITEOS_COMPAT
1978 #ifndef TCPIP_THREAD_STACKSIZE
1979 #define TCPIP_THREAD_STACKSIZE          0x6000
1980 #endif
1981 #ifndef TCPIP_THREAD_PRIO
1982 #define TCPIP_THREAD_PRIO               5
1983 #endif
1984
1985 #ifndef LWIP_SOCKET_START_NUM
1986 #define LWIP_SOCKET_START_NUM CONFIG_NFILE_DESCRIPTORS
1987 #endif
1988
1989
1990 #ifndef LWIP_SOCKET_OFFSET
1991 #define LWIP_SOCKET_OFFSET CONFIG_NFILE_DESCRIPTORS
1992 #endif
1993
1994 #ifndef LWIP_ENABLE_LOS_SHELL_CMD
1995 #define LWIP_ENABLE_LOS_SHELL_CMD     1
1996 #endif
1997 #ifndef ERRNO
1998 #define ERRNO
1999 #endif
2000 #ifndef LWIP_PROVIDE_ERRNO
2001 #define LWIP_PROVIDE_ERRNO 0
2002 #endif
2003 /* Currently pthread_cond_timedwait() in liteos doesn't support absolute time */
2004 #ifndef LWIP_USE_POSIX_COND_WAIT_WITH_ABS_TIMEOUT
2005 #define LWIP_USE_POSIX_COND_WAIT_WITH_ABS_TIMEOUT 0
2006 #endif
2007
2008 #ifndef LWIP_INET_ADDR_FUNC
2009 #define LWIP_INET_ADDR_FUNC         1
2010 #endif
2011
2012 #ifndef LWIP_INET_NTOA_FUNC
2013 #define LWIP_INET_NTOA_FUNC         1
2014 #endif
2015
2016 #ifndef LWIP_INET_ATON_FUNC
2017 #define LWIP_INET_ATON_FUNC         1
2018 #endif
2019
2020
2021 #else
2022 #define ERRNO
2023 #define LWIP_PROVIDE_ERRNO 1
2024
2025 #ifndef LWIP_INET_ADDR_FUNC
2026 #define LWIP_INET_ADDR_FUNC         1
2027 #endif
2028
2029 #ifndef LWIP_INET_NTOA_FUNC
2030 #define LWIP_INET_NTOA_FUNC         1
2031 #endif
2032
2033 #ifndef LWIP_INET_ATON_FUNC
2034 #define LWIP_INET_ATON_FUNC         1
2035 #endif
2036
2037 #endif
2038
2039 /* ---------- Socket Filter options ---------- */
2040 /**
2041   * implement sock filter based on BPF.
2042   * BPF-extension was not supported.
2043   * only AF_PACKET RAW socket support socket filter now,
2044   * we would add supports for other socket type in the feature.
2045 */
2046 #if defined(LWIP_RAW) && LWIP_RAW
2047 #ifndef LWIP_SOCK_FILTER
2048 #define LWIP_SOCK_FILTER 1
2049 #endif
2050 #else
2051 #define LWIP_SOCK_FILTER 0
2052 #endif
2053
2054 #ifndef LWIP_STATIC
2055 #define LWIP_STATIC static
2056 #endif
2057
2058
2059 #ifndef LWIP_ALWAYS_SEND_HWTYPE_AS_ETHER_IN_DHCP
2060 #define LWIP_ALWAYS_SEND_HWTYPE_AS_ETHER_IN_DHCP    1
2061 #endif
2062
2063 #ifndef USE_ONLY_PRIMARY_IFACE
2064 #define USE_ONLY_PRIMARY_IFACE 1
2065 #endif
2066
2067 #ifndef DRIVER_STATUS_CHECK
2068 #define DRIVER_STATUS_CHECK    0
2069 #endif
2070
2071 #if DRIVER_STATUS_CHECK
2072 #ifndef DRIVER_WAKEUP_INTERVAL
2073 #define DRIVER_WAKEUP_INTERVAL 120000
2074 #endif
2075 #endif
2076
2077 /* ---------- NETIF options ---------- */
2078 /**
2079  * LWIP_NETIF_API==1: Supports netif api (in netifapi.c)
2080  */
2081 #ifndef LWIP_NETIF_API
2082 #define LWIP_NETIF_API                  1
2083 #endif
2084
2085 /**
2086  * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function
2087  * for several netif related event that supports multiple subscribers.
2088  * @see netif_ext_status_callback
2089  */
2090 #ifndef LWIP_NETIF_EXT_STATUS_CALLBACK
2091 #define LWIP_NETIF_EXT_STATUS_CALLBACK  1
2092 #endif
2093
2094 /*
2095  * LWIP_NETIF_LINK_CALLBACK==1: Supports a callback function from an interface
2096  * whenever the link changes. Example: when link goes down.
2097  */
2098 #ifndef LWIP_NETIF_LINK_CALLBACK
2099 #define LWIP_NETIF_LINK_CALLBACK        1
2100 #endif
2101
2102 /*
2103  * LWIP_NETIF_NUM_MAX==255: Defines the maximum support number of same type netif.
2104  */
2105 /* Increase the count of netifs supported by stack.
2106 Currently stack restricts the number of netif to 5, but older versions of linux kernel supports
2107 upto 255 interfaces . New versions donot have these restrictions but we stick to 255   */
2108 #ifndef LWIP_NETIF_NUM_MAX
2109 #define LWIP_NETIF_NUM_MAX            10
2110 #endif
2111
2112 #ifndef LWIP_NETIF_IFINDEX_START
2113 #define LWIP_NETIF_IFINDEX_START        1
2114 #endif /* LWIP_NETIF_IFINDEX_START */
2115
2116 #ifndef LWIP_NETIF_IFINDEX_MAX
2117 #define LWIP_NETIF_IFINDEX_MAX 0xFE
2118 #endif
2119
2120 /* ---------- SOCKET options ---------- */
2121 /**
2122  * LWIP_SO_RCVBUF==1: Enables SO_RCVBUF processing.
2123  */
2124 #ifndef LWIP_SO_RCVBUF
2125 #define LWIP_SO_RCVBUF                  1
2126 #endif
2127
2128 /* ---------- Statistics options ---------- */
2129 /**
2130  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
2131  */
2132 #ifndef LWIP_STATS_DISPLAY
2133 #define LWIP_STATS_DISPLAY              0
2134 #endif
2135
2136 /* ---------- Debugging options ---------- */
2137 /**
2138  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
2139  * compared against this value. If it is smaller, then debugging
2140  * messages are written.
2141  */
2142 #ifndef LWIP_DBG_MIN_LEVEL
2143 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
2144 #endif
2145
2146 #ifndef LWIP_SOCKET_POLL
2147 #define LWIP_SOCKET_POLL 1
2148 #endif
2149
2150 #ifndef LWIP_EXT_POLL_SUPPORT
2151 #define LWIP_EXT_POLL_SUPPORT 1
2152 #endif
2153
2154 // flags for cross compilation-- manual.. to be automated
2155 #ifndef LWIP_TCP_INFO
2156 #define LWIP_TCP_INFO 1
2157 #endif
2158
2159 #ifndef LWIP_RPL
2160 #define LWIP_RPL 0
2161 #endif
2162
2163 #if !defined(LWIP_RPL) || (0 == LWIP_RPL)
2164 #ifndef LWIP_RPL_TIMER_COUNT
2165 #define LWIP_RPL_TIMER_COUNT 0
2166 #endif
2167 #else
2168 #ifndef LWIP_RPL_TIMER_COUNT
2169 #define LWIP_RPL_TIMER_COUNT 12
2170 #endif
2171 #endif
2172
2173 #ifndef LWIP_IPV6_MLD
2174 #define LWIP_IPV6_MLD 1
2175 #endif
2176
2177 #ifndef LWIP_MLD6_ENABLE_MLD_ON_DAD
2178 #define LWIP_MLD6_ENABLE_MLD_ON_DAD   LWIP_IPV6 && LWIP_IPV6_MLD
2179 #endif
2180
2181 #ifndef LWIP_MLD6_DONE_ONLYFOR_LAST_REPORTER
2182 #define LWIP_MLD6_DONE_ONLYFOR_LAST_REPORTER   LWIP_IPV6 && LWIP_IPV6_MLD
2183 #endif
2184 #ifndef NETIF_MAX_HWADDR_LEN
2185 #define NETIF_MAX_HWADDR_LEN 6
2186 #endif
2187
2188 #ifndef LWIP_ND6_NUM_NEIGHBORS
2189 #define LWIP_ND6_NUM_NEIGHBORS 10
2190 #endif
2191 #ifndef LWIP_IPV6_SCOPES
2192 #define LWIP_IPV6_SCOPES 0
2193 #endif
2194
2195 #ifndef LWIP_ND6_STATIC_NBR
2196 #define LWIP_ND6_STATIC_NBR 0
2197 #endif
2198 #ifndef LWIP_L3_EVENT_MSG
2199 #define LWIP_L3_EVENT_MSG 1
2200 #endif
2201
2202 #if LWIP_L3_EVENT_MSG
2203
2204 #ifndef MEMP_NUM_L3_EVENT_MSG
2205 #define MEMP_NUM_L3_EVENT_MSG 15
2206 #endif
2207
2208 #ifndef LWIP_ROUTE_CHANGE_MSG
2209 #define LWIP_ROUTE_CHANGE_MSG 1
2210 #endif
2211
2212 #ifndef LWIP_NAT64_CHANGE_MSG
2213 #define LWIP_NAT64_CHANGE_MSG 1
2214 #endif
2215
2216 #ifndef LWIP_RPL_JOIN_SUCC_MSG
2217 #define LWIP_RPL_JOIN_SUCC_MSG 1
2218 #endif
2219
2220 #ifndef LWIP_RPL_PARENT_CLEAR_MSG
2221 #define LWIP_RPL_PARENT_CLEAR_MSG 1
2222 #endif
2223
2224 #ifndef LWIP_RPL_BEACON_PRI_RESET
2225 #define LWIP_RPL_BEACON_PRI_RESET 1
2226 #endif
2227
2228 #ifndef LWIP_RPL_GET_IPV4_ADDR_FAIL
2229 #define LWIP_RPL_GET_IPV4_ADDR_FAIL 1
2230 #endif
2231
2232 #ifndef LWIP_RPL_MSTA_GET_IPV4_ADDR_FAIL
2233 #define LWIP_RPL_MSTA_GET_IPV4_ADDR_FAIL 1
2234 #endif
2235
2236 #ifndef LWIP_RPL_MG_FULL
2237 #define LWIP_RPL_MG_FULL 1
2238 #endif
2239
2240 #ifndef LWIP_RPL_RT_FULL
2241 #define LWIP_RPL_RT_FULL 1
2242 #endif
2243
2244 #ifndef LWIP_RPL_GET_MNID_FAIL
2245 #define LWIP_RPL_GET_MNID_FAIL 1
2246 #endif
2247
2248 #ifndef LWIP_L3_EVENT_MSG_EXIST
2249 #if (LWIP_ROUTE_CHANGE_MSG || LWIP_RPL_JOIN_SUCC_MSG || \
2250        LWIP_RPL_PARENT_CLEAR_MSG || LWIP_RPL_BEACON_PRI_RESET || \
2251        LWIP_RPL_GET_IPV4_ADDR_FAIL || LWIP_RPL_MSTA_GET_IPV4_ADDR_FAIL || \
2252        LWIP_RPL_MG_FULL || LWIP_RPL_RT_FULL || LWIP_RPL_GET_MNID_FAIL)
2253 #define LWIP_L3_EVENT_MSG_EXIST 1
2254 #else
2255 #define LWIP_L3_EVENT_MSG_EXIST 0
2256 #endif
2257 #endif
2258
2259 #endif /* LWIP_L3_EVENT_MSG */
2260
2261 #ifndef LWIP_LITEOS_TASK
2262 #define LWIP_LITEOS_TASK 1
2263 #endif
2264
2265 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
2266 #define LWIP_SOCK_OPT_ICMP6_FILTER 0
2267 #endif
2268
2269 #if LWIP_RIPPLE
2270 #ifndef LWIP_IPV6_FORWARD
2271 #define LWIP_IPV6_FORWARD 1
2272 #endif
2273 #endif
2274
2275 #if LWIP_RIPPLE
2276 #ifndef LWIP_MPL
2277 #define LWIP_MPL  0
2278 #endif
2279 #else
2280 #ifndef LWIP_MPL
2281 #define LWIP_MPL  0
2282 #endif
2283 #endif
2284
2285 #if LWIP_MPL
2286 #ifndef LWIP_MPL_IPV4
2287 #define LWIP_MPL_IPV4  1
2288 #endif
2289 #else
2290 #ifndef LWIP_MPL_IPV4
2291 #define LWIP_MPL_IPV4  0
2292 #endif
2293 #endif
2294
2295 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
2296 #define LWIP_ENABLE_MESH_SHELL_CMD 1
2297 #else
2298 #ifndef LWIP_MPL_IPV4
2299 #define LWIP_MPL_IPV4  0
2300 #endif
2301 #endif
2302
2303 #ifndef LWIP_MPL_IPV4_BCAST
2304 #define LWIP_MPL_IPV4_BCAST 0
2305 #endif
2306 #ifndef LWIP_IPV6_MLD_QUERIER
2307 #define LWIP_IPV6_MLD_QUERIER 1
2308 #endif
2309
2310 #ifdef __cplusplus
2311 }
2312 #endif /* __cplusplus */
2313
2314 #endif /* __LWIPOPTS_H__ */
2315
2316
2317