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 <[email protected]> 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 * Macro/function to check whether lwIP's threading/locking 218 * requirements are satisfied during current function call. 219 * This macro usually calls a function that is implemented in the OS-dependent 220 * sys layer and performs the following checks: 221 * - Not in ISR (this should be checked for NO_SYS==1, too!) 222 * - If @ref LWIP_TCPIP_CORE_LOCKING = 1: TCPIP core lock is held 223 * - If @ref LWIP_TCPIP_CORE_LOCKING = 0: function is called from TCPIP thread 224 * @see @ref multithreading 225 */ 226 #if !defined LWIP_ASSERT_CORE_LOCKED || defined __DOXYGEN__ 227 #define LWIP_ASSERT_CORE_LOCKED() 228 #endif 229 230 /** 231 * Called as first thing in the lwIP TCPIP thread. Can be used in conjunction 232 * with @ref LWIP_ASSERT_CORE_LOCKED to check core locking. 233 * @see @ref multithreading 234 */ 235 #if !defined LWIP_MARK_TCPIP_THREAD || defined __DOXYGEN__ 236 #define LWIP_MARK_TCPIP_THREAD() 237 #endif 238 /** 239 * @} 240 */ 241 242 /* 243 ------------------------------------ 244 ---------- Memory options ---------- 245 ------------------------------------ 246 */ 247 /** 248 * @defgroup lwip_opts_mem Heap and memory pools 249 * @ingroup lwip_opts_infrastructure 250 * @{ 251 */ 252 /** 253 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library 254 * instead of the lwip internal allocator. Can save code size if you 255 * already use it. 256 */ 257 #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ 258 #define MEM_LIBC_MALLOC 0 259 #endif 260 261 /** 262 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. 263 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution 264 * speed (heap alloc can be much slower than pool alloc) and usage from interrupts 265 * (especially if your netif driver allocates PBUF_POOL pbufs for received frames 266 * from interrupt)! 267 * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, 268 * not only for internal pools defined in memp_std.h)! 269 */ 270 #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ 271 #define MEMP_MEM_MALLOC 0 272 #endif 273 274 /** 275 * MEMP_MEM_INIT==1: Force use of memset to initialize pool memory. 276 * Useful if pool are moved in uninitialized section of memory. This will ensure 277 * default values in pcbs struct are well initialized in all conditions. 278 */ 279 #if !defined MEMP_MEM_INIT || defined __DOXYGEN__ 280 #define MEMP_MEM_INIT 0 281 #endif 282 283 /** 284 * MEM_ALIGNMENT: should be set to the alignment of the CPU 285 * 4 byte alignment -> \#define MEM_ALIGNMENT 4 286 * 2 byte alignment -> \#define MEM_ALIGNMENT 2 287 */ 288 #if !defined MEM_ALIGNMENT || defined __DOXYGEN__ 289 #define MEM_ALIGNMENT 1 290 #endif 291 292 /** 293 * MEM_SIZE: the size of the heap memory. If the application will send 294 * a lot of data that needs to be copied, this should be set high. 295 */ 296 #if !defined MEM_SIZE || defined __DOXYGEN__ 297 #define MEM_SIZE 1600 298 #endif 299 300 /** 301 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable 302 * amount of bytes before and after each memp element in every pool and fills 303 * it with a prominent default value. 304 * MEMP_OVERFLOW_CHECK == 0 no checking 305 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed 306 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time 307 * memp_malloc() or memp_free() is called (useful but slow!) 308 */ 309 #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ 310 #define MEMP_OVERFLOW_CHECK 0 311 #endif 312 313 /** 314 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make 315 * sure that there are no cycles in the linked lists. 316 */ 317 #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ 318 #define MEMP_SANITY_CHECK 0 319 #endif 320 321 /** 322 * MEM_OVERFLOW_CHECK: mem overflow protection reserves a configurable 323 * amount of bytes before and after each heap allocation chunk and fills 324 * it with a prominent default value. 325 * MEM_OVERFLOW_CHECK == 0 no checking 326 * MEM_OVERFLOW_CHECK == 1 checks each element when it is freed 327 * MEM_OVERFLOW_CHECK >= 2 checks all heap elements every time 328 * mem_malloc() or mem_free() is called (useful but slow!) 329 */ 330 #if !defined MEM_OVERFLOW_CHECK || defined __DOXYGEN__ 331 #define MEM_OVERFLOW_CHECK 0 332 #endif 333 334 /** 335 * MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make 336 * sure that the linked list of heap elements is not corrupted. 337 */ 338 #if !defined MEM_SANITY_CHECK || defined __DOXYGEN__ 339 #define MEM_SANITY_CHECK 0 340 #endif 341 342 /** 343 * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set 344 * of memory pools of various sizes. When mem_malloc is called, an element of 345 * the smallest pool that can provide the length needed is returned. 346 * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. 347 */ 348 #if !defined MEM_USE_POOLS || defined __DOXYGEN__ 349 #define MEM_USE_POOLS 0 350 #endif 351 352 /** 353 * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next 354 * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more 355 * reliable. */ 356 #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ 357 #define MEM_USE_POOLS_TRY_BIGGER_POOL 0 358 #endif 359 360 /** 361 * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h 362 * that defines additional pools beyond the "standard" ones required 363 * by lwIP. If you set this to 1, you must have lwippools.h in your 364 * include path somewhere. 365 */ 366 #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ 367 #define MEMP_USE_CUSTOM_POOLS 0 368 #endif 369 370 /** 371 * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from 372 * interrupt context (or another context that doesn't allow waiting for a 373 * semaphore). 374 * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, 375 * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs 376 * with each loop so that mem_free can run. 377 * 378 * ATTENTION: As you can see from the above description, this leads to dis-/ 379 * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc 380 * can need longer. 381 * 382 * If you don't want that, at least for NO_SYS=0, you can still use the following 383 * functions to enqueue a deallocation call which then runs in the tcpip_thread 384 * context: 385 * - pbuf_free_callback(p); 386 * - mem_free_callback(m); 387 */ 388 #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ 389 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 390 #endif 391 /** 392 * @} 393 */ 394 395 /* 396 ------------------------------------------------ 397 ---------- Internal Memory Pool Sizes ---------- 398 ------------------------------------------------ 399 */ 400 /** 401 * @defgroup lwip_opts_memp Internal memory pools 402 * @ingroup lwip_opts_infrastructure 403 * @{ 404 */ 405 /** 406 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). 407 * If the application sends a lot of data out of ROM (or other static memory), 408 * this should be set high. 409 */ 410 #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ 411 #define MEMP_NUM_PBUF 16 412 #endif 413 414 /** 415 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs 416 * (requires the LWIP_RAW option) 417 */ 418 #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ 419 #define MEMP_NUM_RAW_PCB 4 420 #endif 421 422 /** 423 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 424 * per active UDP "connection". 425 * (requires the LWIP_UDP option) 426 */ 427 #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ 428 #define MEMP_NUM_UDP_PCB 4 429 #endif 430 431 /** 432 * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. 433 * (requires the LWIP_TCP option) 434 */ 435 #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ 436 #define MEMP_NUM_TCP_PCB 5 437 #endif 438 439 /** 440 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. 441 * (requires the LWIP_TCP option) 442 */ 443 #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ 444 #define MEMP_NUM_TCP_PCB_LISTEN 8 445 #endif 446 447 /** 448 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. 449 * (requires the LWIP_TCP option) 450 */ 451 #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ 452 #define MEMP_NUM_TCP_SEG 16 453 #endif 454 455 /** 456 * MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs. 457 * (requires the LWIP_ALTCP option) 458 * Connections with multiple layers require more than one altcp_pcb (e.g. TLS 459 * over TCP requires 2 altcp_pcbs, one for TLS and one for TCP). 460 */ 461 #if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__ 462 #define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB 463 #endif 464 465 /** 466 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for 467 * reassembly (whole packets, not fragments!) 468 */ 469 #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ 470 #define MEMP_NUM_REASSDATA 5 471 #endif 472 473 /** 474 * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent 475 * (fragments, not whole packets!). 476 * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 477 * with DMA-enabled MACs where the packet is not yet sent when netif->output 478 * returns. 479 */ 480 #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ 481 #define MEMP_NUM_FRAG_PBUF 15 482 #endif 483 484 /** 485 * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing 486 * packets (pbufs) that are waiting for an ARP request (to resolve 487 * their destination address) to finish. 488 * (requires the ARP_QUEUEING option) 489 */ 490 #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ 491 #define MEMP_NUM_ARP_QUEUE 30 492 #endif 493 494 /** 495 * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces 496 * can be members at the same time (one per netif - allsystems group -, plus one 497 * per netif membership). 498 * (requires the LWIP_IGMP option) 499 */ 500 #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ 501 #define MEMP_NUM_IGMP_GROUP 8 502 #endif 503 504 /** 505 * The number of sys timeouts used by the core stack (not apps) 506 * The default number of timeouts is calculated here for all enabled modules. 507 */ 508 #define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD))) 509 510 /** 511 * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. 512 * The default number of timeouts is calculated here for all enabled modules. 513 * The formula expects settings to be either '0' or '1'. 514 */ 515 #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ 516 #define MEMP_NUM_SYS_TIMEOUT LWIP_NUM_SYS_TIMEOUT_INTERNAL 517 #endif 518 519 /** 520 * MEMP_NUM_NETBUF: the number of struct netbufs. 521 * (only needed if you use the sequential API, like api_lib.c) 522 */ 523 #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ 524 #define MEMP_NUM_NETBUF 2 525 #endif 526 527 /** 528 * MEMP_NUM_NETCONN: the number of struct netconns. 529 * (only needed if you use the sequential API, like api_lib.c) 530 */ 531 #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ 532 #define MEMP_NUM_NETCONN 4 533 #endif 534 535 /** 536 * MEMP_NUM_SELECT_CB: the number of struct lwip_select_cb. 537 * (Only needed if you have LWIP_MPU_COMPATIBLE==1 and use the socket API. 538 * In that case, you need one per thread calling lwip_select.) 539 */ 540 #if !defined MEMP_NUM_SELECT_CB || defined __DOXYGEN__ 541 #define MEMP_NUM_SELECT_CB 4 542 #endif 543 544 /** 545 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used 546 * for callback/timeout API communication. 547 * (only needed if you use tcpip.c) 548 */ 549 #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ 550 #define MEMP_NUM_TCPIP_MSG_API 8 551 #endif 552 553 /** 554 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used 555 * for incoming packets. 556 * (only needed if you use tcpip.c) 557 */ 558 #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ 559 #define MEMP_NUM_TCPIP_MSG_INPKT 8 560 #endif 561 562 /** 563 * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls 564 * (before freeing the corresponding memory using lwip_freeaddrinfo()). 565 */ 566 #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ 567 #define MEMP_NUM_NETDB 1 568 #endif 569 570 /** 571 * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list 572 * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. 573 */ 574 #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ 575 #define MEMP_NUM_LOCALHOSTLIST 1 576 #endif 577 578 /** 579 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 580 */ 581 #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ 582 #define PBUF_POOL_SIZE 16 583 #endif 584 585 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various 586 * socket, netconn, and tcpip functions 587 */ 588 #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ 589 #define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API 590 #endif 591 592 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname 593 */ 594 #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ 595 #define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API 596 #endif 597 598 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls 599 * to getsockopt/setsockopt 600 */ 601 #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ 602 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API 603 #endif 604 605 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the 606 * netifapi functions 607 */ 608 #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ 609 #define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API 610 #endif 611 /** 612 * @} 613 */ 614 615 /* 616 --------------------------------- 617 ---------- ARP options ---------- 618 --------------------------------- 619 */ 620 /** 621 * @defgroup lwip_opts_arp ARP 622 * @ingroup lwip_opts_ipv4 623 * @{ 624 */ 625 /** 626 * LWIP_ARP==1: Enable ARP functionality. 627 */ 628 #if !defined LWIP_ARP || defined __DOXYGEN__ 629 #define LWIP_ARP 1 630 #endif 631 632 /** 633 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. 634 */ 635 #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ 636 #define ARP_TABLE_SIZE 10 637 #endif 638 639 /** the time an ARP entry stays valid after its last update, 640 * for ARP_TMR_INTERVAL = 1000, this is 641 * (60 * 5) seconds = 5 minutes. 642 */ 643 #if !defined ARP_MAXAGE || defined __DOXYGEN__ 644 #define ARP_MAXAGE 300 645 #endif 646 647 /** 648 * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address 649 * resolution. By default, only the most recent packet is queued per IP address. 650 * This is sufficient for most protocols and mainly reduces TCP connection 651 * startup time. Set this to 1 if you know your application sends more than one 652 * packet in a row to an IP address that is not in the ARP cache. 653 */ 654 #if !defined ARP_QUEUEING || defined __DOXYGEN__ 655 #define ARP_QUEUEING 0 656 #endif 657 658 /** The maximum number of packets which may be queued for each 659 * unresolved address by other network layers. Defaults to 3, 0 means disabled. 660 * Old packets are dropped, new packets are queued. 661 */ 662 #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ 663 #define ARP_QUEUE_LEN 3 664 #endif 665 666 /** 667 * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with 668 * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and 669 * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. 670 * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. 671 * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. 672 * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. 673 * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) 674 * that returns 1 to accept a packet or 0 to drop a packet. 675 */ 676 #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ 677 #define ETHARP_SUPPORT_VLAN 0 678 #endif 679 680 /** 681 * LWIP_VLAN_PCP==1: Enable outgoing VLAN taggning of frames on a per-PCB basis 682 * for QoS purposes. With this feature enabled, each PCB has a new variable: "tci". 683 * (Tag Control Identifier). The TCI contains three fields: VID, CFI and PCP. 684 * VID is the VLAN ID, which should be set to zero. 685 * The "CFI" bit is used to enable or disable VLAN tags for the PCB. 686 * PCP (Priority Code Point) is a 3 bit field used for Ethernet level QoS. 687 */ 688 #ifndef LWIP_VLAN_PCP 689 #define LWIP_VLAN_PCP 0 690 #endif 691 692 /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled 693 */ 694 #if !defined LWIP_ETHERNET || defined __DOXYGEN__ 695 #define LWIP_ETHERNET LWIP_ARP 696 #endif 697 698 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure 699 * alignment of payload after that header. Since the header is 14 bytes long, 700 * without this padding e.g. addresses in the IP header will not be aligned 701 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. 702 */ 703 #if !defined ETH_PAD_SIZE || defined __DOXYGEN__ 704 #define ETH_PAD_SIZE 0 705 #endif 706 707 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table 708 * entries (using etharp_add_static_entry/etharp_remove_static_entry). 709 */ 710 #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ 711 #define ETHARP_SUPPORT_STATIC_ENTRIES 0 712 #endif 713 714 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. 715 * If disabled, duplicate IP address on multiple netifs are not supported 716 * (but this should only occur for AutoIP). 717 */ 718 #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ 719 #define ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF 720 #endif 721 /** 722 * @} 723 */ 724 725 /* 726 -------------------------------- 727 ---------- IP options ---------- 728 -------------------------------- 729 */ 730 /** 731 * @defgroup lwip_opts_ipv4 IPv4 732 * @ingroup lwip_opts 733 * @{ 734 */ 735 /** 736 * LWIP_IPV4==1: Enable IPv4 737 */ 738 #if !defined LWIP_IPV4 || defined __DOXYGEN__ 739 #define LWIP_IPV4 1 740 #endif 741 742 /** 743 * IP_FORWARD==1: Enables the ability to forward IP packets across network 744 * interfaces. If you are going to run lwIP on a device with only one network 745 * interface, define this to 0. 746 */ 747 #if !defined IP_FORWARD || defined __DOXYGEN__ 748 #define IP_FORWARD 0 749 #endif 750 751 /** 752 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that 753 * this option does not affect outgoing packet sizes, which can be controlled 754 * via IP_FRAG. 755 */ 756 #if !defined IP_REASSEMBLY || defined __DOXYGEN__ 757 #define IP_REASSEMBLY 1 758 #endif 759 760 /** 761 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note 762 * that this option does not affect incoming packet sizes, which can be 763 * controlled via IP_REASSEMBLY. 764 */ 765 #if !defined IP_FRAG || defined __DOXYGEN__ 766 #define IP_FRAG 1 767 #endif 768 769 #if !LWIP_IPV4 770 /* disable IPv4 extensions when IPv4 is disabled */ 771 #undef IP_FORWARD 772 #define IP_FORWARD 0 773 #undef IP_REASSEMBLY 774 #define IP_REASSEMBLY 0 775 #undef IP_FRAG 776 #define IP_FRAG 0 777 #endif /* !LWIP_IPV4 */ 778 779 /** 780 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. 781 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. 782 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). 783 */ 784 #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ 785 #define IP_OPTIONS_ALLOWED 1 786 #endif 787 788 /** 789 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) 790 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 791 * in this time, the whole packet is discarded. 792 */ 793 #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ 794 #define IP_REASS_MAXAGE 15 795 #endif 796 797 /** 798 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. 799 * Since the received pbufs are enqueued, be sure to configure 800 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive 801 * packets even if the maximum amount of fragments is enqueued for reassembly! 802 * When IPv4 *and* IPv6 are enabled, this even changes to 803 * (PBUF_POOL_SIZE > 2 * IP_REASS_MAX_PBUFS)! 804 */ 805 #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ 806 #define IP_REASS_MAX_PBUFS 10 807 #endif 808 809 /** 810 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. 811 */ 812 #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ 813 #define IP_DEFAULT_TTL 255 814 #endif 815 816 /** 817 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast 818 * filter per pcb on udp and raw send operations. To enable broadcast filter 819 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. 820 */ 821 #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ 822 #define IP_SOF_BROADCAST 0 823 #endif 824 825 /** 826 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast 827 * filter on recv operations. 828 */ 829 #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ 830 #define IP_SOF_BROADCAST_RECV 0 831 #endif 832 833 /** 834 * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back 835 * out on the netif where it was received. This should only be used for 836 * wireless networks. 837 * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming 838 * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! 839 */ 840 #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ 841 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 842 #endif 843 /** 844 * @} 845 */ 846 847 /* 848 ---------------------------------- 849 ---------- ICMP options ---------- 850 ---------------------------------- 851 */ 852 /** 853 * @defgroup lwip_opts_icmp ICMP 854 * @ingroup lwip_opts_ipv4 855 * @{ 856 */ 857 /** 858 * LWIP_ICMP==1: Enable ICMP module inside the IP stack. 859 * Be careful, disable that make your product non-compliant to RFC1122 860 */ 861 #if !defined LWIP_ICMP || defined __DOXYGEN__ 862 #define LWIP_ICMP 1 863 #endif 864 865 /** 866 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. 867 */ 868 #if !defined ICMP_TTL || defined __DOXYGEN__ 869 #define ICMP_TTL IP_DEFAULT_TTL 870 #endif 871 872 /** 873 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) 874 */ 875 #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ 876 #define LWIP_BROADCAST_PING 0 877 #endif 878 879 /** 880 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) 881 */ 882 #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ 883 #define LWIP_MULTICAST_PING 0 884 #endif 885 /** 886 * @} 887 */ 888 889 /* 890 --------------------------------- 891 ---------- RAW options ---------- 892 --------------------------------- 893 */ 894 /** 895 * @defgroup lwip_opts_raw RAW 896 * @ingroup lwip_opts_callback 897 * @{ 898 */ 899 /** 900 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 901 */ 902 #if !defined LWIP_RAW || defined __DOXYGEN__ 903 #define LWIP_RAW 0 904 #endif 905 906 /** 907 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 908 */ 909 #if !defined RAW_TTL || defined __DOXYGEN__ 910 #define RAW_TTL IP_DEFAULT_TTL 911 #endif 912 /** 913 * @} 914 */ 915 916 /* 917 ---------------------------------- 918 ---------- DHCP options ---------- 919 ---------------------------------- 920 */ 921 /** 922 * @defgroup lwip_opts_dhcp DHCP 923 * @ingroup lwip_opts_ipv4 924 * @{ 925 */ 926 /** 927 * LWIP_DHCP==1: Enable DHCP module. 928 */ 929 #if !defined LWIP_DHCP || defined __DOXYGEN__ 930 #define LWIP_DHCP 0 931 #endif 932 #if !LWIP_IPV4 933 /* disable DHCP when IPv4 is disabled */ 934 #undef LWIP_DHCP 935 #define LWIP_DHCP 0 936 #endif /* !LWIP_IPV4 */ 937 938 /** 939 * LWIP_DHCP_DOES_ACD_CHECK==1: Perform address conflict detection on the dhcp address. 940 */ 941 #if !defined LWIP_DHCP_DOES_ACD_CHECK || defined __DOXYGEN__ 942 #define LWIP_DHCP_DOES_ACD_CHECK LWIP_DHCP 943 #endif 944 945 /** 946 * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. 947 */ 948 #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ 949 #define LWIP_DHCP_BOOTP_FILE 0 950 #endif 951 952 /** 953 * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each 954 * response packet, an callback is called, which has to be provided by the port: 955 * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 956 */ 957 #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ 958 #define LWIP_DHCP_GET_NTP_SRV 0 959 #endif 960 961 /** 962 * The maximum of NTP servers requested 963 */ 964 #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ 965 #define LWIP_DHCP_MAX_NTP_SERVERS 1 966 #endif 967 968 /** 969 * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. 970 * DNS servers received in the response are passed to DNS via @ref dns_setserver() 971 * (up to the maximum limit defined here). 972 */ 973 #if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__ 974 #define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS 975 #endif 976 /** 977 * @} 978 */ 979 980 /* 981 ------------------------------------ 982 ---------- AUTOIP options ---------- 983 ------------------------------------ 984 */ 985 /** 986 * @defgroup lwip_opts_autoip AUTOIP 987 * @ingroup lwip_opts_ipv4 988 * @{ 989 */ 990 /** 991 * LWIP_AUTOIP==1: Enable AUTOIP module. 992 */ 993 #if !defined LWIP_AUTOIP || defined __DOXYGEN__ 994 #define LWIP_AUTOIP 0 995 #endif 996 #if !LWIP_IPV4 997 /* disable AUTOIP when IPv4 is disabled */ 998 #undef LWIP_AUTOIP 999 #define LWIP_AUTOIP 0 1000 #endif /* !LWIP_IPV4 */ 1001 1002 /** 1003 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on 1004 * the same interface at the same time. 1005 */ 1006 #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ 1007 #define LWIP_DHCP_AUTOIP_COOP 0 1008 #endif 1009 1010 /** 1011 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes 1012 * that should be sent before falling back on AUTOIP (the DHCP client keeps 1013 * running in this case). This can be set as low as 1 to get an AutoIP address 1014 * very quickly, but you should be prepared to handle a changing IP address 1015 * when DHCP overrides AutoIP. 1016 */ 1017 #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ 1018 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9 1019 #endif 1020 /** 1021 * @} 1022 */ 1023 1024 /* 1025 ------------------------------------ 1026 ----------- ACD options ------------ 1027 ------------------------------------ 1028 */ 1029 /** 1030 * @defgroup lwip_opts_acd ACD 1031 * @ingroup lwip_opts_ipv4 1032 * @{ 1033 */ 1034 /** 1035 * LWIP_ACD==1: Enable ACD module. ACD module is needed when using AUTOIP. 1036 */ 1037 #if !defined LWIP_ACD || defined __DOXYGEN__ 1038 #define LWIP_ACD (LWIP_AUTOIP || LWIP_DHCP_DOES_ACD_CHECK) 1039 #endif 1040 #if !LWIP_IPV4 1041 /* disable ACD when IPv4 is disabled */ 1042 #undef LWIP_ACD 1043 #define LWIP_ACD 0 1044 #endif /* !LWIP_IPV4 */ 1045 /** 1046 * @} 1047 */ 1048 1049 /* 1050 ---------------------------------- 1051 ----- SNMP MIB2 support ----- 1052 ---------------------------------- 1053 */ 1054 /** 1055 * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks 1056 * @ingroup lwip_opts_infrastructure 1057 * @{ 1058 */ 1059 /** 1060 * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. 1061 * Turn this on to get callbacks needed to implement MIB2. 1062 * Usually MIB2_STATS should be enabled, too. 1063 */ 1064 #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ 1065 #define LWIP_MIB2_CALLBACKS 0 1066 #endif 1067 /** 1068 * @} 1069 */ 1070 1071 /* 1072 ---------------------------------- 1073 -------- Multicast options ------- 1074 ---------------------------------- 1075 */ 1076 /** 1077 * @defgroup lwip_opts_multicast Multicast 1078 * @ingroup lwip_opts_infrastructure 1079 * @{ 1080 */ 1081 /** 1082 * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options 1083 * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only) 1084 * core support for the corresponding IPv6 options. 1085 */ 1086 #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ 1087 #define LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW)) 1088 #endif 1089 /** 1090 * @} 1091 */ 1092 1093 /* 1094 ---------------------------------- 1095 ---------- IGMP options ---------- 1096 ---------------------------------- 1097 */ 1098 /** 1099 * @defgroup lwip_opts_igmp IGMP 1100 * @ingroup lwip_opts_ipv4 1101 * @{ 1102 */ 1103 /** 1104 * LWIP_IGMP==1: Turn on IGMP module. 1105 */ 1106 #if !defined LWIP_IGMP || defined __DOXYGEN__ 1107 #define LWIP_IGMP 0 1108 #endif 1109 #if !LWIP_IPV4 1110 #undef LWIP_IGMP 1111 #define LWIP_IGMP 0 1112 #endif 1113 /** 1114 * @} 1115 */ 1116 1117 /* 1118 ---------------------------------- 1119 ---------- DNS options ----------- 1120 ---------------------------------- 1121 */ 1122 /** 1123 * @defgroup lwip_opts_dns DNS 1124 * @ingroup lwip_opts_callback 1125 * @{ 1126 */ 1127 /** 1128 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS 1129 * transport. 1130 */ 1131 #if !defined LWIP_DNS || defined __DOXYGEN__ 1132 #define LWIP_DNS 0 1133 #endif 1134 1135 /** DNS maximum number of entries to maintain locally. */ 1136 #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ 1137 #define DNS_TABLE_SIZE 4 1138 #endif 1139 1140 /** DNS maximum host name length supported in the name table. */ 1141 #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ 1142 #define DNS_MAX_NAME_LENGTH 256 1143 #endif 1144 1145 /** The maximum of DNS servers 1146 * The first server can be initialized automatically by defining 1147 * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' 1148 */ 1149 #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ 1150 #define DNS_MAX_SERVERS 2 1151 #endif 1152 1153 /** DNS maximum number of retries when asking for a name, before "timeout". */ 1154 #if !defined DNS_MAX_RETRIES || defined __DOXYGEN__ 1155 #define DNS_MAX_RETRIES 4 1156 #endif 1157 1158 /** DNS do a name checking between the query and the response. */ 1159 #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ 1160 #define DNS_DOES_NAME_CHECK 1 1161 #endif 1162 1163 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation 1164 * Use all DNS security features by default. 1165 * This is overridable but should only be needed by very small targets 1166 * or when using against non standard DNS servers. */ 1167 #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ 1168 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) 1169 #endif 1170 1171 /* A list of DNS security features follows */ 1172 #define LWIP_DNS_SECURE_RAND_XID 1 1173 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 1174 #define LWIP_DNS_SECURE_RAND_SRC_PORT 4 1175 1176 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: 1177 * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ 1178 * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} 1179 * 1180 * Instead, you can also use an external function: 1181 * \#define DNS_LOOKUP_LOCAL_EXTERN(name, namelen, addr, dns_addrtype) my_lookup_function(name, namelen, addr, dns_addrtype) 1182 * with function signature: 1183 * extern err_t my_lookup_function(const char *name, size_t namelen, ip_addr_t *addr, u8_t dns_addrtype) 1184 * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). 1185 */ 1186 #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ 1187 #define DNS_LOCAL_HOSTLIST 0 1188 #endif /* DNS_LOCAL_HOSTLIST */ 1189 1190 /** If this is turned on, the local host-list can be dynamically changed 1191 * at runtime. */ 1192 #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ 1193 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 1194 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ 1195 1196 /** Set this to 1 to enable querying ".local" names via mDNS 1197 * using a One-Shot Multicast DNS Query */ 1198 #if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__ 1199 #define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 1200 #endif 1201 /** 1202 * @} 1203 */ 1204 1205 /* 1206 --------------------------------- 1207 ---------- UDP options ---------- 1208 --------------------------------- 1209 */ 1210 /** 1211 * @defgroup lwip_opts_udp UDP 1212 * @ingroup lwip_opts_callback 1213 * @{ 1214 */ 1215 /** 1216 * LWIP_UDP==1: Turn on UDP. 1217 */ 1218 #if !defined LWIP_UDP || defined __DOXYGEN__ 1219 #define LWIP_UDP 1 1220 #endif 1221 1222 /** 1223 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) 1224 */ 1225 #if !defined LWIP_UDPLITE || defined __DOXYGEN__ 1226 #define LWIP_UDPLITE 0 1227 #endif 1228 1229 /** 1230 * UDP_TTL: Default Time-To-Live value. 1231 */ 1232 #if !defined UDP_TTL || defined __DOXYGEN__ 1233 #define UDP_TTL IP_DEFAULT_TTL 1234 #endif 1235 1236 /** 1237 * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. 1238 */ 1239 #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ 1240 #define LWIP_NETBUF_RECVINFO 0 1241 #endif 1242 /** 1243 * @} 1244 */ 1245 1246 /* 1247 --------------------------------- 1248 ---------- TCP options ---------- 1249 --------------------------------- 1250 */ 1251 /** 1252 * @defgroup lwip_opts_tcp TCP 1253 * @ingroup lwip_opts_callback 1254 * @{ 1255 */ 1256 /** 1257 * LWIP_TCP==1: Turn on TCP. 1258 */ 1259 #if !defined LWIP_TCP || defined __DOXYGEN__ 1260 #define LWIP_TCP 1 1261 #endif 1262 1263 /** 1264 * TCP_TTL: Default Time-To-Live value. 1265 */ 1266 #if !defined TCP_TTL || defined __DOXYGEN__ 1267 #define TCP_TTL IP_DEFAULT_TTL 1268 #endif 1269 1270 /** 1271 * TCP_WND: The size of a TCP window. This must be at least 1272 * (2 * TCP_MSS) for things to work well. 1273 * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size 1274 * with scaling applied. Maximum window value in the TCP header 1275 * will be TCP_WND >> TCP_RCV_SCALE 1276 */ 1277 #if !defined TCP_WND || defined __DOXYGEN__ 1278 #define TCP_WND (4 * TCP_MSS) 1279 #endif 1280 1281 /** 1282 * TCP_MAXRTX: Maximum number of retransmissions of data segments. 1283 */ 1284 #if !defined TCP_MAXRTX || defined __DOXYGEN__ 1285 #define TCP_MAXRTX 12 1286 #endif 1287 1288 /** 1289 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. 1290 */ 1291 #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ 1292 #define TCP_SYNMAXRTX 6 1293 #endif 1294 1295 /** 1296 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. 1297 * Define to 0 if your device is low on memory. 1298 */ 1299 #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ 1300 #define TCP_QUEUE_OOSEQ LWIP_TCP 1301 #endif 1302 1303 /** 1304 * LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs). 1305 */ 1306 #if !defined LWIP_TCP_SACK_OUT || defined __DOXYGEN__ 1307 #define LWIP_TCP_SACK_OUT 0 1308 #endif 1309 1310 /** 1311 * LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments. 1312 * Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled. 1313 * NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment 1314 * (depending on other options), setting this option to values greater than 4 is not pointless. 1315 * This is basically the max number of SACK ranges we want to keep track of. 1316 * As new data is delivered, some of the SACK ranges may be removed or merged. 1317 * In that case some of those older SACK ranges may be used again. 1318 * The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB. 1319 */ 1320 #if !defined LWIP_TCP_MAX_SACK_NUM || defined __DOXYGEN__ 1321 #define LWIP_TCP_MAX_SACK_NUM 4 1322 #endif 1323 1324 /** 1325 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, 1326 * you might want to increase this.) 1327 * For the receive side, this MSS is advertised to the remote side 1328 * when opening a connection. For the transmit size, this MSS sets 1329 * an upper limit on the MSS advertised by the remote host. 1330 */ 1331 #if !defined TCP_MSS || defined __DOXYGEN__ 1332 #define TCP_MSS 536 1333 #endif 1334 1335 /** 1336 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really 1337 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which 1338 * reflects the available reassembly buffer size at the remote host) and the 1339 * largest size permitted by the IP layer" (RFC 1122) 1340 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the 1341 * netif used for a connection and limits the MSS if it would be too big otherwise. 1342 */ 1343 #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ 1344 #define TCP_CALCULATE_EFF_SEND_MSS 1 1345 #endif 1346 1347 1348 /** 1349 * TCP_SND_BUF: TCP sender buffer space (bytes). 1350 * To achieve good performance, this should be at least 2 * TCP_MSS. 1351 */ 1352 #if !defined TCP_SND_BUF || defined __DOXYGEN__ 1353 #define TCP_SND_BUF (2 * TCP_MSS) 1354 #endif 1355 1356 /** 1357 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least 1358 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. 1359 */ 1360 #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ 1361 #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) 1362 #endif 1363 1364 /** 1365 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than 1366 * TCP_SND_BUF. It is the amount of space which must be available in the 1367 * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). 1368 */ 1369 #if !defined TCP_SNDLOWAT || defined __DOXYGEN__ 1370 #define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) 1371 #endif 1372 1373 /** 1374 * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less 1375 * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below 1376 * this number, select returns writable (combined with TCP_SNDLOWAT). 1377 */ 1378 #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ 1379 #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) 1380 #endif 1381 1382 /** 1383 * TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per 1384 * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). 1385 * Only valid for TCP_QUEUE_OOSEQ==1. 1386 */ 1387 #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ 1388 #define TCP_OOSEQ_MAX_BYTES 0 1389 #endif 1390 1391 /** 1392 * TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued 1393 * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && 1394 * TCP_OOSEQ_MAX_BYTES==1. 1395 * Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb. 1396 */ 1397 #if !defined TCP_OOSEQ_BYTES_LIMIT 1398 #if TCP_OOSEQ_MAX_BYTES 1399 #define TCP_OOSEQ_BYTES_LIMIT(pcb) TCP_OOSEQ_MAX_BYTES 1400 #elif defined __DOXYGEN__ 1401 #define TCP_OOSEQ_BYTES_LIMIT(pcb) 1402 #endif 1403 #endif 1404 1405 /** 1406 * TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per 1407 * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). 1408 * Only valid for TCP_QUEUE_OOSEQ==1. 1409 */ 1410 #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ 1411 #define TCP_OOSEQ_MAX_PBUFS 0 1412 #endif 1413 1414 /** 1415 * TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued 1416 * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && 1417 * TCP_OOSEQ_MAX_PBUFS==1. 1418 * Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb. 1419 */ 1420 #if !defined TCP_OOSEQ_PBUFS_LIMIT 1421 #if TCP_OOSEQ_MAX_PBUFS 1422 #define TCP_OOSEQ_PBUFS_LIMIT(pcb) TCP_OOSEQ_MAX_PBUFS 1423 #elif defined __DOXYGEN__ 1424 #define TCP_OOSEQ_PBUFS_LIMIT(pcb) 1425 #endif 1426 #endif 1427 1428 /** 1429 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. 1430 */ 1431 #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ 1432 #define TCP_LISTEN_BACKLOG 0 1433 #endif 1434 1435 /** 1436 * The maximum allowed backlog for TCP listen netconns. 1437 * This backlog is used unless another is explicitly specified. 1438 * 0xff is the maximum (u8_t). 1439 */ 1440 #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ 1441 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff 1442 #endif 1443 1444 /** 1445 * TCP_OVERSIZE: The maximum number of bytes that tcp_write may 1446 * allocate ahead of time in an attempt to create shorter pbuf chains 1447 * for transmission. The meaningful range is 0 to TCP_MSS. Some 1448 * suggested values are: 1449 * 1450 * 0: Disable oversized allocation. Each tcp_write() allocates a new 1451 pbuf (old behaviour). 1452 * 1: Allocate size-aligned pbufs with minimal excess. Use this if your 1453 * scatter-gather DMA requires aligned fragments. 1454 * 128: Limit the pbuf/memory overhead to 20%. 1455 * TCP_MSS: Try to create unfragmented TCP packets. 1456 * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. 1457 */ 1458 #if !defined TCP_OVERSIZE || defined __DOXYGEN__ 1459 #define TCP_OVERSIZE TCP_MSS 1460 #endif 1461 1462 /** 1463 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. 1464 * The timestamp option is currently only used to help remote hosts, it is not 1465 * really used locally. Therefore, it is only enabled when a TS option is 1466 * received in the initial SYN packet from a remote host. 1467 */ 1468 #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ 1469 #define LWIP_TCP_TIMESTAMPS 0 1470 #endif 1471 1472 /** 1473 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an 1474 * explicit window update 1475 */ 1476 #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ 1477 #define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) 1478 #endif 1479 1480 /** 1481 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. 1482 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all 1483 * events (accept, sent, etc) that happen in the system. 1484 * LWIP_CALLBACK_API==1: The PCB callback function is called directly 1485 * for the event. This is the default. 1486 */ 1487 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ 1488 #define LWIP_EVENT_API 0 1489 #define LWIP_CALLBACK_API 1 1490 #else 1491 #ifndef LWIP_EVENT_API 1492 #define LWIP_EVENT_API 0 1493 #endif 1494 #ifndef LWIP_CALLBACK_API 1495 #define LWIP_CALLBACK_API 0 1496 #endif 1497 #endif 1498 1499 /** 1500 * LWIP_WND_SCALE and TCP_RCV_SCALE: 1501 * Set LWIP_WND_SCALE to 1 to enable window scaling. 1502 * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the 1503 * range of [0..14]). 1504 * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large 1505 * send window while having a small receive window only. 1506 */ 1507 #if !defined LWIP_WND_SCALE || defined __DOXYGEN__ 1508 #define LWIP_WND_SCALE 0 1509 #define TCP_RCV_SCALE 0 1510 #endif 1511 1512 /** 1513 * LWIP_TCP_PCB_NUM_EXT_ARGS: 1514 * When this is > 0, every tcp pcb (including listen pcb) includes a number of 1515 * additional argument entries in an array (see tcp_ext_arg_alloc_id) 1516 */ 1517 #if !defined LWIP_TCP_PCB_NUM_EXT_ARGS || defined __DOXYGEN__ 1518 #define LWIP_TCP_PCB_NUM_EXT_ARGS 0 1519 #endif 1520 1521 /** LWIP_ALTCP==1: enable the altcp API. 1522 * altcp is an abstraction layer that prevents applications linking against the 1523 * tcp.h functions but provides the same functionality. It is used to e.g. add 1524 * SSL/TLS or proxy-connect support to an application written for the tcp callback 1525 * API without that application knowing the protocol details. 1526 * 1527 * With LWIP_ALTCP==0, applications written against the altcp API can still be 1528 * compiled but are directly linked against the tcp.h callback API and then 1529 * cannot use layered protocols. 1530 * 1531 * See @ref altcp_api 1532 */ 1533 #if !defined LWIP_ALTCP || defined __DOXYGEN__ 1534 #define LWIP_ALTCP 0 1535 #endif 1536 1537 /** LWIP_ALTCP_TLS==1: enable TLS support for altcp API. 1538 * This needs a port of the functions in altcp_tls.h to a TLS library. 1539 * A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory 1540 * and LWIP_ALTCP_TLS_MBEDTLS option. 1541 */ 1542 #if !defined LWIP_ALTCP_TLS || defined __DOXYGEN__ 1543 #define LWIP_ALTCP_TLS 0 1544 #endif 1545 1546 /** 1547 * @} 1548 */ 1549 1550 /* 1551 ---------------------------------- 1552 ---------- Pbuf options ---------- 1553 ---------------------------------- 1554 */ 1555 /** 1556 * @defgroup lwip_opts_pbuf PBUF 1557 * @ingroup lwip_opts 1558 * @{ 1559 */ 1560 /** 1561 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a 1562 * link level header. The default is 14, the standard value for 1563 * Ethernet. 1564 */ 1565 #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ 1566 #if (defined LWIP_HOOK_VLAN_SET || LWIP_VLAN_PCP) && !defined __DOXYGEN__ 1567 #define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) 1568 #else /* LWIP_HOOK_VLAN_SET || LWIP_VLAN_PCP */ 1569 #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) 1570 #endif /* LWIP_HOOK_VLAN_SET || LWIP_VLAN_PCP */ 1571 #endif 1572 1573 /** 1574 * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated 1575 * for an additional encapsulation header before ethernet headers (e.g. 802.11) 1576 */ 1577 #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ 1578 #define PBUF_LINK_ENCAPSULATION_HLEN 0 1579 #endif 1580 1581 /** 1582 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is 1583 * designed to accommodate single full size TCP frame in one pbuf, including 1584 * TCP_MSS, IP header, and link header. 1585 */ 1586 #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ 1587 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) 1588 #endif 1589 1590 /** 1591 * LWIP_PBUF_REF_T: Refcount type in pbuf. 1592 * Default width of u8_t can be increased if 255 refs are not enough for you. 1593 */ 1594 #if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__ 1595 #define LWIP_PBUF_REF_T u8_t 1596 #endif 1597 1598 /** 1599 * LWIP_PBUF_CUSTOM_DATA: Store private data on pbufs (e.g. timestamps) 1600 * This extends struct pbuf so user can store custom data on every pbuf. 1601 */ 1602 #if !defined LWIP_PBUF_CUSTOM_DATA || defined __DOXYGEN__ 1603 #define LWIP_PBUF_CUSTOM_DATA 1604 #endif 1605 /** 1606 * @} 1607 */ 1608 1609 /* 1610 ------------------------------------------------ 1611 ---------- Network Interfaces options ---------- 1612 ------------------------------------------------ 1613 */ 1614 /** 1615 * @defgroup lwip_opts_netif NETIF 1616 * @ingroup lwip_opts 1617 * @{ 1618 */ 1619 /** 1620 * LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for 1621 * small real-life targets. Some code like routing etc. can be left out. 1622 */ 1623 #if !defined LWIP_SINGLE_NETIF || defined __DOXYGEN__ 1624 #define LWIP_SINGLE_NETIF 0 1625 #endif 1626 1627 /** 1628 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname 1629 * field. 1630 */ 1631 #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ 1632 #define LWIP_NETIF_HOSTNAME 0 1633 #endif 1634 1635 /** 1636 * LWIP_NETIF_API==1: Support netif api (in netifapi.c) 1637 */ 1638 #if !defined LWIP_NETIF_API || defined __DOXYGEN__ 1639 #define LWIP_NETIF_API 0 1640 #endif 1641 1642 /** 1643 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface 1644 * changes its up/down status (i.e., due to DHCP IP acquisition) 1645 */ 1646 #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ 1647 #define LWIP_NETIF_STATUS_CALLBACK 0 1648 #endif 1649 1650 /** 1651 * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function 1652 * for several netif related event that supports multiple subscribers. 1653 * @see netif_ext_status_callback 1654 */ 1655 #if !defined LWIP_NETIF_EXT_STATUS_CALLBACK || defined __DOXYGEN__ 1656 #define LWIP_NETIF_EXT_STATUS_CALLBACK 0 1657 #endif 1658 1659 /** 1660 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface 1661 * whenever the link changes (i.e., link down) 1662 */ 1663 #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ 1664 #define LWIP_NETIF_LINK_CALLBACK 0 1665 #endif 1666 1667 /** 1668 * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called 1669 * when a netif has been removed 1670 */ 1671 #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ 1672 #define LWIP_NETIF_REMOVE_CALLBACK 0 1673 #endif 1674 1675 /** 1676 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table 1677 * indices) in struct netif. TCP and UDP can make use of this to prevent 1678 * scanning the ARP table for every sent packet. While this is faster for big 1679 * ARP tables or many concurrent connections, it might be counterproductive 1680 * if you have a tiny ARP table or if there never are concurrent connections. 1681 */ 1682 #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ 1683 #define LWIP_NETIF_HWADDRHINT 0 1684 #endif 1685 1686 /** 1687 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data 1688 * to be sent into one single pbuf. This is for compatibility with DMA-enabled 1689 * MACs that do not support scatter-gather. 1690 * Beware that this might involve CPU-memcpy before transmitting that would not 1691 * be needed without this flag! Use this only if you need to! 1692 * 1693 * ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX 1694 * pbufs for being in one piece. If not, @ref pbuf_clone can be used to get 1695 * a single pbuf: 1696 * if (p->next != NULL) { 1697 * struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p); 1698 * if (q == NULL) { 1699 * return ERR_MEM; 1700 * } 1701 * p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller! 1702 * } 1703 */ 1704 #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ 1705 #define LWIP_NETIF_TX_SINGLE_PBUF 0 1706 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */ 1707 1708 /** 1709 * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store 1710 * data in client_data member array of struct netif (max. 256). 1711 */ 1712 #if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__ 1713 #define LWIP_NUM_NETIF_CLIENT_DATA 0 1714 #endif 1715 /** 1716 * @} 1717 */ 1718 1719 /* 1720 ------------------------------------ 1721 ---------- LOOPIF options ---------- 1722 ------------------------------------ 1723 */ 1724 /** 1725 * @defgroup lwip_opts_loop Loopback interface 1726 * @ingroup lwip_opts_netif 1727 * @{ 1728 */ 1729 /** 1730 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). 1731 * This is only needed when no real netifs are available. If at least one other 1732 * netif is available, loopback traffic uses this netif. 1733 */ 1734 #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ 1735 #define LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF) 1736 #endif 1737 1738 /** 1739 * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). 1740 */ 1741 #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ 1742 #define LWIP_LOOPIF_MULTICAST 0 1743 #endif 1744 1745 /** 1746 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP 1747 * address equal to the netif IP address, looping them back up the stack. 1748 */ 1749 #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ 1750 #define LWIP_NETIF_LOOPBACK 0 1751 #endif 1752 1753 /** 1754 * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback 1755 * sending for each netif (0 = disabled) 1756 */ 1757 #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ 1758 #define LWIP_LOOPBACK_MAX_PBUFS 0 1759 #endif 1760 1761 /** 1762 * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in 1763 * the system, as netifs must change how they behave depending on this setting 1764 * for the LWIP_NETIF_LOOPBACK option to work. 1765 * Setting this is needed to avoid reentering non-reentrant functions like 1766 * tcp_input(). 1767 * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a 1768 * multithreaded environment like tcpip.c. In this case, netif->input() 1769 * is called directly. 1770 * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. 1771 * The packets are put on a list and netif_poll() must be called in 1772 * the main application loop. 1773 */ 1774 #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ 1775 #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) 1776 #endif 1777 /** 1778 * @} 1779 */ 1780 1781 /* 1782 ------------------------------------ 1783 ---------- Thread options ---------- 1784 ------------------------------------ 1785 */ 1786 /** 1787 * @defgroup lwip_opts_thread Threading 1788 * @ingroup lwip_opts_infrastructure 1789 * @{ 1790 */ 1791 /** 1792 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. 1793 */ 1794 #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ 1795 #define TCPIP_THREAD_NAME "tcpip_thread" 1796 #endif 1797 1798 /** 1799 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. 1800 * The stack size value itself is platform-dependent, but is passed to 1801 * sys_thread_new() when the thread is created. 1802 */ 1803 #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ 1804 #define TCPIP_THREAD_STACKSIZE 0 1805 #endif 1806 1807 /** 1808 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. 1809 * The priority value itself is platform-dependent, but is passed to 1810 * sys_thread_new() when the thread is created. 1811 */ 1812 #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ 1813 #define TCPIP_THREAD_PRIO 1 1814 #endif 1815 1816 /** 1817 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages 1818 * The queue size value itself is platform-dependent, but is passed to 1819 * sys_mbox_new() when tcpip_init is called. 1820 */ 1821 #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ 1822 #define TCPIP_MBOX_SIZE 0 1823 #endif 1824 1825 /** 1826 * Define this to something that triggers a watchdog. This is called from 1827 * tcpip_thread after processing a message. 1828 */ 1829 #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ 1830 #define LWIP_TCPIP_THREAD_ALIVE() 1831 #endif 1832 1833 /** 1834 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. 1835 */ 1836 #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ 1837 #define SLIPIF_THREAD_NAME "slipif_loop" 1838 #endif 1839 1840 /** 1841 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. 1842 * The stack size value itself is platform-dependent, but is passed to 1843 * sys_thread_new() when the thread is created. 1844 */ 1845 #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ 1846 #define SLIPIF_THREAD_STACKSIZE 0 1847 #endif 1848 1849 /** 1850 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. 1851 * The priority value itself is platform-dependent, but is passed to 1852 * sys_thread_new() when the thread is created. 1853 */ 1854 #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ 1855 #define SLIPIF_THREAD_PRIO 1 1856 #endif 1857 1858 /** 1859 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. 1860 */ 1861 #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ 1862 #define DEFAULT_THREAD_NAME "lwIP" 1863 #endif 1864 1865 /** 1866 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. 1867 * The stack size value itself is platform-dependent, but is passed to 1868 * sys_thread_new() when the thread is created. 1869 */ 1870 #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ 1871 #define DEFAULT_THREAD_STACKSIZE 0 1872 #endif 1873 1874 /** 1875 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. 1876 * The priority value itself is platform-dependent, but is passed to 1877 * sys_thread_new() when the thread is created. 1878 */ 1879 #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ 1880 #define DEFAULT_THREAD_PRIO 1 1881 #endif 1882 1883 /** 1884 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1885 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed 1886 * to sys_mbox_new() when the recvmbox is created. 1887 */ 1888 #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ 1889 #define DEFAULT_RAW_RECVMBOX_SIZE 0 1890 #endif 1891 1892 /** 1893 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1894 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed 1895 * to sys_mbox_new() when the recvmbox is created. 1896 */ 1897 #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ 1898 #define DEFAULT_UDP_RECVMBOX_SIZE 0 1899 #endif 1900 1901 /** 1902 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 1903 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed 1904 * to sys_mbox_new() when the recvmbox is created. 1905 */ 1906 #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ 1907 #define DEFAULT_TCP_RECVMBOX_SIZE 0 1908 #endif 1909 1910 /** 1911 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. 1912 * The queue size value itself is platform-dependent, but is passed to 1913 * sys_mbox_new() when the acceptmbox is created. 1914 */ 1915 #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ 1916 #define DEFAULT_ACCEPTMBOX_SIZE 0 1917 #endif 1918 /** 1919 * @} 1920 */ 1921 1922 /* 1923 ---------------------------------------------- 1924 ---------- Sequential layer options ---------- 1925 ---------------------------------------------- 1926 */ 1927 /** 1928 * @defgroup lwip_opts_netconn Netconn 1929 * @ingroup lwip_opts_threadsafe_apis 1930 * @{ 1931 */ 1932 /** 1933 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) 1934 */ 1935 #if !defined LWIP_NETCONN || defined __DOXYGEN__ 1936 #define LWIP_NETCONN 1 1937 #endif 1938 1939 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create 1940 * timers running in tcpip_thread from another thread. 1941 */ 1942 #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ 1943 #define LWIP_TCPIP_TIMEOUT 0 1944 #endif 1945 1946 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per 1947 * thread calling socket/netconn functions instead of allocating one 1948 * semaphore per netconn (and per select etc.) 1949 * ATTENTION: a thread-local semaphore for API calls is needed: 1950 * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* 1951 * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore 1952 * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore 1953 * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). 1954 * Ports may call these for threads created with sys_thread_new(). 1955 */ 1956 #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ 1957 #define LWIP_NETCONN_SEM_PER_THREAD 0 1958 #endif 1959 1960 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, 1961 * writing from a 2nd thread and closing from a 3rd thread at the same time. 1962 * ATTENTION: This is currently really alpha! Some requirements: 1963 * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from 1964 * multiple threads at once 1965 * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox 1966 * and prevent a task pending on this during/after deletion 1967 */ 1968 #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ 1969 #define LWIP_NETCONN_FULLDUPLEX 0 1970 #endif 1971 /** 1972 * @} 1973 */ 1974 1975 /* 1976 ------------------------------------ 1977 ---------- Socket options ---------- 1978 ------------------------------------ 1979 */ 1980 /** 1981 * @defgroup lwip_opts_socket Sockets 1982 * @ingroup lwip_opts_threadsafe_apis 1983 * @{ 1984 */ 1985 /** 1986 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) 1987 */ 1988 #if !defined LWIP_SOCKET || defined __DOXYGEN__ 1989 #define LWIP_SOCKET 1 1990 #endif 1991 1992 /** 1993 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. 1994 * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. 1995 * While this helps code completion, it might conflict with existing libraries. 1996 * (only used if you use sockets.c) 1997 */ 1998 #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ 1999 #define LWIP_COMPAT_SOCKETS 1 2000 #endif 2001 2002 /** 2003 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. 2004 * Disable this option if you use a POSIX operating system that uses the same 2005 * names (read, write & close). (only used if you use sockets.c) 2006 */ 2007 #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ 2008 #define LWIP_POSIX_SOCKETS_IO_NAMES 1 2009 #endif 2010 2011 /** 2012 * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. 2013 * This can be useful when there are multiple APIs which create file descriptors. 2014 * When they all start with a different offset and you won't make them overlap you can 2015 * re implement read/write/close/ioctl/fnctl to send the requested action to the right 2016 * library (sharing select will need more work though). 2017 */ 2018 #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ 2019 #define LWIP_SOCKET_OFFSET 0 2020 #endif 2021 2022 /** 2023 * LWIP_SOCKET_EXTERNAL_HEADERS==1: Use external headers instead of sockets.h 2024 * and inet.h. In this case, user must provide its own headers by setting the 2025 * values for LWIP_SOCKET_EXTERNAL_HEADER_SOCKETS_H and 2026 * LWIP_SOCKET_EXTERNAL_HEADER_INET_H to appropriate include file names and the 2027 * whole content of the default sockets.h and inet.h is skipped. 2028 */ 2029 #if !defined LWIP_SOCKET_EXTERNAL_HEADERS || defined __DOXYGEN__ 2030 #define LWIP_SOCKET_EXTERNAL_HEADERS 0 2031 #endif 2032 2033 /** 2034 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT 2035 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set 2036 * in seconds. (does not require sockets.c, and will affect tcp.c) 2037 */ 2038 #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ 2039 #define LWIP_TCP_KEEPALIVE 0 2040 #endif 2041 2042 /** 2043 * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and 2044 * SO_SNDTIMEO processing. 2045 */ 2046 #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ 2047 #define LWIP_SO_SNDTIMEO 0 2048 #endif 2049 2050 /** 2051 * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and 2052 * SO_RCVTIMEO processing. 2053 */ 2054 #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ 2055 #define LWIP_SO_RCVTIMEO 0 2056 #endif 2057 2058 /** 2059 * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int 2060 * (milliseconds, much like winsock does) instead of a struct timeval (default). 2061 */ 2062 #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ 2063 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 2064 #endif 2065 2066 /** 2067 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. 2068 */ 2069 #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ 2070 #define LWIP_SO_RCVBUF 0 2071 #endif 2072 2073 /** 2074 * LWIP_SO_LINGER==1: Enable SO_LINGER processing. 2075 */ 2076 #if !defined LWIP_SO_LINGER || defined __DOXYGEN__ 2077 #define LWIP_SO_LINGER 0 2078 #endif 2079 2080 /** 2081 * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. 2082 */ 2083 #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ 2084 #define RECV_BUFSIZE_DEFAULT INT_MAX 2085 #endif 2086 2087 /** 2088 * By default, TCP socket/netconn close waits 20 seconds max to send the FIN 2089 */ 2090 #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ 2091 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 2092 #endif 2093 2094 /** 2095 * SO_REUSE==1: Enable SO_REUSEADDR option. 2096 */ 2097 #if !defined SO_REUSE || defined __DOXYGEN__ 2098 #define SO_REUSE 0 2099 #endif 2100 2101 /** 2102 * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets 2103 * to all local matches if SO_REUSEADDR is turned on. 2104 * WARNING: Adds a memcpy for every packet if passing to more than one pcb! 2105 */ 2106 #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ 2107 #define SO_REUSE_RXTOALL 0 2108 #endif 2109 2110 /** 2111 * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of 2112 * pending data in the network buffer. This is the way windows does it. It's 2113 * the default for lwIP since it is smaller. 2114 * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next 2115 * pending datagram in bytes. This is the way linux does it. This code is only 2116 * here for compatibility. 2117 */ 2118 #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ 2119 #define LWIP_FIONREAD_LINUXMODE 0 2120 #endif 2121 2122 /** 2123 * LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn 2124 * callback to keep track of events). 2125 * This saves RAM (counters per socket) and code (netconn event callback), which 2126 * should improve performance a bit). 2127 */ 2128 #if !defined LWIP_SOCKET_SELECT || defined __DOXYGEN__ 2129 #define LWIP_SOCKET_SELECT 1 2130 #endif 2131 2132 /** 2133 * LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including 2134 * struct pollfd, nfds_t, and constants) 2135 */ 2136 #if !defined LWIP_SOCKET_POLL || defined __DOXYGEN__ 2137 #define LWIP_SOCKET_POLL 1 2138 #endif 2139 /** 2140 * @} 2141 */ 2142 2143 /* 2144 ---------------------------------------- 2145 ---------- Statistics options ---------- 2146 ---------------------------------------- 2147 */ 2148 /** 2149 * @defgroup lwip_opts_stats Statistics 2150 * @ingroup lwip_opts_debug 2151 * @{ 2152 */ 2153 /** 2154 * LWIP_STATS==1: Enable statistics collection in lwip_stats. 2155 */ 2156 #if !defined LWIP_STATS || defined __DOXYGEN__ 2157 #define LWIP_STATS 1 2158 #endif 2159 2160 #if LWIP_STATS 2161 2162 /** 2163 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. 2164 */ 2165 #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ 2166 #define LWIP_STATS_DISPLAY 0 2167 #endif 2168 2169 /** 2170 * LINK_STATS==1: Enable link stats. 2171 */ 2172 #if !defined LINK_STATS || defined __DOXYGEN__ 2173 #define LINK_STATS 1 2174 #endif 2175 2176 /** 2177 * ETHARP_STATS==1: Enable etharp stats. 2178 */ 2179 #if !defined ETHARP_STATS || defined __DOXYGEN__ 2180 #define ETHARP_STATS (LWIP_ARP) 2181 #endif 2182 2183 /** 2184 * IP_STATS==1: Enable IP stats. 2185 */ 2186 #if !defined IP_STATS || defined __DOXYGEN__ 2187 #define IP_STATS 1 2188 #endif 2189 2190 /** 2191 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is 2192 * on if using either frag or reass. 2193 */ 2194 #if !defined IPFRAG_STATS || defined __DOXYGEN__ 2195 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) 2196 #endif 2197 2198 /** 2199 * ICMP_STATS==1: Enable ICMP stats. 2200 */ 2201 #if !defined ICMP_STATS || defined __DOXYGEN__ 2202 #define ICMP_STATS 1 2203 #endif 2204 2205 /** 2206 * IGMP_STATS==1: Enable IGMP stats. 2207 */ 2208 #if !defined IGMP_STATS || defined __DOXYGEN__ 2209 #define IGMP_STATS (LWIP_IGMP) 2210 #endif 2211 2212 /** 2213 * UDP_STATS==1: Enable UDP stats. Default is on if 2214 * UDP enabled, otherwise off. 2215 */ 2216 #if !defined UDP_STATS || defined __DOXYGEN__ 2217 #define UDP_STATS (LWIP_UDP) 2218 #endif 2219 2220 /** 2221 * TCP_STATS==1: Enable TCP stats. Default is on if TCP 2222 * enabled, otherwise off. 2223 */ 2224 #if !defined TCP_STATS || defined __DOXYGEN__ 2225 #define TCP_STATS (LWIP_TCP) 2226 #endif 2227 2228 /** 2229 * MEM_STATS==1: Enable mem.c stats. 2230 */ 2231 #if !defined MEM_STATS || defined __DOXYGEN__ 2232 #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) 2233 #endif 2234 2235 /** 2236 * MEMP_STATS==1: Enable memp.c pool stats. 2237 */ 2238 #if !defined MEMP_STATS || defined __DOXYGEN__ 2239 #define MEMP_STATS (MEMP_MEM_MALLOC == 0) 2240 #endif 2241 2242 /** 2243 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). 2244 */ 2245 #if !defined SYS_STATS || defined __DOXYGEN__ 2246 #define SYS_STATS (NO_SYS == 0) 2247 #endif 2248 2249 /** 2250 * IP6_STATS==1: Enable IPv6 stats. 2251 */ 2252 #if !defined IP6_STATS || defined __DOXYGEN__ 2253 #define IP6_STATS (LWIP_IPV6) 2254 #endif 2255 2256 /** 2257 * ICMP6_STATS==1: Enable ICMP for IPv6 stats. 2258 */ 2259 #if !defined ICMP6_STATS || defined __DOXYGEN__ 2260 #define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) 2261 #endif 2262 2263 /** 2264 * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. 2265 */ 2266 #if !defined IP6_FRAG_STATS || defined __DOXYGEN__ 2267 #define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) 2268 #endif 2269 2270 /** 2271 * MLD6_STATS==1: Enable MLD for IPv6 stats. 2272 */ 2273 #if !defined MLD6_STATS || defined __DOXYGEN__ 2274 #define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) 2275 #endif 2276 2277 /** 2278 * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. 2279 */ 2280 #if !defined ND6_STATS || defined __DOXYGEN__ 2281 #define ND6_STATS (LWIP_IPV6) 2282 #endif 2283 2284 /** 2285 * MIB2_STATS==1: Stats for SNMP MIB2. 2286 */ 2287 #if !defined MIB2_STATS || defined __DOXYGEN__ 2288 #define MIB2_STATS 0 2289 #endif 2290 2291 #else 2292 2293 #define LINK_STATS 0 2294 #define ETHARP_STATS 0 2295 #define IP_STATS 0 2296 #define IPFRAG_STATS 0 2297 #define ICMP_STATS 0 2298 #define IGMP_STATS 0 2299 #define UDP_STATS 0 2300 #define TCP_STATS 0 2301 #define MEM_STATS 0 2302 #define MEMP_STATS 0 2303 #define SYS_STATS 0 2304 #define LWIP_STATS_DISPLAY 0 2305 #define IP6_STATS 0 2306 #define ICMP6_STATS 0 2307 #define IP6_FRAG_STATS 0 2308 #define MLD6_STATS 0 2309 #define ND6_STATS 0 2310 #define MIB2_STATS 0 2311 2312 #endif /* LWIP_STATS */ 2313 /** 2314 * @} 2315 */ 2316 2317 /* 2318 -------------------------------------- 2319 ---------- Checksum options ---------- 2320 -------------------------------------- 2321 */ 2322 /** 2323 * @defgroup lwip_opts_checksum Checksum 2324 * @ingroup lwip_opts_infrastructure 2325 * @{ 2326 */ 2327 /** 2328 * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled 2329 * per netif. 2330 * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! 2331 */ 2332 #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ 2333 #define LWIP_CHECKSUM_CTRL_PER_NETIF 0 2334 #endif 2335 2336 /** 2337 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. 2338 */ 2339 #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ 2340 #define CHECKSUM_GEN_IP 1 2341 #endif 2342 2343 /** 2344 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. 2345 */ 2346 #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ 2347 #define CHECKSUM_GEN_UDP 1 2348 #endif 2349 2350 /** 2351 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. 2352 */ 2353 #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ 2354 #define CHECKSUM_GEN_TCP 1 2355 #endif 2356 2357 /** 2358 * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. 2359 */ 2360 #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ 2361 #define CHECKSUM_GEN_ICMP 1 2362 #endif 2363 2364 /** 2365 * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. 2366 */ 2367 #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ 2368 #define CHECKSUM_GEN_ICMP6 1 2369 #endif 2370 2371 /** 2372 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. 2373 */ 2374 #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ 2375 #define CHECKSUM_CHECK_IP 1 2376 #endif 2377 2378 /** 2379 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. 2380 */ 2381 #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ 2382 #define CHECKSUM_CHECK_UDP 1 2383 #endif 2384 2385 /** 2386 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. 2387 */ 2388 #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ 2389 #define CHECKSUM_CHECK_TCP 1 2390 #endif 2391 2392 /** 2393 * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. 2394 */ 2395 #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ 2396 #define CHECKSUM_CHECK_ICMP 1 2397 #endif 2398 2399 /** 2400 * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets 2401 */ 2402 #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ 2403 #define CHECKSUM_CHECK_ICMP6 1 2404 #endif 2405 2406 /** 2407 * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from 2408 * application buffers to pbufs. 2409 */ 2410 #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ 2411 #define LWIP_CHECKSUM_ON_COPY 0 2412 #endif 2413 /** 2414 * @} 2415 */ 2416 2417 /* 2418 --------------------------------------- 2419 ---------- IPv6 options --------------- 2420 --------------------------------------- 2421 */ 2422 /** 2423 * @defgroup lwip_opts_ipv6 IPv6 2424 * @ingroup lwip_opts 2425 * @{ 2426 */ 2427 /** 2428 * LWIP_IPV6==1: Enable IPv6 2429 */ 2430 #if !defined LWIP_IPV6 || defined __DOXYGEN__ 2431 #define LWIP_IPV6 0 2432 #endif 2433 2434 /** 2435 * IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally) 2436 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 2437 * in this time, the whole packet is discarded. 2438 */ 2439 #if !defined IPV6_REASS_MAXAGE || defined __DOXYGEN__ 2440 #define IPV6_REASS_MAXAGE 60 2441 #endif 2442 2443 /** 2444 * LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that 2445 * e.g. link-local addresses are really treated as link-local. Disable this 2446 * setting only for single-interface configurations. 2447 * All addresses that have a scope according to the default policy (link-local 2448 * unicast addresses, interface-local and link-local multicast addresses) should 2449 * now have a zone set on them before being passed to the core API, although 2450 * lwIP will currently attempt to select a zone on the caller's behalf when 2451 * necessary. Applications that directly assign IPv6 addresses to interfaces 2452 * (which is NOT recommended) must now ensure that link-local addresses carry 2453 * the netif's zone. See the new ip6_zone.h header file for more information and 2454 * relevant macros. For now it is still possible to turn off scopes support 2455 * through the new LWIP_IPV6_SCOPES option. When upgrading an implementation that 2456 * uses the core API directly, it is highly recommended to enable 2457 * LWIP_IPV6_SCOPES_DEBUG at least for a while, to ensure e.g. proper address 2458 * initialization. 2459 */ 2460 #if !defined LWIP_IPV6_SCOPES || defined __DOXYGEN__ 2461 #define LWIP_IPV6_SCOPES (LWIP_IPV6 && !LWIP_SINGLE_NETIF) 2462 #endif 2463 2464 /** 2465 * LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses 2466 * are properly zoned (see ip6_zone.h on what that means) where it matters. 2467 * Enabling this setting is highly recommended when upgrading from an existing 2468 * installation that is not yet scope-aware; otherwise it may be too expensive. 2469 */ 2470 #if !defined LWIP_IPV6_SCOPES_DEBUG || defined __DOXYGEN__ 2471 #define LWIP_IPV6_SCOPES_DEBUG 0 2472 #endif 2473 2474 /** 2475 * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. 2476 */ 2477 #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ 2478 #define LWIP_IPV6_NUM_ADDRESSES 3 2479 #endif 2480 2481 /** 2482 * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs 2483 */ 2484 #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ 2485 #define LWIP_IPV6_FORWARD 0 2486 #endif 2487 2488 /** 2489 * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. 2490 */ 2491 #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ 2492 #define LWIP_IPV6_FRAG 1 2493 #endif 2494 2495 /** 2496 * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented 2497 */ 2498 #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ 2499 #define LWIP_IPV6_REASS LWIP_IPV6 2500 #endif 2501 2502 /** 2503 * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during 2504 * network startup. 2505 */ 2506 #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ 2507 #define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 2508 #endif 2509 2510 /** 2511 * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. 2512 */ 2513 #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ 2514 #define LWIP_IPV6_AUTOCONFIG LWIP_IPV6 2515 #endif 2516 2517 /** 2518 * LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each 2519 * IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled 2520 * otherwise, in which case the application may assign address lifetimes with 2521 * the appropriate macros. Addresses with no lifetime are assumed to be static. 2522 * If this option is disabled, all addresses are assumed to be static. 2523 */ 2524 #if !defined LWIP_IPV6_ADDRESS_LIFETIMES || defined __DOXYGEN__ 2525 #define LWIP_IPV6_ADDRESS_LIFETIMES LWIP_IPV6_AUTOCONFIG 2526 #endif 2527 2528 /** 2529 * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts. 2530 */ 2531 #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ 2532 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 2533 #endif 2534 /** 2535 * @} 2536 */ 2537 2538 /** 2539 * @defgroup lwip_opts_icmp6 ICMP6 2540 * @ingroup lwip_opts_ipv6 2541 * @{ 2542 */ 2543 /** 2544 * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) 2545 */ 2546 #if !defined LWIP_ICMP6 || defined __DOXYGEN__ 2547 #define LWIP_ICMP6 LWIP_IPV6 2548 #endif 2549 2550 /** 2551 * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in 2552 * ICMPv6 error messages. 2553 */ 2554 #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ 2555 #define LWIP_ICMP6_DATASIZE 8 2556 #endif 2557 2558 /** 2559 * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages 2560 */ 2561 #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ 2562 #define LWIP_ICMP6_HL 255 2563 #endif 2564 /** 2565 * @} 2566 */ 2567 2568 /** 2569 * @defgroup lwip_opts_mld6 Multicast listener discovery 2570 * @ingroup lwip_opts_ipv6 2571 * @{ 2572 */ 2573 /** 2574 * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. 2575 * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must 2576 * indiscriminately pass all inbound IPv6 multicast traffic to lwIP. 2577 */ 2578 #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ 2579 #define LWIP_IPV6_MLD LWIP_IPV6 2580 #endif 2581 2582 /** 2583 * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. 2584 * There must be enough groups so that each netif can join the solicited-node 2585 * multicast group for each of its local addresses, plus one for MDNS if 2586 * applicable, plus any number of groups to be joined on UDP sockets. 2587 */ 2588 #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ 2589 #define MEMP_NUM_MLD6_GROUP 4 2590 #endif 2591 /** 2592 * @} 2593 */ 2594 2595 /** 2596 * @defgroup lwip_opts_nd6 Neighbor discovery 2597 * @ingroup lwip_opts_ipv6 2598 * @{ 2599 */ 2600 /** 2601 * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address 2602 * is being resolved. 2603 */ 2604 #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ 2605 #define LWIP_ND6_QUEUEING LWIP_IPV6 2606 #endif 2607 2608 /** 2609 * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. 2610 */ 2611 #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ 2612 #define MEMP_NUM_ND6_QUEUE 20 2613 #endif 2614 2615 /** 2616 * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache 2617 */ 2618 #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ 2619 #define LWIP_ND6_NUM_NEIGHBORS 10 2620 #endif 2621 2622 /** 2623 * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache 2624 */ 2625 #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ 2626 #define LWIP_ND6_NUM_DESTINATIONS 10 2627 #endif 2628 2629 /** 2630 * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache 2631 */ 2632 #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ 2633 #define LWIP_ND6_NUM_PREFIXES 5 2634 #endif 2635 2636 /** 2637 * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache 2638 */ 2639 #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ 2640 #define LWIP_ND6_NUM_ROUTERS 3 2641 #endif 2642 2643 /** 2644 * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send 2645 * (neighbor solicit and router solicit) 2646 */ 2647 #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ 2648 #define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 2649 #endif 2650 2651 /** 2652 * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages 2653 * to send during neighbor reachability detection. 2654 */ 2655 #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ 2656 #define LWIP_ND6_MAX_UNICAST_SOLICIT 3 2657 #endif 2658 2659 /** 2660 * Unused: See ND RFC (time in milliseconds). 2661 */ 2662 #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ 2663 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 2664 #endif 2665 2666 /** 2667 * Unused: See ND RFC 2668 */ 2669 #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ 2670 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 2671 #endif 2672 2673 /** 2674 * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). 2675 * May be updated by router advertisement messages. 2676 */ 2677 #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ 2678 #define LWIP_ND6_REACHABLE_TIME 30000 2679 #endif 2680 2681 /** 2682 * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages 2683 */ 2684 #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ 2685 #define LWIP_ND6_RETRANS_TIMER 1000 2686 #endif 2687 2688 /** 2689 * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation 2690 * message is sent, during neighbor reachability detection. 2691 */ 2692 #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__ 2693 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 2694 #endif 2695 2696 /** 2697 * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update 2698 * Reachable time and retransmission timers, and netif MTU. 2699 */ 2700 #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ 2701 #define LWIP_ND6_ALLOW_RA_UPDATES 1 2702 #endif 2703 2704 /** 2705 * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery 2706 * with reachability hints for connected destinations. This helps avoid sending 2707 * unicast neighbor solicitation messages. 2708 */ 2709 #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ 2710 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1 2711 #endif 2712 2713 /** 2714 * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive 2715 * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS 2716 * servers to the DNS module. 2717 */ 2718 #if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__ 2719 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 2720 #endif 2721 /** 2722 * @} 2723 */ 2724 2725 /** 2726 * @defgroup lwip_opts_dhcpv6 DHCPv6 2727 * @ingroup lwip_opts_ipv6 2728 * @{ 2729 */ 2730 /** 2731 * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration. 2732 */ 2733 #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ 2734 #define LWIP_IPV6_DHCP6 0 2735 #endif 2736 2737 /** 2738 * LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration. 2739 * (not supported, yet!) 2740 */ 2741 #if !defined LWIP_IPV6_DHCP6_STATEFUL || defined __DOXYGEN__ 2742 #define LWIP_IPV6_DHCP6_STATEFUL 0 2743 #endif 2744 2745 /** 2746 * LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration. 2747 */ 2748 #if !defined LWIP_IPV6_DHCP6_STATELESS || defined __DOXYGEN__ 2749 #define LWIP_IPV6_DHCP6_STATELESS LWIP_IPV6_DHCP6 2750 #endif 2751 2752 /** 2753 * LWIP_DHCP6_GETS_NTP==1: Request NTP servers via DHCPv6. For each 2754 * response packet, a callback is called, which has to be provided by the port: 2755 * void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 2756 */ 2757 #if !defined LWIP_DHCP6_GET_NTP_SRV || defined __DOXYGEN__ 2758 #define LWIP_DHCP6_GET_NTP_SRV 0 2759 #endif 2760 2761 /** 2762 * The maximum of NTP servers requested 2763 */ 2764 #if !defined LWIP_DHCP6_MAX_NTP_SERVERS || defined __DOXYGEN__ 2765 #define LWIP_DHCP6_MAX_NTP_SERVERS 1 2766 #endif 2767 2768 /** 2769 * LWIP_DHCP6_MAX_DNS_SERVERS > 0: Request DNS servers via DHCPv6. 2770 * DNS servers received in the response are passed to DNS via @ref dns_setserver() 2771 * (up to the maximum limit defined here). 2772 */ 2773 #if !defined LWIP_DHCP6_MAX_DNS_SERVERS || defined __DOXYGEN__ 2774 #define LWIP_DHCP6_MAX_DNS_SERVERS DNS_MAX_SERVERS 2775 #endif 2776 /** 2777 * @} 2778 */ 2779 2780 /* 2781 --------------------------------------- 2782 ---------- Hook options --------------- 2783 --------------------------------------- 2784 */ 2785 2786 /** 2787 * @defgroup lwip_opts_hooks Hooks 2788 * @ingroup lwip_opts_infrastructure 2789 * Hooks are undefined by default, define them to a function if you need them. 2790 * @{ 2791 */ 2792 2793 /** 2794 * LWIP_HOOK_FILENAME: Custom filename to \#include in files that provide hooks. 2795 * Declare your hook function prototypes in there, you may also \#include all headers 2796 * providing data types that are need in this file. 2797 */ 2798 #ifdef __DOXYGEN__ 2799 #define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" 2800 #endif 2801 2802 /** 2803 * LWIP_HOOK_TCP_ISN: 2804 * Hook for generation of the Initial Sequence Number (ISN) for a new TCP 2805 * connection. The default lwIP ISN generation algorithm is very basic and may 2806 * allow for TCP spoofing attacks. This hook provides the means to implement 2807 * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), 2808 * or any other desired algorithm as a replacement. 2809 * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for 2810 * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.<br> 2811 * Signature:\code{.c} 2812 * 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); 2813 * \endcode 2814 * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations<br> 2815 * Arguments: 2816 * - local_ip: pointer to the local IP address of the connection 2817 * - local_port: local port number of the connection (host-byte order) 2818 * - remote_ip: pointer to the remote IP address of the connection 2819 * - remote_port: remote port number of the connection (host-byte order)<br> 2820 * Return value: 2821 * - the 32-bit Initial Sequence Number to use for the new TCP connection. 2822 */ 2823 #ifdef __DOXYGEN__ 2824 #define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) 2825 #endif 2826 2827 /** 2828 * LWIP_HOOK_TCP_INPACKET_PCB: 2829 * Hook for intercepting incoming packets before they are passed to a pcb. This 2830 * allows updating some state or even dropping a packet. 2831 * Signature:\code{.c} 2832 * err_t my_hook_tcp_inpkt(struct tcp_pcb *pcb, struct tcp_hdr *hdr, u16_t optlen, u16_t opt1len, u8_t *opt2, struct pbuf *p); 2833 * \endcode 2834 * Arguments: 2835 * - pcb: tcp_pcb selected for input of this packet (ATTENTION: this may be 2836 * struct tcp_pcb_listen if pcb->state == LISTEN) 2837 * - hdr: pointer to tcp header (ATTENTION: tcp options may not be in one piece!) 2838 * - optlen: tcp option length 2839 * - opt1len: tcp option length 1st part 2840 * - opt2: if this is != NULL, tcp options are split among 2 pbufs. In that case, 2841 * options start at right after the tcp header ('(u8_t*)(hdr + 1)') for 2842 * the first 'opt1len' bytes and the rest starts at 'opt2'. opt2len can 2843 * be simply calculated: 'opt2len = optlen - opt1len;' 2844 * - p: input packet, p->payload points to application data (that's why tcp hdr 2845 * and options are passed in seperately) 2846 * Return value: 2847 * - ERR_OK: continue input of this packet as normal 2848 * - != ERR_OK: drop this packet for input (don't continue input processing) 2849 * 2850 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 2851 * state or any pcb lists) from this callback! 2852 */ 2853 #ifdef __DOXYGEN__ 2854 #define LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p) 2855 #endif 2856 2857 /** 2858 * LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH: 2859 * Hook for increasing the size of the options allocated with a tcp header. 2860 * Together with LWIP_HOOK_TCP_OUT_ADD_TCPOPTS, this can be used to add custom 2861 * options to outgoing tcp segments. 2862 * Signature:\code{.c} 2863 * u8_t my_hook_tcp_out_tcpopt_length(const struct tcp_pcb *pcb, u8_t internal_option_length); 2864 * \endcode 2865 * Arguments: 2866 * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or 2867 * struct tcp_pcb_listen if pcb->state == LISTEN) 2868 * - internal_option_length: tcp option length used by the stack internally 2869 * Return value: 2870 * - a number of bytes to allocate for tcp options (internal_option_length <= ret <= 40) 2871 * 2872 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 2873 * state or any pcb lists) from this callback! 2874 */ 2875 #ifdef __DOXYGEN__ 2876 #define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len) 2877 #endif 2878 2879 /** 2880 * LWIP_HOOK_TCP_OUT_ADD_TCPOPTS: 2881 * Hook for adding custom options to outgoing tcp segments. 2882 * Space for these custom options has to be reserved via LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH. 2883 * Signature:\code{.c} 2884 * u32_t *my_hook_tcp_out_add_tcpopts(struct pbuf *p, struct tcp_hdr *hdr, const struct tcp_pcb *pcb, u32_t *opts); 2885 * \endcode 2886 * Arguments: 2887 * - p: output packet, p->payload pointing to tcp header, data follows 2888 * - hdr: tcp header 2889 * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or 2890 * struct tcp_pcb_listen if pcb->state == LISTEN) 2891 * - opts: pointer where to add the custom options (there may already be options 2892 * between the header and these) 2893 * Return value: 2894 * - pointer pointing directly after the inserted options 2895 * 2896 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 2897 * state or any pcb lists) from this callback! 2898 */ 2899 #ifdef __DOXYGEN__ 2900 #define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts) 2901 #endif 2902 2903 /** 2904 * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): 2905 * Called from ip_input() (IPv4) 2906 * Signature:\code{.c} 2907 * int my_hook(struct pbuf *pbuf, struct netif *input_netif); 2908 * \endcode 2909 * Arguments: 2910 * - pbuf: received struct pbuf passed to ip_input() 2911 * - input_netif: struct netif on which the packet has been received 2912 * Return values: 2913 * - 0: Hook has not consumed the packet, packet is processed as normal 2914 * - != 0: Hook has consumed the packet. 2915 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 2916 * (i.e. free it when done). 2917 */ 2918 #ifdef __DOXYGEN__ 2919 #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) 2920 #endif 2921 2922 /** 2923 * LWIP_HOOK_IP4_ROUTE(dest): 2924 * Called from ip_route() (IPv4) 2925 * Signature:\code{.c} 2926 * struct netif *my_hook(const ip4_addr_t *dest); 2927 * \endcode 2928 * Arguments: 2929 * - dest: destination IPv4 address 2930 * Returns values: 2931 * - the destination netif 2932 * - NULL if no destination netif is found. In that case, ip_route() continues as normal. 2933 */ 2934 #ifdef __DOXYGEN__ 2935 #define LWIP_HOOK_IP4_ROUTE() 2936 #endif 2937 2938 /** 2939 * LWIP_HOOK_IP4_ROUTE_SRC(src, dest): 2940 * Source-based routing for IPv4 - called from ip_route() (IPv4) 2941 * Signature:\code{.c} 2942 * struct netif *my_hook(const ip4_addr_t *src, const ip4_addr_t *dest); 2943 * \endcode 2944 * Arguments: 2945 * - src: local/source IPv4 address 2946 * - dest: destination IPv4 address 2947 * Returns values: 2948 * - the destination netif 2949 * - NULL if no destination netif is found. In that case, ip_route() continues as normal. 2950 */ 2951 #ifdef __DOXYGEN__ 2952 #define LWIP_HOOK_IP4_ROUTE_SRC(src, dest) 2953 #endif 2954 2955 /** 2956 * LWIP_HOOK_IP4_CANFORWARD(src, dest): 2957 * Check if an IPv4 can be forwarded - called from: 2958 * ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4) 2959 * - source address is available via ip4_current_src_addr() 2960 * - calling an output function in this context (e.g. multicast router) is allowed 2961 * Signature:\code{.c} 2962 * int my_hook(struct pbuf *p, u32_t dest_addr_hostorder); 2963 * \endcode 2964 * Arguments: 2965 * - p: packet to forward 2966 * - dest: destination IPv4 address 2967 * Returns values: 2968 * - 1: forward 2969 * - 0: don't forward 2970 * - -1: no decision. In that case, ip4_canforward() continues as normal. 2971 */ 2972 #ifdef __DOXYGEN__ 2973 #define LWIP_HOOK_IP4_CANFORWARD(src, dest) 2974 #endif 2975 2976 /** 2977 * LWIP_HOOK_ETHARP_GET_GW(netif, dest): 2978 * Called from etharp_output() (IPv4) 2979 * Signature:\code{.c} 2980 * const ip4_addr_t *my_hook(struct netif *netif, const ip4_addr_t *dest); 2981 * \endcode 2982 * Arguments: 2983 * - netif: the netif used for sending 2984 * - dest: the destination IPv4 address 2985 * Return values: 2986 * - the IPv4 address of the gateway to handle the specified destination IPv4 address 2987 * - NULL, in which case the netif's default gateway is used 2988 * 2989 * The returned address MUST be directly reachable on the specified netif! 2990 * This function is meant to implement advanced IPv4 routing together with 2991 * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is 2992 * not part of lwIP but can e.g. be hidden in the netif's state argument. 2993 */ 2994 #ifdef __DOXYGEN__ 2995 #define LWIP_HOOK_ETHARP_GET_GW(netif, dest) 2996 #endif 2997 2998 /** 2999 * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): 3000 * Called from ip6_input() (IPv6) 3001 * Signature:\code{.c} 3002 * int my_hook(struct pbuf *pbuf, struct netif *input_netif); 3003 * \endcode 3004 * Arguments: 3005 * - pbuf: received struct pbuf passed to ip6_input() 3006 * - input_netif: struct netif on which the packet has been received 3007 * Return values: 3008 * - 0: Hook has not consumed the packet, packet is processed as normal 3009 * - != 0: Hook has consumed the packet. 3010 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 3011 * (i.e. free it when done). 3012 */ 3013 #ifdef __DOXYGEN__ 3014 #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) 3015 #endif 3016 3017 /** 3018 * LWIP_HOOK_IP6_ROUTE(src, dest): 3019 * Called from ip_route() (IPv6) 3020 * Signature:\code{.c} 3021 * struct netif *my_hook(const ip6_addr_t *dest, const ip6_addr_t *src); 3022 * \endcode 3023 * Arguments: 3024 * - src: source IPv6 address 3025 * - dest: destination IPv6 address 3026 * Return values: 3027 * - the destination netif 3028 * - NULL if no destination netif is found. In that case, ip6_route() continues as normal. 3029 */ 3030 #ifdef __DOXYGEN__ 3031 #define LWIP_HOOK_IP6_ROUTE(src, dest) 3032 #endif 3033 3034 /** 3035 * LWIP_HOOK_ND6_GET_GW(netif, dest): 3036 * Called from nd6_get_next_hop_entry() (IPv6) 3037 * Signature:\code{.c} 3038 * const ip6_addr_t *my_hook(struct netif *netif, const ip6_addr_t *dest); 3039 * \endcode 3040 * Arguments: 3041 * - netif: the netif used for sending 3042 * - dest: the destination IPv6 address 3043 * Return values: 3044 * - the IPv6 address of the next hop to handle the specified destination IPv6 address 3045 * - NULL, in which case a NDP-discovered router is used instead 3046 * 3047 * The returned address MUST be directly reachable on the specified netif! 3048 * This function is meant to implement advanced IPv6 routing together with 3049 * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is 3050 * not part of lwIP but can e.g. be hidden in the netif's state argument. 3051 */ 3052 #ifdef __DOXYGEN__ 3053 #define LWIP_HOOK_ND6_GET_GW(netif, dest) 3054 #endif 3055 3056 /** 3057 * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): 3058 * Called from ethernet_input() if VLAN support is enabled 3059 * Signature:\code{.c} 3060 * int my_hook(struct netif *netif, struct eth_hdr *eth_hdr, struct eth_vlan_hdr *vlan_hdr); 3061 * \endcode 3062 * Arguments: 3063 * - netif: struct netif on which the packet has been received 3064 * - eth_hdr: struct eth_hdr of the packet 3065 * - vlan_hdr: struct eth_vlan_hdr of the packet 3066 * Return values: 3067 * - 0: Packet must be dropped. 3068 * - != 0: Packet must be accepted. 3069 */ 3070 #ifdef __DOXYGEN__ 3071 #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) 3072 #endif 3073 3074 /** 3075 * LWIP_HOOK_VLAN_SET: 3076 * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data 3077 * on per-netif basis to implement this callback, see @ref netif_cd. 3078 * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.<br> 3079 * Signature:\code{.c} 3080 * 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); 3081 * \endcode 3082 * Arguments: 3083 * - netif: struct netif that the packet will be sent through 3084 * - p: struct pbuf packet to be sent 3085 * - src: source eth address 3086 * - dst: destination eth address 3087 * - eth_type: ethernet type to packet to be sent<br> 3088 * 3089 * 3090 * Return values: 3091 * - <0: Packet shall not contain VLAN header. 3092 * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. 3093 */ 3094 #ifdef __DOXYGEN__ 3095 #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) 3096 #endif 3097 3098 /** 3099 * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): 3100 * Called from memp_free() when a memp pool was empty and an item is now available 3101 * Signature:\code{.c} 3102 * void my_hook(memp_t type); 3103 * \endcode 3104 */ 3105 #ifdef __DOXYGEN__ 3106 #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) 3107 #endif 3108 3109 /** 3110 * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): 3111 * Called from ethernet_input() when an unknown eth type is encountered. 3112 * Signature:\code{.c} 3113 * err_t my_hook(struct pbuf* pbuf, struct netif* netif); 3114 * \endcode 3115 * Arguments: 3116 * - p: rx packet with unknown eth type 3117 * - netif: netif on which the packet has been received 3118 * Return values: 3119 * - ERR_OK if packet is accepted (hook function now owns the pbuf) 3120 * - any error code otherwise (pbuf is freed) 3121 * 3122 * Payload points to ethernet header! 3123 */ 3124 #ifdef __DOXYGEN__ 3125 #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) 3126 #endif 3127 3128 /** 3129 * LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr): 3130 * Called from various dhcp functions when sending a DHCP message. 3131 * This hook is called just before the DHCP message trailer is added, so the 3132 * options are at the end of a DHCP message. 3133 * Signature:\code{.c} 3134 * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg, 3135 * u8_t msg_type, u16_t *options_len_ptr); 3136 * \endcode 3137 * Arguments: 3138 * - netif: struct netif that the packet will be sent through 3139 * - dhcp: struct dhcp on that netif 3140 * - state: current dhcp state (dhcp_state_enum_t as an u8_t) 3141 * - msg: struct dhcp_msg that will be sent 3142 * - msg_type: dhcp message type to be sent (u8_t) 3143 * - options_len_ptr: pointer to the current length of options in the dhcp_msg "msg" 3144 * (must be increased when options are added!) 3145 * 3146 * Options need to appended like this: 3147 * LWIP_ASSERT("dhcp option overflow", *options_len_ptr + option_len + 2 <= DHCP_OPTIONS_LEN); 3148 * msg->options[(*options_len_ptr)++] = <option_number>; 3149 * msg->options[(*options_len_ptr)++] = <option_len>; 3150 * msg->options[(*options_len_ptr)++] = <option_bytes>; 3151 * [...] 3152 */ 3153 #ifdef __DOXYGEN__ 3154 #define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr) 3155 #endif 3156 3157 /** 3158 * LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset): 3159 * Called from dhcp_parse_reply when receiving a DHCP message. 3160 * This hook is called for every option in the received message that is not handled internally. 3161 * Signature:\code{.c} 3162 * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg, 3163 * u8_t msg_type, u8_t option, u8_t option_len, struct pbuf *pbuf, u16_t option_value_offset); 3164 * \endcode 3165 * Arguments: 3166 * - netif: struct netif that the packet will be sent through 3167 * - dhcp: struct dhcp on that netif 3168 * - state: current dhcp state (dhcp_state_enum_t as an u8_t) 3169 * - msg: struct dhcp_msg that was received 3170 * - msg_type: dhcp message type received (u8_t, ATTENTION: only valid after 3171 * the message type option has been parsed!) 3172 * - option: option value (u8_t) 3173 * - len: option data length (u8_t) 3174 * - pbuf: pbuf where option data is contained 3175 * - option_value_offset: offset in pbuf where option data begins 3176 * 3177 * A nice way to get the option contents is pbuf_get_contiguous(): 3178 * u8_t buf[32]; 3179 * u8_t *ptr = (u8_t*)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset); 3180 */ 3181 #ifdef __DOXYGEN__ 3182 #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) 3183 #endif 3184 3185 /** 3186 * LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len): 3187 * Called from various dhcp6 functions when sending a DHCP6 message. 3188 * This hook is called just before the DHCP6 message is sent, so the 3189 * options are at the end of a DHCP6 message. 3190 * Signature:\code{.c} 3191 * void my_hook(struct netif *netif, struct dhcp6 *dhcp, u8_t state, struct dhcp6_msg *msg, 3192 * u8_t msg_type, u16_t *options_len_ptr); 3193 * \endcode 3194 * Arguments: 3195 * - netif: struct netif that the packet will be sent through 3196 * - dhcp6: struct dhcp6 on that netif 3197 * - state: current dhcp6 state (dhcp6_state_enum_t as an u8_t) 3198 * - msg: struct dhcp6_msg that will be sent 3199 * - msg_type: dhcp6 message type to be sent (u8_t) 3200 * - options_len_ptr: pointer to the current length of options in the dhcp6_msg "msg" 3201 * (must be increased when options are added!) 3202 * 3203 * Options need to appended like this: 3204 * u8_t *options = (u8_t *)(msg + 1); 3205 * LWIP_ASSERT("dhcp option overflow", sizeof(struct dhcp6_msg) + *options_len_ptr + newoptlen <= max_len); 3206 * options[(*options_len_ptr)++] = <option_data>; 3207 * [...] 3208 */ 3209 #ifdef __DOXYGEN__ 3210 #define LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len) 3211 #endif 3212 3213 /** 3214 * LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) 3215 * Called from socket API to implement setsockopt() for options not provided by lwIP. 3216 * Core lock is held when this hook is called. 3217 * Signature:\code{.c} 3218 * int my_hook(int s, struct lwip_sock *sock, int level, int optname, const void *optval, socklen_t optlen, int *err) 3219 * \endcode 3220 * Arguments: 3221 * - s: socket file descriptor 3222 * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h) 3223 * - level: protocol level at which the option resides 3224 * - optname: option to set 3225 * - optval: value to set 3226 * - optlen: size of optval 3227 * - err: output error 3228 * Return values: 3229 * - 0: Hook has not consumed the option, code continues as normal (to internal options) 3230 * - != 0: Hook has consumed the option, 'err' is returned 3231 */ 3232 #ifdef __DOXYGEN__ 3233 #define LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) 3234 #endif 3235 3236 /** 3237 * LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) 3238 * Called from socket API to implement getsockopt() for options not provided by lwIP. 3239 * Core lock is held when this hook is called. 3240 * Signature:\code{.c} 3241 * int my_hook(int s, struct lwip_sock *sock, int level, int optname, void *optval, socklen_t *optlen, int *err) 3242 * \endcode 3243 * Arguments: 3244 * - s: socket file descriptor 3245 * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h) 3246 * - level: protocol level at which the option resides 3247 * - optname: option to get 3248 * - optval: value to get 3249 * - optlen: size of optval 3250 * - err: output error 3251 * Return values: 3252 * - 0: Hook has not consumed the option, code continues as normal (to internal options) 3253 * - != 0: Hook has consumed the option, 'err' is returned 3254 */ 3255 #ifdef __DOXYGEN__ 3256 #define LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) 3257 #endif 3258 3259 /** 3260 * LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) 3261 * Called from netconn APIs (not usable with callback apps) allowing an 3262 * external DNS resolver (which uses sequential API) to handle the query. 3263 * Signature:\code{.c} 3264 * int my_hook(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err) 3265 * \endcode 3266 * Arguments: 3267 * - name: hostname to resolve 3268 * - addr: output host address 3269 * - addrtype: type of address to query 3270 * - err: output error 3271 * Return values: 3272 * - 0: Hook has not consumed hostname query, query continues into DNS module 3273 * - != 0: Hook has consumed the query 3274 * 3275 * err must also be checked to determine if the hook consumed the query, but 3276 * the query failed 3277 */ 3278 #ifdef __DOXYGEN__ 3279 #define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) 3280 #endif 3281 /** 3282 * @} 3283 */ 3284 3285 /* 3286 --------------------------------------- 3287 ---------- Debugging options ---------- 3288 --------------------------------------- 3289 */ 3290 /** 3291 * @defgroup lwip_opts_debugmsg Debug messages 3292 * @ingroup lwip_opts_debug 3293 * @{ 3294 */ 3295 /** 3296 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is 3297 * compared against this value. If it is smaller, then debugging 3298 * messages are written. 3299 * @see debugging_levels 3300 */ 3301 #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ 3302 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 3303 #endif 3304 3305 /** 3306 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable 3307 * debug messages of certain types. 3308 * @see debugging_levels 3309 */ 3310 #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ 3311 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 3312 #endif 3313 3314 /** 3315 * ETHARP_DEBUG: Enable debugging in etharp.c. 3316 */ 3317 #if !defined ETHARP_DEBUG || defined __DOXYGEN__ 3318 #define ETHARP_DEBUG LWIP_DBG_OFF 3319 #endif 3320 3321 /** 3322 * NETIF_DEBUG: Enable debugging in netif.c. 3323 */ 3324 #if !defined NETIF_DEBUG || defined __DOXYGEN__ 3325 #define NETIF_DEBUG LWIP_DBG_OFF 3326 #endif 3327 3328 /** 3329 * PBUF_DEBUG: Enable debugging in pbuf.c. 3330 */ 3331 #if !defined PBUF_DEBUG || defined __DOXYGEN__ 3332 #define PBUF_DEBUG LWIP_DBG_OFF 3333 #endif 3334 3335 /** 3336 * API_LIB_DEBUG: Enable debugging in api_lib.c. 3337 */ 3338 #if !defined API_LIB_DEBUG || defined __DOXYGEN__ 3339 #define API_LIB_DEBUG LWIP_DBG_OFF 3340 #endif 3341 3342 /** 3343 * API_MSG_DEBUG: Enable debugging in api_msg.c. 3344 */ 3345 #if !defined API_MSG_DEBUG || defined __DOXYGEN__ 3346 #define API_MSG_DEBUG LWIP_DBG_OFF 3347 #endif 3348 3349 /** 3350 * SOCKETS_DEBUG: Enable debugging in sockets.c. 3351 */ 3352 #if !defined SOCKETS_DEBUG || defined __DOXYGEN__ 3353 #define SOCKETS_DEBUG LWIP_DBG_OFF 3354 #endif 3355 3356 /** 3357 * ICMP_DEBUG: Enable debugging in icmp.c. 3358 */ 3359 #if !defined ICMP_DEBUG || defined __DOXYGEN__ 3360 #define ICMP_DEBUG LWIP_DBG_OFF 3361 #endif 3362 3363 /** 3364 * IGMP_DEBUG: Enable debugging in igmp.c. 3365 */ 3366 #if !defined IGMP_DEBUG || defined __DOXYGEN__ 3367 #define IGMP_DEBUG LWIP_DBG_OFF 3368 #endif 3369 3370 /** 3371 * INET_DEBUG: Enable debugging in inet.c. 3372 */ 3373 #if !defined INET_DEBUG || defined __DOXYGEN__ 3374 #define INET_DEBUG LWIP_DBG_OFF 3375 #endif 3376 3377 /** 3378 * IP_DEBUG: Enable debugging for IP. 3379 */ 3380 #if !defined IP_DEBUG || defined __DOXYGEN__ 3381 #define IP_DEBUG LWIP_DBG_OFF 3382 #endif 3383 3384 /** 3385 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. 3386 */ 3387 #if !defined IP_REASS_DEBUG || defined __DOXYGEN__ 3388 #define IP_REASS_DEBUG LWIP_DBG_OFF 3389 #endif 3390 3391 /** 3392 * RAW_DEBUG: Enable debugging in raw.c. 3393 */ 3394 #if !defined RAW_DEBUG || defined __DOXYGEN__ 3395 #define RAW_DEBUG LWIP_DBG_OFF 3396 #endif 3397 3398 /** 3399 * MEM_DEBUG: Enable debugging in mem.c. 3400 */ 3401 #if !defined MEM_DEBUG || defined __DOXYGEN__ 3402 #define MEM_DEBUG LWIP_DBG_OFF 3403 #endif 3404 3405 /** 3406 * MEMP_DEBUG: Enable debugging in memp.c. 3407 */ 3408 #if !defined MEMP_DEBUG || defined __DOXYGEN__ 3409 #define MEMP_DEBUG LWIP_DBG_OFF 3410 #endif 3411 3412 /** 3413 * SYS_DEBUG: Enable debugging in sys.c. 3414 */ 3415 #if !defined SYS_DEBUG || defined __DOXYGEN__ 3416 #define SYS_DEBUG LWIP_DBG_OFF 3417 #endif 3418 3419 /** 3420 * TIMERS_DEBUG: Enable debugging in timers.c. 3421 */ 3422 #if !defined TIMERS_DEBUG || defined __DOXYGEN__ 3423 #define TIMERS_DEBUG LWIP_DBG_OFF 3424 #endif 3425 3426 /** 3427 * TCP_DEBUG: Enable debugging for TCP. 3428 */ 3429 #if !defined TCP_DEBUG || defined __DOXYGEN__ 3430 #define TCP_DEBUG LWIP_DBG_OFF 3431 #endif 3432 3433 /** 3434 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. 3435 */ 3436 #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ 3437 #define TCP_INPUT_DEBUG LWIP_DBG_OFF 3438 #endif 3439 3440 /** 3441 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. 3442 */ 3443 #if !defined TCP_FR_DEBUG || defined __DOXYGEN__ 3444 #define TCP_FR_DEBUG LWIP_DBG_OFF 3445 #endif 3446 3447 /** 3448 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit 3449 * timeout. 3450 */ 3451 #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ 3452 #define TCP_RTO_DEBUG LWIP_DBG_OFF 3453 #endif 3454 3455 /** 3456 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. 3457 */ 3458 #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ 3459 #define TCP_CWND_DEBUG LWIP_DBG_OFF 3460 #endif 3461 3462 /** 3463 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. 3464 */ 3465 #if !defined TCP_WND_DEBUG || defined __DOXYGEN__ 3466 #define TCP_WND_DEBUG LWIP_DBG_OFF 3467 #endif 3468 3469 /** 3470 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. 3471 */ 3472 #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ 3473 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF 3474 #endif 3475 3476 /** 3477 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. 3478 */ 3479 #if !defined TCP_RST_DEBUG || defined __DOXYGEN__ 3480 #define TCP_RST_DEBUG LWIP_DBG_OFF 3481 #endif 3482 3483 /** 3484 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. 3485 */ 3486 #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ 3487 #define TCP_QLEN_DEBUG LWIP_DBG_OFF 3488 #endif 3489 3490 /** 3491 * UDP_DEBUG: Enable debugging in UDP. 3492 */ 3493 #if !defined UDP_DEBUG || defined __DOXYGEN__ 3494 #define UDP_DEBUG LWIP_DBG_OFF 3495 #endif 3496 3497 /** 3498 * TCPIP_DEBUG: Enable debugging in tcpip.c. 3499 */ 3500 #if !defined TCPIP_DEBUG || defined __DOXYGEN__ 3501 #define TCPIP_DEBUG LWIP_DBG_OFF 3502 #endif 3503 3504 /** 3505 * SLIP_DEBUG: Enable debugging in slipif.c. 3506 */ 3507 #if !defined SLIP_DEBUG || defined __DOXYGEN__ 3508 #define SLIP_DEBUG LWIP_DBG_OFF 3509 #endif 3510 3511 /** 3512 * DHCP_DEBUG: Enable debugging in dhcp.c. 3513 */ 3514 #if !defined DHCP_DEBUG || defined __DOXYGEN__ 3515 #define DHCP_DEBUG LWIP_DBG_OFF 3516 #endif 3517 3518 /** 3519 * AUTOIP_DEBUG: Enable debugging in autoip.c. 3520 */ 3521 #if !defined AUTOIP_DEBUG || defined __DOXYGEN__ 3522 #define AUTOIP_DEBUG LWIP_DBG_OFF 3523 #endif 3524 3525 /** 3526 * ACD_DEBUG: Enable debugging in acd.c. 3527 */ 3528 #if !defined ACD_DEBUG || defined __DOXYGEN__ 3529 #define ACD_DEBUG LWIP_DBG_OFF 3530 #endif 3531 3532 /** 3533 * DNS_DEBUG: Enable debugging for DNS. 3534 */ 3535 #if !defined DNS_DEBUG || defined __DOXYGEN__ 3536 #define DNS_DEBUG LWIP_DBG_OFF 3537 #endif 3538 3539 /** 3540 * IP6_DEBUG: Enable debugging for IPv6. 3541 */ 3542 #if !defined IP6_DEBUG || defined __DOXYGEN__ 3543 #define IP6_DEBUG LWIP_DBG_OFF 3544 #endif 3545 3546 /** 3547 * DHCP6_DEBUG: Enable debugging in dhcp6.c. 3548 */ 3549 #if !defined DHCP6_DEBUG || defined __DOXYGEN__ 3550 #define DHCP6_DEBUG LWIP_DBG_OFF 3551 #endif 3552 /** 3553 * @} 3554 */ 3555 3556 /** 3557 * LWIP_TESTMODE: Changes to make unit test possible 3558 */ 3559 #if !defined LWIP_TESTMODE 3560 #define LWIP_TESTMODE 0 3561 #endif 3562 3563 /* 3564 -------------------------------------------------- 3565 ---------- Performance tracking options ---------- 3566 -------------------------------------------------- 3567 */ 3568 /** 3569 * @defgroup lwip_opts_perf Performance 3570 * @ingroup lwip_opts_debug 3571 * @{ 3572 */ 3573 /** 3574 * LWIP_PERF: Enable performance testing for lwIP 3575 * (if enabled, arch/perf.h is included) 3576 */ 3577 #if !defined LWIP_PERF || defined __DOXYGEN__ 3578 #define LWIP_PERF 0 3579 #endif 3580 /** 3581 * @} 3582 */ 3583 3584 #endif /* LWIP_HDR_OPT_H */ 3585