1 /** 2 * @file 3 * 4 * lwIP Options Configuration 5 */ 6 7 /* 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without modification, 12 * are permitted provided that the following conditions are met: 13 * 14 * 1. Redistributions of source code must retain the above copyright notice, 15 * this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright notice, 17 * this list of conditions and the following disclaimer in the documentation 18 * and/or other materials provided with the distribution. 19 * 3. The name of the author may not be used to endorse or promote products 20 * derived from this software without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 * OF SUCH DAMAGE. 32 * 33 * This file is part of the lwIP TCP/IP stack. 34 * 35 * Author: Adam Dunkels <adam@sics.se> 36 * 37 */ 38 39 /* 40 * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug - 41 * without this, doxygen does not see the actual #define 42 */ 43 44 #if !defined LWIP_HDR_OPT_H 45 #define LWIP_HDR_OPT_H 46 47 /* 48 * Include user defined options first. Anything not defined in these files 49 * will be set to standard values. Override anything you don't like! 50 */ 51 #include "lwipopts.h" 52 #include "lwip/debug.h" 53 54 /** 55 * @defgroup lwip_opts Options (lwipopts.h) 56 * @ingroup lwip 57 * 58 * @defgroup lwip_opts_debug Debugging 59 * @ingroup lwip_opts 60 * 61 * @defgroup lwip_opts_infrastructure Infrastructure 62 * @ingroup lwip_opts 63 * 64 * @defgroup lwip_opts_callback Callback-style APIs 65 * @ingroup lwip_opts 66 * 67 * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs 68 * @ingroup lwip_opts 69 */ 70 71 /* 72 ------------------------------------ 73 -------------- NO SYS -------------- 74 ------------------------------------ 75 */ 76 /** 77 * @defgroup lwip_opts_nosys NO_SYS 78 * @ingroup lwip_opts_infrastructure 79 * @{ 80 */ 81 /** 82 * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or 83 * mboxes). This means threaded APIs cannot be used (socket, netconn, 84 * i.e. everything in the 'api' folder), only the callback-style raw API is 85 * available (and you have to watch out for yourself that you don't access 86 * lwIP functions/structures from more than one context at a time!) 87 */ 88 #if !defined NO_SYS || defined __DOXYGEN__ 89 #define NO_SYS 0 90 #endif 91 /** 92 * @} 93 */ 94 95 /** 96 * @defgroup lwip_opts_timers Timers 97 * @ingroup lwip_opts_infrastructure 98 * @{ 99 */ 100 /** 101 * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers. 102 * (the array of lwip-internal cyclic timers is still provided) 103 * (check NO_SYS_NO_TIMERS for compatibility to old versions) 104 */ 105 #if !defined LWIP_TIMERS || defined __DOXYGEN__ 106 #ifdef NO_SYS_NO_TIMERS 107 #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) 108 #else 109 #define LWIP_TIMERS 1 110 #endif 111 #endif 112 113 /** 114 * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation. 115 * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers 116 * are still included, but the implementation is not. The following functions 117 * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(), 118 * sys_timeouts_mbox_fetch() 119 */ 120 #if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__ 121 #define LWIP_TIMERS_CUSTOM 0 122 #endif 123 /** 124 * @} 125 */ 126 127 /** 128 * @defgroup lwip_opts_memcpy memcpy 129 * @ingroup lwip_opts_infrastructure 130 * @{ 131 */ 132 /** 133 * MEMCPY: override this if you have a faster implementation at hand than the 134 * one included in your C library 135 */ 136 #if !defined MEMCPY || defined __DOXYGEN__ 137 #define MEMCPY(dst,src,len) memcpy(dst,src,len) 138 #endif 139 140 /** 141 * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a 142 * call to memcpy() if the length is known at compile time and is small. 143 */ 144 #if !defined SMEMCPY || defined __DOXYGEN__ 145 #define SMEMCPY(dst,src,len) memcpy(dst,src,len) 146 #endif 147 148 /** 149 * MEMMOVE: override this if you have a faster implementation at hand than the 150 * one included in your C library. lwIP currently uses MEMMOVE only when IPv6 151 * fragmentation support is enabled. 152 */ 153 #if !defined MEMMOVE || defined __DOXYGEN__ 154 #define MEMMOVE(dst,src,len) memmove(dst,src,len) 155 #endif 156 /** 157 * @} 158 */ 159 160 /* 161 ------------------------------------ 162 ----------- Core locking ----------- 163 ------------------------------------ 164 */ 165 /** 166 * @defgroup lwip_opts_lock Core locking and MPU 167 * @ingroup lwip_opts_infrastructure 168 * @{ 169 */ 170 /** 171 * LWIP_MPU_COMPATIBLE: enables special memory management mechanism 172 * which makes lwip able to work on MPU (Memory Protection Unit) system 173 * by not passing stack-pointers to other threads 174 * (this decreases performance as memory is allocated from pools instead 175 * of keeping it on the stack) 176 */ 177 #if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__ 178 #define LWIP_MPU_COMPATIBLE 0 179 #endif 180 181 /** 182 * LWIP_TCPIP_CORE_LOCKING 183 * Creates a global mutex that is held during TCPIP thread operations. 184 * Can be locked by client code to perform lwIP operations without changing 185 * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and 186 * UNLOCK_TCPIP_CORE(). 187 * Your system should provide mutexes supporting priority inversion to use this. 188 */ 189 #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ 190 #define LWIP_TCPIP_CORE_LOCKING 1 191 #endif 192 193 /** 194 * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, 195 * this lets tcpip_input() grab the mutex for input packets as well, 196 * instead of allocating a message and passing it to tcpip_thread. 197 * 198 * ATTENTION: this does not work when tcpip_input() is called from 199 * interrupt context! 200 */ 201 #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ 202 #define LWIP_TCPIP_CORE_LOCKING_INPUT 0 203 #endif 204 205 /** 206 * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt 207 * protection) for certain critical regions during buffer allocation, deallocation 208 * and memory allocation and deallocation. 209 * ATTENTION: This is required when using lwIP from more than one context! If 210 * you disable this, you must be sure what you are doing! 211 */ 212 #if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__ 213 #define SYS_LIGHTWEIGHT_PROT 1 214 #endif 215 /** 216 * @} 217 */ 218 219 /* 220 ------------------------------------ 221 ---------- Memory options ---------- 222 ------------------------------------ 223 */ 224 /** 225 * @defgroup lwip_opts_mem Heap and memory pools 226 * @ingroup lwip_opts_infrastructure 227 * @{ 228 */ 229 /** 230 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library 231 * instead of the lwip internal allocator. Can save code size if you 232 * already use it. 233 */ 234 #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ 235 #define MEM_LIBC_MALLOC 0 236 #endif 237 238 /** 239 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. 240 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution 241 * speed (heap alloc can be much slower than pool alloc) and usage from interrupts 242 * (especially if your netif driver allocates PBUF_POOL pbufs for received frames 243 * from interrupt)! 244 * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, 245 * not only for internal pools defined in memp_std.h)! 246 */ 247 #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ 248 #define MEMP_MEM_MALLOC 0 249 #endif 250 251 /** 252 * MEM_ALIGNMENT: should be set to the alignment of the CPU 253 * 4 byte alignment -> \#define MEM_ALIGNMENT 4 254 * 2 byte alignment -> \#define MEM_ALIGNMENT 2 255 */ 256 #if !defined MEM_ALIGNMENT || defined __DOXYGEN__ 257 #define MEM_ALIGNMENT 1 258 #endif 259 260 /** 261 * MEM_SIZE: the size of the heap memory. If the application will send 262 * a lot of data that needs to be copied, this should be set high. 263 */ 264 #if !defined MEM_SIZE || defined __DOXYGEN__ 265 #define MEM_SIZE 1600 266 #endif 267 268 /** 269 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable 270 * amount of bytes before and after each memp element in every pool and fills 271 * it with a prominent default value. 272 * MEMP_OVERFLOW_CHECK == 0 no checking 273 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed 274 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time 275 * memp_malloc() or memp_free() is called (useful but slow!) 276 */ 277 #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ 278 #define MEMP_OVERFLOW_CHECK 0 279 #endif 280 281 /** 282 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make 283 * sure that there are no cycles in the linked lists. 284 */ 285 #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ 286 #define MEMP_SANITY_CHECK 0 287 #endif 288 289 /** 290 * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set 291 * of memory pools of various sizes. When mem_malloc is called, an element of 292 * the smallest pool that can provide the length needed is returned. 293 * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. 294 */ 295 #if !defined MEM_USE_POOLS || defined __DOXYGEN__ 296 #define MEM_USE_POOLS 0 297 #endif 298 299 /** 300 * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next 301 * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more 302 * reliable. */ 303 #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ 304 #define MEM_USE_POOLS_TRY_BIGGER_POOL 0 305 #endif 306 307 /** 308 * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h 309 * that defines additional pools beyond the "standard" ones required 310 * by lwIP. If you set this to 1, you must have lwippools.h in your 311 * include path somewhere. 312 */ 313 #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ 314 #define MEMP_USE_CUSTOM_POOLS 0 315 #endif 316 317 /** 318 * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from 319 * interrupt context (or another context that doesn't allow waiting for a 320 * semaphore). 321 * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, 322 * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs 323 * with each loop so that mem_free can run. 324 * 325 * ATTENTION: As you can see from the above description, this leads to dis-/ 326 * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc 327 * can need longer. 328 * 329 * If you don't want that, at least for NO_SYS=0, you can still use the following 330 * functions to enqueue a deallocation call which then runs in the tcpip_thread 331 * context: 332 * - pbuf_free_callback(p); 333 * - mem_free_callback(m); 334 */ 335 #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ 336 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 337 #endif 338 /** 339 * @} 340 */ 341 342 /* 343 ------------------------------------------------ 344 ---------- Internal Memory Pool Sizes ---------- 345 ------------------------------------------------ 346 */ 347 /** 348 * @defgroup lwip_opts_memp Internal memory pools 349 * @ingroup lwip_opts_infrastructure 350 * @{ 351 */ 352 /** 353 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). 354 * If the application sends a lot of data out of ROM (or other static memory), 355 * this should be set high. 356 */ 357 #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ 358 #define MEMP_NUM_PBUF 16 359 #endif 360 361 /** 362 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs 363 * (requires the LWIP_RAW option) 364 */ 365 #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ 366 #define MEMP_NUM_RAW_PCB 4 367 #endif 368 369 /** 370 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 371 * per active UDP "connection". 372 * (requires the LWIP_UDP option) 373 */ 374 #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ 375 #define MEMP_NUM_UDP_PCB 4 376 #endif 377 378 /** 379 * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. 380 * (requires the LWIP_TCP option) 381 */ 382 #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ 383 #define MEMP_NUM_TCP_PCB 5 384 #endif 385 386 /** 387 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. 388 * (requires the LWIP_TCP option) 389 */ 390 #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ 391 #define MEMP_NUM_TCP_PCB_LISTEN 8 392 #endif 393 394 /** 395 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. 396 * (requires the LWIP_TCP option) 397 */ 398 #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ 399 #define MEMP_NUM_TCP_SEG 16 400 #endif 401 402 /** 403 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for 404 * reassembly (whole packets, not fragments!) 405 */ 406 #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ 407 #define MEMP_NUM_REASSDATA 5 408 #endif 409 410 /** 411 * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent 412 * (fragments, not whole packets!). 413 * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 414 * with DMA-enabled MACs where the packet is not yet sent when netif->output 415 * returns. 416 */ 417 #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ 418 #define MEMP_NUM_FRAG_PBUF 15 419 #endif 420 421 /** 422 * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing 423 * packets (pbufs) that are waiting for an ARP request (to resolve 424 * their destination address) to finish. 425 * (requires the ARP_QUEUEING option) 426 */ 427 #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ 428 #define MEMP_NUM_ARP_QUEUE 30 429 #endif 430 431 /** 432 * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces 433 * can be members at the same time (one per netif - allsystems group -, plus one 434 * per netif membership). 435 * (requires the LWIP_IGMP option) 436 */ 437 #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ 438 #define MEMP_NUM_IGMP_GROUP 8 439 #endif 440 441 /** 442 * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. 443 * The default number of timeouts is calculated here for all enabled modules. 444 * The formula expects settings to be either '0' or '1'. 445 */ 446 #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ 447 #define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) 448 #endif 449 450 /** 451 * MEMP_NUM_NETBUF: the number of struct netbufs. 452 * (only needed if you use the sequential API, like api_lib.c) 453 */ 454 #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ 455 #define MEMP_NUM_NETBUF 2 456 #endif 457 458 /** 459 * MEMP_NUM_NETCONN: the number of struct netconns. 460 * (only needed if you use the sequential API, like api_lib.c) 461 */ 462 #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ 463 #define MEMP_NUM_NETCONN 4 464 #endif 465 466 /** 467 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used 468 * for callback/timeout API communication. 469 * (only needed if you use tcpip.c) 470 */ 471 #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ 472 #define MEMP_NUM_TCPIP_MSG_API 8 473 #endif 474 475 /** 476 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used 477 * for incoming packets. 478 * (only needed if you use tcpip.c) 479 */ 480 #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ 481 #define MEMP_NUM_TCPIP_MSG_INPKT 8 482 #endif 483 484 /** 485 * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls 486 * (before freeing the corresponding memory using lwip_freeaddrinfo()). 487 */ 488 #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ 489 #define MEMP_NUM_NETDB 1 490 #endif 491 492 /** 493 * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list 494 * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. 495 */ 496 #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ 497 #define MEMP_NUM_LOCALHOSTLIST 1 498 #endif 499 500 /** 501 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 502 */ 503 #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ 504 #define PBUF_POOL_SIZE 16 505 #endif 506 507 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various 508 * socket, netconn, and tcpip functions 509 */ 510 #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ 511 #define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API 512 #endif 513 514 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname 515 */ 516 #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ 517 #define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API 518 #endif 519 520 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls 521 * to getsockopt/setsockopt 522 */ 523 #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ 524 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API 525 #endif 526 527 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the 528 * netifapi functions 529 */ 530 #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ 531 #define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API 532 #endif 533 /** 534 * @} 535 */ 536 537 /* 538 --------------------------------- 539 ---------- ARP options ---------- 540 --------------------------------- 541 */ 542 /** 543 * @defgroup lwip_opts_arp ARP 544 * @ingroup lwip_opts_ipv4 545 * @{ 546 */ 547 /** 548 * LWIP_ARP==1: Enable ARP functionality. 549 */ 550 #if !defined LWIP_ARP || defined __DOXYGEN__ 551 #define LWIP_ARP 1 552 #endif 553 554 /** 555 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. 556 */ 557 #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ 558 #define ARP_TABLE_SIZE 10 559 #endif 560 561 /** the time an ARP entry stays valid after its last update, 562 * for ARP_TMR_INTERVAL = 1000, this is 563 * (60 * 5) seconds = 5 minutes. 564 */ 565 #if !defined ARP_MAXAGE || defined __DOXYGEN__ 566 #define ARP_MAXAGE 300 567 #endif 568 569 /** 570 * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address 571 * resolution. By default, only the most recent packet is queued per IP address. 572 * This is sufficient for most protocols and mainly reduces TCP connection 573 * startup time. Set this to 1 if you know your application sends more than one 574 * packet in a row to an IP address that is not in the ARP cache. 575 */ 576 #if !defined ARP_QUEUEING || defined __DOXYGEN__ 577 #define ARP_QUEUEING 0 578 #endif 579 580 /** The maximum number of packets which may be queued for each 581 * unresolved address by other network layers. Defaults to 3, 0 means disabled. 582 * Old packets are dropped, new packets are queued. 583 */ 584 #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ 585 #define ARP_QUEUE_LEN 3 586 #endif 587 588 /** 589 * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with 590 * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and 591 * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. 592 * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. 593 * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. 594 * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. 595 * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) 596 * that returns 1 to accept a packet or 0 to drop a packet. 597 */ 598 #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ 599 #define ETHARP_SUPPORT_VLAN 0 600 #endif 601 602 /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled 603 */ 604 #if !defined LWIP_ETHERNET || defined __DOXYGEN__ 605 #define LWIP_ETHERNET LWIP_ARP 606 #endif 607 608 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure 609 * alignment of payload after that header. Since the header is 14 bytes long, 610 * without this padding e.g. addresses in the IP header will not be aligned 611 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. 612 */ 613 #if !defined ETH_PAD_SIZE || defined __DOXYGEN__ 614 #define ETH_PAD_SIZE 0 615 #endif 616 617 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table 618 * entries (using etharp_add_static_entry/etharp_remove_static_entry). 619 */ 620 #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ 621 #define ETHARP_SUPPORT_STATIC_ENTRIES 0 622 #endif 623 624 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. 625 * If disabled, duplicate IP address on multiple netifs are not supported 626 * (but this should only occur for AutoIP). 627 */ 628 #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ 629 #define ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF 630 #endif 631 /** 632 * @} 633 */ 634 635 /* 636 -------------------------------- 637 ---------- IP options ---------- 638 -------------------------------- 639 */ 640 /** 641 * @defgroup lwip_opts_ipv4 IPv4 642 * @ingroup lwip_opts 643 * @{ 644 */ 645 /** 646 * LWIP_IPV4==1: Enable IPv4 647 */ 648 #if !defined LWIP_IPV4 || defined __DOXYGEN__ 649 #define LWIP_IPV4 1 650 #endif 651 652 /** 653 * IP_FORWARD==1: Enables the ability to forward IP packets across network 654 * interfaces. If you are going to run lwIP on a device with only one network 655 * interface, define this to 0. 656 */ 657 #if !defined IP_FORWARD || defined __DOXYGEN__ 658 #define IP_FORWARD 0 659 #endif 660 661 /** 662 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that 663 * this option does not affect outgoing packet sizes, which can be controlled 664 * via IP_FRAG. 665 */ 666 #if !defined IP_REASSEMBLY || defined __DOXYGEN__ 667 #define IP_REASSEMBLY 1 668 #endif 669 670 /** 671 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note 672 * that this option does not affect incoming packet sizes, which can be 673 * controlled via IP_REASSEMBLY. 674 */ 675 #if !defined IP_FRAG || defined __DOXYGEN__ 676 #define IP_FRAG 1 677 #endif 678 679 #if !LWIP_IPV4 680 /* disable IPv4 extensions when IPv4 is disabled */ 681 #undef IP_FORWARD 682 #define IP_FORWARD 0 683 #undef IP_REASSEMBLY 684 #define IP_REASSEMBLY 0 685 #undef IP_FRAG 686 #define IP_FRAG 0 687 #endif /* !LWIP_IPV4 */ 688 689 /** 690 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. 691 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. 692 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). 693 */ 694 #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ 695 #define IP_OPTIONS_ALLOWED 1 696 #endif 697 698 /** 699 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) 700 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 701 * in this time, the whole packet is discarded. 702 */ 703 #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ 704 #define IP_REASS_MAXAGE 3 705 #endif 706 707 /** 708 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. 709 * Since the received pbufs are enqueued, be sure to configure 710 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive 711 * packets even if the maximum amount of fragments is enqueued for reassembly! 712 */ 713 #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ 714 #define IP_REASS_MAX_PBUFS 10 715 #endif 716 717 /** 718 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. 719 */ 720 #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ 721 #define IP_DEFAULT_TTL 255 722 #endif 723 724 /** 725 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast 726 * filter per pcb on udp and raw send operations. To enable broadcast filter 727 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. 728 */ 729 #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ 730 #define IP_SOF_BROADCAST 0 731 #endif 732 733 /** 734 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast 735 * filter on recv operations. 736 */ 737 #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ 738 #define IP_SOF_BROADCAST_RECV 0 739 #endif 740 741 /** 742 * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back 743 * out on the netif where it was received. This should only be used for 744 * wireless networks. 745 * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming 746 * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! 747 */ 748 #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ 749 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 750 #endif 751 752 /** 753 * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first 754 * local TCP/UDP pcb (default==0). This can prevent creating predictable port 755 * numbers after booting a device. 756 */ 757 #if !defined LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS || defined __DOXYGEN__ 758 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0 759 #endif 760 /** 761 * @} 762 */ 763 764 /* 765 ---------------------------------- 766 ---------- ICMP options ---------- 767 ---------------------------------- 768 */ 769 /** 770 * @defgroup lwip_opts_icmp ICMP 771 * @ingroup lwip_opts_ipv4 772 * @{ 773 */ 774 /** 775 * LWIP_ICMP==1: Enable ICMP module inside the IP stack. 776 * Be careful, disable that make your product non-compliant to RFC1122 777 */ 778 #if !defined LWIP_ICMP || defined __DOXYGEN__ 779 #define LWIP_ICMP 1 780 #endif 781 782 /** 783 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. 784 */ 785 #if !defined ICMP_TTL || defined __DOXYGEN__ 786 #define ICMP_TTL (IP_DEFAULT_TTL) 787 #endif 788 789 /** 790 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) 791 */ 792 #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ 793 #define LWIP_BROADCAST_PING 0 794 #endif 795 796 /** 797 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) 798 */ 799 #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ 800 #define LWIP_MULTICAST_PING 0 801 #endif 802 /** 803 * @} 804 */ 805 806 /* 807 --------------------------------- 808 ---------- RAW options ---------- 809 --------------------------------- 810 */ 811 /** 812 * @defgroup lwip_opts_raw RAW 813 * @ingroup lwip_opts_callback 814 * @{ 815 */ 816 /** 817 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 818 */ 819 #if !defined LWIP_RAW || defined __DOXYGEN__ 820 #define LWIP_RAW 0 821 #endif 822 823 /** 824 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 825 */ 826 #if !defined RAW_TTL || defined __DOXYGEN__ 827 #define RAW_TTL (IP_DEFAULT_TTL) 828 #endif 829 /** 830 * @} 831 */ 832 833 /* 834 ---------------------------------- 835 ---------- DHCP options ---------- 836 ---------------------------------- 837 */ 838 /** 839 * @defgroup lwip_opts_dhcp DHCP 840 * @ingroup lwip_opts_ipv4 841 * @{ 842 */ 843 /** 844 * LWIP_DHCP==1: Enable DHCP module. 845 */ 846 #if !defined LWIP_DHCP || defined __DOXYGEN__ 847 #define LWIP_DHCP 0 848 #endif 849 #if !LWIP_IPV4 850 /* disable DHCP when IPv4 is disabled */ 851 #undef LWIP_DHCP 852 #define LWIP_DHCP 0 853 #endif /* !LWIP_IPV4 */ 854 855 /** 856 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. 857 */ 858 #if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__ 859 #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) 860 #endif 861 862 /** 863 * LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has 864 * NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and 865 * netif drivers might not set this flag, the default is off. If enabled, 866 * netif_set_link_up() must be called to continue dhcp starting. 867 */ 868 #if !defined LWIP_DHCP_CHECK_LINK_UP 869 #define LWIP_DHCP_CHECK_LINK_UP 0 870 #endif 871 872 /** 873 * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. 874 */ 875 #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ 876 #define LWIP_DHCP_BOOTP_FILE 0 877 #endif 878 879 /** 880 * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each 881 * response packet, an callback is called, which has to be provided by the port: 882 * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 883 */ 884 #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ 885 #define LWIP_DHCP_GET_NTP_SRV 0 886 #endif 887 888 /** 889 * The maximum of NTP servers requested 890 */ 891 #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ 892 #define LWIP_DHCP_MAX_NTP_SERVERS 1 893 #endif 894 895 /** 896 * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. 897 * DHCP servers received in the response are passed to DNS via @ref dns_setserver() 898 * (up to the maximum limit defined here). 899 */ 900 #if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__ 901 #define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS 902 #endif 903 /** 904 * @} 905 */ 906 907 /* 908 ------------------------------------ 909 ---------- AUTOIP options ---------- 910 ------------------------------------ 911 */ 912 /** 913 * @defgroup lwip_opts_autoip AUTOIP 914 * @ingroup lwip_opts_ipv4 915 * @{ 916 */ 917 /** 918 * LWIP_AUTOIP==1: Enable AUTOIP module. 919 */ 920 #if !defined LWIP_AUTOIP || defined __DOXYGEN__ 921 #define LWIP_AUTOIP 0 922 #endif 923 #if !LWIP_IPV4 924 /* disable AUTOIP when IPv4 is disabled */ 925 #undef LWIP_AUTOIP 926 #define LWIP_AUTOIP 0 927 #endif /* !LWIP_IPV4 */ 928 929 /** 930 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on 931 * the same interface at the same time. 932 */ 933 #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ 934 #define LWIP_DHCP_AUTOIP_COOP 0 935 #endif 936 937 /** 938 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes 939 * that should be sent before falling back on AUTOIP (the DHCP client keeps 940 * running in this case). This can be set as low as 1 to get an AutoIP address 941 * very quickly, but you should be prepared to handle a changing IP address 942 * when DHCP overrides AutoIP. 943 */ 944 #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ 945 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9 946 #endif 947 /** 948 * @} 949 */ 950 951 /* 952 ---------------------------------- 953 ----- SNMP MIB2 support ----- 954 ---------------------------------- 955 */ 956 /** 957 * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks 958 * @ingroup lwip_opts_infrastructure 959 * @{ 960 */ 961 /** 962 * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. 963 * Turn this on to get callbacks needed to implement MIB2. 964 * Usually MIB2_STATS should be enabled, too. 965 */ 966 #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ 967 #define LWIP_MIB2_CALLBACKS 0 968 #endif 969 /** 970 * @} 971 */ 972 973 /* 974 ---------------------------------- 975 -------- Multicast options ------- 976 ---------------------------------- 977 */ 978 /** 979 * @defgroup lwip_opts_multicast Multicast 980 * @ingroup lwip_opts_infrastructure 981 * @{ 982 */ 983 /** 984 * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options 985 * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only) 986 * core support for the corresponding IPv6 options. 987 */ 988 #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ 989 #define LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW)) 990 #endif 991 /** 992 * @} 993 */ 994 995 /* 996 ---------------------------------- 997 ---------- IGMP options ---------- 998 ---------------------------------- 999 */ 1000 /** 1001 * @defgroup lwip_opts_igmp IGMP 1002 * @ingroup lwip_opts_ipv4 1003 * @{ 1004 */ 1005 /** 1006 * LWIP_IGMP==1: Turn on IGMP module. 1007 */ 1008 #if !defined LWIP_IGMP || defined __DOXYGEN__ 1009 #define LWIP_IGMP 0 1010 #endif 1011 #if !LWIP_IPV4 1012 #undef LWIP_IGMP 1013 #define LWIP_IGMP 0 1014 #endif 1015 /** 1016 * @} 1017 */ 1018 1019 /* 1020 ---------------------------------- 1021 ---------- DNS options ----------- 1022 ---------------------------------- 1023 */ 1024 /** 1025 * @defgroup lwip_opts_dns DNS 1026 * @ingroup lwip_opts_callback 1027 * @{ 1028 */ 1029 /** 1030 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS 1031 * transport. 1032 */ 1033 #if !defined LWIP_DNS || defined __DOXYGEN__ 1034 #define LWIP_DNS 0 1035 #endif 1036 1037 /** DNS maximum number of entries to maintain locally. */ 1038 #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ 1039 #define DNS_TABLE_SIZE 4 1040 #endif 1041 1042 /** DNS maximum host name length supported in the name table. */ 1043 #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ 1044 #define DNS_MAX_NAME_LENGTH 256 1045 #endif 1046 1047 /** The maximum of DNS servers 1048 * The first server can be initialized automatically by defining 1049 * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' 1050 */ 1051 #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ 1052 #define DNS_MAX_SERVERS 2 1053 #endif 1054 1055 /** DNS do a name checking between the query and the response. */ 1056 #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ 1057 #define DNS_DOES_NAME_CHECK 1 1058 #endif 1059 1060 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation 1061 * Use all DNS security features by default. 1062 * This is overridable but should only be needed by very small targets 1063 * or when using against non standard DNS servers. */ 1064 #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ 1065 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) 1066 #endif 1067 1068 /* A list of DNS security features follows */ 1069 #define LWIP_DNS_SECURE_RAND_XID 1 1070 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 1071 #define LWIP_DNS_SECURE_RAND_SRC_PORT 4 1072 1073 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: 1074 * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ 1075 * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} 1076 * 1077 * Instead, you can also use an external function: 1078 * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) 1079 * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). 1080 */ 1081 #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ 1082 #define DNS_LOCAL_HOSTLIST 0 1083 #endif /* DNS_LOCAL_HOSTLIST */ 1084 1085 /** If this is turned on, the local host-list can be dynamically changed 1086 * at runtime. */ 1087 #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ 1088 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 1089 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ 1090 1091 /** Set this to 1 to enable querying ".local" names via mDNS 1092 * using a One-Shot Multicast DNS Query */ 1093 #if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__ 1094 #define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 1095 #endif 1096 /** 1097 * @} 1098 */ 1099 1100 /* 1101 --------------------------------- 1102 ---------- UDP options ---------- 1103 --------------------------------- 1104 */ 1105 /** 1106 * @defgroup lwip_opts_udp UDP 1107 * @ingroup lwip_opts_callback 1108 * @{ 1109 */ 1110 /** 1111 * LWIP_UDP==1: Turn on UDP. 1112 */ 1113 #if !defined LWIP_UDP || defined __DOXYGEN__ 1114 #define LWIP_UDP 1 1115 #endif 1116 1117 /** 1118 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) 1119 */ 1120 #if !defined LWIP_UDPLITE || defined __DOXYGEN__ 1121 #define LWIP_UDPLITE 0 1122 #endif 1123 1124 /** 1125 * UDP_TTL: Default Time-To-Live value. 1126 */ 1127 #if !defined UDP_TTL || defined __DOXYGEN__ 1128 #define UDP_TTL (IP_DEFAULT_TTL) 1129 #endif 1130 1131 /** 1132 * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. 1133 */ 1134 #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ 1135 #define LWIP_NETBUF_RECVINFO 0 1136 #endif 1137 /** 1138 * @} 1139 */ 1140 1141 /* 1142 --------------------------------- 1143 ---------- TCP options ---------- 1144 --------------------------------- 1145 */ 1146 /** 1147 * @defgroup lwip_opts_tcp TCP 1148 * @ingroup lwip_opts_callback 1149 * @{ 1150 */ 1151 /** 1152 * LWIP_TCP==1: Turn on TCP. 1153 */ 1154 #if !defined LWIP_TCP || defined __DOXYGEN__ 1155 #define LWIP_TCP 1 1156 #endif 1157 1158 /** 1159 * TCP_TTL: Default Time-To-Live value. 1160 */ 1161 #if !defined TCP_TTL || defined __DOXYGEN__ 1162 #define TCP_TTL (IP_DEFAULT_TTL) 1163 #endif 1164 1165 /** 1166 * TCP_WND: The size of a TCP window. This must be at least 1167 * (2 * TCP_MSS) for things to work well. 1168 * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size 1169 * with scaling applied. Maximum window value in the TCP header 1170 * will be TCP_WND >> TCP_RCV_SCALE 1171 */ 1172 #if !defined TCP_WND || defined __DOXYGEN__ 1173 #define TCP_WND (4 * TCP_MSS) 1174 #endif 1175 1176 /** 1177 * TCP_MAXRTX: Maximum number of retransmissions of data segments. 1178 */ 1179 #if !defined TCP_MAXRTX || defined __DOXYGEN__ 1180 #define TCP_MAXRTX 12 1181 #endif 1182 1183 /** 1184 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. 1185 */ 1186 #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ 1187 #define TCP_SYNMAXRTX 6 1188 #endif 1189 1190 /** 1191 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. 1192 * Define to 0 if your device is low on memory. 1193 */ 1194 #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ 1195 #define TCP_QUEUE_OOSEQ (LWIP_TCP) 1196 #endif 1197 1198 /** 1199 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, 1200 * you might want to increase this.) 1201 * For the receive side, this MSS is advertised to the remote side 1202 * when opening a connection. For the transmit size, this MSS sets 1203 * an upper limit on the MSS advertised by the remote host. 1204 */ 1205 #if !defined TCP_MSS || defined __DOXYGEN__ 1206 #define TCP_MSS 536 1207 #endif 1208 1209 /** 1210 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really 1211 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which 1212 * reflects the available reassembly buffer size at the remote host) and the 1213 * largest size permitted by the IP layer" (RFC 1122) 1214 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the 1215 * netif used for a connection and limits the MSS if it would be too big otherwise. 1216 */ 1217 #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ 1218 #define TCP_CALCULATE_EFF_SEND_MSS 1 1219 #endif 1220 1221 1222 /** 1223 * TCP_SND_BUF: TCP sender buffer space (bytes). 1224 * To achieve good performance, this should be at least 2 * TCP_MSS. 1225 */ 1226 #if !defined TCP_SND_BUF || defined __DOXYGEN__ 1227 #define TCP_SND_BUF (2 * TCP_MSS) 1228 #endif 1229 1230 /** 1231 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least 1232 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. 1233 */ 1234 #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ 1235 #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) 1236 #endif 1237 1238 /** 1239 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than 1240 * TCP_SND_BUF. It is the amount of space which must be available in the 1241 * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). 1242 */ 1243 #if !defined TCP_SNDLOWAT || defined __DOXYGEN__ 1244 #define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) 1245 #endif 1246 1247 /** 1248 * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less 1249 * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below 1250 * this number, select returns writable (combined with TCP_SNDLOWAT). 1251 */ 1252 #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ 1253 #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) 1254 #endif 1255 1256 /** 1257 * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb. 1258 * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. 1259 */ 1260 #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ 1261 #define TCP_OOSEQ_MAX_BYTES 0 1262 #endif 1263 1264 /** 1265 * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb. 1266 * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. 1267 */ 1268 #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ 1269 #define TCP_OOSEQ_MAX_PBUFS 0 1270 #endif 1271 1272 /** 1273 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. 1274 */ 1275 #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ 1276 #define TCP_LISTEN_BACKLOG 0 1277 #endif 1278 1279 /** 1280 * The maximum allowed backlog for TCP listen netconns. 1281 * This backlog is used unless another is explicitly specified. 1282 * 0xff is the maximum (u8_t). 1283 */ 1284 #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ 1285 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff 1286 #endif 1287 1288 /** 1289 * TCP_OVERSIZE: The maximum number of bytes that tcp_write may 1290 * allocate ahead of time in an attempt to create shorter pbuf chains 1291 * for transmission. The meaningful range is 0 to TCP_MSS. Some 1292 * suggested values are: 1293 * 1294 * 0: Disable oversized allocation. Each tcp_write() allocates a new 1295 pbuf (old behaviour). 1296 * 1: Allocate size-aligned pbufs with minimal excess. Use this if your 1297 * scatter-gather DMA requires aligned fragments. 1298 * 128: Limit the pbuf/memory overhead to 20%. 1299 * TCP_MSS: Try to create unfragmented TCP packets. 1300 * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. 1301 */ 1302 #if !defined TCP_OVERSIZE || defined __DOXYGEN__ 1303 #define TCP_OVERSIZE TCP_MSS 1304 #endif 1305 1306 /** 1307 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. 1308 * The timestamp option is currently only used to help remote hosts, it is not 1309 * really used locally. Therefore, it is only enabled when a TS option is 1310 * received in the initial SYN packet from a remote host. 1311 */ 1312 #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ 1313 #define LWIP_TCP_TIMESTAMPS 0 1314 #endif 1315 1316 /** 1317 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an 1318 * explicit window update 1319 */ 1320 #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ 1321 #define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) 1322 #endif 1323 1324 /** 1325 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. 1326 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all 1327 * events (accept, sent, etc) that happen in the system. 1328 * LWIP_CALLBACK_API==1: The PCB callback function is called directly 1329 * for the event. This is the default. 1330 */ 1331 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ 1332 #define LWIP_EVENT_API 0 1333 #define LWIP_CALLBACK_API 1 1334 #else 1335 #ifndef LWIP_EVENT_API 1336 #define LWIP_EVENT_API 0 1337 #endif 1338 #ifndef LWIP_CALLBACK_API 1339 #define LWIP_CALLBACK_API 0 1340 #endif 1341 #endif 1342 1343 /** 1344 * LWIP_WND_SCALE and TCP_RCV_SCALE: 1345 * Set LWIP_WND_SCALE to 1 to enable window scaling. 1346 * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the 1347 * range of [0..14]). 1348 * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large 1349 * send window while having a small receive window only. 1350 */ 1351 #if !defined LWIP_WND_SCALE || defined __DOXYGEN__ 1352 #define LWIP_WND_SCALE 0 1353 #define TCP_RCV_SCALE 0 1354 #endif 1355 /** 1356 * @} 1357 */ 1358 1359 /* 1360 ---------------------------------- 1361 ---------- Pbuf options ---------- 1362 ---------------------------------- 1363 */ 1364 /** 1365 * @defgroup lwip_opts_pbuf PBUF 1366 * @ingroup lwip_opts 1367 * @{ 1368 */ 1369 /** 1370 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a 1371 * link level header. The default is 14, the standard value for 1372 * Ethernet. 1373 */ 1374 #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ 1375 #if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__ 1376 #define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) 1377 #else /* LWIP_HOOK_VLAN_SET */ 1378 #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) 1379 #endif /* LWIP_HOOK_VLAN_SET */ 1380 #endif 1381 1382 /** 1383 * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated 1384 * for an additional encapsulation header before ethernet headers (e.g. 802.11) 1385 */ 1386 #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ 1387 #define PBUF_LINK_ENCAPSULATION_HLEN 0u 1388 #endif 1389 1390 /** 1391 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is 1392 * designed to accommodate single full size TCP frame in one pbuf, including 1393 * TCP_MSS, IP header, and link header. 1394 */ 1395 #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ 1396 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) 1397 #endif 1398 1399 /** 1400 * LWIP_PBUF_REF_T: Refcount type in pbuf. 1401 * Default width of u8_t can be increased if 255 refs are not enough for you. 1402 */ 1403 #ifndef LWIP_PBUF_REF_T 1404 #define LWIP_PBUF_REF_T u8_t 1405 #endif 1406 /** 1407 * @} 1408 */ 1409 1410 /* 1411 ------------------------------------------------ 1412 ---------- Network Interfaces options ---------- 1413 ------------------------------------------------ 1414 */ 1415 /** 1416 * @defgroup lwip_opts_netif NETIF 1417 * @ingroup lwip_opts 1418 * @{ 1419 */ 1420 /** 1421 * LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for 1422 * small real-life targets. Some code like routing etc. can be left out. 1423 */ 1424 #if !defined LWIP_SINGLE_NETIF || defined __DOXYGEN__ 1425 #define LWIP_SINGLE_NETIF 0 1426 #endif 1427 1428 /** 1429 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname 1430 * field. 1431 */ 1432 #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ 1433 #define LWIP_NETIF_HOSTNAME 0 1434 #endif 1435 1436 /** 1437 * LWIP_NETIF_API==1: Support netif api (in netifapi.c) 1438 */ 1439 #if !defined LWIP_NETIF_API || defined __DOXYGEN__ 1440 #define LWIP_NETIF_API 0 1441 #endif 1442 1443 /** 1444 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface 1445 * changes its up/down status (i.e., due to DHCP IP acquisition) 1446 */ 1447 #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ 1448 #define LWIP_NETIF_STATUS_CALLBACK 0 1449 #endif 1450 1451 /** 1452 * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function 1453 * for several netif related event that supports multiple subscribers. 1454 * @see netif_ext_status_callback 1455 */ 1456 #if !defined LWIP_NETIF_EXT_STATUS_CALLBACK || defined __DOXYGEN__ 1457 #define LWIP_NETIF_EXT_STATUS_CALLBACK 0 1458 #endif 1459 1460 /** 1461 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface 1462 * whenever the link changes (i.e., link down) 1463 */ 1464 #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ 1465 #define LWIP_NETIF_LINK_CALLBACK 0 1466 #endif 1467 1468 /** 1469 * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called 1470 * when a netif has been removed 1471 */ 1472 #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ 1473 #define LWIP_NETIF_REMOVE_CALLBACK 0 1474 #endif 1475 1476 /** 1477 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table 1478 * indices) in struct netif. TCP and UDP can make use of this to prevent 1479 * scanning the ARP table for every sent packet. While this is faster for big 1480 * ARP tables or many concurrent connections, it might be counterproductive 1481 * if you have a tiny ARP table or if there never are concurrent connections. 1482 */ 1483 #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ 1484 #define LWIP_NETIF_HWADDRHINT 0 1485 #endif 1486 1487 /** 1488 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data 1489 * to be sent into one single pbuf. This is for compatibility with DMA-enabled 1490 * MACs that do not support scatter-gather. 1491 * Beware that this might involve CPU-memcpy before transmitting that would not 1492 * be needed without this flag! Use this only if you need to! 1493 * 1494 * @todo: TCP and IP-frag do not work with this, yet: 1495 */ 1496 #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ 1497 #define LWIP_NETIF_TX_SINGLE_PBUF 0 1498 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */ 1499 1500 /** 1501 * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store 1502 * data in client_data member array of struct netif. 1503 */ 1504 #if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__ 1505 #define LWIP_NUM_NETIF_CLIENT_DATA 0 1506 #endif 1507 /** 1508 * @} 1509 */ 1510 1511 /* 1512 ------------------------------------ 1513 ---------- LOOPIF options ---------- 1514 ------------------------------------ 1515 */ 1516 /** 1517 * @defgroup lwip_opts_loop Loopback interface 1518 * @ingroup lwip_opts_netif 1519 * @{ 1520 */ 1521 /** 1522 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). 1523 * This is only needed when no real netifs are available. If at least one other 1524 * netif is available, loopback traffic uses this netif. 1525 */ 1526 #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ 1527 #define LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF) 1528 #endif 1529 1530 /** 1531 * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). 1532 */ 1533 #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ 1534 #define LWIP_LOOPIF_MULTICAST 0 1535 #endif 1536 1537 /** 1538 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP 1539 * address equal to the netif IP address, looping them back up the stack. 1540 */ 1541 #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ 1542 #define LWIP_NETIF_LOOPBACK 0 1543 #endif 1544 1545 /** 1546 * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback 1547 * sending for each netif (0 = disabled) 1548 */ 1549 #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ 1550 #define LWIP_LOOPBACK_MAX_PBUFS 0 1551 #endif 1552 1553 /** 1554 * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in 1555 * the system, as netifs must change how they behave depending on this setting 1556 * for the LWIP_NETIF_LOOPBACK option to work. 1557 * Setting this is needed to avoid reentering non-reentrant functions like 1558 * tcp_input(). 1559 * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a 1560 * multithreaded environment like tcpip.c. In this case, netif->input() 1561 * is called directly. 1562 * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. 1563 * The packets are put on a list and netif_poll() must be called in 1564 * the main application loop. 1565 */ 1566 #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ 1567 #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) 1568 #endif 1569 /** 1570 * @} 1571 */ 1572 1573 /* 1574 ------------------------------------ 1575 ---------- Thread options ---------- 1576 ------------------------------------ 1577 */ 1578 /** 1579 * @defgroup lwip_opts_thread Threading 1580 * @ingroup lwip_opts_infrastructure 1581 * @{ 1582 */ 1583 /** 1584 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. 1585 */ 1586 #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ 1587 #define TCPIP_THREAD_NAME "tcpip_thread" 1588 #endif 1589 1590 /** 1591 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. 1592 * The stack size value itself is platform-dependent, but is passed to 1593 * sys_thread_new() when the thread is created. 1594 */ 1595 #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ 1596 #define TCPIP_THREAD_STACKSIZE 0 1597 #endif 1598 1599 /** 1600 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. 1601 * The priority value itself is platform-dependent, but is passed to 1602 * sys_thread_new() when the thread is created. 1603 */ 1604 #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ 1605 #define TCPIP_THREAD_PRIO 1 1606 #endif 1607 1608 /** 1609 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages 1610 * The queue size value itself is platform-dependent, but is passed to 1611 * sys_mbox_new() when tcpip_init is called. 1612 */ 1613 #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ 1614 #define TCPIP_MBOX_SIZE 0 1615 #endif 1616 1617 /** 1618 * Define this to something that triggers a watchdog. This is called from 1619 * tcpip_thread after processing a message. 1620 */ 1621 #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ 1622 #define LWIP_TCPIP_THREAD_ALIVE() 1623 #endif 1624 1625 /** 1626 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. 1627 */ 1628 #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ 1629 #define SLIPIF_THREAD_NAME "slipif_loop" 1630 #endif 1631 1632 /** 1633 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. 1634 * The stack size value itself is platform-dependent, but is passed to 1635 * sys_thread_new() when the thread is created. 1636 */ 1637 #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ 1638 #define SLIPIF_THREAD_STACKSIZE 0 1639 #endif 1640 1641 /** 1642 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. 1643 * The priority value itself is platform-dependent, but is passed to 1644 * sys_thread_new() when the thread is created. 1645 */ 1646 #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ 1647 #define SLIPIF_THREAD_PRIO 1 1648 #endif 1649 1650 /** 1651 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. 1652 */ 1653 #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ 1654 #define DEFAULT_THREAD_NAME "lwIP" 1655 #endif 1656 1657 /** 1658 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. 1659 * The stack size value itself is platform-dependent, but is passed to 1660 * sys_thread_new() when the thread is created. 1661 */ 1662 #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ 1663 #define DEFAULT_THREAD_STACKSIZE 0 1664 #endif 1665 1666 /** 1667 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. 1668 * The priority value itself is platform-dependent, but is passed to 1669 * sys_thread_new() when the thread is created. 1670 */ 1671 #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ 1672 #define DEFAULT_THREAD_PRIO 1 1673 #endif 1674 1675 /** 1676 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1677 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed 1678 * to sys_mbox_new() when the recvmbox is created. 1679 */ 1680 #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ 1681 #define DEFAULT_RAW_RECVMBOX_SIZE 0 1682 #endif 1683 1684 /** 1685 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1686 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed 1687 * to sys_mbox_new() when the recvmbox is created. 1688 */ 1689 #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ 1690 #define DEFAULT_UDP_RECVMBOX_SIZE 0 1691 #endif 1692 1693 /** 1694 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1695 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed 1696 * to sys_mbox_new() when the recvmbox is created. 1697 */ 1698 #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ 1699 #define DEFAULT_TCP_RECVMBOX_SIZE 0 1700 #endif 1701 1702 /** 1703 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. 1704 * The queue size value itself is platform-dependent, but is passed to 1705 * sys_mbox_new() when the acceptmbox is created. 1706 */ 1707 #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ 1708 #define DEFAULT_ACCEPTMBOX_SIZE 0 1709 #endif 1710 /** 1711 * @} 1712 */ 1713 1714 /* 1715 ---------------------------------------------- 1716 ---------- Sequential layer options ---------- 1717 ---------------------------------------------- 1718 */ 1719 /** 1720 * @defgroup lwip_opts_netconn Netconn 1721 * @ingroup lwip_opts_threadsafe_apis 1722 * @{ 1723 */ 1724 /** 1725 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) 1726 */ 1727 #if !defined LWIP_NETCONN || defined __DOXYGEN__ 1728 #define LWIP_NETCONN 1 1729 #endif 1730 1731 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create 1732 * timers running in tcpip_thread from another thread. 1733 */ 1734 #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ 1735 #define LWIP_TCPIP_TIMEOUT 0 1736 #endif 1737 1738 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per 1739 * thread calling socket/netconn functions instead of allocating one 1740 * semaphore per netconn (and per select etc.) 1741 * ATTENTION: a thread-local semaphore for API calls is needed: 1742 * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* 1743 * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore 1744 * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore 1745 * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). 1746 * Ports may call these for threads created with sys_thread_new(). 1747 */ 1748 #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ 1749 #define LWIP_NETCONN_SEM_PER_THREAD 0 1750 #endif 1751 1752 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, 1753 * writing from a 2nd thread and closing from a 3rd thread at the same time. 1754 * ATTENTION: This is currently really alpha! Some requirements: 1755 * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from 1756 * multiple threads at once 1757 * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox 1758 * and prevent a task pending on this during/after deletion 1759 */ 1760 #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ 1761 #define LWIP_NETCONN_FULLDUPLEX 0 1762 #endif 1763 /** 1764 * @} 1765 */ 1766 1767 /* 1768 ------------------------------------ 1769 ---------- Socket options ---------- 1770 ------------------------------------ 1771 */ 1772 /** 1773 * @defgroup lwip_opts_socket Sockets 1774 * @ingroup lwip_opts_threadsafe_apis 1775 * @{ 1776 */ 1777 /** 1778 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) 1779 */ 1780 #if !defined LWIP_SOCKET || defined __DOXYGEN__ 1781 #define LWIP_SOCKET 1 1782 #endif 1783 1784 /** LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete 1785 * successfully, as required by POSIX. Default is POSIX-compliant. 1786 */ 1787 #if !defined LWIP_SOCKET_SET_ERRNO || defined __DOXYGEN__ 1788 #define LWIP_SOCKET_SET_ERRNO 1 1789 #endif 1790 1791 /** 1792 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. 1793 * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. 1794 * While this helps code completion, it might conflict with existing libraries. 1795 * (only used if you use sockets.c) 1796 */ 1797 #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ 1798 #define LWIP_COMPAT_SOCKETS 1 1799 #endif 1800 1801 /** 1802 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. 1803 * Disable this option if you use a POSIX operating system that uses the same 1804 * names (read, write & close). (only used if you use sockets.c) 1805 */ 1806 #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ 1807 #define LWIP_POSIX_SOCKETS_IO_NAMES 1 1808 #endif 1809 1810 /** 1811 * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. 1812 * This can be useful when there are multiple APIs which create file descriptors. 1813 * When they all start with a different offset and you won't make them overlap you can 1814 * re implement read/write/close/ioctl/fnctl to send the requested action to the right 1815 * library (sharing select will need more work though). 1816 */ 1817 #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ 1818 #define LWIP_SOCKET_OFFSET 0 1819 #endif 1820 1821 /** 1822 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT 1823 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set 1824 * in seconds. (does not require sockets.c, and will affect tcp.c) 1825 */ 1826 #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ 1827 #define LWIP_TCP_KEEPALIVE 0 1828 #endif 1829 1830 /** 1831 * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and 1832 * SO_SNDTIMEO processing. 1833 */ 1834 #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ 1835 #define LWIP_SO_SNDTIMEO 0 1836 #endif 1837 1838 /** 1839 * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and 1840 * SO_RCVTIMEO processing. 1841 */ 1842 #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ 1843 #define LWIP_SO_RCVTIMEO 0 1844 #endif 1845 1846 /** 1847 * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int 1848 * (milliseconds, much like winsock does) instead of a struct timeval (default). 1849 */ 1850 #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ 1851 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 1852 #endif 1853 1854 /** 1855 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. 1856 */ 1857 #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ 1858 #define LWIP_SO_RCVBUF 0 1859 #endif 1860 1861 /** 1862 * LWIP_SO_LINGER==1: Enable SO_LINGER processing. 1863 */ 1864 #if !defined LWIP_SO_LINGER || defined __DOXYGEN__ 1865 #define LWIP_SO_LINGER 0 1866 #endif 1867 1868 /** 1869 * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. 1870 */ 1871 #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ 1872 #define RECV_BUFSIZE_DEFAULT INT_MAX 1873 #endif 1874 1875 /** 1876 * By default, TCP socket/netconn close waits 20 seconds max to send the FIN 1877 */ 1878 #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ 1879 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 1880 #endif 1881 1882 /** 1883 * SO_REUSE==1: Enable SO_REUSEADDR option. 1884 */ 1885 #if !defined SO_REUSE || defined __DOXYGEN__ 1886 #define SO_REUSE 0 1887 #endif 1888 1889 /** 1890 * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets 1891 * to all local matches if SO_REUSEADDR is turned on. 1892 * WARNING: Adds a memcpy for every packet if passing to more than one pcb! 1893 */ 1894 #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ 1895 #define SO_REUSE_RXTOALL 0 1896 #endif 1897 1898 /** 1899 * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of 1900 * pending data in the network buffer. This is the way windows does it. It's 1901 * the default for lwIP since it is smaller. 1902 * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next 1903 * pending datagram in bytes. This is the way linux does it. This code is only 1904 * here for compatibility. 1905 */ 1906 #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ 1907 #define LWIP_FIONREAD_LINUXMODE 0 1908 #endif 1909 1910 /** 1911 * LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn 1912 * callback to keep track of events). 1913 * This saves RAM (counters per socket) and code (netconn event callback), which 1914 * should improve performance a bit). 1915 */ 1916 #if !defined LWIP_SOCKET_SELECT || defined __DOXYGEN__ 1917 #define LWIP_SOCKET_SELECT 1 1918 #endif 1919 /** 1920 * @} 1921 */ 1922 1923 /* 1924 ---------------------------------------- 1925 ---------- Statistics options ---------- 1926 ---------------------------------------- 1927 */ 1928 /** 1929 * @defgroup lwip_opts_stats Statistics 1930 * @ingroup lwip_opts_debug 1931 * @{ 1932 */ 1933 /** 1934 * LWIP_STATS==1: Enable statistics collection in lwip_stats. 1935 */ 1936 #if !defined LWIP_STATS || defined __DOXYGEN__ 1937 #define LWIP_STATS 1 1938 #endif 1939 1940 #if LWIP_STATS 1941 1942 /** 1943 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. 1944 */ 1945 #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ 1946 #define LWIP_STATS_DISPLAY 0 1947 #endif 1948 1949 /** 1950 * LINK_STATS==1: Enable link stats. 1951 */ 1952 #if !defined LINK_STATS || defined __DOXYGEN__ 1953 #define LINK_STATS 1 1954 #endif 1955 1956 /** 1957 * ETHARP_STATS==1: Enable etharp stats. 1958 */ 1959 #if !defined ETHARP_STATS || defined __DOXYGEN__ 1960 #define ETHARP_STATS (LWIP_ARP) 1961 #endif 1962 1963 /** 1964 * IP_STATS==1: Enable IP stats. 1965 */ 1966 #if !defined IP_STATS || defined __DOXYGEN__ 1967 #define IP_STATS 1 1968 #endif 1969 1970 /** 1971 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is 1972 * on if using either frag or reass. 1973 */ 1974 #if !defined IPFRAG_STATS || defined __DOXYGEN__ 1975 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) 1976 #endif 1977 1978 /** 1979 * ICMP_STATS==1: Enable ICMP stats. 1980 */ 1981 #if !defined ICMP_STATS || defined __DOXYGEN__ 1982 #define ICMP_STATS 1 1983 #endif 1984 1985 /** 1986 * IGMP_STATS==1: Enable IGMP stats. 1987 */ 1988 #if !defined IGMP_STATS || defined __DOXYGEN__ 1989 #define IGMP_STATS (LWIP_IGMP) 1990 #endif 1991 1992 /** 1993 * UDP_STATS==1: Enable UDP stats. Default is on if 1994 * UDP enabled, otherwise off. 1995 */ 1996 #if !defined UDP_STATS || defined __DOXYGEN__ 1997 #define UDP_STATS (LWIP_UDP) 1998 #endif 1999 2000 /** 2001 * TCP_STATS==1: Enable TCP stats. Default is on if TCP 2002 * enabled, otherwise off. 2003 */ 2004 #if !defined TCP_STATS || defined __DOXYGEN__ 2005 #define TCP_STATS (LWIP_TCP) 2006 #endif 2007 2008 /** 2009 * MEM_STATS==1: Enable mem.c stats. 2010 */ 2011 #if !defined MEM_STATS || defined __DOXYGEN__ 2012 #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) 2013 #endif 2014 2015 /** 2016 * MEMP_STATS==1: Enable memp.c pool stats. 2017 */ 2018 #if !defined MEMP_STATS || defined __DOXYGEN__ 2019 #define MEMP_STATS (MEMP_MEM_MALLOC == 0) 2020 #endif 2021 2022 /** 2023 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). 2024 */ 2025 #if !defined SYS_STATS || defined __DOXYGEN__ 2026 #define SYS_STATS (NO_SYS == 0) 2027 #endif 2028 2029 /** 2030 * IP6_STATS==1: Enable IPv6 stats. 2031 */ 2032 #if !defined IP6_STATS || defined __DOXYGEN__ 2033 #define IP6_STATS (LWIP_IPV6) 2034 #endif 2035 2036 /** 2037 * ICMP6_STATS==1: Enable ICMP for IPv6 stats. 2038 */ 2039 #if !defined ICMP6_STATS || defined __DOXYGEN__ 2040 #define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) 2041 #endif 2042 2043 /** 2044 * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. 2045 */ 2046 #if !defined IP6_FRAG_STATS || defined __DOXYGEN__ 2047 #define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) 2048 #endif 2049 2050 /** 2051 * MLD6_STATS==1: Enable MLD for IPv6 stats. 2052 */ 2053 #if !defined MLD6_STATS || defined __DOXYGEN__ 2054 #define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) 2055 #endif 2056 2057 /** 2058 * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. 2059 */ 2060 #if !defined ND6_STATS || defined __DOXYGEN__ 2061 #define ND6_STATS (LWIP_IPV6) 2062 #endif 2063 2064 /** 2065 * MIB2_STATS==1: Stats for SNMP MIB2. 2066 */ 2067 #if !defined MIB2_STATS || defined __DOXYGEN__ 2068 #define MIB2_STATS 0 2069 #endif 2070 2071 #else 2072 2073 #define LINK_STATS 0 2074 #define ETHARP_STATS 0 2075 #define IP_STATS 0 2076 #define IPFRAG_STATS 0 2077 #define ICMP_STATS 0 2078 #define IGMP_STATS 0 2079 #define UDP_STATS 0 2080 #define TCP_STATS 0 2081 #define MEM_STATS 0 2082 #define MEMP_STATS 0 2083 #define SYS_STATS 0 2084 #define LWIP_STATS_DISPLAY 0 2085 #define IP6_STATS 0 2086 #define ICMP6_STATS 0 2087 #define IP6_FRAG_STATS 0 2088 #define MLD6_STATS 0 2089 #define ND6_STATS 0 2090 #define MIB2_STATS 0 2091 2092 #endif /* LWIP_STATS */ 2093 /** 2094 * @} 2095 */ 2096 2097 /* 2098 -------------------------------------- 2099 ---------- Checksum options ---------- 2100 -------------------------------------- 2101 */ 2102 /** 2103 * @defgroup lwip_opts_checksum Checksum 2104 * @ingroup lwip_opts_infrastructure 2105 * @{ 2106 */ 2107 /** 2108 * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled 2109 * per netif. 2110 * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! 2111 */ 2112 #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ 2113 #define LWIP_CHECKSUM_CTRL_PER_NETIF 0 2114 #endif 2115 2116 /** 2117 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. 2118 */ 2119 #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ 2120 #define CHECKSUM_GEN_IP 1 2121 #endif 2122 2123 /** 2124 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. 2125 */ 2126 #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ 2127 #define CHECKSUM_GEN_UDP 1 2128 #endif 2129 2130 /** 2131 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. 2132 */ 2133 #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ 2134 #define CHECKSUM_GEN_TCP 1 2135 #endif 2136 2137 /** 2138 * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. 2139 */ 2140 #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ 2141 #define CHECKSUM_GEN_ICMP 1 2142 #endif 2143 2144 /** 2145 * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. 2146 */ 2147 #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ 2148 #define CHECKSUM_GEN_ICMP6 1 2149 #endif 2150 2151 /** 2152 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. 2153 */ 2154 #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ 2155 #define CHECKSUM_CHECK_IP 1 2156 #endif 2157 2158 /** 2159 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. 2160 */ 2161 #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ 2162 #define CHECKSUM_CHECK_UDP 1 2163 #endif 2164 2165 /** 2166 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. 2167 */ 2168 #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ 2169 #define CHECKSUM_CHECK_TCP 1 2170 #endif 2171 2172 /** 2173 * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. 2174 */ 2175 #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ 2176 #define CHECKSUM_CHECK_ICMP 1 2177 #endif 2178 2179 /** 2180 * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets 2181 */ 2182 #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ 2183 #define CHECKSUM_CHECK_ICMP6 1 2184 #endif 2185 2186 /** 2187 * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from 2188 * application buffers to pbufs. 2189 */ 2190 #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ 2191 #define LWIP_CHECKSUM_ON_COPY 0 2192 #endif 2193 /** 2194 * @} 2195 */ 2196 2197 /* 2198 --------------------------------------- 2199 ---------- IPv6 options --------------- 2200 --------------------------------------- 2201 */ 2202 /** 2203 * @defgroup lwip_opts_ipv6 IPv6 2204 * @ingroup lwip_opts 2205 * @{ 2206 */ 2207 /** 2208 * LWIP_IPV6==1: Enable IPv6 2209 */ 2210 #if !defined LWIP_IPV6 || defined __DOXYGEN__ 2211 #define LWIP_IPV6 0 2212 #endif 2213 2214 /** 2215 * LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that 2216 * e.g. link-local addresses are really treated as link-local. Disable this 2217 * setting only for single-interface configurations. 2218 */ 2219 #if !defined LWIP_IPV6_SCOPES || defined __DOXYGEN__ 2220 #define LWIP_IPV6_SCOPES (LWIP_IPV6 && !LWIP_SINGLE_NETIF) 2221 #endif 2222 2223 /** 2224 * LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses 2225 * are properly zoned (see ip6_zone.h on what that means) where it matters. 2226 * Enabling this setting is highly recommended when upgrading from an existing 2227 * installation that is not yet scope-aware; otherwise it may be too expensive. 2228 */ 2229 #if !defined LWIP_IPV6_SCOPES_DEBUG || defined __DOXYGEN__ 2230 #define LWIP_IPV6_SCOPES_DEBUG 0 2231 #endif 2232 2233 /** 2234 * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. 2235 */ 2236 #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ 2237 #define LWIP_IPV6_NUM_ADDRESSES 3 2238 #endif 2239 2240 /** 2241 * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs 2242 */ 2243 #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ 2244 #define LWIP_IPV6_FORWARD 0 2245 #endif 2246 2247 /** 2248 * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. 2249 */ 2250 #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ 2251 #define LWIP_IPV6_FRAG 0 2252 #endif 2253 2254 /** 2255 * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented 2256 */ 2257 #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ 2258 #define LWIP_IPV6_REASS (LWIP_IPV6) 2259 #endif 2260 2261 /** 2262 * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during 2263 * network startup. 2264 */ 2265 #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ 2266 #define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 2267 #endif 2268 2269 /** 2270 * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. 2271 */ 2272 #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ 2273 #define LWIP_IPV6_AUTOCONFIG (LWIP_IPV6) 2274 #endif 2275 2276 /** 2277 * LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each 2278 * IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled 2279 * otherwise, in which case the application may assign address lifetimes with 2280 * the appropriate macros. Addresses with no lifetime are assumed to be static. 2281 * If this option is disabled, all addresses are assumed to be static. 2282 */ 2283 #if !defined LWIP_IPV6_ADDRESS_LIFETIMES || defined __DOXYGEN__ 2284 #define LWIP_IPV6_ADDRESS_LIFETIMES (LWIP_IPV6_AUTOCONFIG) 2285 #endif 2286 2287 /** 2288 * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts. 2289 */ 2290 #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ 2291 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 2292 #endif 2293 /** 2294 * @} 2295 */ 2296 2297 /** 2298 * @defgroup lwip_opts_icmp6 ICMP6 2299 * @ingroup lwip_opts_ipv6 2300 * @{ 2301 */ 2302 /** 2303 * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) 2304 */ 2305 #if !defined LWIP_ICMP6 || defined __DOXYGEN__ 2306 #define LWIP_ICMP6 (LWIP_IPV6) 2307 #endif 2308 2309 /** 2310 * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in 2311 * ICMPv6 error messages. 2312 */ 2313 #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ 2314 #define LWIP_ICMP6_DATASIZE 8 2315 #endif 2316 2317 /** 2318 * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages 2319 */ 2320 #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ 2321 #define LWIP_ICMP6_HL 255 2322 #endif 2323 /** 2324 * @} 2325 */ 2326 2327 /** 2328 * @defgroup lwip_opts_mld6 Multicast listener discovery 2329 * @ingroup lwip_opts_ipv6 2330 * @{ 2331 */ 2332 /** 2333 * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. 2334 * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must 2335 * indiscriminately pass all inbound IPv6 multicast traffic to lwIP. 2336 */ 2337 #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ 2338 #define LWIP_IPV6_MLD (LWIP_IPV6) 2339 #endif 2340 2341 /** 2342 * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. 2343 * There must be enough groups so that each netif can join the solicited-node 2344 * multicast group for each of its local addresses, plus one for MDNS if 2345 * applicable, plus any number of groups to be joined on UDP sockets. 2346 */ 2347 #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ 2348 #define MEMP_NUM_MLD6_GROUP 4 2349 #endif 2350 /** 2351 * @} 2352 */ 2353 2354 /** 2355 * @defgroup lwip_opts_nd6 Neighbor discovery 2356 * @ingroup lwip_opts_ipv6 2357 * @{ 2358 */ 2359 /** 2360 * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address 2361 * is being resolved. 2362 */ 2363 #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ 2364 #define LWIP_ND6_QUEUEING (LWIP_IPV6) 2365 #endif 2366 2367 /** 2368 * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. 2369 */ 2370 #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ 2371 #define MEMP_NUM_ND6_QUEUE 20 2372 #endif 2373 2374 /** 2375 * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache 2376 */ 2377 #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ 2378 #define LWIP_ND6_NUM_NEIGHBORS 10 2379 #endif 2380 2381 /** 2382 * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache 2383 */ 2384 #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ 2385 #define LWIP_ND6_NUM_DESTINATIONS 10 2386 #endif 2387 2388 /** 2389 * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache 2390 */ 2391 #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ 2392 #define LWIP_ND6_NUM_PREFIXES 5 2393 #endif 2394 2395 /** 2396 * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache 2397 */ 2398 #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ 2399 #define LWIP_ND6_NUM_ROUTERS 3 2400 #endif 2401 2402 /** 2403 * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send 2404 * (neighbor solicit and router solicit) 2405 */ 2406 #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ 2407 #define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 2408 #endif 2409 2410 /** 2411 * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages 2412 * to send during neighbor reachability detection. 2413 */ 2414 #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ 2415 #define LWIP_ND6_MAX_UNICAST_SOLICIT 3 2416 #endif 2417 2418 /** 2419 * Unused: See ND RFC (time in milliseconds). 2420 */ 2421 #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ 2422 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 2423 #endif 2424 2425 /** 2426 * Unused: See ND RFC 2427 */ 2428 #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ 2429 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 2430 #endif 2431 2432 /** 2433 * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). 2434 * May be updated by router advertisement messages. 2435 */ 2436 #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ 2437 #define LWIP_ND6_REACHABLE_TIME 30000 2438 #endif 2439 2440 /** 2441 * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages 2442 */ 2443 #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ 2444 #define LWIP_ND6_RETRANS_TIMER 1000 2445 #endif 2446 2447 /** 2448 * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation 2449 * message is sent, during neighbor reachability detection. 2450 */ 2451 #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__ 2452 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 2453 #endif 2454 2455 /** 2456 * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update 2457 * Reachable time and retransmission timers, and netif MTU. 2458 */ 2459 #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ 2460 #define LWIP_ND6_ALLOW_RA_UPDATES 1 2461 #endif 2462 2463 /** 2464 * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery 2465 * with reachability hints for connected destinations. This helps avoid sending 2466 * unicast neighbor solicitation messages. 2467 */ 2468 #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ 2469 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1 2470 #endif 2471 2472 /** 2473 * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive 2474 * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS 2475 * servers to the DNS module. 2476 */ 2477 #if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__ 2478 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 2479 #endif 2480 /** 2481 * @} 2482 */ 2483 2484 /** 2485 * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration. 2486 */ 2487 #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ 2488 #define LWIP_IPV6_DHCP6 0 2489 #endif 2490 2491 /* 2492 --------------------------------------- 2493 ---------- Hook options --------------- 2494 --------------------------------------- 2495 */ 2496 2497 /** 2498 * @defgroup lwip_opts_hooks Hooks 2499 * @ingroup lwip_opts_infrastructure 2500 * Hooks are undefined by default, define them to a function if you need them. 2501 * @{ 2502 */ 2503 2504 /** 2505 * LWIP_HOOK_FILENAME: Custom filename to \#include in files that provide hooks. 2506 * Declare your hook function prototypes in there, you may also \#include all headers 2507 * providing data types that are need in this file. 2508 */ 2509 #ifdef __DOXYGEN__ 2510 #define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" 2511 #endif 2512 2513 /** 2514 * LWIP_HOOK_TCP_ISN: 2515 * Hook for generation of the Initial Sequence Number (ISN) for a new TCP 2516 * connection. The default lwIP ISN generation algorithm is very basic and may 2517 * allow for TCP spoofing attacks. This hook provides the means to implement 2518 * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), 2519 * or any other desired algorithm as a replacement. 2520 * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for 2521 * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n 2522 * Signature: u32_t my_hook_tcp_isn(const ip_addr_t* local_ip, u16_t local_port, const ip_addr_t* remote_ip, u16_t remote_port); 2523 * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n 2524 * Arguments: 2525 * - local_ip: pointer to the local IP address of the connection 2526 * - local_port: local port number of the connection (host-byte order) 2527 * - remote_ip: pointer to the remote IP address of the connection 2528 * - remote_port: remote port number of the connection (host-byte order)\n 2529 * Return value: 2530 * - the 32-bit Initial Sequence Number to use for the new TCP connection. 2531 */ 2532 #ifdef __DOXYGEN__ 2533 #define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) 2534 #endif 2535 2536 /** 2537 * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): 2538 * - called from ip_input() (IPv4) 2539 * - pbuf: received struct pbuf passed to ip_input() 2540 * - input_netif: struct netif on which the packet has been received 2541 * Return values: 2542 * - 0: Hook has not consumed the packet, packet is processed as normal 2543 * - != 0: Hook has consumed the packet. 2544 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 2545 * (i.e. free it when done). 2546 */ 2547 #ifdef __DOXYGEN__ 2548 #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) 2549 #endif 2550 2551 /** 2552 * LWIP_HOOK_IP4_ROUTE(dest): 2553 * - called from ip_route() (IPv4) 2554 * - dest: destination IPv4 address 2555 * Returns the destination netif or NULL if no destination netif is found. In 2556 * that case, ip_route() continues as normal. 2557 */ 2558 #ifdef __DOXYGEN__ 2559 #define LWIP_HOOK_IP4_ROUTE() 2560 #endif 2561 2562 /** 2563 * LWIP_HOOK_IP4_ROUTE_SRC(dest, src): 2564 * - source-based routing for IPv4 (see LWIP_HOOK_IP4_ROUTE(), src may be NULL) 2565 */ 2566 #ifdef __DOXYGEN__ 2567 #define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) 2568 #endif 2569 2570 /** 2571 * LWIP_HOOK_ETHARP_GET_GW(netif, dest): 2572 * - called from etharp_output() (IPv4) 2573 * - netif: the netif used for sending 2574 * - dest: the destination IPv4 address 2575 * Returns the IPv4 address of the gateway to handle the specified destination 2576 * IPv4 address. If NULL is returned, the netif's default gateway is used. 2577 * The returned address MUST be directly reachable on the specified netif! 2578 * This function is meant to implement advanced IPv4 routing together with 2579 * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is 2580 * not part of lwIP but can e.g. be hidden in the netif's state argument. 2581 */ 2582 #ifdef __DOXYGEN__ 2583 #define LWIP_HOOK_ETHARP_GET_GW(netif, dest) 2584 #endif 2585 2586 /** 2587 * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): 2588 * - called from ip6_input() (IPv6) 2589 * - pbuf: received struct pbuf passed to ip6_input() 2590 * - input_netif: struct netif on which the packet has been received 2591 * Return values: 2592 * - 0: Hook has not consumed the packet, packet is processed as normal 2593 * - != 0: Hook has consumed the packet. 2594 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 2595 * (i.e. free it when done). 2596 */ 2597 #ifdef __DOXYGEN__ 2598 #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) 2599 #endif 2600 2601 /** 2602 * LWIP_HOOK_IP6_ROUTE(src, dest): 2603 * - called from ip6_route() (IPv6) 2604 * - src: sourc IPv6 address 2605 * - dest: destination IPv6 address 2606 * Returns the destination netif or NULL if no destination netif is found. In 2607 * that case, ip6_route() continues as normal. 2608 */ 2609 #ifdef __DOXYGEN__ 2610 #define LWIP_HOOK_IP6_ROUTE(src, dest) 2611 #endif 2612 2613 /** 2614 * LWIP_HOOK_ND6_GET_GW(netif, dest): 2615 * - called from nd6_get_next_hop_entry() (IPv6) 2616 * - netif: the netif used for sending 2617 * - dest: the destination IPv6 address 2618 * Returns the IPv6 address of the next hop to handle the specified destination 2619 * IPv6 address. If NULL is returned, a NDP-discovered router is used instead. 2620 * The returned address MUST be directly reachable on the specified netif! 2621 * This function is meant to implement advanced IPv6 routing together with 2622 * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is 2623 * not part of lwIP but can e.g. be hidden in the netif's state argument. 2624 */ 2625 #ifdef __DOXYGEN__ 2626 #define LWIP_HOOK_ND6_GET_GW(netif, dest) 2627 #endif 2628 2629 /** 2630 * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): 2631 * - called from ethernet_input() if VLAN support is enabled 2632 * - netif: struct netif on which the packet has been received 2633 * - eth_hdr: struct eth_hdr of the packet 2634 * - vlan_hdr: struct eth_vlan_hdr of the packet 2635 * Return values: 2636 * - 0: Packet must be dropped. 2637 * - != 0: Packet must be accepted. 2638 */ 2639 #ifdef __DOXYGEN__ 2640 #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) 2641 #endif 2642 2643 /** 2644 * LWIP_HOOK_VLAN_SET: 2645 * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data 2646 * on per-netif basis to implement this callback, see @ref netif_cd. 2647 * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n 2648 * Signature: s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n 2649 * Arguments: 2650 * - netif: struct netif that the packet will be sent through 2651 * - p: struct pbuf packet to be sent 2652 * - src: source eth address 2653 * - dst: destination eth address 2654 * - eth_type: ethernet type to packet to be sent\n 2655 * 2656 * 2657 * Return values: 2658 * - <0: Packet shall not contain VLAN header. 2659 * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. 2660 */ 2661 #ifdef __DOXYGEN__ 2662 #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) 2663 #endif 2664 2665 /** 2666 * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): 2667 * - called from memp_free() when a memp pool was empty and an item is now available 2668 */ 2669 #ifdef __DOXYGEN__ 2670 #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) 2671 #endif 2672 2673 /** 2674 * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): 2675 * Called from ethernet_input() when an unknown eth type is encountered. 2676 * Return ERR_OK if packet is accepted, any error code otherwise. 2677 * Payload points to ethernet header! 2678 */ 2679 #ifdef __DOXYGEN__ 2680 #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) 2681 #endif 2682 /** 2683 * @} 2684 */ 2685 2686 /* 2687 --------------------------------------- 2688 ---------- Debugging options ---------- 2689 --------------------------------------- 2690 */ 2691 /** 2692 * @defgroup lwip_opts_debugmsg Debug messages 2693 * @ingroup lwip_opts_debug 2694 * @{ 2695 */ 2696 /** 2697 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is 2698 * compared against this value. If it is smaller, then debugging 2699 * messages are written. 2700 * @see debugging_levels 2701 */ 2702 #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ 2703 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 2704 #endif 2705 2706 /** 2707 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable 2708 * debug messages of certain types. 2709 * @see debugging_levels 2710 */ 2711 #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ 2712 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 2713 #endif 2714 2715 /** 2716 * ETHARP_DEBUG: Enable debugging in etharp.c. 2717 */ 2718 #if !defined ETHARP_DEBUG || defined __DOXYGEN__ 2719 #define ETHARP_DEBUG LWIP_DBG_OFF 2720 #endif 2721 2722 /** 2723 * NETIF_DEBUG: Enable debugging in netif.c. 2724 */ 2725 #if !defined NETIF_DEBUG || defined __DOXYGEN__ 2726 #define NETIF_DEBUG LWIP_DBG_OFF 2727 #endif 2728 2729 /** 2730 * PBUF_DEBUG: Enable debugging in pbuf.c. 2731 */ 2732 #if !defined PBUF_DEBUG || defined __DOXYGEN__ 2733 #define PBUF_DEBUG LWIP_DBG_OFF 2734 #endif 2735 2736 /** 2737 * API_LIB_DEBUG: Enable debugging in api_lib.c. 2738 */ 2739 #if !defined API_LIB_DEBUG || defined __DOXYGEN__ 2740 #define API_LIB_DEBUG LWIP_DBG_OFF 2741 #endif 2742 2743 /** 2744 * API_MSG_DEBUG: Enable debugging in api_msg.c. 2745 */ 2746 #if !defined API_MSG_DEBUG || defined __DOXYGEN__ 2747 #define API_MSG_DEBUG LWIP_DBG_OFF 2748 #endif 2749 2750 /** 2751 * SOCKETS_DEBUG: Enable debugging in sockets.c. 2752 */ 2753 #if !defined SOCKETS_DEBUG || defined __DOXYGEN__ 2754 #define SOCKETS_DEBUG LWIP_DBG_OFF 2755 #endif 2756 2757 /** 2758 * ICMP_DEBUG: Enable debugging in icmp.c. 2759 */ 2760 #if !defined ICMP_DEBUG || defined __DOXYGEN__ 2761 #define ICMP_DEBUG LWIP_DBG_OFF 2762 #endif 2763 2764 /** 2765 * IGMP_DEBUG: Enable debugging in igmp.c. 2766 */ 2767 #if !defined IGMP_DEBUG || defined __DOXYGEN__ 2768 #define IGMP_DEBUG LWIP_DBG_OFF 2769 #endif 2770 2771 /** 2772 * INET_DEBUG: Enable debugging in inet.c. 2773 */ 2774 #if !defined INET_DEBUG || defined __DOXYGEN__ 2775 #define INET_DEBUG LWIP_DBG_OFF 2776 #endif 2777 2778 /** 2779 * IP_DEBUG: Enable debugging for IP. 2780 */ 2781 #if !defined IP_DEBUG || defined __DOXYGEN__ 2782 #define IP_DEBUG LWIP_DBG_OFF 2783 #endif 2784 2785 /** 2786 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. 2787 */ 2788 #if !defined IP_REASS_DEBUG || defined __DOXYGEN__ 2789 #define IP_REASS_DEBUG LWIP_DBG_OFF 2790 #endif 2791 2792 /** 2793 * RAW_DEBUG: Enable debugging in raw.c. 2794 */ 2795 #if !defined RAW_DEBUG || defined __DOXYGEN__ 2796 #define RAW_DEBUG LWIP_DBG_OFF 2797 #endif 2798 2799 /** 2800 * MEM_DEBUG: Enable debugging in mem.c. 2801 */ 2802 #if !defined MEM_DEBUG || defined __DOXYGEN__ 2803 #define MEM_DEBUG LWIP_DBG_OFF 2804 #endif 2805 2806 /** 2807 * MEMP_DEBUG: Enable debugging in memp.c. 2808 */ 2809 #if !defined MEMP_DEBUG || defined __DOXYGEN__ 2810 #define MEMP_DEBUG LWIP_DBG_OFF 2811 #endif 2812 2813 /** 2814 * SYS_DEBUG: Enable debugging in sys.c. 2815 */ 2816 #if !defined SYS_DEBUG || defined __DOXYGEN__ 2817 #define SYS_DEBUG LWIP_DBG_OFF 2818 #endif 2819 2820 /** 2821 * TIMERS_DEBUG: Enable debugging in timers.c. 2822 */ 2823 #if !defined TIMERS_DEBUG || defined __DOXYGEN__ 2824 #define TIMERS_DEBUG LWIP_DBG_OFF 2825 #endif 2826 2827 /** 2828 * TCP_DEBUG: Enable debugging for TCP. 2829 */ 2830 #if !defined TCP_DEBUG || defined __DOXYGEN__ 2831 #define TCP_DEBUG LWIP_DBG_OFF 2832 #endif 2833 2834 /** 2835 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. 2836 */ 2837 #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ 2838 #define TCP_INPUT_DEBUG LWIP_DBG_OFF 2839 #endif 2840 2841 /** 2842 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. 2843 */ 2844 #if !defined TCP_FR_DEBUG || defined __DOXYGEN__ 2845 #define TCP_FR_DEBUG LWIP_DBG_OFF 2846 #endif 2847 2848 /** 2849 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit 2850 * timeout. 2851 */ 2852 #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ 2853 #define TCP_RTO_DEBUG LWIP_DBG_OFF 2854 #endif 2855 2856 /** 2857 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. 2858 */ 2859 #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ 2860 #define TCP_CWND_DEBUG LWIP_DBG_OFF 2861 #endif 2862 2863 /** 2864 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. 2865 */ 2866 #if !defined TCP_WND_DEBUG || defined __DOXYGEN__ 2867 #define TCP_WND_DEBUG LWIP_DBG_OFF 2868 #endif 2869 2870 /** 2871 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. 2872 */ 2873 #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ 2874 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF 2875 #endif 2876 2877 /** 2878 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. 2879 */ 2880 #if !defined TCP_RST_DEBUG || defined __DOXYGEN__ 2881 #define TCP_RST_DEBUG LWIP_DBG_OFF 2882 #endif 2883 2884 /** 2885 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. 2886 */ 2887 #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ 2888 #define TCP_QLEN_DEBUG LWIP_DBG_OFF 2889 #endif 2890 2891 /** 2892 * UDP_DEBUG: Enable debugging in UDP. 2893 */ 2894 #if !defined UDP_DEBUG || defined __DOXYGEN__ 2895 #define UDP_DEBUG LWIP_DBG_OFF 2896 #endif 2897 2898 /** 2899 * TCPIP_DEBUG: Enable debugging in tcpip.c. 2900 */ 2901 #if !defined TCPIP_DEBUG || defined __DOXYGEN__ 2902 #define TCPIP_DEBUG LWIP_DBG_OFF 2903 #endif 2904 2905 /** 2906 * SLIP_DEBUG: Enable debugging in slipif.c. 2907 */ 2908 #if !defined SLIP_DEBUG || defined __DOXYGEN__ 2909 #define SLIP_DEBUG LWIP_DBG_OFF 2910 #endif 2911 2912 /** 2913 * DHCP_DEBUG: Enable debugging in dhcp.c. 2914 */ 2915 #if !defined DHCP_DEBUG || defined __DOXYGEN__ 2916 #define DHCP_DEBUG LWIP_DBG_OFF 2917 #endif 2918 2919 /** 2920 * AUTOIP_DEBUG: Enable debugging in autoip.c. 2921 */ 2922 #if !defined AUTOIP_DEBUG || defined __DOXYGEN__ 2923 #define AUTOIP_DEBUG LWIP_DBG_OFF 2924 #endif 2925 2926 /** 2927 * DNS_DEBUG: Enable debugging for DNS. 2928 */ 2929 #if !defined DNS_DEBUG || defined __DOXYGEN__ 2930 #define DNS_DEBUG LWIP_DBG_OFF 2931 #endif 2932 2933 /** 2934 * IP6_DEBUG: Enable debugging for IPv6. 2935 */ 2936 #if !defined IP6_DEBUG || defined __DOXYGEN__ 2937 #define IP6_DEBUG LWIP_DBG_OFF 2938 #endif 2939 /** 2940 * @} 2941 */ 2942 2943 /* 2944 -------------------------------------------------- 2945 ---------- Performance tracking options ---------- 2946 -------------------------------------------------- 2947 */ 2948 /** 2949 * @defgroup lwip_opts_perf Performance 2950 * @ingroup lwip_opts_debug 2951 * @{ 2952 */ 2953 /** 2954 * LWIP_PERF: Enable performance testing for lwIP 2955 * (if enabled, arch/perf.h is included) 2956 */ 2957 #if !defined LWIP_PERF || defined __DOXYGEN__ 2958 #define LWIP_PERF 0 2959 #endif 2960 /** 2961 * @} 2962 */ 2963 2964 #endif /* LWIP_HDR_OPT_H */ 2965