BSB Developer Docs
Loading...
Searching...
No Matches
f64/lwip/lwipopts.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Nest Labs, Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
26#ifndef __LWIPOPTS_H__
27#define __LWIPOPTS_H__
28
29#include <stdlib.h>
30
31#define NO_SYS 0
32#define MEM_ALIGNMENT (4)
33#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1)
34#define LWIP_TIMEVAL_PRIVATE (0)
35#if 1
36#define MEM_LIBC_MALLOC (1)
37#define mem_clib_free free
38#define mem_clib_malloc malloc
39#else
40#define MEM_LIBC_MALLOC (0)
41#endif
42
43#define LWIP_COMPAT_MUTEX (0)
44#define SYS_LIGHTWEIGHT_PROT (1)
45#define LWIP_AUTOIP (0)
46#define LWIP_DHCP_AUTOIP_COOP (0)
47#define LWIP_SOCKET_SET_ERRNO 0
48#define IP_REASS_MAX_PBUFS 0
49#define IP_REASSEMBLY 1
50#define IP_FRAG 1
51#define IP_OPTIONS_ALLOWED 1
52#define MEMP_NUM_REASSDATA 0
53#define LWIP_SO_RCVTIMEO 0
54#define SO_REUSE (1)
55#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1)
56#define LWIP_STATS (1)
57#define MEMP_STATS (1)
58#define LWIP_STATS_DISPLAY (1)
59#define LWIP_TCPIP_CORE_LOCKING 1
60#define TCP_QUEUE_OOSEQ 0
61#define ARP_QUEUEING (0)
62#define TCPIP_THREAD_NAME "LwipWorker"
63
64#define LWIP_SOCKET 0
65
66#ifdef DIC_ENABLE
67#define LWIP_DNS 1
68#define DNS_RAND_TXID() ((u32_t)rand())
69#define TCP_MSS (4 * 1152)
70#define TCPIP_THREAD_PRIO (3)
71#else
72#define LWIP_DNS 0
73#define TCP_MSS (1152)
74#define TCPIP_THREAD_PRIO (2)
75#endif /* DIC_ENABLE */
76
77#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1
78
79#define LWIP_RAW 1
80#define MEMP_NUM_RAW_PCB (2)
81
82#define MEMP_NUM_UDP_PCB (8)
83#define MEMP_NUM_TCP_PCB (4)
84#define MEMP_NUM_TCP_PCB_LISTEN (4)
85
86#define LWIP_HAVE_LOOPIF (0)
87
88#define MEMP_NUM_FRAG_PBUF (0)
89#define LWIP_NETIF_TX_SINGLE_PBUF (1)
90#define MEMP_NUM_TCPIP_MSG_INPKT (12)
91
92// TODO: not sure why this is disabled
93#define LWIP_NETIF_LOOPBACK (0)
94
95#define LWIP_NETIF_API (1)
96#define LWIP_NETIF_STATUS_CALLBACK (1)
97
98#define MEMP_NUM_NETCONN (0)
99
100#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
101#define LWIP_IPV4 1
102#else
103#define LWIP_IPV4 0
104#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4
105#define LWIP_IPV6 (1)
106
107#ifndef LWIP_ARP
108#define LWIP_ARP (LWIP_IPV4)
109#endif /* LWIP_ARP */
110#ifndef LWIP_DNS
111#define LWIP_DNS (LWIP_IPV4)
112#endif /* LWIP_DNS */
113#ifndef LWIP_ICMP
114#define LWIP_ICMP (LWIP_IPV4)
115#endif /* LWIP_ICMP */
116#ifndef LWIP_IGMP
117#define LWIP_IGMP (LWIP_IPV4)
118#endif /* LWIP_IGMP */
119#ifndef LWIP_DHCP
120#define LWIP_DHCP (LWIP_IPV4)
121#endif /* LWIP_DHCP */
122
123#define LWIP_IPV6_ND (LWIP_IPV6)
124#define LWIP_ND6_QUEUEING (LWIP_IPV6)
125#define LWIP_NUM_ND6_QUEUE 3
126
127#define LWIP_ETHERNET (LWIP_IPV6) // Required for IPV6 only mode
128#define LWIP_IPV6_MLD (LWIP_IPV6)
129#define LWIP_ICMP6 (LWIP_IPV6)
130#define LWIP_IPV6_REASS (LWIP_IPV6)
131#define LWIP_IPV6_FRAG (LWIP_IPV6)
132#define LWIP_IPV6_DHCP6 0
133#define LWIP_IPV6_AUTOCONFIG (LWIP_IPV6)
134#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1
135#define LWIP_IPV6_ROUTER_SUPPORT (LWIP_IPV6)
136#define LWIP_ND6_LISTEN_RA (LWIP_IPV6_ND)
137#define LWIP_ND6_NUM_NEIGHBORS (10)
138#define LWIP_ND6_NUM_DESTINATIONS (10)
139#define LWIP_ND6_NUM_PREFIXES (5)
140#define LWIP_ND6_NUM_ROUTERS (3)
141#define LWIP_ND6_MAX_MULTICAST_SOLICIT (3)
142#define LWIP_ND6_MAX_UNICAST_SOLICIT (3)
143#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (3)
144#define LWIP_ND6_TCP_REACHABILITY_HINTS (0)
145#define LWIP_ND6_ALLOW_RA_UPDATES (LWIP_IPV6_ND)
146#define LWIP_ND6_SUPPORT_RIO (LWIP_IPV6_ND)
147#define LWIP_ND6_NUM_ROUTES (5)
148
149#define MEMP_SEPARATE_POOLS (1)
150#define LWIP_PBUF_FROM_CUSTOM_POOLS (0)
151#define MEMP_USE_CUSTOM_POOLS (0)
152#define PBUF_POOL_SIZE (32)
153#define PBUF_POOL_BUFSIZE (1500) // IPv6 path MTU
154#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL)
155#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE)
156
157#define MEMP_NUM_ND6_QUEUE (8)
158
159#define TCP_SND_BUF (2 * TCP_MSS)
160#define TCP_LISTEN_BACKLOG (1)
161
162#define ETH_PAD_SIZE (0)
163#define SUB_ETHERNET_HEADER_SPACE (0)
164#define PBUF_LINK_HLEN (14)
165
166#define TCPIP_THREAD_STACKSIZE (2048)
167
168#define NETIF_MAX_HWADDR_LEN 8U
169
170#define LWIP_IPV6_NUM_ADDRESSES 5
171
172#define LWIP_MULTICAST_PING 0
173
174#define TCPIP_MBOX_SIZE 6
175#define DEFAULT_RAW_RECVMBOX_SIZE 6
176#define DEFAULT_UDP_RECVMBOX_SIZE 6
177#define DEFAULT_TCP_RECVMBOX_SIZE 6
178
179#if SL_ICD_ENABLED
180#define SL_LWIP_MLD6_TIMERS_ONDEMAND 1
181#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
182
183#ifdef LWIP_DEBUG
184
185#define MEMP_OVERFLOW_CHECK (0)
186#define MEMP_SANITY_CHECK (0)
187#define MEM_DEBUG (LWIP_DBG_OFF)
188#define MEMP_DEBUG (LWIP_DBG_OFF)
189#define PBUF_DEBUG (LWIP_DBG_OFF)
190#define API_LIB_DEBUG (LWIP_DBG_OFF)
191#define API_MSG_DEBUG (LWIP_DBG_OFF)
192#define TCPIP_DEBUG (LWIP_DBG_OFF)
193#define NETIF_DEBUG (LWIP_DBG_OFF)
194#define SOCKETS_DEBUG (LWIP_DBG_OFF)
195#define DEMO_DEBUG (LWIP_DBG_OFF)
196#define DHCP_DEBUG (LWIP_DBG_OFF)
197#define AUTOIP_DEBUG (LWIP_DBG_OFF)
198#define ETHARP_DEBUG (LWIP_DBG_OFF)
199#define IP_DEBUG (LWIP_DBG_OFF)
200#define IP_REASS_DEBUG (LWIP_DBG_OFF)
201#define IP6_DEBUG (LWIP_DBG_OFF)
202#define RAW_DEBUG (LWIP_DBG_OFF)
203#define ICMP_DEBUG (LWIP_DBG_OFF)
204#define ICMP6_DEBUG (LWIP_DBG_OFF)
205#define UDP_DEBUG (LWIP_DBG_OFF)
206#define TCP_DEBUG (LWIP_DBG_OFF)
207#define TCP_INPUT_DEBUG (LWIP_DBG_OFF)
208#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF)
209#define TCP_RTO_DEBUG (LWIP_DBG_OFF)
210#define TCP_CWND_DEBUG (LWIP_DBG_OFF)
211#define TCP_WND_DEBUG (LWIP_DBG_OFF)
212#define TCP_FR_DEBUG (LWIP_DBG_OFF)
213#define TCP_QLEN_DEBUG (LWIP_DBG_OFF)
214#define TCP_RST_DEBUG (LWIP_DBG_OFF)
215#define PPP_DEBUG (LWIP_DBG_OFF)
216#endif /* LWIP_DEBUG */
217
218#define LWIP_DBG_TYPES_ON \
219 (LWIP_DBG_ON | \
220 LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */
221#endif /* __LWIPOPTS_H__ */