Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Rob Walker | e812e67 | 2020-03-31 17:51:57 -0700 | [diff] [blame] | 3 | * Copyright (c) 2020 Project CHIP Authors |
| 4 | * Copyright (c) 2019 Google LLC. |
| 5 | * Copyright (c) 2014-2018 Nest Labs, Inc. |
Robert Szewczyk | 38cf731 | 2020-06-29 09:07:49 -0700 | [diff] [blame] | 6 | * All rights reserved. |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 7 | * |
| 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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 28 | #ifndef __LWIPOPTS_H__ |
| 29 | #define __LWIPOPTS_H__ |
| 30 | |
Michael Spang | f6a6c1b | 2020-10-22 19:45:40 -0400 | [diff] [blame] | 31 | #if CHIP_HAVE_CONFIG_H |
Michael Spang | 1fcb6dd | 2020-08-24 11:19:04 -0400 | [diff] [blame] | 32 | #include <lwip/lwip_buildconfig.h> |
| 33 | #endif |
| 34 | |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 35 | #include <stdlib.h> |
| 36 | |
| 37 | /** |
| 38 | * NO_SYS==1: Provides VERY minimal functionality. Otherwise, |
| 39 | * use lwIP facilities. |
| 40 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 41 | #define NO_SYS 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 42 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 48 | #define MEM_ALIGNMENT (4) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * MEM_SIZE: specify bigger memory size to pass LwIP-internal unit tests |
| 52 | * (only needed when building tests) |
| 53 | */ |
Pankaj Garg | 07543a0 | 2020-03-04 09:47:55 -0800 | [diff] [blame] | 54 | #ifdef CHIP_WITH_TESTS |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 55 | #define MEM_SIZE (16000) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | /** |
| 59 | * Use Malloc from LibC - saves code space |
| 60 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 61 | #define MEM_LIBC_MALLOC (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 62 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 67 | #define MEM_USE_POOLS (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Do not use custom memory pools for specific, named LwIP objects, sourced |
| 71 | * from lwippools.h. |
| 72 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 73 | #define MEM_USE_CUSTOM_POOLS (MEM_USE_POOLS) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 74 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 79 | #define MEMP_NUM_NETBUF (PBUF_POOL_SIZE) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 80 | |
| 81 | /** |
| 82 | * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. |
| 83 | * (requires the LWIP_TCP option) |
| 84 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 85 | #define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. |
| 89 | * |
Martin Turon | d24eff1 | 2021-12-17 06:21:23 -0800 | [diff] [blame] | 90 | * This is just a default designed to be overridden by the FreeRTOS.mk makefile |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 91 | * To perform this override, define the makefile variable LWIP_NUM_PACKET_BUFFERS_IN_POOL |
| 92 | */ |
| 93 | #ifndef PBUF_POOL_SIZE |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 94 | #define PBUF_POOL_SIZE (10) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 95 | #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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 106 | #define IP_REASS_MAX_PBUFS (PBUF_POOL_SIZE - 2) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 107 | #endif |
| 108 | #else |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 109 | #define IP_REASS_MAX_PBUFS 0 |
| 110 | #define IP_REASSEMBLY 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 111 | #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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 119 | #define MEMP_NUM_REASSDATA (IP_REASS_MAX_PBUFS - 1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 120 | #endif |
| 121 | #else |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 122 | #define MEMP_NUM_REASSDATA 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 123 | #endif |
| 124 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 125 | #define PAYLOAD_MTU (1500) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 126 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 134 | #define TCP_MSS (1152) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 135 | |
| 136 | /** |
| 137 | * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is |
Martin Turon | d24eff1 | 2021-12-17 06:21:23 -0800 | [diff] [blame] | 138 | * designed to accommodate single full size link-layer frame in one pbuf, including |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 139 | * the link-layer header and any link-layer encapsulation header, and the pbuf |
| 140 | * structure itself. |
| 141 | */ |
| 142 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 143 | #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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 145 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 150 | #define TCP_SND_BUF (6 * TCP_MSS) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * ETH_PAD_SIZE: the header space required preceeding the of each pbuf in the pbuf pool. The default is |
Martin Turon | d24eff1 | 2021-12-17 06:21:23 -0800 | [diff] [blame] | 154 | * designed to accommodate single full size TCP frame in one pbuf, including |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 155 | * 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 159 | #define ETH_PAD_SIZE (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 160 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 170 | #define LWIP_NETIF_TX_SINGLE_PBUF (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 171 | |
| 172 | /** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores |
| 173 | * should be used instead |
| 174 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 175 | #define LWIP_COMPAT_MUTEX (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 176 | |
| 177 | /** Define LWIP_COMPAT_MUTEX_ALLOWED if the platform concurrency model has no |
| 178 | * support for avoiding priority inversion deadlocks |
| 179 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 180 | #define LWIP_COMPAT_MUTEX_ALLOWED (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 181 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 187 | #define SYS_LIGHTWEIGHT_PROT (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 188 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 194 | #define TCPIP_THREAD_STACKSIZE (1300) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 195 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 201 | #define TCPIP_THREAD_PRIO (7) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 202 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 203 | #define TCP_LISTEN_BACKLOG (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 204 | |
| 205 | /** |
| 206 | * LWIP_DHCP==1: Enable DHCP module. |
| 207 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 208 | #define LWIP_DHCP (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 209 | |
| 210 | /** |
| 211 | * Enable automatic IPv4 link-local address assignment. |
| 212 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 213 | #define LWIP_AUTOIP 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 214 | |
| 215 | /** |
| 216 | * Allow DHCP and automatic IPv4 link-local address assignment to |
| 217 | * work cooperatively. |
| 218 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 219 | #define LWIP_DHCP_AUTOIP_COOP 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 220 | |
| 221 | /** |
| 222 | * LWIP_PROVIDE_ERRNO: errno definitions from the Standard C Library. |
| 223 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 224 | #undef LWIP_PROVIDE_ERRNO |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 225 | |
| 226 | /** |
| 227 | * ERRNO: set errno on interface invocation failures |
| 228 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 229 | #define ERRNO (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 230 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 236 | #define MEMP_NUM_RAW_PCB (5) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 237 | #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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 245 | #define MEMP_NUM_UDP_PCB (6) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 246 | #endif |
| 247 | |
| 248 | /** |
| 249 | * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. |
| 250 | * (requires NO_SYS==0) |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 251 | * 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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 254 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 255 | #define MEMP_NUM_SYS_TIMEOUT (48) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 256 | |
| 257 | /* ARP before DHCP causes multi-second delay - turn it off */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 258 | #define DHCP_DOES_ARP_CHECK (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 259 | |
| 260 | /** |
| 261 | * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c |
| 262 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 263 | #define LWIP_HAVE_LOOPIF (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 264 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 269 | #define LWIP_NETIF_LOOPBACK (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 270 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 275 | #define MEMP_NUM_NETCONN (8) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 276 | |
| 277 | /** |
| 278 | * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. |
| 279 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 280 | #define LWIP_SO_RCVTIMEO (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 281 | |
| 282 | /** |
| 283 | * LWIP_IGMP==1: Turn on IGMP module. |
| 284 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 285 | #define LWIP_IGMP (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 286 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 291 | #define SO_REUSE (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 292 | |
| 293 | /** |
| 294 | * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS |
| 295 | * transport. |
| 296 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 297 | #define LWIP_DNS (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 298 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 307 | #define LWIP_POSIX_SOCKETS_IO_NAMES (0) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 308 | |
| 309 | #ifdef LWIP_SO_RCVBUF |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 310 | #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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 314 | |
| 315 | /** |
| 316 | * LWIP_STATS : Turn on statistics gathering |
| 317 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 318 | #define LWIP_STATS (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 319 | |
| 320 | /** |
| 321 | * LWIP_IPV6==1: Enable IPv6 |
| 322 | */ |
| 323 | #ifndef LWIP_IPV6 |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 324 | #define LWIP_IPV6 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 325 | #endif |
| 326 | |
| 327 | /** |
| 328 | * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration. |
| 329 | */ |
| 330 | #ifndef LWIP_IPV6_DHCP6 |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 331 | #define LWIP_IPV6_DHCP6 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 332 | #endif |
| 333 | |
| 334 | /** |
| 335 | * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. |
| 336 | */ |
| 337 | #ifndef LWIP_IPV6_MLD |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 338 | #define LWIP_IPV6_MLD 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 339 | #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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 349 | #define MEMP_NUM_MLD6_GROUP ((1 + 1) + 4) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 350 | |
| 351 | /** |
| 352 | * LWIP_IPV6_FORWARD==1: Enable IPv6 forwarding. |
| 353 | */ |
| 354 | #ifndef LWIP_IPV6_FORWARD |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 355 | #define LWIP_IPV6_FORWARD 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 356 | #endif |
| 357 | |
| 358 | /** |
Martin Turon | d24eff1 | 2021-12-17 06:21:23 -0800 | [diff] [blame] | 359 | * LWIP_IPV6_ROUTE_TABLE_SUPPORT==1: Enable support for a routing table and referring these during forwarding. |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 360 | */ |
| 361 | #ifndef LWIP_IPV6_ROUTE_TABLE_SUPPORT |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 362 | #define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 363 | #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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 370 | #define IPV6_FRAG_COPYHEADER 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 371 | #else |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 372 | #define IPV6_FRAG_COPYHEADER 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 373 | #endif |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 374 | #endif |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 375 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 383 | #define MEMP_OVERFLOW_CHECK (1) |
| 384 | #define MEMP_SANITY_CHECK (1) |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 385 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 386 | #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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 403 | #define TCP_OUTPUT_DEBUG LWIP_DBG_ON |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 404 | #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 Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 411 | |
| 412 | extern 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 430 | #define TCPIP_MBOX_SIZE 6 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 431 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 432 | #define DEFAULT_RAW_RECVMBOX_SIZE 6 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 433 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 434 | #define DEFAULT_UDP_RECVMBOX_SIZE 6 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 435 | |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 436 | #define DEFAULT_TCP_RECVMBOX_SIZE 6 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 437 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 447 | #define LWIP_RAW 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 448 | |
| 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 458 | #define LWIP_NETCONN 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 459 | |
| 460 | /* |
| 461 | ------------------------------------ |
| 462 | ---------- Socket options ---------- |
| 463 | ------------------------------------ |
| 464 | */ |
| 465 | |
| 466 | /** |
| 467 | * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) |
| 468 | */ |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 469 | #define LWIP_SOCKET 0 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 470 | |
| 471 | /** |
| 472 | * Enable locking in the lwip (tcpip) thread. |
| 473 | */ |
| 474 | #ifndef LWIP_TCPIP_CORE_LOCKING |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 475 | #define LWIP_TCPIP_CORE_LOCKING 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 476 | #endif |
| 477 | |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 478 | /** |
| 479 | * Enable support for TCP keepalives. |
| 480 | */ |
| 481 | #ifndef LWIP_TCP_KEEPALIVE |
Justin Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 482 | #define LWIP_TCP_KEEPALIVE 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 483 | #endif |
| 484 | |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 485 | /** 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 Wood | 0a9545e | 2020-04-20 18:15:21 -0700 | [diff] [blame] | 490 | #define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS 1 |
Pankaj Garg | 281b868 | 2020-03-04 09:31:04 -0800 | [diff] [blame] | 491 | #endif |
| 492 | |
| 493 | #endif /* __LWIPOPTS_H__ */ |