blob: 84aa44e1c5c62a170db0b5464bc29ad79571dfc6 [file] [log] [blame]
Pankaj Garg281b8682020-03-04 09:31:04 -08001/*
2 *
Rob Walkere812e672020-03-31 17:51:57 -07003 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Google LLC.
5 * Copyright (c) 2014-2018 Nest Labs, Inc.
Robert Szewczyk38cf7312020-06-29 09:07:49 -07006 * All rights reserved.
Pankaj Garg281b8682020-03-04 09:31:04 -08007 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21/**
22 * @file
23 * This file describes compile-time constants for configuring LwIP
24 * for use in standalone (desktop) environments.
25 *
26 */
27
Pankaj Garg281b8682020-03-04 09:31:04 -080028#ifndef __LWIPOPTS_H__
29#define __LWIPOPTS_H__
30
Michael Spangf6a6c1b2020-10-22 19:45:40 -040031#if CHIP_HAVE_CONFIG_H
Michael Spang1fcb6dd2020-08-24 11:19:04 -040032#include <lwip/lwip_buildconfig.h>
33#endif
34
Pankaj Garg281b8682020-03-04 09:31:04 -080035#include <stdlib.h>
36
37/**
38 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
39 * use lwIP facilities.
40 */
Justin Wood0a9545e2020-04-20 18:15:21 -070041#define NO_SYS 0
Pankaj Garg281b8682020-03-04 09:31:04 -080042
43/**
44 * MEM_ALIGNMENT: should be set to the alignment of the CPU
45 * 4 byte alignment -> #define MEM_ALIGNMENT 4
46 * 2 byte alignment -> #define MEM_ALIGNMENT 2
47 */
Justin Wood0a9545e2020-04-20 18:15:21 -070048#define MEM_ALIGNMENT (4)
Pankaj Garg281b8682020-03-04 09:31:04 -080049
50/**
51 * MEM_SIZE: specify bigger memory size to pass LwIP-internal unit tests
52 * (only needed when building tests)
53 */
Pankaj Garg07543a02020-03-04 09:47:55 -080054#ifdef CHIP_WITH_TESTS
Justin Wood0a9545e2020-04-20 18:15:21 -070055#define MEM_SIZE (16000)
Pankaj Garg281b8682020-03-04 09:31:04 -080056#endif
57
58/**
59 * Use Malloc from LibC - saves code space
60 */
Justin Wood0a9545e2020-04-20 18:15:21 -070061#define MEM_LIBC_MALLOC (0)
Pankaj Garg281b8682020-03-04 09:31:04 -080062
63/**
64 * Do not use memory pools to create fixed, statically allocated pools of
65 * memory in lieu of the Standard C Library heap and APIs.
66 */
Justin Wood0a9545e2020-04-20 18:15:21 -070067#define MEM_USE_POOLS (0)
Pankaj Garg281b8682020-03-04 09:31:04 -080068
69/**
70 * Do not use custom memory pools for specific, named LwIP objects, sourced
71 * from lwippools.h.
72 */
Justin Wood0a9545e2020-04-20 18:15:21 -070073#define MEM_USE_CUSTOM_POOLS (MEM_USE_POOLS)
Pankaj Garg281b8682020-03-04 09:31:04 -080074
75/**
76 * MEMP_NUM_NETBUF: the number of struct netbufs.
77 * (only needed if you use the sequential API, like api_lib.c)
78 */
Justin Wood0a9545e2020-04-20 18:15:21 -070079#define MEMP_NUM_NETBUF (PBUF_POOL_SIZE)
Pankaj Garg281b8682020-03-04 09:31:04 -080080
81/**
82 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
83 * (requires the LWIP_TCP option)
84 */
Justin Wood0a9545e2020-04-20 18:15:21 -070085#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1)
Pankaj Garg281b8682020-03-04 09:31:04 -080086
87/**
88 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
89 *
Martin Turond24eff12021-12-17 06:21:23 -080090 * This is just a default designed to be overridden by the FreeRTOS.mk makefile
Pankaj Garg281b8682020-03-04 09:31:04 -080091 * To perform this override, define the makefile variable LWIP_NUM_PACKET_BUFFERS_IN_POOL
92 */
93#ifndef PBUF_POOL_SIZE
Justin Wood0a9545e2020-04-20 18:15:21 -070094#define PBUF_POOL_SIZE (10)
Pankaj Garg281b8682020-03-04 09:31:04 -080095#endif
96
97/*
98 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
99 * Since the received pbufs are enqueued, be sure to configure
100 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
101 * packets even if the maximum amount of fragments is enqueued for reassembly!
102 *
103 */
104#if PBUF_POOL_SIZE > 2
105#ifndef IP_REASS_MAX_PBUFS
Justin Wood0a9545e2020-04-20 18:15:21 -0700106#define IP_REASS_MAX_PBUFS (PBUF_POOL_SIZE - 2)
Pankaj Garg281b8682020-03-04 09:31:04 -0800107#endif
108#else
Justin Wood0a9545e2020-04-20 18:15:21 -0700109#define IP_REASS_MAX_PBUFS 0
110#define IP_REASSEMBLY 0
Pankaj Garg281b8682020-03-04 09:31:04 -0800111#endif
112
113/**
114 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
115 * reassembly (whole packets, not fragments!)
116 */
117#if IP_REASS_MAX_PBUFS > 1
118#ifndef MEMP_NUM_REASSDATA
Justin Wood0a9545e2020-04-20 18:15:21 -0700119#define MEMP_NUM_REASSDATA (IP_REASS_MAX_PBUFS - 1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800120#endif
121#else
Justin Wood0a9545e2020-04-20 18:15:21 -0700122#define MEMP_NUM_REASSDATA 0
Pankaj Garg281b8682020-03-04 09:31:04 -0800123#endif
124
Justin Wood0a9545e2020-04-20 18:15:21 -0700125#define PAYLOAD_MTU (1500)
Pankaj Garg281b8682020-03-04 09:31:04 -0800126
127/**
128 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
129 * you might want to increase this.)
130 * For the receive side, this MSS is advertised to the remote side
131 * when opening a connection. For the transmit size, this MSS sets
132 * an upper limit on the MSS advertised by the remote host.
133 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700134#define TCP_MSS (1152)
Pankaj Garg281b8682020-03-04 09:31:04 -0800135
136/**
137 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
Martin Turond24eff12021-12-17 06:21:23 -0800138 * designed to accommodate single full size link-layer frame in one pbuf, including
Pankaj Garg281b8682020-03-04 09:31:04 -0800139 * the link-layer header and any link-layer encapsulation header, and the pbuf
140 * structure itself.
141 */
142
Justin Wood0a9545e2020-04-20 18:15:21 -0700143#define PBUF_POOL_BUFSIZE \
144 LWIP_MEM_ALIGN_SIZE(PAYLOAD_MTU + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN) + LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf) + 1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800145
146/**
147 * TCP_SND_BUF: TCP sender buffer space (bytes).
148 * must be at least as much as (2 * TCP_MSS) for things to work smoothly
149 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700150#define TCP_SND_BUF (6 * TCP_MSS)
Pankaj Garg281b8682020-03-04 09:31:04 -0800151
152/**
153 * ETH_PAD_SIZE: the header space required preceeding the of each pbuf in the pbuf pool. The default is
Martin Turond24eff12021-12-17 06:21:23 -0800154 * designed to accommodate single full size TCP frame in one pbuf, including
Pankaj Garg281b8682020-03-04 09:31:04 -0800155 * TCP_MSS, IP header, and link header.
156 *
157 * This is zero since the role has been taken over by SUB_ETHERNET_HEADER_SPACE as ETH_PAD_SIZE was not always obeyed
158 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700159#define ETH_PAD_SIZE (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800160
161/**
162 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
163 * to be sent into one single pbuf. This is for compatibility with DMA-enabled
164 * MACs that do not support scatter-gather.
165 * Beware that this might involve CPU-memcpy before transmitting that would not
166 * be needed without this flag! Use this only if you need to!
167 *
168 * @todo: TCP and IP-frag do not work with this, yet:
169 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700170#define LWIP_NETIF_TX_SINGLE_PBUF (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800171
172/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores
173 * should be used instead
174 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700175#define LWIP_COMPAT_MUTEX (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800176
177/** Define LWIP_COMPAT_MUTEX_ALLOWED if the platform concurrency model has no
178 * support for avoiding priority inversion deadlocks
179 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700180#define LWIP_COMPAT_MUTEX_ALLOWED (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800181
182/**
183 * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
184 * critical regions during buffer allocation, deallocation and memory
185 * allocation and deallocation.
186 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700187#define SYS_LIGHTWEIGHT_PROT (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800188
189/**
190 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
191 * The stack size value itself is platform-dependent, but is passed to
192 * sys_thread_new() when the thread is created.
193 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700194#define TCPIP_THREAD_STACKSIZE (1300)
Pankaj Garg281b8682020-03-04 09:31:04 -0800195
196/**
197 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
198 * The priority value itself is platform-dependent, but is passed to
199 * sys_thread_new() when the thread is created.
200 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700201#define TCPIP_THREAD_PRIO (7)
Pankaj Garg281b8682020-03-04 09:31:04 -0800202
Justin Wood0a9545e2020-04-20 18:15:21 -0700203#define TCP_LISTEN_BACKLOG (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800204
205/**
206 * LWIP_DHCP==1: Enable DHCP module.
207 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700208#define LWIP_DHCP (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800209
210/**
211 * Enable automatic IPv4 link-local address assignment.
212 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700213#define LWIP_AUTOIP 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800214
215/**
216 * Allow DHCP and automatic IPv4 link-local address assignment to
217 * work cooperatively.
218 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700219#define LWIP_DHCP_AUTOIP_COOP 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800220
221/**
222 * LWIP_PROVIDE_ERRNO: errno definitions from the Standard C Library.
223 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700224#undef LWIP_PROVIDE_ERRNO
Pankaj Garg281b8682020-03-04 09:31:04 -0800225
226/**
227 * ERRNO: set errno on interface invocation failures
228 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700229#define ERRNO (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800230
231/**
232 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
233 * (requires the LWIP_RAW option)
234 */
235#ifndef MEMP_NUM_RAW_PCB
Justin Wood0a9545e2020-04-20 18:15:21 -0700236#define MEMP_NUM_RAW_PCB (5)
Pankaj Garg281b8682020-03-04 09:31:04 -0800237#endif
238
239/**
240 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
241 * per active UDP "connection".
242 * (requires the LWIP_UDP option)
243 */
244#ifndef MEMP_NUM_UDP_PCB
Justin Wood0a9545e2020-04-20 18:15:21 -0700245#define MEMP_NUM_UDP_PCB (6)
Pankaj Garg281b8682020-03-04 09:31:04 -0800246#endif
247
248/**
249 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
250 * (requires NO_SYS==0)
Justin Wood0a9545e2020-04-20 18:15:21 -0700251 * Must be larger than or equal to LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS +
252 * PPP_SUPPORT Since each InetTimer requires one matching LwIP timeout (if built with LwIP option), the number should be expanded to
253 * be (All LwIP needs) + (max number of InetTimers)
Pankaj Garg281b8682020-03-04 09:31:04 -0800254 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700255#define MEMP_NUM_SYS_TIMEOUT (48)
Pankaj Garg281b8682020-03-04 09:31:04 -0800256
257/* ARP before DHCP causes multi-second delay - turn it off */
Justin Wood0a9545e2020-04-20 18:15:21 -0700258#define DHCP_DOES_ARP_CHECK (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800259
260/**
261 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
262 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700263#define LWIP_HAVE_LOOPIF (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800264
265/**
266 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
267 * address equal to the netif IP address, looping them back up the stack.
268 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700269#define LWIP_NETIF_LOOPBACK (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800270
271/**
272 * MEMP_NUM_NETCONN: the number of struct netconns.
273 * (only needed if you use the sequential API, like api_lib.c)
274 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700275#define MEMP_NUM_NETCONN (8)
Pankaj Garg281b8682020-03-04 09:31:04 -0800276
277/**
278 * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
279 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700280#define LWIP_SO_RCVTIMEO (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800281
282/**
283 * LWIP_IGMP==1: Turn on IGMP module.
284 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700285#define LWIP_IGMP (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800286
287/**
288 * SO_REUSE==1: Enable SO_REUSEADDR option.
289 * Required by IGMP for reuse of multicast address and port by other sockets
290 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700291#define SO_REUSE (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800292
293/**
294 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
295 * transport.
296 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700297#define LWIP_DNS (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800298
299/**
300 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
301 * Disable this option if you use a POSIX operating system that uses the same
302 * names (read, write & close). (only used if you use sockets.c)
303 *
304 * We disable this because this otherwise collides with the Standard C
305 * Library where both LWIP and its headers are included.
306 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700307#define LWIP_POSIX_SOCKETS_IO_NAMES (0)
Pankaj Garg281b8682020-03-04 09:31:04 -0800308
309#ifdef LWIP_SO_RCVBUF
Justin Wood0a9545e2020-04-20 18:15:21 -0700310#if (LWIP_SO_RCVBUF == 1)
311#include <limits.h> /* Needed because RECV_BUFSIZE_DEFAULT is defined as INT_MAX */
312#endif /* if ( LWIP_SO_RCVBUF == 1 ) */
313#endif /* ifdef LWIP_SO_RCVBUF */
Pankaj Garg281b8682020-03-04 09:31:04 -0800314
315/**
316 * LWIP_STATS : Turn on statistics gathering
317 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700318#define LWIP_STATS (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800319
320/**
321 * LWIP_IPV6==1: Enable IPv6
322 */
323#ifndef LWIP_IPV6
Justin Wood0a9545e2020-04-20 18:15:21 -0700324#define LWIP_IPV6 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800325#endif
326
327/**
328 * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration.
329 */
330#ifndef LWIP_IPV6_DHCP6
Justin Wood0a9545e2020-04-20 18:15:21 -0700331#define LWIP_IPV6_DHCP6 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800332#endif
333
334/**
335 * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol.
336 */
337#ifndef LWIP_IPV6_MLD
Justin Wood0a9545e2020-04-20 18:15:21 -0700338#define LWIP_IPV6_MLD 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800339#endif
340
341/**
342 * MEMP_NUM_MLD6_GROUP: Maximum number of IPv6 multicast groups that
343 * can be joined. Allocate one (1) for the link local address
344 * solicited node multicast group, one (1) for the any/unspecified
345 * address solicited node multicast group (which seems to be used
346 * for/by DAD in this epoch of LwIP), and another four (4) for
347 * application groups.
348 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700349#define MEMP_NUM_MLD6_GROUP ((1 + 1) + 4)
Pankaj Garg281b8682020-03-04 09:31:04 -0800350
351/**
352 * LWIP_IPV6_FORWARD==1: Enable IPv6 forwarding.
353 */
354#ifndef LWIP_IPV6_FORWARD
Justin Wood0a9545e2020-04-20 18:15:21 -0700355#define LWIP_IPV6_FORWARD 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800356#endif
357
358/**
Martin Turond24eff12021-12-17 06:21:23 -0800359 * LWIP_IPV6_ROUTE_TABLE_SUPPORT==1: Enable support for a routing table and referring these during forwarding.
Pankaj Garg281b8682020-03-04 09:31:04 -0800360 */
361#ifndef LWIP_IPV6_ROUTE_TABLE_SUPPORT
Justin Wood0a9545e2020-04-20 18:15:21 -0700362#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800363#endif
364
365/**
366 * IPV6_FRAG_COPYHEADER==1: Enable copying of IPv6 fragment headers on 64-bit platforms.
367 */
368#ifndef IPV6_FRAG_COPYHEADER
369#if defined(__x86_64__)
Justin Wood0a9545e2020-04-20 18:15:21 -0700370#define IPV6_FRAG_COPYHEADER 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800371#else
Justin Wood0a9545e2020-04-20 18:15:21 -0700372#define IPV6_FRAG_COPYHEADER 0
Pankaj Garg281b8682020-03-04 09:31:04 -0800373#endif
Justin Wood0a9545e2020-04-20 18:15:21 -0700374#endif
Pankaj Garg281b8682020-03-04 09:31:04 -0800375
376/**
377 * Debug printing
378 * By default enable debug printing for debug build, but set level to off
379 * This allows user to change any desired debug level to on.
380 */
381#ifdef LWIP_DEBUG
382
Justin Wood0a9545e2020-04-20 18:15:21 -0700383#define MEMP_OVERFLOW_CHECK (1)
384#define MEMP_SANITY_CHECK (1)
Pankaj Garg281b8682020-03-04 09:31:04 -0800385
Justin Wood0a9545e2020-04-20 18:15:21 -0700386#define MEM_DEBUG LWIP_DBG_OFF
387#define MEMP_DEBUG LWIP_DBG_OFF
388#define PBUF_DEBUG LWIP_DBG_ON
389#define API_LIB_DEBUG LWIP_DBG_ON
390#define API_MSG_DEBUG LWIP_DBG_ON
391#define TCPIP_DEBUG LWIP_DBG_ON
392#define NETIF_DEBUG LWIP_DBG_ON
393#define SOCKETS_DEBUG LWIP_DBG_ON
394#define DEMO_DEBUG LWIP_DBG_ON
395#define IP_DEBUG LWIP_DBG_ON
396#define IP6_DEBUG LWIP_DBG_ON
397#define IP_REASS_DEBUG LWIP_DBG_ON
398#define RAW_DEBUG LWIP_DBG_ON
399#define ICMP_DEBUG LWIP_DBG_ON
400#define UDP_DEBUG LWIP_DBG_ON
401#define TCP_DEBUG LWIP_DBG_ON
402#define TCP_INPUT_DEBUG LWIP_DBG_ON
Pankaj Garg281b8682020-03-04 09:31:04 -0800403#define TCP_OUTPUT_DEBUG LWIP_DBG_ON
Justin Wood0a9545e2020-04-20 18:15:21 -0700404#define TCP_RTO_DEBUG LWIP_DBG_ON
405#define TCP_CWND_DEBUG LWIP_DBG_ON
406#define TCP_WND_DEBUG LWIP_DBG_ON
407#define TCP_FR_DEBUG LWIP_DBG_ON
408#define TCP_QLEN_DEBUG LWIP_DBG_ON
409#define TCP_RST_DEBUG LWIP_DBG_ON
410#define PPP_DEBUG LWIP_DBG_OFF
Pankaj Garg281b8682020-03-04 09:31:04 -0800411
412extern unsigned char gLwIP_DebugFlags;
413#define LWIP_DBG_TYPES_ON gLwIP_DebugFlags
414
415#endif
416
417/**
418 * The WICED definition of PBUF_POOL_BUFSIZE includes a number of
419 * sizeof() instantiations which causes the C preprocessor to
420 * fail. Disable TCP configuration constant sanity checks to work
421 * around this.
422 */
423#define LWIP_DISABLE_TCP_SANITY_CHECKS (1)
424
425/**
426 * LwIP defaults the size of most mailboxes (i.e. message queues) to
427 * zero (0). That generally makes RTOSes such as FreeRTOS very
428 * unhappy. Specify reasonable defaults instead.
429 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700430#define TCPIP_MBOX_SIZE 6
Pankaj Garg281b8682020-03-04 09:31:04 -0800431
Justin Wood0a9545e2020-04-20 18:15:21 -0700432#define DEFAULT_RAW_RECVMBOX_SIZE 6
Pankaj Garg281b8682020-03-04 09:31:04 -0800433
Justin Wood0a9545e2020-04-20 18:15:21 -0700434#define DEFAULT_UDP_RECVMBOX_SIZE 6
Pankaj Garg281b8682020-03-04 09:31:04 -0800435
Justin Wood0a9545e2020-04-20 18:15:21 -0700436#define DEFAULT_TCP_RECVMBOX_SIZE 6
Pankaj Garg281b8682020-03-04 09:31:04 -0800437
438/*
439 ---------------------------------
440 ---------- RAW options ----------
441 ---------------------------------
442*/
443
444/**
445 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
446 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700447#define LWIP_RAW 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800448
449/*
450 ----------------------------------------------
451 ---------- Sequential layer options ----------
452 ----------------------------------------------
453*/
454
455/**
456 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
457 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700458#define LWIP_NETCONN 0
Pankaj Garg281b8682020-03-04 09:31:04 -0800459
460/*
461 ------------------------------------
462 ---------- Socket options ----------
463 ------------------------------------
464*/
465
466/**
467 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
468 */
Justin Wood0a9545e2020-04-20 18:15:21 -0700469#define LWIP_SOCKET 0
Pankaj Garg281b8682020-03-04 09:31:04 -0800470
471/**
472 * Enable locking in the lwip (tcpip) thread.
473 */
474#ifndef LWIP_TCPIP_CORE_LOCKING
Justin Wood0a9545e2020-04-20 18:15:21 -0700475#define LWIP_TCPIP_CORE_LOCKING 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800476#endif
477
Pankaj Garg281b8682020-03-04 09:31:04 -0800478/**
479 * Enable support for TCP keepalives.
480 */
481#ifndef LWIP_TCP_KEEPALIVE
Justin Wood0a9545e2020-04-20 18:15:21 -0700482#define LWIP_TCP_KEEPALIVE 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800483#endif
484
Pankaj Garg281b8682020-03-04 09:31:04 -0800485/** LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS:
486 * Ensure compatibilty with platforms where LwIP is configured not to define the host/network byte-order conversion
487 * functions normally provided in <arpa/inet.h> on POSIX systems.
488 */
489#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
Justin Wood0a9545e2020-04-20 18:15:21 -0700490#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1
Pankaj Garg281b8682020-03-04 09:31:04 -0800491#endif
492
493#endif /* __LWIPOPTS_H__ */