2 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
4 * Copyright (c) <2013-2020>, <CompanyNameMagicTag>
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
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.
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
29 * This file is part of the lwIP TCP/IP stack.
31 * Author: Simon Goldschmidt
35 #ifndef __LWIPOPTS_H__
36 #define __LWIPOPTS_H__
40 #endif /* __cplusplus */
41 #ifndef LWIP_PLATFORM_PRINT
42 #define LWIP_PLATFORM_PRINT PRINTK
45 #define LWIP_DEFINE_SWITCH 0
46 #define LOSCFG_CONFIG_MQTT 1
47 #define LWIP_LOWPOWER 0
50 #define MS_PER_SECOND 1000
51 #define US_PER_MSECOND 1000
52 #define NS_PER_USECOND 1000
53 #define NS_PER_MS 1000000
55 #ifndef LWIP_DISABLE_TCP_SANITY_CHECKS
56 #define LWIP_DISABLE_TCP_SANITY_CHECKS 1
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
73 /* ---------- SLIP/PPP Protocol Selection ---------- */
76 * 通过编译时定义SLIP_MODULE_ENABLED或PPP_MODULE_ENABLED来选择协议
77 * 如果两个都定义或都未定义,则默认使用SLIP
80 #if defined(SLIP_MODULE_ENABLED) && defined(PPP_MODULE_ENABLED)
81 #error "Cannot enable both SLIP and PPP modules simultaneously. Please choose one."
84 #if defined(PPP_MODULE_ENABLED) && !defined(SLIP_MODULE_ENABLED)
95 #define PPPOS_SUPPORT 1
98 #ifndef PPP_IPV4_SUPPORT
99 #define PPP_IPV4_SUPPORT 1
103 #define PAP_SUPPORT 1
107 #define CHAP_SUPPORT 1
111 #define LWIP_PPP_API 1
114 #ifndef PPP_NOTIFY_PHASE
115 #define PPP_NOTIFY_PHASE 1
118 #ifndef MEMP_NUM_PPP_PCB
119 #define MEMP_NUM_PPP_PCB 2
122 #ifndef MEMP_NUM_PPPOS_INTERFACES
123 #define MEMP_NUM_PPPOS_INTERFACES 2
126 #ifndef PPP_USE_PBUF_RAM
127 #define PPP_USE_PBUF_RAM 1
130 #ifndef PPP_FCS_TABLE
131 #define PPP_FCS_TABLE 1
134 #ifndef PRINTPKT_SUPPORT
135 #define PRINTPKT_SUPPORT 1
139 #define PPP_DEBUG LWIP_DBG_ON
142 #ifndef PPP_INPROC_IRQ_SAFE
143 #define PPP_INPROC_IRQ_SAFE 0
146 /* PPP MRU配置控制 - 用于防止发送分片 */
147 #ifndef PPP_ENABLE_LARGE_MRU
148 #define PPP_ENABLE_LARGE_MRU 0 // 0=禁用1500字节MRU(防止分片), 1=启用1500字节MRU
151 #if PPP_ENABLE_LARGE_MRU
152 #define PPP_MRU_SIZE 1500 // PPP MRU大小 - 启用大MRU
154 #define PPP_MRU_SIZE 1500 // PPP MRU大小 - 限制为128字节防止分片
157 #elif defined(SLIP_MODULE_ENABLED) && !defined(PPP_MODULE_ENABLED)
165 #define PPP_SUPPORT 0
168 #ifndef PPPOS_SUPPORT
169 #define PPPOS_SUPPORT 0
179 #define PPP_SUPPORT 0
182 #ifndef PPPOS_SUPPORT
183 #define PPPOS_SUPPORT 0
189 /* SLIP UART configuration */
190 // UART_BUS_0 = 0 UART_BUS_1 = 1
195 #ifndef SLIP_RX_FROM_ISR
196 #define SLIP_RX_FROM_ISR 1
199 #ifndef SLIP_USE_RX_THREAD
200 #define SLIP_USE_RX_THREAD 1 // 启用接收线程作为主线程处理队列
204 #define SLIP_DEBUG LWIP_DBG_ON
209 /* SIO UART configuration - unified for PPP, SLIP and all serial protocols */
211 #define SIO_UART_BUS UART_BUS_0
214 #ifndef SIO_UART_IRQ_NUM
215 #define SIO_UART_IRQ_NUM UART_0_IRQN
218 #ifndef SIO_UART_BAUDRATE
219 #define SIO_UART_BAUDRATE 921600
222 #ifndef SIO_UART_TX_PIN
223 #define SIO_UART_TX_PIN S_MGPIO19
226 #ifndef SIO_UART_RX_PIN
227 #define SIO_UART_RX_PIN S_MGPIO20
230 #ifndef SIO_UART_DATA_BIT
231 #define SIO_UART_DATA_BIT UART_DATA_BIT_8
234 #ifndef SIO_UART_PARITY
235 #define SIO_UART_PARITY UART_PARITY_NONE
238 #ifndef SIO_UART_STOP_BIT
239 #define SIO_UART_STOP_BIT UART_STOP_BIT_1
242 #ifndef SIO_UART_FLOW_CTRL
243 #define SIO_UART_FLOW_CTRL UART_FLOW_CTRL_NONE
247 #define LWIP_HTTPC_HAVE_FILE_IO 1
249 To support the CMSIS interface, you need to enable this macro.
250 By default, this macro is not supported.
252 #ifndef LWIP_ALIOS_COMPAT
253 #define LWIP_ALIOS_COMPAT 0
256 #ifndef LWIP_CMSIS_SUPPORT
257 #define LWIP_CMSIS_SUPPORT 0
260 #ifndef LWIP_FREERTOS_COMPAT
261 #define LWIP_FREERTOS_COMPAT 0
264 #ifndef LWIP_GETHOSTBYNAME
265 #define LWIP_GETHOSTBYNAME 1
268 #ifndef LWIP_GETPEERNAME
269 #define LWIP_GETPEERNAME 1
272 #ifndef LWIP_GETSOCKNAME
273 #define LWIP_GETSOCKNAME 1
276 #ifndef LWIP_SMALL_SIZE
277 #define LWIP_SMALL_SIZE 1
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
287 #if LWIP_SMALL_SIZE_MESH
289 #ifndef LWIP_L3_EVENT_MSG
290 #define LWIP_L3_EVENT_MSG 1
293 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
294 #define LWIP_ENABLE_MESH_SHELL_CMD 1
302 #define LWIP_RIPPLE 0
309 #ifndef LWIP_NA_PROXY
310 #define LWIP_NA_PROXY 1
313 #ifndef LWIP_RA_PREFIX_DYNAMIC
314 #define LWIP_RA_PREFIX_DYNAMIC 1
317 #ifndef LWIP_IPV6_MLD
318 #define LWIP_IPV6_MLD 0
321 #ifndef LWIP_IPV6_MLD_QUERIER
322 #define LWIP_IPV6_MLD_QUERIER 0
329 #ifndef LWIP_MPL_IPV4
330 #define LWIP_MPL_IPV4 0
333 #ifndef LWIP_MPL_IPV4_BCAST
334 #define LWIP_MPL_IPV4_BCAST 0
338 #define LWIP_6LOWPAN 0
342 #define ETH_6LOWPAN 1
345 #ifndef LWIP_IPV6_AUTOCONFIG_DEFAULT
346 #define LWIP_IPV6_AUTOCONFIG_DEFAULT 1
349 #ifndef LWIP_DHCP_SUBSTITUTE
350 #define LWIP_DHCP_SUBSTITUTE 0
353 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
354 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 1
361 #ifndef LWIP_NAT64_MIN_SUBSTITUTE
362 #define LWIP_NAT64_MIN_SUBSTITUTE 0
369 #ifndef LWIP_ND6_ROUTER
370 #define LWIP_ND6_ROUTER 1
373 #ifndef LWIP_ND6_DAG_PREFIX
374 #define LWIP_ND6_DAG_PREFIX 1
377 #ifndef LWIP_USE_L2_METRICS
378 #define LWIP_USE_L2_METRICS 1
381 #ifndef LWIP_SO_PRIORITY
382 #define LWIP_SO_PRIORITY 1
385 #ifndef LWIP_ENABLE_ROUTER
386 #define LWIP_ENABLE_ROUTER 1
389 /* maximum that an AP can associate with others */
390 #ifndef LWIP_AP_ASSOCIATE_NUM
391 #define LWIP_AP_ASSOCIATE_NUM 5
394 /* maximum of MBRs */
395 #ifndef LWIP_MULTI_MBR_NUM
396 #define LWIP_MULTI_MBR_NUM 3
399 /* number of nodes at Router side */
400 #ifndef LWIP_ROUTER_NBR_NUM
401 #define LWIP_ROUTER_NBR_NUM 11
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 */
409 #ifndef LWIP_ND6_NUM_NEIGHBORS
410 #define LWIP_ND6_NUM_NEIGHBORS LWIP_ND6_NUM_DESTINATIONS
413 #ifndef LWIP_ND6_DESTINATIONS_OLDTIME
414 #define LWIP_ND6_DESTINATIONS_OLDTIME 180
417 #else /* LWIP_SMALL_SIZE_MESH */
421 #endif /* LWIP_SMALL_SIZE_MESH */
423 #ifndef LWIP_L3_EVENT_MSG
424 #define LWIP_L3_EVENT_MSG 0
427 #if defined (LOSCFG_CONFIG_MQTT)
428 #ifndef CONFIG_NFILE_DESCRIPTORS
429 #define CONFIG_NFILE_DESCRIPTORS 1
433 #ifndef LWIP_API_MESH
434 #define LWIP_API_MESH 0
437 #ifndef LWIP_API_RICH
438 #define LWIP_API_RICH 0
441 #ifndef LWIP_ICMP6_ERR_RT_LMT
442 #define LWIP_ICMP6_ERR_RT_LMT 0
445 #ifndef LWIP_DHCPS_AGENT_INFO
446 #define LWIP_DHCPS_AGENT_INFO 0
449 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
450 #define LWIP_SOCK_OPT_ICMP6_FILTER 0
453 #ifndef LWIP_IPV6_PER_PROTO_CHKSUM
454 #define LWIP_IPV6_PER_PROTO_CHKSUM 0
457 #ifndef LWIP_SOCK_OPT_IPV6_UNICAST_HOPS
458 #define LWIP_SOCK_OPT_IPV6_UNICAST_HOPS 0
461 #ifndef LWIP_SOCK_OPT_TCP_QUEUE_SEQ
462 #define LWIP_SOCK_OPT_TCP_QUEUE_SEQ 0
465 #ifndef LWIP_LINK_MCAST_FILTER
466 #define LWIP_LINK_MCAST_FILTER 0
469 #ifndef LWIP_IOCTL_IPV6DPCTD
470 #define LWIP_IOCTL_IPV6DPCTD 0
473 #ifndef LWIP_IOCTL_ROUTE
474 #define LWIP_IOCTL_ROUTE 0
477 #ifndef LWIP_IOCTL_IF
478 #define LWIP_IOCTL_IF 0
481 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
482 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
485 #ifndef LWIP_NETIFAPI_DHCPS_IP
486 #define LWIP_NETIFAPI_DHCPS_IP 0
489 #ifndef LWIP_NETIFAPI_GET_ADDR
490 #define LWIP_NETIFAPI_GET_ADDR 1
493 #ifndef LWIP_DROP_PKT_WHEN_NETIF_DOWN
494 #define LWIP_DROP_PKT_WHEN_NETIF_DOWN 1
497 #ifndef LWIP_NETIFAPI_LINK_CALLBACK
498 #define LWIP_NETIFAPI_LINK_CALLBACK 0
501 #ifndef LWIP_NETIFAPI_MTU
502 #define LWIP_NETIFAPI_MTU 0
505 #ifndef LWIP_NETIFAPI_IF_NUM
506 #define LWIP_NETIFAPI_IF_NUM 0
509 #ifndef LWIP_NETIFAPI_IF_INDEX
510 #define LWIP_NETIFAPI_IF_INDEX 0
513 #ifndef LWIP_NETIFAPI_IF_HW
514 #define LWIP_NETIFAPI_IF_HW 0
517 #ifndef LWIP_NETIFAPI_IP6_ADDR
518 #define LWIP_NETIFAPI_IP6_ADDR 0
521 #ifndef LWIP_NETIFAPI_MLD6
522 #define LWIP_NETIFAPI_MLD6 0
525 #ifndef LWIP_NETIFAPI_IF_GET_DEFAULT
526 #define LWIP_NETIFAPI_IF_GET_DEFAULT 0
529 #ifndef LWIP_IP_FILTER
530 #define LWIP_IP_FILTER 0
533 #ifndef LWIP_IPV6_FILTER
534 #define LWIP_IPV6_FILTER 0
537 #ifndef LWIP_NETIF_NBR_CACHE_API
538 #define LWIP_NETIF_NBR_CACHE_API 0
541 #if defined (CONFIG_NETIF_HOSTNAME)
543 #ifndef LWIP_NETIF_HOSTNAME
544 #define LWIP_NETIF_HOSTNAME 1
547 #ifndef LWIP_NETIF_GET_HOSTNAME
548 #define LWIP_NETIF_GET_HOSTNAME 0
553 #ifndef LWIP_NETIF_HOSTNAME
554 #define LWIP_NETIF_HOSTNAME 0
559 #define LWIP_IFADDRS 0
562 #ifndef LWIP_ALLOW_SOCKET_CONFIG
563 #define LWIP_ALLOW_SOCKET_CONFIG 0
566 #if defined (CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER)
567 #ifndef LWIP_DHCP_VENDOR_CLASS_IDENTIFIER
568 #define LWIP_DHCP_VENDOR_CLASS_IDENTIFIER 1
571 #ifndef LWIP_DHCP_GET_VENDOR_CLASS_IDENTIFIER
572 #define LWIP_DHCP_GET_VENDOR_CLASS_IDENTIFIER 0
577 #ifndef LWIP_DHCP_VENDOR_CLASS_IDENTIFIER
578 #define LWIP_DHCP_VENDOR_CLASS_IDENTIFIER 0
582 #ifndef LWIP_IPV6_DHCP6
583 #define LWIP_IPV6_DHCP6 0
586 #ifndef LWIP_TCP_TLP_SUPPORT
587 #define LWIP_TCP_TLP_SUPPORT 0
590 #ifndef LWIP_WND_SCALE
591 #define LWIP_WND_SCALE 0
594 #ifndef LWIP_SOCK_FILTER
595 #define LWIP_SOCK_FILTER 0
598 #ifndef DRIVER_STATUS_CHECK
599 #define DRIVER_STATUS_CHECK 0
606 #ifndef LWIP_DEBUG_TIMERNAMES
607 #define LWIP_DEBUG_TIMERNAMES 0
610 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
611 #define ETHARP_SUPPORT_STATIC_ENTRIES 1
623 #define ICMP6_STATS 0
626 #ifndef LWIP_TCP_INFO
627 #define LWIP_TCP_INFO 0
630 #ifndef LWIP_NETIF_ETHTOOL
631 #define LWIP_NETIF_ETHTOOL 0
634 #ifndef LWIP_ENABLE_LOS_SHELL_CMD
635 #define LWIP_ENABLE_LOS_SHELL_CMD 0
638 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
639 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
642 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
643 #define LWIP_ENABLE_MESH_SHELL_CMD 0
647 #define LWIP_RIPPLE 0
650 #ifndef LWIP_RA_PREFIX_DYNAMIC
651 #define LWIP_RA_PREFIX_DYNAMIC 0
654 #ifndef LWIP_DHCP_COAP_RELAY
655 #define LWIP_DHCP_COAP_RELAY 0
658 #ifndef LWIP_MPL_IPV4_BCAST
659 #define LWIP_MPL_IPV4_BCAST 0
663 #define LWIP_6LOWPAN 0
667 #define ETH_6LOWPAN 0
670 #ifndef LWIP_DHCP_SUBSTITUTE
671 #define LWIP_DHCP_SUBSTITUTE 0
674 #ifndef LWIP_DHCPS_MAX_LEASE
675 #define LWIP_DHCPS_MAX_LEASE 6
686 #ifndef LWIP_ND6_ROUTER
687 #define LWIP_ND6_ROUTER 0
690 #ifndef LWIP_RPL_RS_DAO
691 #define LWIP_RPL_RS_DAO 0
694 #ifndef LWIP_SO_BINDTODEVICE
695 #define LWIP_SO_BINDTODEVICE 1
698 #ifndef LWIP_SO_DONTROUTE
699 #define LWIP_SO_DONTROUTE 1
702 #ifndef LWIP_NUM_SOCKETS_MAX
703 #define LWIP_NUM_SOCKETS_MAX 9
706 #ifndef DEFAULT_LWIP_NUM_SOCKETS
707 #define DEFAULT_LWIP_NUM_SOCKETS 12
708 #endif /* DEFAULT_LWIP_NUM_SOCKETS */
710 #ifndef MEMP_NUM_PBUF
711 #define MEMP_NUM_PBUF 8
714 #ifndef MEMP_NUM_RAW_PCB
715 #define MEMP_NUM_RAW_PCB 1
718 #ifndef MEMP_NUM_TCPIP_MSG_API
719 #define MEMP_NUM_TCPIP_MSG_API 16
722 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
723 #define MEMP_NUM_TCPIP_MSG_INPKT 32
726 #ifndef MEMP_NUM_NETCONN
727 #define MEMP_NUM_NETCONN LWIP_CONFIG_NUM_SOCKETS
730 #ifndef MEMP_NUM_NETBUF
732 #define MEMP_NUM_NETBUF 24
734 #define MEMP_NUM_NETBUF 24
738 #ifndef MEMP_NUM_ARP_QUEUE
739 #define MEMP_NUM_ARP_QUEUE 12
742 #ifndef MEMP_NUM_UDP_PCB
743 #define MEMP_NUM_UDP_PCB (7 + LWIP_MPL)
746 #ifndef MEMP_NUM_TCP_PCB
747 #define MEMP_NUM_TCP_PCB 6
750 #ifndef MEMP_NUM_TCP_PCB_LISTEN
751 #define MEMP_NUM_TCP_PCB_LISTEN 9
754 #ifndef MEMP_NUM_TCP_SEG
755 #define MEMP_NUM_TCP_SEG 32
758 #ifndef PBUF_POOL_SIZE
759 #define PBUF_POOL_SIZE 16
762 #if defined (CONFIG_LWIP_FOR_WIFI_SIGMA)
763 #ifndef MEMP_NUM_REASSDATA
764 #define MEMP_NUM_REASSDATA 64
766 #if !defined IP_REASS_MAXAGE
767 #define IP_REASS_MAXAGE 1
770 #ifndef MEMP_NUM_REASSDATA
771 #define MEMP_NUM_REASSDATA 5
776 #define TCP_SND_BUF (65535 / 3)
779 #ifndef TCP_SND_QUEUELEN
780 #define TCP_SND_QUEUELEN (TCP_SND_BUF / TCP_MSS)
784 #define TCP_WND (TCP_SND_BUF * 2 / 6) //改善810的下载速度
791 #ifndef LWIP_DNS_REVERSE
792 #define LWIP_DNS_REVERSE 0
795 #ifndef PF_PKT_SUPPORT
796 #define PF_PKT_SUPPORT 0
799 #ifndef LWIP_SO_RCVBUF
800 #define LWIP_SO_RCVBUF 0
803 #ifndef LWIP_IPV6_MLD
804 #define LWIP_IPV6_MLD 0
807 #ifndef LWIP_IPV6_MLD_QUERIER
808 #define LWIP_IPV6_MLD_QUERIER 0
811 #ifndef LWIP_ND6_NUM_NEIGHBORS
812 #define LWIP_ND6_NUM_NEIGHBORS 5
815 #ifndef LWIP_SO_PRIORITY
816 #define LWIP_SO_PRIORITY 0
819 #ifndef LWIP_NETIF_PROMISC
820 #define LWIP_NETIF_PROMISC 0
823 #ifndef LWIP_NETBUF_RECVINFO
824 #define LWIP_NETBUF_RECVINFO 0
827 #ifndef LWIP_ND6_STATIC_PREFIX
828 #define LWIP_ND6_STATIC_PREFIX 0
831 #ifndef LWIP_USE_L2_METRICS
832 #define LWIP_USE_L2_METRICS 0
835 #ifndef MEMP_NUM_NETDB
836 #define MEMP_NUM_NETDB 1
839 #ifndef DNS_TABLE_SIZE
840 #define DNS_TABLE_SIZE 2
843 #ifndef DNS_MAX_IPADDR
844 #define DNS_MAX_IPADDR 1
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)
851 #ifndef LWIP_ENABLE_ROUTER
852 #define LWIP_ENABLE_ROUTER 0
855 #ifndef LWIP_ND6_NUM_ROUTERS
856 #define LWIP_ND6_NUM_ROUTERS 1
859 #endif /* LWIP_SMALL_SIZE */
861 #ifndef RPL_CONF_SWITCH_MBR_BY_AUTOLINK
862 #define RPL_CONF_SWITCH_MBR_BY_AUTOLINK LWIP_MMBR
865 #ifndef RPL_CONF_MMBR_MNID
866 #define RPL_CONF_MMBR_MNID LWIP_MMBR
870 #define LWIP_IP6IN4 LWIP_MMBR
873 #ifndef LWIP_DHCP_SUBSTITUTE_MMBR
874 #if defined(LWIP_DHCP_SUBSTITUTE) && LWIP_DHCP_SUBSTITUTE && LWIP_MMBR
875 #define LWIP_DHCP_SUBSTITUTE_MMBR 1
877 #define LWIP_DHCP_SUBSTITUTE_MMBR 0
879 #endif /* LWIP_DHCP_SUBSTITUTE_MMBR */
881 #ifndef LWIP_IGMP_REPORT_TIMES
882 #define LWIP_IGMP_REPORT_TIMES 5
886 #define LWIP_LIBCOAP 0
893 #ifndef LWIP_API_MESH
894 #define LWIP_API_MESH 1
897 #ifndef LWIP_L2_NETDEV_STATUS_CALLBACK
898 #define LWIP_L2_NETDEV_STATUS_CALLBACK 1
901 #ifndef LWIP_NETIF_STATUS_CALLBACK
902 #define LWIP_NETIF_STATUS_CALLBACK 1
905 #ifndef LWIP_TCP_TLP_SUPPORT
906 #define LWIP_TCP_TLP_SUPPORT 0
909 #ifndef LWIP_WND_SCALE
910 #define LWIP_WND_SCALE 0
913 #ifndef LWIP_TCP_INFO
914 #define LWIP_TCP_INFO 0
917 #ifndef LWIP_API_RICH
918 #define LWIP_API_RICH 1
921 #ifndef LWIP_DHCPS_AGENT_INFO
922 #define LWIP_DHCPS_AGENT_INFO 1
925 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
926 #define LWIP_SOCK_OPT_ICMP6_FILTER 1
929 #ifndef LWIP_IPV6_PER_PROTO_CHKSUM
930 #define LWIP_IPV6_PER_PROTO_CHKSUM 1
933 #ifndef LWIP_SOCK_OPT_IPV6_UNICAST_HOPS
934 #define LWIP_SOCK_OPT_IPV6_UNICAST_HOPS 1
937 #ifndef LWIP_SOCK_OPT_TCP_QUEUE_SEQ
938 #define LWIP_SOCK_OPT_TCP_QUEUE_SEQ 1
941 #ifndef LWIP_LINK_MCAST_FILTER
942 #define LWIP_LINK_MCAST_FILTER 1
945 #ifndef LWIP_IOCTL_IPV6DPCTD
946 #define LWIP_IOCTL_IPV6DPCTD 1
949 #ifndef LWIP_IOCTL_ROUTE
950 #define LWIP_IOCTL_ROUTE 1
953 #ifndef LWIP_IOCTL_IF
954 #define LWIP_IOCTL_IF 1
957 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
958 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1
961 #ifndef LWIP_NETIFAPI_DHCPS_IP
962 #define LWIP_NETIFAPI_DHCPS_IP 1
965 #ifndef LWIP_NETIFAPI_GET_ADDR
966 #define LWIP_NETIFAPI_GET_ADDR 1
969 #ifndef LWIP_NETIFAPI_LINK_CALLBACK
970 #define LWIP_NETIFAPI_LINK_CALLBACK 1
973 #ifndef LWIP_NETIFAPI_MTU
974 #define LWIP_NETIFAPI_MTU 1
977 #ifndef LWIP_NETIFAPI_IF_NUM
978 #define LWIP_NETIFAPI_IF_NUM 1
981 #ifndef LWIP_NETIFAPI_IF_INDEX
982 #define LWIP_NETIFAPI_IF_INDEX 1
985 #ifndef LWIP_NETIFAPI_IF_HW
986 #define LWIP_NETIFAPI_IF_HW 1
989 #ifndef LWIP_NETIFAPI_IP6_ADDR
990 #define LWIP_NETIFAPI_IP6_ADDR 1
993 #ifndef LWIP_NETIFAPI_MLD6
994 #define LWIP_NETIFAPI_MLD6 1
997 #ifndef LWIP_NETIFAPI_IF_GET_DEFAULT
998 #define LWIP_NETIFAPI_IF_GET_DEFAULT 1
1001 #ifndef LWIP_IFADDRS
1002 #define LWIP_IFADDRS 1
1005 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
1006 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
1009 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
1010 #define LWIP_ENABLE_MESH_SHELL_CMD 1
1013 #ifndef LWIP_NETIF_ETHTOOL
1014 #define LWIP_NETIF_ETHTOOL 0
1017 #ifndef LWIP_RPL_CTX
1018 #define LWIP_RPL_CTX 0
1025 #ifndef IP_REASSEMBLY
1026 #define IP_REASSEMBLY 1
1034 #define LWIP_RIPPLE 1
1037 #ifndef LWIP_LITEOS_TASK
1038 #define LWIP_LITEOS_TASK 1
1041 #ifndef LWIP_DHCP_COAP_RELAY
1042 #define LWIP_DHCP_COAP_RELAY 0
1045 #ifndef LWIP_NA_PROXY
1046 #define LWIP_NA_PROXY 1
1049 #ifndef LWIP_RA_PREFIX_DYNAMIC
1050 #define LWIP_RA_PREFIX_DYNAMIC 1
1054 #if !defined(LWIP_MPL)
1058 #if !defined(LWIP_MPL)
1064 #if !defined(LWIP_MPL_IPV4)
1065 #define LWIP_MPL_IPV4 1
1068 #if !defined(LWIP_MPL_IPV4)
1069 #define LWIP_MPL_IPV4 0
1073 #ifndef LWIP_MPL_IPV4_BCAST
1074 #define LWIP_MPL_IPV4_BCAST 1
1077 #ifndef LWIP_6LOWPAN
1078 #define LWIP_6LOWPAN 0
1082 #define ETH_6LOWPAN 1
1085 #ifndef LWIP_IPV6_AUTOCONFIG_DEFAULT
1086 #define LWIP_IPV6_AUTOCONFIG_DEFAULT 1
1089 * LWIP_DHCP_SUBSTITUTE==1: Enables MBR Querying IPv4 address for non-mesh IPv6 STA.
1091 #ifndef LWIP_DHCP_SUBSTITUTE
1092 #define LWIP_DHCP_SUBSTITUTE 1
1095 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
1096 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 1
1100 #define MEM_SIZE (512*1024)
1107 #ifndef LWIP_IEEE802154
1108 #define LWIP_IEEE802154 0
1112 #define LWIP_NAT64 1
1116 #define LWIP_DNS64 1
1119 #ifndef LWIP_ND6_ROUTER
1120 #define LWIP_ND6_ROUTER 1
1123 #ifndef LWIP_ND6_DAG_PREFIX
1124 #define LWIP_ND6_DAG_PREFIX 1
1127 #ifndef LWIP_ND6_RDNSS_MAX_DNS_SERVERS
1128 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 2
1131 #ifndef LWIP_COMPAT_SOCKETS
1132 #define LWIP_COMPAT_SOCKETS 1
1135 #define LWIP_PLATFORM_BYTESWAP 0
1138 #ifndef LWIP_GETHOSTBYNAME
1139 #define LWIP_GETHOSTBYNAME 1
1142 #ifndef LWIP_GETPEERNAME
1143 #define LWIP_GETPEERNAME 1
1146 #ifndef LWIP_GETSOCKNAME
1147 #define LWIP_GETSOCKNAME 1
1150 #ifndef LWIP_SMALL_SIZE
1151 #define LWIP_SMALL_SIZE 1
1153 #ifndef LWIP_L2_NETDEV_STATUS_CALLBACK
1154 #define LWIP_L2_NETDEV_STATUS_CALLBACK 1
1158 #define LWIP_RIPPLE 0
1162 #define LWIP_NAT64 0
1165 #ifndef LWIP_ND6_ROUTER
1166 #define LWIP_ND6_ROUTER 0
1169 #ifndef LWIP_ND6_DAG_PREFIX
1170 #define LWIP_ND6_DAG_PREFIX 1
1173 #ifndef LWIP_USE_L2_METRICS
1174 #define LWIP_USE_L2_METRICS 1
1177 #ifndef LWIP_ENABLE_ROUTER
1178 #define LWIP_ENABLE_ROUTER 0
1181 #ifndef LWIP_RPL_RS_DAO
1182 #define LWIP_RPL_RS_DAO 0
1185 #ifndef LWIP_API_MESH
1186 #define LWIP_API_MESH 1
1189 #ifndef LWIP_DHCP_SUBSTITUTE
1190 #define LWIP_DHCP_SUBSTITUTE 1
1193 #ifndef LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS
1194 #define LWIP_DHCP_LIMIT_CONCURRENT_REQUESTS 0
1197 #ifndef LWIP_ENABLE_BASIC_SHELL_CMD
1198 #define LWIP_ENABLE_BASIC_SHELL_CMD 1
1201 #ifndef LWIP_NA_PROXY
1202 #define LWIP_NA_PROXY 1
1205 #ifndef LWIP_LITEOS_COMPAT
1206 #define LWIP_LITEOS_COMPAT 1
1209 /* Set to 1 if target platform is linux */
1210 #ifndef LWIP_LINUX_COMPAT
1211 #define LWIP_LINUX_COMPAT 0
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
1219 #ifndef LWIP_COMPAT_SOCKETS
1220 #define LWIP_COMPAT_SOCKETS 1
1221 #define LWIP_POSIX_SOCKETS_IO_NAMES 0
1225 #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1
1228 #define VALUE_TO_STRING(x) #x
1229 #define VALUE(x) VALUE_TO_STRING(x)
1230 #define VAR_NAME_VALUE(var) #var "=" VALUE(var)
1232 #ifndef LWIP_CHKSUM_ALGORITHM
1233 #define LWIP_CHKSUM_ALGORITHM 3
1236 #ifndef LWIP_NETIF_IFINDEX_MAX
1237 #define LWIP_NETIF_IFINDEX_MAX 0xFE
1240 #ifndef LWIP_NEIGHBOR_CLEANUP_WHILE_NETIF_LINK_DOWN
1241 #define LWIP_NEIGHBOR_CLEANUP_WHILE_NETIF_LINK_DOWN LWIP_RIPPLE
1244 #ifndef LWIP_PROVIDE_ERRNO
1245 #define LWIP_PROVIDE_ERRNO 1
1248 #ifndef LWIP_COMPAT_MUTEX_ALLOWED
1249 #define LWIP_COMPAT_MUTEX_ALLOWED 1
1253 * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
1254 * SO_SNDTIMEO processing.
1256 #ifndef LWIP_SO_SNDTIMEO
1257 #define LWIP_SO_SNDTIMEO 1
1261 * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
1262 * SO_RCVTIMEO processing.
1264 #ifndef LWIP_SO_RCVTIMEO
1265 #define LWIP_SO_RCVTIMEO 1
1269 * LWIP_SO_BINDTODEVICE==1: Enable bind sockets/netconns to specific netif
1271 #ifndef LWIP_SO_BINDTODEVICE
1272 #define LWIP_SO_BINDTODEVICE 1
1276 * LWIP_SO_DONTROUTE==1: Enable don't use universal route entry
1278 #ifndef LWIP_SO_DONTROUTE
1279 #define LWIP_SO_DONTROUTE 1
1287 #ifndef LWIP_SACK_PERF_OPT
1288 #define LWIP_SACK_PERF_OPT 1
1291 #define LWIP_SACK_PERF_OPT 0
1294 #ifndef LWIP_SACK_CWND_OPT
1295 #define LWIP_SACK_CWND_OPT LWIP_SACK_PERF_OPT
1298 #ifndef LWIP_SACK_DATA_SEG_PIGGYBACK
1299 #define LWIP_SACK_DATA_SEG_PIGGYBACK (LWIP_SACK & 1)
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.>
1314 #ifndef LWIP_TCP_ER_SUPPORT
1315 #define LWIP_TCP_ER_SUPPORT 1
1319 #ifndef LWIP_TCP_TLP_SUPPORT
1320 #define LWIP_TCP_TLP_SUPPORT 0
1323 #define LWIP_TCP_TLP_SUPPORT 0
1327 #ifndef LWIP_FACK_THRESHOLD_BASED_FR
1328 #define LWIP_FACK_THRESHOLD_BASED_FR 1
1331 #define LWIP_FACK_THRESHOLD_BASED_FR 0
1334 #ifndef LWIP_WND_SCALE
1335 #define LWIP_WND_SCALE 0
1337 #ifndef TCP_OOSEQ_MAX_PBUFS
1338 #define TCP_OOSEQ_MAX_PBUFS 8
1343 * NO_SYS==1: Provides very minimal functionality. Otherwise,
1344 * use lwIP facilities.
1348 #ifndef LWIP_NOASSERT
1349 #define LWIP_NOASSERT
1352 /* ---------- DEBUG options --------- */
1353 /* LWIP_DEBUG_INFO is opened by default. */
1354 #ifndef LWIP_DEBUG_INFO
1355 #define LWIP_DEBUG_INFO
1359 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1360 * debug messages of certain types.
1362 #ifndef LWIP_DBG_TYPES_ON
1363 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
1367 #define IP_DEBUG LWIP_DBG_ON
1370 #ifndef ETHARP_DEBUG
1371 #define ETHARP_DEBUG LWIP_DBG_OFF
1375 #define NETIF_DEBUG LWIP_DBG_ON
1378 #ifndef L3_EVENT_MSG_DEBUG
1379 #define L3_EVENT_MSG_DEBUG LWIP_DBG_OFF
1383 #define MLD6_DEBUG LWIP_DBG_OFF
1386 #ifndef LWIP_NETIF_PROMISC
1387 #define LWIP_NETIF_PROMISC 0
1390 /* ---------- Memory options ---------- */
1392 #if LWIP_LITEOS_COMPAT
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
1398 #define MEM_LIBC_MALLOC 1
1400 #define MEM_SIZE (4 * 1024 * 1024)
1403 #ifndef MEM_LIBC_MALLOC_TOTAL_SIZE_LIMIT
1404 #define MEM_LIBC_MALLOC_TOTAL_SIZE_LIMIT 0
1407 #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1
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. */
1412 #define MEM_SIZE (512 * 1024)
1418 #ifndef MEM_PBUF_RAM_SIZE_LIMIT
1419 #define MEM_PBUF_RAM_SIZE_LIMIT 1
1424 #define MAX_NUM_PID 128
1428 * Defines the align size of the DMA memory. If set to 1, then not using DMA.
1430 #ifndef MEM_MALLOC_DMA_ALIGN
1431 #if LWIP_LITEOS_COMPAT
1432 #define MEM_MALLOC_DMA_ALIGN 1
1434 #define MEM_MALLOC_DMA_ALIGN 1
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
1445 #ifndef LWIP_NUM_SOCKETS_MAX
1446 #define LWIP_NUM_SOCKETS_MAX 8 // 128
1451 * LWIP_NUM_SOCKETS can be used to override DEFAULT_LWIP_NUM_SOCKETS in lwipopts_*.h
1453 #ifndef LWIP_NUM_SOCKETS
1456 * DEFAULT_LWIP_NUM_SOCKETS is default number of sockets.
1458 #ifndef DEFAULT_LWIP_NUM_SOCKETS
1459 #define DEFAULT_LWIP_NUM_SOCKETS 8
1460 #endif /* DEFAULT_LWIP_NUM_SOCKETS */
1462 #else /* else LWIP_NUM_SOCKETS*/
1464 #ifndef DEFAULT_LWIP_NUM_SOCKETS
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*/
1472 #endif /* DEFAULT_LWIP_NUM_SOCKETS*/
1473 #endif /* LWIP_NUM_SOCKETS*/
1476 * Provides flexibility to use configured values to spread across code
1478 #ifndef LWIP_ALLOW_SOCKET_CONFIG
1479 #define LWIP_ALLOW_SOCKET_CONFIG 1
1482 #if LWIP_ALLOW_SOCKET_CONFIG == 0
1483 #ifndef LWIP_CONFIG_NUM_SOCKETS
1484 #define LWIP_CONFIG_NUM_SOCKETS DEFAULT_LWIP_NUM_SOCKETS
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)
1492 #endif /* LWIP_ALLOW_SOCKET_CONFIG */
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
1502 * Defines the number of raw connection PCBs
1503 * (requires the LWIP_RAW option).
1505 #ifndef MEMP_NUM_RAW_PCB
1506 #define MEMP_NUM_RAW_PCB 1
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)
1514 #ifndef MEMP_NUM_TCPIP_MSG_API
1515 #define MEMP_NUM_TCPIP_MSG_API 64
1519 * Defines the number of struct tcpip_msg, which are used
1520 * for incoming packets.
1521 * (only needed if you use tcpip.c)
1523 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
1524 #define MEMP_NUM_TCPIP_MSG_INPKT 512
1527 #ifndef MEMP_NUM_NETCONN
1528 #define MEMP_NUM_NETCONN (LWIP_CONFIG_NUM_SOCKETS * 4)
1532 * Defines the number of struct netbufs.
1533 * (only needed if you use the sequential API, like api_lib.c)
1535 #ifndef MEMP_NUM_NETBUF
1536 #define MEMP_NUM_NETBUF (65535 * 3 * LWIP_CONFIG_NUM_SOCKETS / (IP_FRAG_MAX_MTU - 20 - 8))
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)
1545 #ifndef MEMP_NUM_ARP_QUEUE
1546 #define MEMP_NUM_ARP_QUEUE 30
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
1555 /** MEMP_NUM_TCP_PCB: Indicates the number of simultaneously active TCP
1557 #ifndef MEMP_NUM_TCP_PCB
1558 #define MEMP_NUM_TCP_PCB LWIP_CONFIG_NUM_SOCKETS
1561 /** MEMP_NUM_TCP_PCB_LISTEN: Indicates the number of listening TCP
1563 #ifndef MEMP_NUM_TCP_PCB_LISTEN
1564 #define MEMP_NUM_TCP_PCB_LISTEN LWIP_CONFIG_NUM_SOCKETS
1567 #ifndef IP_FRAG_MAX_MTU
1568 #define IP_FRAG_MAX_MTU 1500
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
1578 #ifndef IP_REASS_MAX_MEM_SIZE
1579 #define IP_REASS_MAX_MEM_SIZE (MEM_SIZE / 4)
1582 #ifndef MEMP_NUM_REASSDATA
1583 #define MEMP_NUM_REASSDATA (IP_REASS_MAX_MEM_SIZE / 65535)
1586 #ifndef IP_REASS_MAX_PBUFS
1587 #define IP_REASS_MAX_PBUFS ((65535 * 2 * (LWIP_CONFIG_NUM_SOCKETS)) / ((IP_FRAG_MAX_MTU) - 20 - 8))
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))
1594 /* TCP Maximum segment size. */
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 */
1600 #define TCP_MSS (IP_FRAG_MAX_MTU - 20 - 20)
1602 #endif /* LWIP_TCP_MSS*/
1604 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
1606 #ifndef MEMP_NUM_TCP_SEG
1607 #define MEMP_NUM_TCP_SEG 32
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
1616 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
1617 #ifndef PBUF_POOL_BUFSIZE
1618 #define PBUF_POOL_BUFSIZE 1550
1621 #ifndef PBUF_LINK_CHKSUM_LEN
1622 #define PBUF_LINK_CHKSUM_LEN 0
1625 #ifndef PBUF_ZERO_COPY_RESERVE
1626 #define PBUF_ZERO_COPY_RESERVE 80
1629 #ifndef PBUF_ZERO_COPY_TAILROOM
1630 #define PBUF_ZERO_COPY_TAILROOM 4
1633 #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
1634 #define LWIP_TCPIP_CORE_LOCKING_INPUT 1
1636 /* ---------- ARP options ---------- */
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.
1644 #ifndef ARP_QUEUEING
1645 #define ARP_QUEUEING 1
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.
1658 #ifndef ETHARP_TRUST_IP_MAC
1659 #define ETHARP_TRUST_IP_MAC 1
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.
1667 #ifndef ETH_PAD_SIZE
1668 #define ETH_PAD_SIZE 2
1671 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: Enables code to support static ARP table
1672 * entries (using etharp_add_static_entry/etharp_remove_static_entry).
1674 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
1675 #define ETHARP_SUPPORT_STATIC_ENTRIES 1
1678 /* ---------- TCP options ---------- */
1683 /* @ingroup Config_TCP
1684 * Defines the TCP TTL value.
1690 #define LWIP_ETHERNET 1
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.
1700 #ifndef TCPIP_MBOX_SIZE
1701 #define TCPIP_MBOX_SIZE 64
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.
1709 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1710 #define DEFAULT_TCP_RECVMBOX_SIZE 128
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.
1718 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1719 #define DEFAULT_ACCEPTMBOX_SIZE 32
1722 #ifndef MEMP_NUM_REASSDATA
1723 #define MEMP_NUM_REASSDATA (2*LWIP_CONFIG_NUM_SOCKETS)
1726 #ifdef LWIP_DBG_PREPROCESSOR
1727 #pragma message(VAR_NAME_VALUE(TCP_MSS))
1730 /* @ingroup Config_TCP
1731 * TCP sender buffer space (bytes). */
1733 #define TCP_SND_BUF 65535
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
1744 * Defines the size of a TCP receive window. */
1747 #define TCP_WND 32768
1751 * Defines the Maximum number of retransmissions of data segments.
1754 #define TCP_MAXRTX 12
1758 * User define tcp wnd. default is 0
1760 #ifndef LWIP_TCP_USRWND
1761 #define LWIP_TCP_USRWND 0
1762 #endif /* LWIP_TCP_USRWND */
1764 /* ---------- IP options ---------- */
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.
1772 #ifndef IP_FRAG_USES_STATIC_BUF
1773 #define IP_FRAG_USES_STATIC_BUF 1
1777 * Defines the assumed maximum MTU on any interface for IP fragment buffer
1778 * (requires IP_FRAG_USES_STATIC_BUF==1)
1780 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
1781 #define IP_FRAG_MAX_MTU 1500
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
1791 /* ---------- ICMP options ---------- */
1793 * LWIP_ICMP==1: Enables the ICMP module inside the IP stack.
1799 /* ---------- IGMP options ---------- */
1804 /* ---------- DHCP options ---------- */
1806 * LWIP_DHCP==1: Enables the DHCP module.
1812 /* ---------- DNS options ---------- */
1814 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
1822 #ifndef LWIP_DNS_REVERSE
1823 #define LWIP_DNS_REVERSE 1
1826 #undef LWIP_DNS_REVERSE
1827 #define LWIP_DNS_REVERSE 0
1830 #if !defined DNS_MAX_RETRIES && LWIP_SMALL_SIZE
1831 #define DNS_MAX_RETRIES 2
1834 /* ---------- UDP options ---------- */
1836 * LWIP_UDP==1: Turns on UDP.
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.
1857 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1858 #define DEFAULT_UDP_RECVMBOX_SIZE 128
1861 /* -----------RAW options -----------*/
1862 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1865 * LWIP_RAW==1: Enables the application layer to hook into the IP layer itself.
1867 #if !defined LWIP_RAW || defined __DOXYGEN__
1872 * Enable to support PF_PACKET RAW sockets
1874 #if defined(LWIP_RAW) && LWIP_RAW
1875 #ifndef PF_PKT_SUPPORT
1876 #define PF_PKT_SUPPORT 1
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.
1886 #define DEFAULT_RAW_RECVMBOX_SIZE 128
1889 #ifndef LWIP_MAX_PF_RAW_SEND_SIZE
1890 #define LWIP_MAX_PF_RAW_SEND_SIZE (0xFFFF - 40) // - IPv6 header
1893 /* -----------LOOPIF options -----------*/
1894 #ifndef LWIP_HAVE_LOOPIF
1895 #define LWIP_HAVE_LOOPIF 1
1898 /* -----------LOOPBACK options -----------*/
1899 #ifndef LWIP_NETIF_LOOPBACK
1900 #define LWIP_NETIF_LOOPBACK 1
1903 /* ---------- Statistics options ---------- */
1905 * LWIP_STATS==1: Enables statistics gathering in lwip_stats.
1908 #define LWIP_STATS 1
1911 /* ---------- TFTP options ---------- */
1916 /* ---------- SNTP options ---------- */
1923 #define LWIP_DHCP_MAX_NTP_SERVERS 1
1924 #define SNTP_SERVER_DNS 1
1927 #define SNTP_SERVER_ADDRESS "pool.ntp.org" //"pool.ntp.org"
1932 // #define LWIP_DHCP_MAX_NTP_SERVERS 3
1933 // #define SNTP_SERVER_DNS 1
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"
1943 * SO_REUSE==1: Enable SO_REUSEADDR option.
1949 #define LWIP_ETHERNET 1
1950 #define LWIP_NETCONN 1
1951 #define LWIP_SOCKET 1
1954 #define IP_FORWARD 0
1957 #ifndef LWIP_DHCPS_START_ADDR_OFFSET
1958 #define LWIP_DHCPS_START_ADDR_OFFSET 2
1961 #define LWIP_DHCPS_DISCOVER_BROADCAST 0
1963 #if defined (CONFIG_DHCPS_GW)
1964 #ifndef LWIP_DHCPS_GW
1965 #define LWIP_DHCPS_GW 1
1968 #ifndef LWIP_DHCPS_GW
1969 #define LWIP_DHCPS_GW 0
1973 #ifndef LWIP_DHCP_REQUEST_UNICAST
1974 #define LWIP_DHCP_REQUEST_UNICAST 0
1977 #if LWIP_LITEOS_COMPAT
1978 #ifndef TCPIP_THREAD_STACKSIZE
1979 #define TCPIP_THREAD_STACKSIZE 0x6000
1981 #ifndef TCPIP_THREAD_PRIO
1982 #define TCPIP_THREAD_PRIO 5
1985 #ifndef LWIP_SOCKET_START_NUM
1986 #define LWIP_SOCKET_START_NUM CONFIG_NFILE_DESCRIPTORS
1990 #ifndef LWIP_SOCKET_OFFSET
1991 #define LWIP_SOCKET_OFFSET CONFIG_NFILE_DESCRIPTORS
1994 #ifndef LWIP_ENABLE_LOS_SHELL_CMD
1995 #define LWIP_ENABLE_LOS_SHELL_CMD 1
2000 #ifndef LWIP_PROVIDE_ERRNO
2001 #define LWIP_PROVIDE_ERRNO 0
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
2008 #ifndef LWIP_INET_ADDR_FUNC
2009 #define LWIP_INET_ADDR_FUNC 1
2012 #ifndef LWIP_INET_NTOA_FUNC
2013 #define LWIP_INET_NTOA_FUNC 1
2016 #ifndef LWIP_INET_ATON_FUNC
2017 #define LWIP_INET_ATON_FUNC 1
2023 #define LWIP_PROVIDE_ERRNO 1
2025 #ifndef LWIP_INET_ADDR_FUNC
2026 #define LWIP_INET_ADDR_FUNC 1
2029 #ifndef LWIP_INET_NTOA_FUNC
2030 #define LWIP_INET_NTOA_FUNC 1
2033 #ifndef LWIP_INET_ATON_FUNC
2034 #define LWIP_INET_ATON_FUNC 1
2039 /* ---------- Socket Filter options ---------- */
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.
2046 #if defined(LWIP_RAW) && LWIP_RAW
2047 #ifndef LWIP_SOCK_FILTER
2048 #define LWIP_SOCK_FILTER 1
2051 #define LWIP_SOCK_FILTER 0
2055 #define LWIP_STATIC static
2059 #ifndef LWIP_ALWAYS_SEND_HWTYPE_AS_ETHER_IN_DHCP
2060 #define LWIP_ALWAYS_SEND_HWTYPE_AS_ETHER_IN_DHCP 1
2063 #ifndef USE_ONLY_PRIMARY_IFACE
2064 #define USE_ONLY_PRIMARY_IFACE 1
2067 #ifndef DRIVER_STATUS_CHECK
2068 #define DRIVER_STATUS_CHECK 0
2071 #if DRIVER_STATUS_CHECK
2072 #ifndef DRIVER_WAKEUP_INTERVAL
2073 #define DRIVER_WAKEUP_INTERVAL 120000
2077 /* ---------- NETIF options ---------- */
2079 * LWIP_NETIF_API==1: Supports netif api (in netifapi.c)
2081 #ifndef LWIP_NETIF_API
2082 #define LWIP_NETIF_API 1
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
2090 #ifndef LWIP_NETIF_EXT_STATUS_CALLBACK
2091 #define LWIP_NETIF_EXT_STATUS_CALLBACK 1
2095 * LWIP_NETIF_LINK_CALLBACK==1: Supports a callback function from an interface
2096 * whenever the link changes. Example: when link goes down.
2098 #ifndef LWIP_NETIF_LINK_CALLBACK
2099 #define LWIP_NETIF_LINK_CALLBACK 1
2103 * LWIP_NETIF_NUM_MAX==255: Defines the maximum support number of same type netif.
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
2112 #ifndef LWIP_NETIF_IFINDEX_START
2113 #define LWIP_NETIF_IFINDEX_START 1
2114 #endif /* LWIP_NETIF_IFINDEX_START */
2116 #ifndef LWIP_NETIF_IFINDEX_MAX
2117 #define LWIP_NETIF_IFINDEX_MAX 0xFE
2120 /* ---------- SOCKET options ---------- */
2122 * LWIP_SO_RCVBUF==1: Enables SO_RCVBUF processing.
2124 #ifndef LWIP_SO_RCVBUF
2125 #define LWIP_SO_RCVBUF 1
2128 /* ---------- Statistics options ---------- */
2130 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
2132 #ifndef LWIP_STATS_DISPLAY
2133 #define LWIP_STATS_DISPLAY 0
2136 /* ---------- Debugging options ---------- */
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.
2142 #ifndef LWIP_DBG_MIN_LEVEL
2143 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
2146 #ifndef LWIP_SOCKET_POLL
2147 #define LWIP_SOCKET_POLL 1
2150 #ifndef LWIP_EXT_POLL_SUPPORT
2151 #define LWIP_EXT_POLL_SUPPORT 1
2154 // flags for cross compilation-- manual.. to be automated
2155 #ifndef LWIP_TCP_INFO
2156 #define LWIP_TCP_INFO 1
2163 #if !defined(LWIP_RPL) || (0 == LWIP_RPL)
2164 #ifndef LWIP_RPL_TIMER_COUNT
2165 #define LWIP_RPL_TIMER_COUNT 0
2168 #ifndef LWIP_RPL_TIMER_COUNT
2169 #define LWIP_RPL_TIMER_COUNT 12
2173 #ifndef LWIP_IPV6_MLD
2174 #define LWIP_IPV6_MLD 1
2177 #ifndef LWIP_MLD6_ENABLE_MLD_ON_DAD
2178 #define LWIP_MLD6_ENABLE_MLD_ON_DAD LWIP_IPV6 && LWIP_IPV6_MLD
2181 #ifndef LWIP_MLD6_DONE_ONLYFOR_LAST_REPORTER
2182 #define LWIP_MLD6_DONE_ONLYFOR_LAST_REPORTER LWIP_IPV6 && LWIP_IPV6_MLD
2184 #ifndef NETIF_MAX_HWADDR_LEN
2185 #define NETIF_MAX_HWADDR_LEN 6
2188 #ifndef LWIP_ND6_NUM_NEIGHBORS
2189 #define LWIP_ND6_NUM_NEIGHBORS 10
2191 #ifndef LWIP_IPV6_SCOPES
2192 #define LWIP_IPV6_SCOPES 0
2195 #ifndef LWIP_ND6_STATIC_NBR
2196 #define LWIP_ND6_STATIC_NBR 0
2198 #ifndef LWIP_L3_EVENT_MSG
2199 #define LWIP_L3_EVENT_MSG 1
2202 #if LWIP_L3_EVENT_MSG
2204 #ifndef MEMP_NUM_L3_EVENT_MSG
2205 #define MEMP_NUM_L3_EVENT_MSG 15
2208 #ifndef LWIP_ROUTE_CHANGE_MSG
2209 #define LWIP_ROUTE_CHANGE_MSG 1
2212 #ifndef LWIP_NAT64_CHANGE_MSG
2213 #define LWIP_NAT64_CHANGE_MSG 1
2216 #ifndef LWIP_RPL_JOIN_SUCC_MSG
2217 #define LWIP_RPL_JOIN_SUCC_MSG 1
2220 #ifndef LWIP_RPL_PARENT_CLEAR_MSG
2221 #define LWIP_RPL_PARENT_CLEAR_MSG 1
2224 #ifndef LWIP_RPL_BEACON_PRI_RESET
2225 #define LWIP_RPL_BEACON_PRI_RESET 1
2228 #ifndef LWIP_RPL_GET_IPV4_ADDR_FAIL
2229 #define LWIP_RPL_GET_IPV4_ADDR_FAIL 1
2232 #ifndef LWIP_RPL_MSTA_GET_IPV4_ADDR_FAIL
2233 #define LWIP_RPL_MSTA_GET_IPV4_ADDR_FAIL 1
2236 #ifndef LWIP_RPL_MG_FULL
2237 #define LWIP_RPL_MG_FULL 1
2240 #ifndef LWIP_RPL_RT_FULL
2241 #define LWIP_RPL_RT_FULL 1
2244 #ifndef LWIP_RPL_GET_MNID_FAIL
2245 #define LWIP_RPL_GET_MNID_FAIL 1
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
2255 #define LWIP_L3_EVENT_MSG_EXIST 0
2259 #endif /* LWIP_L3_EVENT_MSG */
2261 #ifndef LWIP_LITEOS_TASK
2262 #define LWIP_LITEOS_TASK 1
2265 #ifndef LWIP_SOCK_OPT_ICMP6_FILTER
2266 #define LWIP_SOCK_OPT_ICMP6_FILTER 0
2270 #ifndef LWIP_IPV6_FORWARD
2271 #define LWIP_IPV6_FORWARD 1
2286 #ifndef LWIP_MPL_IPV4
2287 #define LWIP_MPL_IPV4 1
2290 #ifndef LWIP_MPL_IPV4
2291 #define LWIP_MPL_IPV4 0
2295 #ifndef LWIP_ENABLE_MESH_SHELL_CMD
2296 #define LWIP_ENABLE_MESH_SHELL_CMD 1
2298 #ifndef LWIP_MPL_IPV4
2299 #define LWIP_MPL_IPV4 0
2303 #ifndef LWIP_MPL_IPV4_BCAST
2304 #define LWIP_MPL_IPV4_BCAST 0
2306 #ifndef LWIP_IPV6_MLD_QUERIER
2307 #define LWIP_IPV6_MLD_QUERIER 1
2312 #endif /* __cplusplus */
2314 #endif /* __LWIPOPTS_H__ */