Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
opt.h
00001 /** 00002 * @file 00003 * 00004 * lwIP Options Configuration 00005 */ 00006 00007 /* 00008 * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 00009 * All rights reserved. 00010 * 00011 * Redistribution and use in source and binary forms, with or without modification, 00012 * are permitted provided that the following conditions are met: 00013 * 00014 * 1. Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright notice, 00017 * this list of conditions and the following disclaimer in the documentation 00018 * and/or other materials provided with the distribution. 00019 * 3. The name of the author may not be used to endorse or promote products 00020 * derived from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00023 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00024 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00025 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00026 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00027 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00028 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00029 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00030 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00031 * OF SUCH DAMAGE. 00032 * 00033 * This file is part of the lwIP TCP/IP stack. 00034 * 00035 * Author: Adam Dunkels <adam@sics.se> 00036 * 00037 */ 00038 00039 /* 00040 * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug - 00041 * without this, doxygen does not see the actual #define 00042 */ 00043 00044 #if !defined LWIP_HDR_OPT_H 00045 #define LWIP_HDR_OPT_H 00046 00047 /* 00048 * Include user defined options first. Anything not defined in these files 00049 * will be set to standard values. Override anything you don't like! 00050 */ 00051 #include "lwipopts.h" 00052 #include "lwip/debug.h" 00053 00054 /** 00055 * @defgroup lwip_opts Options (lwipopts.h) 00056 * @ingroup lwip 00057 * 00058 * @defgroup lwip_opts_debug Debugging 00059 * @ingroup lwip_opts 00060 * 00061 * @defgroup lwip_opts_infrastructure Infrastructure 00062 * @ingroup lwip_opts 00063 * 00064 * @defgroup lwip_opts_callback Callback-style APIs 00065 * @ingroup lwip_opts 00066 * 00067 * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs 00068 * @ingroup lwip_opts 00069 */ 00070 00071 /* 00072 ------------------------------------ 00073 -------------- NO SYS -------------- 00074 ------------------------------------ 00075 */ 00076 /** 00077 * @defgroup lwip_opts_nosys NO_SYS 00078 * @ingroup lwip_opts_infrastructure 00079 * @{ 00080 */ 00081 /** 00082 * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or 00083 * mboxes). This means threaded APIs cannot be used (socket, netconn, 00084 * i.e. everything in the 'api' folder), only the callback-style raw API is 00085 * available (and you have to watch out for yourself that you don't access 00086 * lwIP functions/structures from more than one context at a time!) 00087 */ 00088 #if !defined NO_SYS || defined __DOXYGEN__ 00089 #define NO_SYS 0 00090 #endif 00091 /** 00092 * @} 00093 */ 00094 00095 /** 00096 * @defgroup lwip_opts_timers Timers 00097 * @ingroup lwip_opts_infrastructure 00098 * @{ 00099 */ 00100 /** 00101 * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers. 00102 * (the array of lwip-internal cyclic timers is still provided) 00103 * (check NO_SYS_NO_TIMERS for compatibility to old versions) 00104 */ 00105 #if !defined LWIP_TIMERS || defined __DOXYGEN__ 00106 #ifdef NO_SYS_NO_TIMERS 00107 #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) 00108 #else 00109 #define LWIP_TIMERS 1 00110 #endif 00111 #endif 00112 00113 /** 00114 * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation. 00115 * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers 00116 * are still included, but the implementation is not. The following functions 00117 * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(), 00118 * sys_timeouts_mbox_fetch() 00119 */ 00120 #if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__ 00121 #define LWIP_TIMERS_CUSTOM 0 00122 #endif 00123 /** 00124 * @} 00125 */ 00126 00127 /** 00128 * @defgroup lwip_opts_memcpy memcpy 00129 * @ingroup lwip_opts_infrastructure 00130 * @{ 00131 */ 00132 /** 00133 * MEMCPY: override this if you have a faster implementation at hand than the 00134 * one included in your C library 00135 */ 00136 #if !defined MEMCPY || defined __DOXYGEN__ 00137 #define MEMCPY(dst,src,len) memcpy(dst,src,len) 00138 #endif 00139 00140 /** 00141 * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a 00142 * call to memcpy() if the length is known at compile time and is small. 00143 */ 00144 #if !defined SMEMCPY || defined __DOXYGEN__ 00145 #define SMEMCPY(dst,src,len) memcpy(dst,src,len) 00146 #endif 00147 00148 /** 00149 * MEMMOVE: override this if you have a faster implementation at hand than the 00150 * one included in your C library. lwIP currently uses MEMMOVE only when IPv6 00151 * fragmentation support is enabled. 00152 */ 00153 #if !defined MEMMOVE || defined __DOXYGEN__ 00154 #define MEMMOVE(dst,src,len) memmove(dst,src,len) 00155 #endif 00156 /** 00157 * @} 00158 */ 00159 00160 /* 00161 ------------------------------------ 00162 ----------- Core locking ----------- 00163 ------------------------------------ 00164 */ 00165 /** 00166 * @defgroup lwip_opts_lock Core locking and MPU 00167 * @ingroup lwip_opts_infrastructure 00168 * @{ 00169 */ 00170 /** 00171 * LWIP_MPU_COMPATIBLE: enables special memory management mechanism 00172 * which makes lwip able to work on MPU (Memory Protection Unit) system 00173 * by not passing stack-pointers to other threads 00174 * (this decreases performance as memory is allocated from pools instead 00175 * of keeping it on the stack) 00176 */ 00177 #if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__ 00178 #define LWIP_MPU_COMPATIBLE 0 00179 #endif 00180 00181 /** 00182 * LWIP_TCPIP_CORE_LOCKING 00183 * Creates a global mutex that is held during TCPIP thread operations. 00184 * Can be locked by client code to perform lwIP operations without changing 00185 * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and 00186 * UNLOCK_TCPIP_CORE(). 00187 * Your system should provide mutexes supporting priority inversion to use this. 00188 */ 00189 #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ 00190 #define LWIP_TCPIP_CORE_LOCKING 1 00191 #endif 00192 00193 /** 00194 * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, 00195 * this lets tcpip_input() grab the mutex for input packets as well, 00196 * instead of allocating a message and passing it to tcpip_thread. 00197 * 00198 * ATTENTION: this does not work when tcpip_input() is called from 00199 * interrupt context! 00200 */ 00201 #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ 00202 #define LWIP_TCPIP_CORE_LOCKING_INPUT 0 00203 #endif 00204 00205 /** 00206 * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt 00207 * protection) for certain critical regions during buffer allocation, deallocation 00208 * and memory allocation and deallocation. 00209 * ATTENTION: This is required when using lwIP from more than one context! If 00210 * you disable this, you must be sure what you are doing! 00211 */ 00212 #if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__ 00213 #define SYS_LIGHTWEIGHT_PROT 1 00214 #endif 00215 00216 /** 00217 * Macro/function to check whether lwIP's threading/locking 00218 * requirements are satisfied during current function call. 00219 * This macro usually calls a function that is implemented in the OS-dependent 00220 * sys layer and performs the following checks: 00221 * - Not in ISR (this should be checked for NO_SYS==1, too!) 00222 * - If @ref LWIP_TCPIP_CORE_LOCKING = 1: TCPIP core lock is held 00223 * - If @ref LWIP_TCPIP_CORE_LOCKING = 0: function is called from TCPIP thread 00224 * @see @ref multithreading 00225 */ 00226 #if !defined LWIP_ASSERT_CORE_LOCKED || defined __DOXYGEN__ 00227 #define LWIP_ASSERT_CORE_LOCKED() 00228 #endif 00229 00230 /** 00231 * Called as first thing in the lwIP TCPIP thread. Can be used in conjunction 00232 * with @ref LWIP_ASSERT_CORE_LOCKED to check core locking. 00233 * @see @ref multithreading 00234 */ 00235 #if !defined LWIP_MARK_TCPIP_THREAD || defined __DOXYGEN__ 00236 #define LWIP_MARK_TCPIP_THREAD() 00237 #endif 00238 /** 00239 * @} 00240 */ 00241 00242 /* 00243 ------------------------------------ 00244 ---------- Memory options ---------- 00245 ------------------------------------ 00246 */ 00247 /** 00248 * @defgroup lwip_opts_mem Heap and memory pools 00249 * @ingroup lwip_opts_infrastructure 00250 * @{ 00251 */ 00252 /** 00253 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library 00254 * instead of the lwip internal allocator. Can save code size if you 00255 * already use it. 00256 */ 00257 #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ 00258 #define MEM_LIBC_MALLOC 0 00259 #endif 00260 00261 /** 00262 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. 00263 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution 00264 * speed (heap alloc can be much slower than pool alloc) and usage from interrupts 00265 * (especially if your netif driver allocates PBUF_POOL pbufs for received frames 00266 * from interrupt)! 00267 * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, 00268 * not only for internal pools defined in memp_std.h)! 00269 */ 00270 #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ 00271 #define MEMP_MEM_MALLOC 0 00272 #endif 00273 00274 /** 00275 * MEMP_MEM_INIT==1: Force use of memset to initialize pool memory. 00276 * Useful if pool are moved in uninitialized section of memory. This will ensure 00277 * default values in pcbs struct are well initialized in all conditions. 00278 */ 00279 #if !defined MEMP_MEM_INIT || defined __DOXYGEN__ 00280 #define MEMP_MEM_INIT 0 00281 #endif 00282 00283 /** 00284 * MEM_ALIGNMENT: should be set to the alignment of the CPU 00285 * 4 byte alignment -> \#define MEM_ALIGNMENT 4 00286 * 2 byte alignment -> \#define MEM_ALIGNMENT 2 00287 */ 00288 #if !defined MEM_ALIGNMENT || defined __DOXYGEN__ 00289 #define MEM_ALIGNMENT 1 00290 #endif 00291 00292 /** 00293 * MEM_SIZE: the size of the heap memory. If the application will send 00294 * a lot of data that needs to be copied, this should be set high. 00295 */ 00296 #if !defined MEM_SIZE || defined __DOXYGEN__ 00297 #define MEM_SIZE 1600 00298 #endif 00299 00300 /** 00301 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable 00302 * amount of bytes before and after each memp element in every pool and fills 00303 * it with a prominent default value. 00304 * MEMP_OVERFLOW_CHECK == 0 no checking 00305 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed 00306 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time 00307 * memp_malloc() or memp_free() is called (useful but slow!) 00308 */ 00309 #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ 00310 #define MEMP_OVERFLOW_CHECK 0 00311 #endif 00312 00313 /** 00314 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make 00315 * sure that there are no cycles in the linked lists. 00316 */ 00317 #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ 00318 #define MEMP_SANITY_CHECK 0 00319 #endif 00320 00321 /** 00322 * MEM_OVERFLOW_CHECK: mem overflow protection reserves a configurable 00323 * amount of bytes before and after each heap allocation chunk and fills 00324 * it with a prominent default value. 00325 * MEM_OVERFLOW_CHECK == 0 no checking 00326 * MEM_OVERFLOW_CHECK == 1 checks each element when it is freed 00327 * MEM_OVERFLOW_CHECK >= 2 checks all heap elements every time 00328 * mem_malloc() or mem_free() is called (useful but slow!) 00329 */ 00330 #if !defined MEM_OVERFLOW_CHECK || defined __DOXYGEN__ 00331 #define MEM_OVERFLOW_CHECK 0 00332 #endif 00333 00334 /** 00335 * MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make 00336 * sure that the linked list of heap elements is not corrupted. 00337 */ 00338 #if !defined MEM_SANITY_CHECK || defined __DOXYGEN__ 00339 #define MEM_SANITY_CHECK 0 00340 #endif 00341 00342 /** 00343 * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set 00344 * of memory pools of various sizes. When mem_malloc is called, an element of 00345 * the smallest pool that can provide the length needed is returned. 00346 * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. 00347 */ 00348 #if !defined MEM_USE_POOLS || defined __DOXYGEN__ 00349 #define MEM_USE_POOLS 0 00350 #endif 00351 00352 /** 00353 * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next 00354 * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more 00355 * reliable. */ 00356 #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ 00357 #define MEM_USE_POOLS_TRY_BIGGER_POOL 0 00358 #endif 00359 00360 /** 00361 * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h 00362 * that defines additional pools beyond the "standard" ones required 00363 * by lwIP. If you set this to 1, you must have lwippools.h in your 00364 * include path somewhere. 00365 */ 00366 #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ 00367 #define MEMP_USE_CUSTOM_POOLS 0 00368 #endif 00369 00370 /** 00371 * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from 00372 * interrupt context (or another context that doesn't allow waiting for a 00373 * semaphore). 00374 * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, 00375 * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs 00376 * with each loop so that mem_free can run. 00377 * 00378 * ATTENTION: As you can see from the above description, this leads to dis-/ 00379 * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc 00380 * can need longer. 00381 * 00382 * If you don't want that, at least for NO_SYS=0, you can still use the following 00383 * functions to enqueue a deallocation call which then runs in the tcpip_thread 00384 * context: 00385 * - pbuf_free_callback(p); 00386 * - mem_free_callback(m); 00387 */ 00388 #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ 00389 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 00390 #endif 00391 /** 00392 * @} 00393 */ 00394 00395 /* 00396 ------------------------------------------------ 00397 ---------- Internal Memory Pool Sizes ---------- 00398 ------------------------------------------------ 00399 */ 00400 /** 00401 * @defgroup lwip_opts_memp Internal memory pools 00402 * @ingroup lwip_opts_infrastructure 00403 * @{ 00404 */ 00405 /** 00406 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). 00407 * If the application sends a lot of data out of ROM (or other static memory), 00408 * this should be set high. 00409 */ 00410 #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ 00411 #define MEMP_NUM_PBUF 16 00412 #endif 00413 00414 /** 00415 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs 00416 * (requires the LWIP_RAW option) 00417 */ 00418 #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ 00419 #define MEMP_NUM_RAW_PCB 4 00420 #endif 00421 00422 /** 00423 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 00424 * per active UDP "connection". 00425 * (requires the LWIP_UDP option) 00426 */ 00427 #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ 00428 #define MEMP_NUM_UDP_PCB 4 00429 #endif 00430 00431 /** 00432 * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. 00433 * (requires the LWIP_TCP option) 00434 */ 00435 #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ 00436 #define MEMP_NUM_TCP_PCB 5 00437 #endif 00438 00439 /** 00440 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. 00441 * (requires the LWIP_TCP option) 00442 */ 00443 #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ 00444 #define MEMP_NUM_TCP_PCB_LISTEN 8 00445 #endif 00446 00447 /** 00448 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. 00449 * (requires the LWIP_TCP option) 00450 */ 00451 #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ 00452 #define MEMP_NUM_TCP_SEG 16 00453 #endif 00454 00455 /** 00456 * MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs. 00457 * (requires the LWIP_ALTCP option) 00458 * Connections with multiple layers require more than one altcp_pcb (e.g. TLS 00459 * over TCP requires 2 altcp_pcbs, one for TLS and one for TCP). 00460 */ 00461 #if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__ 00462 #define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB 00463 #endif 00464 00465 /** 00466 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for 00467 * reassembly (whole packets, not fragments!) 00468 */ 00469 #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ 00470 #define MEMP_NUM_REASSDATA 5 00471 #endif 00472 00473 /** 00474 * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent 00475 * (fragments, not whole packets!). 00476 * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 00477 * with DMA-enabled MACs where the packet is not yet sent when netif->output 00478 * returns. 00479 */ 00480 #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ 00481 #define MEMP_NUM_FRAG_PBUF 15 00482 #endif 00483 00484 /** 00485 * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing 00486 * packets (pbufs) that are waiting for an ARP request (to resolve 00487 * their destination address) to finish. 00488 * (requires the ARP_QUEUEING option) 00489 */ 00490 #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ 00491 #define MEMP_NUM_ARP_QUEUE 30 00492 #endif 00493 00494 /** 00495 * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces 00496 * can be members at the same time (one per netif - allsystems group -, plus one 00497 * per netif membership). 00498 * (requires the LWIP_IGMP option) 00499 */ 00500 #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ 00501 #define MEMP_NUM_IGMP_GROUP 8 00502 #endif 00503 00504 /** 00505 * The number of sys timeouts used by the core stack (not apps) 00506 * The default number of timeouts is calculated here for all enabled modules. 00507 */ 00508 #define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD))) 00509 00510 /** 00511 * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. 00512 * The default number of timeouts is calculated here for all enabled modules. 00513 * The formula expects settings to be either '0' or '1'. 00514 */ 00515 #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ 00516 #define MEMP_NUM_SYS_TIMEOUT LWIP_NUM_SYS_TIMEOUT_INTERNAL 00517 #endif 00518 00519 /** 00520 * MEMP_NUM_NETBUF: the number of struct netbufs. 00521 * (only needed if you use the sequential API, like api_lib.c) 00522 */ 00523 #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ 00524 #define MEMP_NUM_NETBUF 2 00525 #endif 00526 00527 /** 00528 * MEMP_NUM_NETCONN: the number of struct netconns. 00529 * (only needed if you use the sequential API, like api_lib.c) 00530 */ 00531 #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ 00532 #define MEMP_NUM_NETCONN 4 00533 #endif 00534 00535 /** 00536 * MEMP_NUM_SELECT_CB: the number of struct lwip_select_cb. 00537 * (Only needed if you have LWIP_MPU_COMPATIBLE==1 and use the socket API. 00538 * In that case, you need one per thread calling lwip_select.) 00539 */ 00540 #if !defined MEMP_NUM_SELECT_CB || defined __DOXYGEN__ 00541 #define MEMP_NUM_SELECT_CB 4 00542 #endif 00543 00544 /** 00545 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used 00546 * for callback/timeout API communication. 00547 * (only needed if you use tcpip.c) 00548 */ 00549 #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ 00550 #define MEMP_NUM_TCPIP_MSG_API 8 00551 #endif 00552 00553 /** 00554 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used 00555 * for incoming packets. 00556 * (only needed if you use tcpip.c) 00557 */ 00558 #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ 00559 #define MEMP_NUM_TCPIP_MSG_INPKT 8 00560 #endif 00561 00562 /** 00563 * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls 00564 * (before freeing the corresponding memory using lwip_freeaddrinfo()). 00565 */ 00566 #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ 00567 #define MEMP_NUM_NETDB 1 00568 #endif 00569 00570 /** 00571 * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list 00572 * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. 00573 */ 00574 #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ 00575 #define MEMP_NUM_LOCALHOSTLIST 1 00576 #endif 00577 00578 /** 00579 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 00580 */ 00581 #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ 00582 #define PBUF_POOL_SIZE 16 00583 #endif 00584 00585 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various 00586 * socket, netconn, and tcpip functions 00587 */ 00588 #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ 00589 #define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API 00590 #endif 00591 00592 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname 00593 */ 00594 #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ 00595 #define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API 00596 #endif 00597 00598 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls 00599 * to getsockopt/setsockopt 00600 */ 00601 #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ 00602 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API 00603 #endif 00604 00605 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the 00606 * netifapi functions 00607 */ 00608 #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ 00609 #define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API 00610 #endif 00611 /** 00612 * @} 00613 */ 00614 00615 /* 00616 --------------------------------- 00617 ---------- ARP options ---------- 00618 --------------------------------- 00619 */ 00620 /** 00621 * @defgroup lwip_opts_arp ARP 00622 * @ingroup lwip_opts_ipv4 00623 * @{ 00624 */ 00625 /** 00626 * LWIP_ARP==1: Enable ARP functionality. 00627 */ 00628 #if !defined LWIP_ARP || defined __DOXYGEN__ 00629 #define LWIP_ARP 1 00630 #endif 00631 00632 /** 00633 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. 00634 */ 00635 #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ 00636 #define ARP_TABLE_SIZE 10 00637 #endif 00638 00639 /** the time an ARP entry stays valid after its last update, 00640 * for ARP_TMR_INTERVAL = 1000, this is 00641 * (60 * 5) seconds = 5 minutes. 00642 */ 00643 #if !defined ARP_MAXAGE || defined __DOXYGEN__ 00644 #define ARP_MAXAGE 300 00645 #endif 00646 00647 /** 00648 * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address 00649 * resolution. By default, only the most recent packet is queued per IP address. 00650 * This is sufficient for most protocols and mainly reduces TCP connection 00651 * startup time. Set this to 1 if you know your application sends more than one 00652 * packet in a row to an IP address that is not in the ARP cache. 00653 */ 00654 #if !defined ARP_QUEUEING || defined __DOXYGEN__ 00655 #define ARP_QUEUEING 0 00656 #endif 00657 00658 /** The maximum number of packets which may be queued for each 00659 * unresolved address by other network layers. Defaults to 3, 0 means disabled. 00660 * Old packets are dropped, new packets are queued. 00661 */ 00662 #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ 00663 #define ARP_QUEUE_LEN 3 00664 #endif 00665 00666 /** 00667 * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with 00668 * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and 00669 * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. 00670 * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. 00671 * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. 00672 * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. 00673 * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) 00674 * that returns 1 to accept a packet or 0 to drop a packet. 00675 */ 00676 #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ 00677 #define ETHARP_SUPPORT_VLAN 0 00678 #endif 00679 00680 /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled 00681 */ 00682 #if !defined LWIP_ETHERNET || defined __DOXYGEN__ 00683 #define LWIP_ETHERNET LWIP_ARP 00684 #endif 00685 00686 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure 00687 * alignment of payload after that header. Since the header is 14 bytes long, 00688 * without this padding e.g. addresses in the IP header will not be aligned 00689 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. 00690 */ 00691 #if !defined ETH_PAD_SIZE || defined __DOXYGEN__ 00692 #define ETH_PAD_SIZE 0 00693 #endif 00694 00695 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table 00696 * entries (using etharp_add_static_entry/etharp_remove_static_entry). 00697 */ 00698 #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ 00699 #define ETHARP_SUPPORT_STATIC_ENTRIES 0 00700 #endif 00701 00702 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. 00703 * If disabled, duplicate IP address on multiple netifs are not supported 00704 * (but this should only occur for AutoIP). 00705 */ 00706 #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ 00707 #define ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF 00708 #endif 00709 /** 00710 * @} 00711 */ 00712 00713 /* 00714 -------------------------------- 00715 ---------- IP options ---------- 00716 -------------------------------- 00717 */ 00718 /** 00719 * @defgroup lwip_opts_ipv4 IPv4 00720 * @ingroup lwip_opts 00721 * @{ 00722 */ 00723 /** 00724 * LWIP_IPV4==1: Enable IPv4 00725 */ 00726 #if !defined LWIP_IPV4 || defined __DOXYGEN__ 00727 #define LWIP_IPV4 1 00728 #endif 00729 00730 /** 00731 * IP_FORWARD==1: Enables the ability to forward IP packets across network 00732 * interfaces. If you are going to run lwIP on a device with only one network 00733 * interface, define this to 0. 00734 */ 00735 #if !defined IP_FORWARD || defined __DOXYGEN__ 00736 #define IP_FORWARD 0 00737 #endif 00738 00739 /** 00740 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that 00741 * this option does not affect outgoing packet sizes, which can be controlled 00742 * via IP_FRAG. 00743 */ 00744 #if !defined IP_REASSEMBLY || defined __DOXYGEN__ 00745 #define IP_REASSEMBLY 1 00746 #endif 00747 00748 /** 00749 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note 00750 * that this option does not affect incoming packet sizes, which can be 00751 * controlled via IP_REASSEMBLY. 00752 */ 00753 #if !defined IP_FRAG || defined __DOXYGEN__ 00754 #define IP_FRAG 1 00755 #endif 00756 00757 #if !LWIP_IPV4 00758 /* disable IPv4 extensions when IPv4 is disabled */ 00759 #undef IP_FORWARD 00760 #define IP_FORWARD 0 00761 #undef IP_REASSEMBLY 00762 #define IP_REASSEMBLY 0 00763 #undef IP_FRAG 00764 #define IP_FRAG 0 00765 #endif /* !LWIP_IPV4 */ 00766 00767 /** 00768 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. 00769 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. 00770 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). 00771 */ 00772 #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ 00773 #define IP_OPTIONS_ALLOWED 1 00774 #endif 00775 00776 /** 00777 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) 00778 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 00779 * in this time, the whole packet is discarded. 00780 */ 00781 #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ 00782 #define IP_REASS_MAXAGE 15 00783 #endif 00784 00785 /** 00786 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. 00787 * Since the received pbufs are enqueued, be sure to configure 00788 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive 00789 * packets even if the maximum amount of fragments is enqueued for reassembly! 00790 * When IPv4 *and* IPv6 are enabled, this even changes to 00791 * (PBUF_POOL_SIZE > 2 * IP_REASS_MAX_PBUFS)! 00792 */ 00793 #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ 00794 #define IP_REASS_MAX_PBUFS 10 00795 #endif 00796 00797 /** 00798 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. 00799 */ 00800 #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ 00801 #define IP_DEFAULT_TTL 255 00802 #endif 00803 00804 /** 00805 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast 00806 * filter per pcb on udp and raw send operations. To enable broadcast filter 00807 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. 00808 */ 00809 #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ 00810 #define IP_SOF_BROADCAST 0 00811 #endif 00812 00813 /** 00814 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast 00815 * filter on recv operations. 00816 */ 00817 #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ 00818 #define IP_SOF_BROADCAST_RECV 0 00819 #endif 00820 00821 /** 00822 * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back 00823 * out on the netif where it was received. This should only be used for 00824 * wireless networks. 00825 * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming 00826 * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! 00827 */ 00828 #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ 00829 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 00830 #endif 00831 /** 00832 * @} 00833 */ 00834 00835 /* 00836 ---------------------------------- 00837 ---------- ICMP options ---------- 00838 ---------------------------------- 00839 */ 00840 /** 00841 * @defgroup lwip_opts_icmp ICMP 00842 * @ingroup lwip_opts_ipv4 00843 * @{ 00844 */ 00845 /** 00846 * LWIP_ICMP==1: Enable ICMP module inside the IP stack. 00847 * Be careful, disable that make your product non-compliant to RFC1122 00848 */ 00849 #if !defined LWIP_ICMP || defined __DOXYGEN__ 00850 #define LWIP_ICMP 1 00851 #endif 00852 00853 /** 00854 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. 00855 */ 00856 #if !defined ICMP_TTL || defined __DOXYGEN__ 00857 #define ICMP_TTL IP_DEFAULT_TTL 00858 #endif 00859 00860 /** 00861 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) 00862 */ 00863 #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ 00864 #define LWIP_BROADCAST_PING 0 00865 #endif 00866 00867 /** 00868 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) 00869 */ 00870 #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ 00871 #define LWIP_MULTICAST_PING 0 00872 #endif 00873 /** 00874 * @} 00875 */ 00876 00877 /* 00878 --------------------------------- 00879 ---------- RAW options ---------- 00880 --------------------------------- 00881 */ 00882 /** 00883 * @defgroup lwip_opts_raw RAW 00884 * @ingroup lwip_opts_callback 00885 * @{ 00886 */ 00887 /** 00888 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 00889 */ 00890 #if !defined LWIP_RAW || defined __DOXYGEN__ 00891 #define LWIP_RAW 0 00892 #endif 00893 00894 /** 00895 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 00896 */ 00897 #if !defined RAW_TTL || defined __DOXYGEN__ 00898 #define RAW_TTL IP_DEFAULT_TTL 00899 #endif 00900 /** 00901 * @} 00902 */ 00903 00904 /* 00905 ---------------------------------- 00906 ---------- DHCP options ---------- 00907 ---------------------------------- 00908 */ 00909 /** 00910 * @defgroup lwip_opts_dhcp DHCP 00911 * @ingroup lwip_opts_ipv4 00912 * @{ 00913 */ 00914 /** 00915 * LWIP_DHCP==1: Enable DHCP module. 00916 */ 00917 #if !defined LWIP_DHCP || defined __DOXYGEN__ 00918 #define LWIP_DHCP 0 00919 #endif 00920 #if !LWIP_IPV4 00921 /* disable DHCP when IPv4 is disabled */ 00922 #undef LWIP_DHCP 00923 #define LWIP_DHCP 0 00924 #endif /* !LWIP_IPV4 */ 00925 00926 /** 00927 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. 00928 */ 00929 #if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__ 00930 #define DHCP_DOES_ARP_CHECK (LWIP_DHCP && LWIP_ARP) 00931 #endif 00932 00933 /** 00934 * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. 00935 */ 00936 #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ 00937 #define LWIP_DHCP_BOOTP_FILE 0 00938 #endif 00939 00940 /** 00941 * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each 00942 * response packet, an callback is called, which has to be provided by the port: 00943 * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 00944 */ 00945 #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ 00946 #define LWIP_DHCP_GET_NTP_SRV 0 00947 #endif 00948 00949 /** 00950 * The maximum of NTP servers requested 00951 */ 00952 #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ 00953 #define LWIP_DHCP_MAX_NTP_SERVERS 1 00954 #endif 00955 00956 /** 00957 * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. 00958 * DNS servers received in the response are passed to DNS via @ref dns_setserver() 00959 * (up to the maximum limit defined here). 00960 */ 00961 #if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__ 00962 #define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS 00963 #endif 00964 /** 00965 * @} 00966 */ 00967 00968 /* 00969 ------------------------------------ 00970 ---------- AUTOIP options ---------- 00971 ------------------------------------ 00972 */ 00973 /** 00974 * @defgroup lwip_opts_autoip AUTOIP 00975 * @ingroup lwip_opts_ipv4 00976 * @{ 00977 */ 00978 /** 00979 * LWIP_AUTOIP==1: Enable AUTOIP module. 00980 */ 00981 #if !defined LWIP_AUTOIP || defined __DOXYGEN__ 00982 #define LWIP_AUTOIP 0 00983 #endif 00984 #if !LWIP_IPV4 00985 /* disable AUTOIP when IPv4 is disabled */ 00986 #undef LWIP_AUTOIP 00987 #define LWIP_AUTOIP 0 00988 #endif /* !LWIP_IPV4 */ 00989 00990 /** 00991 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on 00992 * the same interface at the same time. 00993 */ 00994 #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ 00995 #define LWIP_DHCP_AUTOIP_COOP 0 00996 #endif 00997 00998 /** 00999 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes 01000 * that should be sent before falling back on AUTOIP (the DHCP client keeps 01001 * running in this case). This can be set as low as 1 to get an AutoIP address 01002 * very quickly, but you should be prepared to handle a changing IP address 01003 * when DHCP overrides AutoIP. 01004 */ 01005 #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ 01006 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9 01007 #endif 01008 /** 01009 * @} 01010 */ 01011 01012 /* 01013 ---------------------------------- 01014 ----- SNMP MIB2 support ----- 01015 ---------------------------------- 01016 */ 01017 /** 01018 * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks 01019 * @ingroup lwip_opts_infrastructure 01020 * @{ 01021 */ 01022 /** 01023 * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. 01024 * Turn this on to get callbacks needed to implement MIB2. 01025 * Usually MIB2_STATS should be enabled, too. 01026 */ 01027 #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ 01028 #define LWIP_MIB2_CALLBACKS 0 01029 #endif 01030 /** 01031 * @} 01032 */ 01033 01034 /* 01035 ---------------------------------- 01036 -------- Multicast options ------- 01037 ---------------------------------- 01038 */ 01039 /** 01040 * @defgroup lwip_opts_multicast Multicast 01041 * @ingroup lwip_opts_infrastructure 01042 * @{ 01043 */ 01044 /** 01045 * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options 01046 * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only) 01047 * core support for the corresponding IPv6 options. 01048 */ 01049 #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ 01050 #define LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW)) 01051 #endif 01052 /** 01053 * @} 01054 */ 01055 01056 /* 01057 ---------------------------------- 01058 ---------- IGMP options ---------- 01059 ---------------------------------- 01060 */ 01061 /** 01062 * @defgroup lwip_opts_igmp IGMP 01063 * @ingroup lwip_opts_ipv4 01064 * @{ 01065 */ 01066 /** 01067 * LWIP_IGMP==1: Turn on IGMP module. 01068 */ 01069 #if !defined LWIP_IGMP || defined __DOXYGEN__ 01070 #define LWIP_IGMP 0 01071 #endif 01072 #if !LWIP_IPV4 01073 #undef LWIP_IGMP 01074 #define LWIP_IGMP 0 01075 #endif 01076 /** 01077 * @} 01078 */ 01079 01080 /* 01081 ---------------------------------- 01082 ---------- DNS options ----------- 01083 ---------------------------------- 01084 */ 01085 /** 01086 * @defgroup lwip_opts_dns DNS 01087 * @ingroup lwip_opts_callback 01088 * @{ 01089 */ 01090 /** 01091 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS 01092 * transport. 01093 */ 01094 #if !defined LWIP_DNS || defined __DOXYGEN__ 01095 #define LWIP_DNS 0 01096 #endif 01097 01098 /** DNS maximum number of entries to maintain locally. */ 01099 #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ 01100 #define DNS_TABLE_SIZE 4 01101 #endif 01102 01103 /** DNS maximum host name length supported in the name table. */ 01104 #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ 01105 #define DNS_MAX_NAME_LENGTH 256 01106 #endif 01107 01108 /** The maximum of DNS servers 01109 * The first server can be initialized automatically by defining 01110 * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' 01111 */ 01112 #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ 01113 #define DNS_MAX_SERVERS 2 01114 #endif 01115 01116 /** DNS maximum number of retries when asking for a name, before "timeout". */ 01117 #if !defined DNS_MAX_RETRIES || defined __DOXYGEN__ 01118 #define DNS_MAX_RETRIES 4 01119 #endif 01120 01121 /** DNS do a name checking between the query and the response. */ 01122 #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ 01123 #define DNS_DOES_NAME_CHECK 1 01124 #endif 01125 01126 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation 01127 * Use all DNS security features by default. 01128 * This is overridable but should only be needed by very small targets 01129 * or when using against non standard DNS servers. */ 01130 #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ 01131 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) 01132 #endif 01133 01134 /* A list of DNS security features follows */ 01135 #define LWIP_DNS_SECURE_RAND_XID 1 01136 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 01137 #define LWIP_DNS_SECURE_RAND_SRC_PORT 4 01138 01139 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: 01140 * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ 01141 * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} 01142 * 01143 * Instead, you can also use an external function: 01144 * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) 01145 * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). 01146 */ 01147 #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ 01148 #define DNS_LOCAL_HOSTLIST 0 01149 #endif /* DNS_LOCAL_HOSTLIST */ 01150 01151 /** If this is turned on, the local host-list can be dynamically changed 01152 * at runtime. */ 01153 #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ 01154 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 01155 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ 01156 01157 /** Set this to 1 to enable querying ".local" names via mDNS 01158 * using a One-Shot Multicast DNS Query */ 01159 #if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__ 01160 #define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 01161 #endif 01162 /** 01163 * @} 01164 */ 01165 01166 /* 01167 --------------------------------- 01168 ---------- UDP options ---------- 01169 --------------------------------- 01170 */ 01171 /** 01172 * @defgroup lwip_opts_udp UDP 01173 * @ingroup lwip_opts_callback 01174 * @{ 01175 */ 01176 /** 01177 * LWIP_UDP==1: Turn on UDP. 01178 */ 01179 #if !defined LWIP_UDP || defined __DOXYGEN__ 01180 #define LWIP_UDP 1 01181 #endif 01182 01183 /** 01184 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) 01185 */ 01186 #if !defined LWIP_UDPLITE || defined __DOXYGEN__ 01187 #define LWIP_UDPLITE 0 01188 #endif 01189 01190 /** 01191 * UDP_TTL: Default Time-To-Live value. 01192 */ 01193 #if !defined UDP_TTL || defined __DOXYGEN__ 01194 #define UDP_TTL IP_DEFAULT_TTL 01195 #endif 01196 01197 /** 01198 * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. 01199 */ 01200 #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ 01201 #define LWIP_NETBUF_RECVINFO 0 01202 #endif 01203 /** 01204 * @} 01205 */ 01206 01207 /* 01208 --------------------------------- 01209 ---------- TCP options ---------- 01210 --------------------------------- 01211 */ 01212 /** 01213 * @defgroup lwip_opts_tcp TCP 01214 * @ingroup lwip_opts_callback 01215 * @{ 01216 */ 01217 /** 01218 * LWIP_TCP==1: Turn on TCP. 01219 */ 01220 #if !defined LWIP_TCP || defined __DOXYGEN__ 01221 #define LWIP_TCP 1 01222 #endif 01223 01224 /** 01225 * TCP_TTL: Default Time-To-Live value. 01226 */ 01227 #if !defined TCP_TTL || defined __DOXYGEN__ 01228 #define TCP_TTL IP_DEFAULT_TTL 01229 #endif 01230 01231 /** 01232 * TCP_WND: The size of a TCP window. This must be at least 01233 * (2 * TCP_MSS) for things to work well. 01234 * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size 01235 * with scaling applied. Maximum window value in the TCP header 01236 * will be TCP_WND >> TCP_RCV_SCALE 01237 */ 01238 #if !defined TCP_WND || defined __DOXYGEN__ 01239 #define TCP_WND (4 * TCP_MSS) 01240 #endif 01241 01242 /** 01243 * TCP_MAXRTX: Maximum number of retransmissions of data segments. 01244 */ 01245 #if !defined TCP_MAXRTX || defined __DOXYGEN__ 01246 #define TCP_MAXRTX 12 01247 #endif 01248 01249 /** 01250 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. 01251 */ 01252 #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ 01253 #define TCP_SYNMAXRTX 6 01254 #endif 01255 01256 /** 01257 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. 01258 * Define to 0 if your device is low on memory. 01259 */ 01260 #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ 01261 #define TCP_QUEUE_OOSEQ LWIP_TCP 01262 #endif 01263 01264 /** 01265 * LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs). 01266 */ 01267 #if !defined LWIP_TCP_SACK_OUT || defined __DOXYGEN__ 01268 #define LWIP_TCP_SACK_OUT 0 01269 #endif 01270 01271 /** 01272 * LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments. 01273 * Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled. 01274 * NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment 01275 * (depending on other options), setting this option to values greater than 4 is not pointless. 01276 * This is basically the max number of SACK ranges we want to keep track of. 01277 * As new data is delivered, some of the SACK ranges may be removed or merged. 01278 * In that case some of those older SACK ranges may be used again. 01279 * The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB. 01280 */ 01281 #if !defined LWIP_TCP_MAX_SACK_NUM || defined __DOXYGEN__ 01282 #define LWIP_TCP_MAX_SACK_NUM 4 01283 #endif 01284 01285 /** 01286 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, 01287 * you might want to increase this.) 01288 * For the receive side, this MSS is advertised to the remote side 01289 * when opening a connection. For the transmit size, this MSS sets 01290 * an upper limit on the MSS advertised by the remote host. 01291 */ 01292 #if !defined TCP_MSS || defined __DOXYGEN__ 01293 #define TCP_MSS 536 01294 #endif 01295 01296 /** 01297 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really 01298 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which 01299 * reflects the available reassembly buffer size at the remote host) and the 01300 * largest size permitted by the IP layer" (RFC 1122) 01301 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the 01302 * netif used for a connection and limits the MSS if it would be too big otherwise. 01303 */ 01304 #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ 01305 #define TCP_CALCULATE_EFF_SEND_MSS 1 01306 #endif 01307 01308 01309 /** 01310 * TCP_SND_BUF: TCP sender buffer space (bytes). 01311 * To achieve good performance, this should be at least 2 * TCP_MSS. 01312 */ 01313 #if !defined TCP_SND_BUF || defined __DOXYGEN__ 01314 #define TCP_SND_BUF (2 * TCP_MSS) 01315 #endif 01316 01317 /** 01318 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least 01319 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. 01320 */ 01321 #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ 01322 #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) 01323 #endif 01324 01325 /** 01326 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than 01327 * TCP_SND_BUF. It is the amount of space which must be available in the 01328 * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). 01329 */ 01330 #if !defined TCP_SNDLOWAT || defined __DOXYGEN__ 01331 #define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) 01332 #endif 01333 01334 /** 01335 * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less 01336 * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below 01337 * this number, select returns writable (combined with TCP_SNDLOWAT). 01338 */ 01339 #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ 01340 #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) 01341 #endif 01342 01343 /** 01344 * TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per 01345 * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). 01346 * Only valid for TCP_QUEUE_OOSEQ==1. 01347 */ 01348 #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ 01349 #define TCP_OOSEQ_MAX_BYTES 0 01350 #endif 01351 01352 /** 01353 * TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued 01354 * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && 01355 * TCP_OOSEQ_MAX_BYTES==1. 01356 * Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb. 01357 */ 01358 #if !defined TCP_OOSEQ_BYTES_LIMIT 01359 #if TCP_OOSEQ_MAX_BYTES 01360 #define TCP_OOSEQ_BYTES_LIMIT(pcb) TCP_OOSEQ_MAX_BYTES 01361 #elif defined __DOXYGEN__ 01362 #define TCP_OOSEQ_BYTES_LIMIT(pcb) 01363 #endif 01364 #endif 01365 01366 /** 01367 * TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per 01368 * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit). 01369 * Only valid for TCP_QUEUE_OOSEQ==1. 01370 */ 01371 #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ 01372 #define TCP_OOSEQ_MAX_PBUFS 0 01373 #endif 01374 01375 /** 01376 * TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued 01377 * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 && 01378 * TCP_OOSEQ_MAX_PBUFS==1. 01379 * Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb. 01380 */ 01381 #if !defined TCP_OOSEQ_PBUFS_LIMIT 01382 #if TCP_OOSEQ_MAX_PBUFS 01383 #define TCP_OOSEQ_PBUFS_LIMIT(pcb) TCP_OOSEQ_MAX_PBUFS 01384 #elif defined __DOXYGEN__ 01385 #define TCP_OOSEQ_PBUFS_LIMIT(pcb) 01386 #endif 01387 #endif 01388 01389 /** 01390 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. 01391 */ 01392 #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ 01393 #define TCP_LISTEN_BACKLOG 0 01394 #endif 01395 01396 /** 01397 * The maximum allowed backlog for TCP listen netconns. 01398 * This backlog is used unless another is explicitly specified. 01399 * 0xff is the maximum (u8_t). 01400 */ 01401 #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ 01402 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff 01403 #endif 01404 01405 /** 01406 * TCP_OVERSIZE: The maximum number of bytes that tcp_write may 01407 * allocate ahead of time in an attempt to create shorter pbuf chains 01408 * for transmission. The meaningful range is 0 to TCP_MSS. Some 01409 * suggested values are: 01410 * 01411 * 0: Disable oversized allocation. Each tcp_write() allocates a new 01412 pbuf (old behaviour). 01413 * 1: Allocate size-aligned pbufs with minimal excess. Use this if your 01414 * scatter-gather DMA requires aligned fragments. 01415 * 128: Limit the pbuf/memory overhead to 20%. 01416 * TCP_MSS: Try to create unfragmented TCP packets. 01417 * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. 01418 */ 01419 #if !defined TCP_OVERSIZE || defined __DOXYGEN__ 01420 #define TCP_OVERSIZE TCP_MSS 01421 #endif 01422 01423 /** 01424 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. 01425 * The timestamp option is currently only used to help remote hosts, it is not 01426 * really used locally. Therefore, it is only enabled when a TS option is 01427 * received in the initial SYN packet from a remote host. 01428 */ 01429 #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ 01430 #define LWIP_TCP_TIMESTAMPS 0 01431 #endif 01432 01433 /** 01434 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an 01435 * explicit window update 01436 */ 01437 #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ 01438 #define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) 01439 #endif 01440 01441 /** 01442 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. 01443 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all 01444 * events (accept, sent, etc) that happen in the system. 01445 * LWIP_CALLBACK_API==1: The PCB callback function is called directly 01446 * for the event. This is the default. 01447 */ 01448 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ 01449 #define LWIP_EVENT_API 0 01450 #define LWIP_CALLBACK_API 1 01451 #else 01452 #ifndef LWIP_EVENT_API 01453 #define LWIP_EVENT_API 0 01454 #endif 01455 #ifndef LWIP_CALLBACK_API 01456 #define LWIP_CALLBACK_API 0 01457 #endif 01458 #endif 01459 01460 /** 01461 * LWIP_WND_SCALE and TCP_RCV_SCALE: 01462 * Set LWIP_WND_SCALE to 1 to enable window scaling. 01463 * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the 01464 * range of [0..14]). 01465 * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large 01466 * send window while having a small receive window only. 01467 */ 01468 #if !defined LWIP_WND_SCALE || defined __DOXYGEN__ 01469 #define LWIP_WND_SCALE 0 01470 #define TCP_RCV_SCALE 0 01471 #endif 01472 01473 /** 01474 * LWIP_TCP_PCB_NUM_EXT_ARGS: 01475 * When this is > 0, every tcp pcb (including listen pcb) includes a number of 01476 * additional argument entries in an array (see tcp_ext_arg_alloc_id) 01477 */ 01478 #if !defined LWIP_TCP_PCB_NUM_EXT_ARGS || defined __DOXYGEN__ 01479 #define LWIP_TCP_PCB_NUM_EXT_ARGS 0 01480 #endif 01481 01482 /** LWIP_ALTCP==1: enable the altcp API. 01483 * altcp is an abstraction layer that prevents applications linking against the 01484 * tcp.h functions but provides the same functionality. It is used to e.g. add 01485 * SSL/TLS or proxy-connect support to an application written for the tcp callback 01486 * API without that application knowing the protocol details. 01487 * 01488 * With LWIP_ALTCP==0, applications written against the altcp API can still be 01489 * compiled but are directly linked against the tcp.h callback API and then 01490 * cannot use layered protocols. 01491 * 01492 * See @ref altcp_api 01493 */ 01494 #if !defined LWIP_ALTCP || defined __DOXYGEN__ 01495 #define LWIP_ALTCP 0 01496 #endif 01497 01498 /** LWIP_ALTCP_TLS==1: enable TLS support for altcp API. 01499 * This needs a port of the functions in altcp_tls.h to a TLS library. 01500 * A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory 01501 * and LWIP_ALTCP_TLS_MBEDTLS option. 01502 */ 01503 #if !defined LWIP_ALTCP_TLS || defined __DOXYGEN__ 01504 #define LWIP_ALTCP_TLS 0 01505 #endif 01506 01507 /** 01508 * @} 01509 */ 01510 01511 /* 01512 ---------------------------------- 01513 ---------- Pbuf options ---------- 01514 ---------------------------------- 01515 */ 01516 /** 01517 * @defgroup lwip_opts_pbuf PBUF 01518 * @ingroup lwip_opts 01519 * @{ 01520 */ 01521 /** 01522 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a 01523 * link level header. The default is 14, the standard value for 01524 * Ethernet. 01525 */ 01526 #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ 01527 #if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__ 01528 #define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) 01529 #else /* LWIP_HOOK_VLAN_SET */ 01530 #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) 01531 #endif /* LWIP_HOOK_VLAN_SET */ 01532 #endif 01533 01534 /** 01535 * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated 01536 * for an additional encapsulation header before ethernet headers (e.g. 802.11) 01537 */ 01538 #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ 01539 #define PBUF_LINK_ENCAPSULATION_HLEN 0 01540 #endif 01541 01542 /** 01543 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is 01544 * designed to accommodate single full size TCP frame in one pbuf, including 01545 * TCP_MSS, IP header, and link header. 01546 */ 01547 #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ 01548 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) 01549 #endif 01550 01551 /** 01552 * LWIP_PBUF_REF_T: Refcount type in pbuf. 01553 * Default width of u8_t can be increased if 255 refs are not enough for you. 01554 */ 01555 #if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__ 01556 #define LWIP_PBUF_REF_T u8_t 01557 #endif 01558 /** 01559 * @} 01560 */ 01561 01562 /* 01563 ------------------------------------------------ 01564 ---------- Network Interfaces options ---------- 01565 ------------------------------------------------ 01566 */ 01567 /** 01568 * @defgroup lwip_opts_netif NETIF 01569 * @ingroup lwip_opts 01570 * @{ 01571 */ 01572 /** 01573 * LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for 01574 * small real-life targets. Some code like routing etc. can be left out. 01575 */ 01576 #if !defined LWIP_SINGLE_NETIF || defined __DOXYGEN__ 01577 #define LWIP_SINGLE_NETIF 0 01578 #endif 01579 01580 /** 01581 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname 01582 * field. 01583 */ 01584 #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ 01585 #define LWIP_NETIF_HOSTNAME 0 01586 #endif 01587 01588 /** 01589 * LWIP_NETIF_API==1: Support netif api (in netifapi.c) 01590 */ 01591 #if !defined LWIP_NETIF_API || defined __DOXYGEN__ 01592 #define LWIP_NETIF_API 0 01593 #endif 01594 01595 /** 01596 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface 01597 * changes its up/down status (i.e., due to DHCP IP acquisition) 01598 */ 01599 #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ 01600 #define LWIP_NETIF_STATUS_CALLBACK 0 01601 #endif 01602 01603 /** 01604 * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function 01605 * for several netif related event that supports multiple subscribers. 01606 * @see netif_ext_status_callback 01607 */ 01608 #if !defined LWIP_NETIF_EXT_STATUS_CALLBACK || defined __DOXYGEN__ 01609 #define LWIP_NETIF_EXT_STATUS_CALLBACK 0 01610 #endif 01611 01612 /** 01613 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface 01614 * whenever the link changes (i.e., link down) 01615 */ 01616 #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ 01617 #define LWIP_NETIF_LINK_CALLBACK 0 01618 #endif 01619 01620 /** 01621 * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called 01622 * when a netif has been removed 01623 */ 01624 #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ 01625 #define LWIP_NETIF_REMOVE_CALLBACK 0 01626 #endif 01627 01628 /** 01629 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table 01630 * indices) in struct netif. TCP and UDP can make use of this to prevent 01631 * scanning the ARP table for every sent packet. While this is faster for big 01632 * ARP tables or many concurrent connections, it might be counterproductive 01633 * if you have a tiny ARP table or if there never are concurrent connections. 01634 */ 01635 #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ 01636 #define LWIP_NETIF_HWADDRHINT 0 01637 #endif 01638 01639 /** 01640 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data 01641 * to be sent into one single pbuf. This is for compatibility with DMA-enabled 01642 * MACs that do not support scatter-gather. 01643 * Beware that this might involve CPU-memcpy before transmitting that would not 01644 * be needed without this flag! Use this only if you need to! 01645 * 01646 * ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX 01647 * pbufs for being in one piece. If not, @ref pbuf_clone can be used to get 01648 * a single pbuf: 01649 * if (p->next != NULL) { 01650 * struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p); 01651 * if (q == NULL) { 01652 * return ERR_MEM; 01653 * } 01654 * p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller! 01655 * } 01656 */ 01657 #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ 01658 #define LWIP_NETIF_TX_SINGLE_PBUF 0 01659 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */ 01660 01661 /** 01662 * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store 01663 * data in client_data member array of struct netif (max. 256). 01664 */ 01665 #if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__ 01666 #define LWIP_NUM_NETIF_CLIENT_DATA 0 01667 #endif 01668 /** 01669 * @} 01670 */ 01671 01672 /* 01673 ------------------------------------ 01674 ---------- LOOPIF options ---------- 01675 ------------------------------------ 01676 */ 01677 /** 01678 * @defgroup lwip_opts_loop Loopback interface 01679 * @ingroup lwip_opts_netif 01680 * @{ 01681 */ 01682 /** 01683 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). 01684 * This is only needed when no real netifs are available. If at least one other 01685 * netif is available, loopback traffic uses this netif. 01686 */ 01687 #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ 01688 #define LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF) 01689 #endif 01690 01691 /** 01692 * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). 01693 */ 01694 #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ 01695 #define LWIP_LOOPIF_MULTICAST 0 01696 #endif 01697 01698 /** 01699 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP 01700 * address equal to the netif IP address, looping them back up the stack. 01701 */ 01702 #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ 01703 #define LWIP_NETIF_LOOPBACK 0 01704 #endif 01705 01706 /** 01707 * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback 01708 * sending for each netif (0 = disabled) 01709 */ 01710 #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ 01711 #define LWIP_LOOPBACK_MAX_PBUFS 0 01712 #endif 01713 01714 /** 01715 * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in 01716 * the system, as netifs must change how they behave depending on this setting 01717 * for the LWIP_NETIF_LOOPBACK option to work. 01718 * Setting this is needed to avoid reentering non-reentrant functions like 01719 * tcp_input(). 01720 * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a 01721 * multithreaded environment like tcpip.c. In this case, netif->input() 01722 * is called directly. 01723 * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. 01724 * The packets are put on a list and netif_poll() must be called in 01725 * the main application loop. 01726 */ 01727 #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ 01728 #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) 01729 #endif 01730 /** 01731 * @} 01732 */ 01733 01734 /* 01735 ------------------------------------ 01736 ---------- Thread options ---------- 01737 ------------------------------------ 01738 */ 01739 /** 01740 * @defgroup lwip_opts_thread Threading 01741 * @ingroup lwip_opts_infrastructure 01742 * @{ 01743 */ 01744 /** 01745 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. 01746 */ 01747 #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ 01748 #define TCPIP_THREAD_NAME "lwip_tcpip" 01749 #endif 01750 01751 /** 01752 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. 01753 * The stack size value itself is platform-dependent, but is passed to 01754 * sys_thread_new() when the thread is created. 01755 */ 01756 #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ 01757 #define TCPIP_THREAD_STACKSIZE 0 01758 #endif 01759 01760 /** 01761 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. 01762 * The priority value itself is platform-dependent, but is passed to 01763 * sys_thread_new() when the thread is created. 01764 */ 01765 #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ 01766 #define TCPIP_THREAD_PRIO 1 01767 #endif 01768 01769 /** 01770 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages 01771 * The queue size value itself is platform-dependent, but is passed to 01772 * sys_mbox_new() when tcpip_init is called. 01773 */ 01774 #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ 01775 #define TCPIP_MBOX_SIZE 0 01776 #endif 01777 01778 /** 01779 * Define this to something that triggers a watchdog. This is called from 01780 * tcpip_thread after processing a message. 01781 */ 01782 #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ 01783 #define LWIP_TCPIP_THREAD_ALIVE() 01784 #endif 01785 01786 /** 01787 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. 01788 */ 01789 #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ 01790 #define SLIPIF_THREAD_NAME "slipif_loop" 01791 #endif 01792 01793 /** 01794 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. 01795 * The stack size value itself is platform-dependent, but is passed to 01796 * sys_thread_new() when the thread is created. 01797 */ 01798 #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ 01799 #define SLIPIF_THREAD_STACKSIZE 0 01800 #endif 01801 01802 /** 01803 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. 01804 * The priority value itself is platform-dependent, but is passed to 01805 * sys_thread_new() when the thread is created. 01806 */ 01807 #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ 01808 #define SLIPIF_THREAD_PRIO 1 01809 #endif 01810 01811 /** 01812 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. 01813 */ 01814 #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ 01815 #define DEFAULT_THREAD_NAME "lwIP" 01816 #endif 01817 01818 /** 01819 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. 01820 * The stack size value itself is platform-dependent, but is passed to 01821 * sys_thread_new() when the thread is created. 01822 */ 01823 #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ 01824 #define DEFAULT_THREAD_STACKSIZE 0 01825 #endif 01826 01827 /** 01828 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. 01829 * The priority value itself is platform-dependent, but is passed to 01830 * sys_thread_new() when the thread is created. 01831 */ 01832 #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ 01833 #define DEFAULT_THREAD_PRIO 1 01834 #endif 01835 01836 /** 01837 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01838 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed 01839 * to sys_mbox_new() when the recvmbox is created. 01840 */ 01841 #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ 01842 #define DEFAULT_RAW_RECVMBOX_SIZE 0 01843 #endif 01844 01845 /** 01846 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01847 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed 01848 * to sys_mbox_new() when the recvmbox is created. 01849 */ 01850 #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ 01851 #define DEFAULT_UDP_RECVMBOX_SIZE 0 01852 #endif 01853 01854 /** 01855 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01856 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed 01857 * to sys_mbox_new() when the recvmbox is created. 01858 */ 01859 #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ 01860 #define DEFAULT_TCP_RECVMBOX_SIZE 0 01861 #endif 01862 01863 /** 01864 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. 01865 * The queue size value itself is platform-dependent, but is passed to 01866 * sys_mbox_new() when the acceptmbox is created. 01867 */ 01868 #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ 01869 #define DEFAULT_ACCEPTMBOX_SIZE 0 01870 #endif 01871 /** 01872 * @} 01873 */ 01874 01875 /* 01876 ---------------------------------------------- 01877 ---------- Sequential layer options ---------- 01878 ---------------------------------------------- 01879 */ 01880 /** 01881 * @defgroup lwip_opts_netconn Netconn 01882 * @ingroup lwip_opts_threadsafe_apis 01883 * @{ 01884 */ 01885 /** 01886 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) 01887 */ 01888 #if !defined LWIP_NETCONN || defined __DOXYGEN__ 01889 #define LWIP_NETCONN 1 01890 #endif 01891 01892 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create 01893 * timers running in tcpip_thread from another thread. 01894 */ 01895 #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ 01896 #define LWIP_TCPIP_TIMEOUT 0 01897 #endif 01898 01899 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per 01900 * thread calling socket/netconn functions instead of allocating one 01901 * semaphore per netconn (and per select etc.) 01902 * ATTENTION: a thread-local semaphore for API calls is needed: 01903 * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* 01904 * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore 01905 * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore 01906 * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). 01907 * Ports may call these for threads created with sys_thread_new(). 01908 */ 01909 #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ 01910 #define LWIP_NETCONN_SEM_PER_THREAD 0 01911 #endif 01912 01913 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, 01914 * writing from a 2nd thread and closing from a 3rd thread at the same time. 01915 * ATTENTION: This is currently really alpha! Some requirements: 01916 * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from 01917 * multiple threads at once 01918 * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox 01919 * and prevent a task pending on this during/after deletion 01920 */ 01921 #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ 01922 #define LWIP_NETCONN_FULLDUPLEX 0 01923 #endif 01924 /** 01925 * @} 01926 */ 01927 01928 /* 01929 ------------------------------------ 01930 ---------- Socket options ---------- 01931 ------------------------------------ 01932 */ 01933 /** 01934 * @defgroup lwip_opts_socket Sockets 01935 * @ingroup lwip_opts_threadsafe_apis 01936 * @{ 01937 */ 01938 /** 01939 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) 01940 */ 01941 #if !defined LWIP_SOCKET || defined __DOXYGEN__ 01942 #define LWIP_SOCKET 1 01943 #endif 01944 01945 /** 01946 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. 01947 * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. 01948 * While this helps code completion, it might conflict with existing libraries. 01949 * (only used if you use sockets.c) 01950 */ 01951 #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ 01952 #define LWIP_COMPAT_SOCKETS 1 01953 #endif 01954 01955 /** 01956 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. 01957 * Disable this option if you use a POSIX operating system that uses the same 01958 * names (read, write & close). (only used if you use sockets.c) 01959 */ 01960 #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ 01961 #define LWIP_POSIX_SOCKETS_IO_NAMES 1 01962 #endif 01963 01964 /** 01965 * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. 01966 * This can be useful when there are multiple APIs which create file descriptors. 01967 * When they all start with a different offset and you won't make them overlap you can 01968 * re implement read/write/close/ioctl/fnctl to send the requested action to the right 01969 * library (sharing select will need more work though). 01970 */ 01971 #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ 01972 #define LWIP_SOCKET_OFFSET 0 01973 #endif 01974 01975 /** 01976 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT 01977 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set 01978 * in seconds. (does not require sockets.c, and will affect tcp.c) 01979 */ 01980 #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ 01981 #define LWIP_TCP_KEEPALIVE 0 01982 #endif 01983 01984 /** 01985 * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and 01986 * SO_SNDTIMEO processing. 01987 */ 01988 #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ 01989 #define LWIP_SO_SNDTIMEO 0 01990 #endif 01991 01992 /** 01993 * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and 01994 * SO_RCVTIMEO processing. 01995 */ 01996 #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ 01997 #define LWIP_SO_RCVTIMEO 0 01998 #endif 01999 02000 /** 02001 * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int 02002 * (milliseconds, much like winsock does) instead of a struct timeval (default). 02003 */ 02004 #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ 02005 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 02006 #endif 02007 02008 /** 02009 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. 02010 */ 02011 #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ 02012 #define LWIP_SO_RCVBUF 0 02013 #endif 02014 02015 /** 02016 * LWIP_SO_LINGER==1: Enable SO_LINGER processing. 02017 */ 02018 #if !defined LWIP_SO_LINGER || defined __DOXYGEN__ 02019 #define LWIP_SO_LINGER 0 02020 #endif 02021 02022 /** 02023 * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. 02024 */ 02025 #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ 02026 #define RECV_BUFSIZE_DEFAULT INT_MAX 02027 #endif 02028 02029 /** 02030 * By default, TCP socket/netconn close waits 20 seconds max to send the FIN 02031 */ 02032 #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ 02033 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 02034 #endif 02035 02036 /** 02037 * SO_REUSE==1: Enable SO_REUSEADDR option. 02038 */ 02039 #if !defined SO_REUSE || defined __DOXYGEN__ 02040 #define SO_REUSE 0 02041 #endif 02042 02043 /** 02044 * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets 02045 * to all local matches if SO_REUSEADDR is turned on. 02046 * WARNING: Adds a memcpy for every packet if passing to more than one pcb! 02047 */ 02048 #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ 02049 #define SO_REUSE_RXTOALL 0 02050 #endif 02051 02052 /** 02053 * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of 02054 * pending data in the network buffer. This is the way windows does it. It's 02055 * the default for lwIP since it is smaller. 02056 * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next 02057 * pending datagram in bytes. This is the way linux does it. This code is only 02058 * here for compatibility. 02059 */ 02060 #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ 02061 #define LWIP_FIONREAD_LINUXMODE 0 02062 #endif 02063 02064 /** 02065 * LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn 02066 * callback to keep track of events). 02067 * This saves RAM (counters per socket) and code (netconn event callback), which 02068 * should improve performance a bit). 02069 */ 02070 #if !defined LWIP_SOCKET_SELECT || defined __DOXYGEN__ 02071 #define LWIP_SOCKET_SELECT 1 02072 #endif 02073 02074 /** 02075 * LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including 02076 * struct pollfd, nfds_t, and constants) 02077 */ 02078 #if !defined LWIP_SOCKET_POLL || defined __DOXYGEN__ 02079 #define LWIP_SOCKET_POLL 1 02080 #endif 02081 /** 02082 * @} 02083 */ 02084 02085 /* 02086 ---------------------------------------- 02087 ---------- Statistics options ---------- 02088 ---------------------------------------- 02089 */ 02090 /** 02091 * @defgroup lwip_opts_stats Statistics 02092 * @ingroup lwip_opts_debug 02093 * @{ 02094 */ 02095 /** 02096 * LWIP_STATS==1: Enable statistics collection in lwip_stats. 02097 */ 02098 #if !defined LWIP_STATS || defined __DOXYGEN__ 02099 #define LWIP_STATS 1 02100 #endif 02101 02102 #if LWIP_STATS 02103 02104 /** 02105 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. 02106 */ 02107 #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ 02108 #define LWIP_STATS_DISPLAY 0 02109 #endif 02110 02111 /** 02112 * LINK_STATS==1: Enable link stats. 02113 */ 02114 #if !defined LINK_STATS || defined __DOXYGEN__ 02115 #define LINK_STATS 1 02116 #endif 02117 02118 /** 02119 * ETHARP_STATS==1: Enable etharp stats. 02120 */ 02121 #if !defined ETHARP_STATS || defined __DOXYGEN__ 02122 #define ETHARP_STATS (LWIP_ARP) 02123 #endif 02124 02125 /** 02126 * IP_STATS==1: Enable IP stats. 02127 */ 02128 #if !defined IP_STATS || defined __DOXYGEN__ 02129 #define IP_STATS 1 02130 #endif 02131 02132 /** 02133 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is 02134 * on if using either frag or reass. 02135 */ 02136 #if !defined IPFRAG_STATS || defined __DOXYGEN__ 02137 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) 02138 #endif 02139 02140 /** 02141 * ICMP_STATS==1: Enable ICMP stats. 02142 */ 02143 #if !defined ICMP_STATS || defined __DOXYGEN__ 02144 #define ICMP_STATS 1 02145 #endif 02146 02147 /** 02148 * IGMP_STATS==1: Enable IGMP stats. 02149 */ 02150 #if !defined IGMP_STATS || defined __DOXYGEN__ 02151 #define IGMP_STATS (LWIP_IGMP) 02152 #endif 02153 02154 /** 02155 * UDP_STATS==1: Enable UDP stats. Default is on if 02156 * UDP enabled, otherwise off. 02157 */ 02158 #if !defined UDP_STATS || defined __DOXYGEN__ 02159 #define UDP_STATS (LWIP_UDP) 02160 #endif 02161 02162 /** 02163 * TCP_STATS==1: Enable TCP stats. Default is on if TCP 02164 * enabled, otherwise off. 02165 */ 02166 #if !defined TCP_STATS || defined __DOXYGEN__ 02167 #define TCP_STATS (LWIP_TCP) 02168 #endif 02169 02170 /** 02171 * MEM_STATS==1: Enable mem.c stats. 02172 */ 02173 #if !defined MEM_STATS || defined __DOXYGEN__ 02174 #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) 02175 #endif 02176 02177 /** 02178 * MEMP_STATS==1: Enable memp.c pool stats. 02179 */ 02180 #if !defined MEMP_STATS || defined __DOXYGEN__ 02181 #define MEMP_STATS (MEMP_MEM_MALLOC == 0) 02182 #endif 02183 02184 /** 02185 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). 02186 */ 02187 #if !defined SYS_STATS || defined __DOXYGEN__ 02188 #define SYS_STATS (NO_SYS == 0) 02189 #endif 02190 02191 /** 02192 * IP6_STATS==1: Enable IPv6 stats. 02193 */ 02194 #if !defined IP6_STATS || defined __DOXYGEN__ 02195 #define IP6_STATS (LWIP_IPV6) 02196 #endif 02197 02198 /** 02199 * ICMP6_STATS==1: Enable ICMP for IPv6 stats. 02200 */ 02201 #if !defined ICMP6_STATS || defined __DOXYGEN__ 02202 #define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) 02203 #endif 02204 02205 /** 02206 * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. 02207 */ 02208 #if !defined IP6_FRAG_STATS || defined __DOXYGEN__ 02209 #define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) 02210 #endif 02211 02212 /** 02213 * MLD6_STATS==1: Enable MLD for IPv6 stats. 02214 */ 02215 #if !defined MLD6_STATS || defined __DOXYGEN__ 02216 #define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) 02217 #endif 02218 02219 /** 02220 * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. 02221 */ 02222 #if !defined ND6_STATS || defined __DOXYGEN__ 02223 #define ND6_STATS (LWIP_IPV6) 02224 #endif 02225 02226 /** 02227 * MIB2_STATS==1: Stats for SNMP MIB2. 02228 */ 02229 #if !defined MIB2_STATS || defined __DOXYGEN__ 02230 #define MIB2_STATS 0 02231 #endif 02232 02233 #else 02234 02235 #define LINK_STATS 0 02236 #define ETHARP_STATS 0 02237 #define IP_STATS 0 02238 #define IPFRAG_STATS 0 02239 #define ICMP_STATS 0 02240 #define IGMP_STATS 0 02241 #define UDP_STATS 0 02242 #define TCP_STATS 0 02243 #define MEM_STATS 0 02244 #define MEMP_STATS 0 02245 #define SYS_STATS 0 02246 #define LWIP_STATS_DISPLAY 0 02247 #define IP6_STATS 0 02248 #define ICMP6_STATS 0 02249 #define IP6_FRAG_STATS 0 02250 #define MLD6_STATS 0 02251 #define ND6_STATS 0 02252 #define MIB2_STATS 0 02253 02254 #endif /* LWIP_STATS */ 02255 /** 02256 * @} 02257 */ 02258 02259 /* 02260 -------------------------------------- 02261 ---------- Checksum options ---------- 02262 -------------------------------------- 02263 */ 02264 /** 02265 * @defgroup lwip_opts_checksum Checksum 02266 * @ingroup lwip_opts_infrastructure 02267 * @{ 02268 */ 02269 /** 02270 * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled 02271 * per netif. 02272 * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! 02273 */ 02274 #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ 02275 #define LWIP_CHECKSUM_CTRL_PER_NETIF 0 02276 #endif 02277 02278 /** 02279 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. 02280 */ 02281 #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ 02282 #define CHECKSUM_GEN_IP 1 02283 #endif 02284 02285 /** 02286 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. 02287 */ 02288 #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ 02289 #define CHECKSUM_GEN_UDP 1 02290 #endif 02291 02292 /** 02293 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. 02294 */ 02295 #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ 02296 #define CHECKSUM_GEN_TCP 1 02297 #endif 02298 02299 /** 02300 * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. 02301 */ 02302 #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ 02303 #define CHECKSUM_GEN_ICMP 1 02304 #endif 02305 02306 /** 02307 * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. 02308 */ 02309 #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ 02310 #define CHECKSUM_GEN_ICMP6 1 02311 #endif 02312 02313 /** 02314 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. 02315 */ 02316 #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ 02317 #define CHECKSUM_CHECK_IP 1 02318 #endif 02319 02320 /** 02321 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. 02322 */ 02323 #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ 02324 #define CHECKSUM_CHECK_UDP 1 02325 #endif 02326 02327 /** 02328 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. 02329 */ 02330 #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ 02331 #define CHECKSUM_CHECK_TCP 1 02332 #endif 02333 02334 /** 02335 * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. 02336 */ 02337 #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ 02338 #define CHECKSUM_CHECK_ICMP 1 02339 #endif 02340 02341 /** 02342 * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets 02343 */ 02344 #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ 02345 #define CHECKSUM_CHECK_ICMP6 1 02346 #endif 02347 02348 /** 02349 * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from 02350 * application buffers to pbufs. 02351 */ 02352 #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ 02353 #define LWIP_CHECKSUM_ON_COPY 0 02354 #endif 02355 /** 02356 * @} 02357 */ 02358 02359 /* 02360 --------------------------------------- 02361 ---------- IPv6 options --------------- 02362 --------------------------------------- 02363 */ 02364 /** 02365 * @defgroup lwip_opts_ipv6 IPv6 02366 * @ingroup lwip_opts 02367 * @{ 02368 */ 02369 /** 02370 * LWIP_IPV6==1: Enable IPv6 02371 */ 02372 #if !defined LWIP_IPV6 || defined __DOXYGEN__ 02373 #define LWIP_IPV6 0 02374 #endif 02375 02376 /** 02377 * IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally) 02378 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 02379 * in this time, the whole packet is discarded. 02380 */ 02381 #if !defined IPV6_REASS_MAXAGE || defined __DOXYGEN__ 02382 #define IPV6_REASS_MAXAGE 60 02383 #endif 02384 02385 /** 02386 * LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that 02387 * e.g. link-local addresses are really treated as link-local. Disable this 02388 * setting only for single-interface configurations. 02389 * All addresses that have a scope according to the default policy (link-local 02390 * unicast addresses, interface-local and link-local multicast addresses) should 02391 * now have a zone set on them before being passed to the core API, although 02392 * lwIP will currently attempt to select a zone on the caller's behalf when 02393 * necessary. Applications that directly assign IPv6 addresses to interfaces 02394 * (which is NOT recommended) must now ensure that link-local addresses carry 02395 * the netif's zone. See the new ip6_zone.h header file for more information and 02396 * relevant macros. For now it is still possible to turn off scopes support 02397 * through the new LWIP_IPV6_SCOPES option. When upgrading an implementation that 02398 * uses the core API directly, it is highly recommended to enable 02399 * LWIP_IPV6_SCOPES_DEBUG at least for a while, to ensure e.g. proper address 02400 * initialization. 02401 */ 02402 #if !defined LWIP_IPV6_SCOPES || defined __DOXYGEN__ 02403 #define LWIP_IPV6_SCOPES 0 /*(LWIP_IPV6 && !LWIP_SINGLE_NETIF)*/ 02404 #endif 02405 02406 /** 02407 * LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses 02408 * are properly zoned (see ip6_zone.h on what that means) where it matters. 02409 * Enabling this setting is highly recommended when upgrading from an existing 02410 * installation that is not yet scope-aware; otherwise it may be too expensive. 02411 */ 02412 #if !defined LWIP_IPV6_SCOPES_DEBUG || defined __DOXYGEN__ 02413 #define LWIP_IPV6_SCOPES_DEBUG 0 02414 #endif 02415 02416 /** 02417 * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. 02418 */ 02419 #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ 02420 #define LWIP_IPV6_NUM_ADDRESSES 3 02421 #endif 02422 02423 /** 02424 * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs 02425 */ 02426 #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ 02427 #define LWIP_IPV6_FORWARD 0 02428 #endif 02429 02430 /** 02431 * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. 02432 */ 02433 #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ 02434 #define LWIP_IPV6_FRAG 1 02435 #endif 02436 02437 /** 02438 * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented 02439 */ 02440 #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ 02441 #define LWIP_IPV6_REASS LWIP_IPV6 02442 #endif 02443 02444 /** 02445 * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during 02446 * network startup. 02447 */ 02448 #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ 02449 #define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 02450 #endif 02451 02452 /** 02453 * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. 02454 */ 02455 #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ 02456 #define LWIP_IPV6_AUTOCONFIG LWIP_IPV6 02457 #endif 02458 02459 /** 02460 * LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each 02461 * IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled 02462 * otherwise, in which case the application may assign address lifetimes with 02463 * the appropriate macros. Addresses with no lifetime are assumed to be static. 02464 * If this option is disabled, all addresses are assumed to be static. 02465 */ 02466 #if !defined LWIP_IPV6_ADDRESS_LIFETIMES || defined __DOXYGEN__ 02467 #define LWIP_IPV6_ADDRESS_LIFETIMES LWIP_IPV6_AUTOCONFIG 02468 #endif 02469 02470 /** 02471 * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts. 02472 */ 02473 #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ 02474 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 02475 #endif 02476 /** 02477 * @} 02478 */ 02479 02480 /** 02481 * @defgroup lwip_opts_icmp6 ICMP6 02482 * @ingroup lwip_opts_ipv6 02483 * @{ 02484 */ 02485 /** 02486 * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) 02487 */ 02488 #if !defined LWIP_ICMP6 || defined __DOXYGEN__ 02489 #define LWIP_ICMP6 LWIP_IPV6 02490 #endif 02491 02492 /** 02493 * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in 02494 * ICMPv6 error messages. 02495 */ 02496 #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ 02497 #define LWIP_ICMP6_DATASIZE 8 02498 #endif 02499 02500 /** 02501 * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages 02502 */ 02503 #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ 02504 #define LWIP_ICMP6_HL 255 02505 #endif 02506 /** 02507 * @} 02508 */ 02509 02510 /** 02511 * @defgroup lwip_opts_mld6 Multicast listener discovery 02512 * @ingroup lwip_opts_ipv6 02513 * @{ 02514 */ 02515 /** 02516 * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. 02517 * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must 02518 * indiscriminately pass all inbound IPv6 multicast traffic to lwIP. 02519 */ 02520 #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ 02521 #define LWIP_IPV6_MLD LWIP_IPV6 02522 #endif 02523 02524 /** 02525 * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. 02526 * There must be enough groups so that each netif can join the solicited-node 02527 * multicast group for each of its local addresses, plus one for MDNS if 02528 * applicable, plus any number of groups to be joined on UDP sockets. 02529 */ 02530 #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ 02531 #define MEMP_NUM_MLD6_GROUP 4 02532 #endif 02533 /** 02534 * @} 02535 */ 02536 02537 /** 02538 * @defgroup lwip_opts_nd6 Neighbor discovery 02539 * @ingroup lwip_opts_ipv6 02540 * @{ 02541 */ 02542 /** 02543 * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address 02544 * is being resolved. 02545 */ 02546 #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ 02547 #define LWIP_ND6_QUEUEING LWIP_IPV6 02548 #endif 02549 02550 /** 02551 * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. 02552 */ 02553 #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ 02554 #define MEMP_NUM_ND6_QUEUE 20 02555 #endif 02556 02557 /** 02558 * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache 02559 */ 02560 #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ 02561 #define LWIP_ND6_NUM_NEIGHBORS 10 02562 #endif 02563 02564 /** 02565 * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache 02566 */ 02567 #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ 02568 #define LWIP_ND6_NUM_DESTINATIONS 10 02569 #endif 02570 02571 /** 02572 * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache 02573 */ 02574 #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ 02575 #define LWIP_ND6_NUM_PREFIXES 5 02576 #endif 02577 02578 /** 02579 * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache 02580 */ 02581 #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ 02582 #define LWIP_ND6_NUM_ROUTERS 3 02583 #endif 02584 02585 /** 02586 * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send 02587 * (neighbor solicit and router solicit) 02588 */ 02589 #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ 02590 #define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 02591 #endif 02592 02593 /** 02594 * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages 02595 * to send during neighbor reachability detection. 02596 */ 02597 #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ 02598 #define LWIP_ND6_MAX_UNICAST_SOLICIT 3 02599 #endif 02600 02601 /** 02602 * Unused: See ND RFC (time in milliseconds). 02603 */ 02604 #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ 02605 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 02606 #endif 02607 02608 /** 02609 * Unused: See ND RFC 02610 */ 02611 #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ 02612 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 02613 #endif 02614 02615 /** 02616 * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). 02617 * May be updated by router advertisement messages. 02618 */ 02619 #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ 02620 #define LWIP_ND6_REACHABLE_TIME 30000 02621 #endif 02622 02623 /** 02624 * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages 02625 */ 02626 #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ 02627 #define LWIP_ND6_RETRANS_TIMER 1000 02628 #endif 02629 02630 /** 02631 * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation 02632 * message is sent, during neighbor reachability detection. 02633 */ 02634 #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__ 02635 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 02636 #endif 02637 02638 /** 02639 * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update 02640 * Reachable time and retransmission timers, and netif MTU. 02641 */ 02642 #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ 02643 #define LWIP_ND6_ALLOW_RA_UPDATES 1 02644 #endif 02645 02646 /** 02647 * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery 02648 * with reachability hints for connected destinations. This helps avoid sending 02649 * unicast neighbor solicitation messages. 02650 */ 02651 #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ 02652 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1 02653 #endif 02654 02655 /** 02656 * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive 02657 * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS 02658 * servers to the DNS module. 02659 */ 02660 #if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__ 02661 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 02662 #endif 02663 /** 02664 * @} 02665 */ 02666 02667 /** 02668 * @defgroup lwip_opts_dhcpv6 DHCPv6 02669 * @ingroup lwip_opts_ipv6 02670 * @{ 02671 */ 02672 /** 02673 * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration. 02674 */ 02675 #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ 02676 #define LWIP_IPV6_DHCP6 0 02677 #endif 02678 02679 /** 02680 * LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration. 02681 * (not supported, yet!) 02682 */ 02683 #if !defined LWIP_IPV6_DHCP6_STATEFUL || defined __DOXYGEN__ 02684 #define LWIP_IPV6_DHCP6_STATEFUL 0 02685 #endif 02686 02687 /** 02688 * LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration. 02689 */ 02690 #if !defined LWIP_IPV6_DHCP6_STATELESS || defined __DOXYGEN__ 02691 #define LWIP_IPV6_DHCP6_STATELESS LWIP_IPV6_DHCP6 02692 #endif 02693 02694 /** 02695 * LWIP_DHCP6_GETS_NTP==1: Request NTP servers via DHCPv6. For each 02696 * response packet, a callback is called, which has to be provided by the port: 02697 * void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 02698 */ 02699 #if !defined LWIP_DHCP6_GET_NTP_SRV || defined __DOXYGEN__ 02700 #define LWIP_DHCP6_GET_NTP_SRV 0 02701 #endif 02702 02703 /** 02704 * The maximum of NTP servers requested 02705 */ 02706 #if !defined LWIP_DHCP6_MAX_NTP_SERVERS || defined __DOXYGEN__ 02707 #define LWIP_DHCP6_MAX_NTP_SERVERS 1 02708 #endif 02709 02710 /** 02711 * LWIP_DHCP6_MAX_DNS_SERVERS > 0: Request DNS servers via DHCPv6. 02712 * DNS servers received in the response are passed to DNS via @ref dns_setserver() 02713 * (up to the maximum limit defined here). 02714 */ 02715 #if !defined LWIP_DHCP6_MAX_DNS_SERVERS || defined __DOXYGEN__ 02716 #define LWIP_DHCP6_MAX_DNS_SERVERS DNS_MAX_SERVERS 02717 #endif 02718 /** 02719 * @} 02720 */ 02721 02722 /* 02723 --------------------------------------- 02724 ---------- Hook options --------------- 02725 --------------------------------------- 02726 */ 02727 02728 /** 02729 * @defgroup lwip_opts_hooks Hooks 02730 * @ingroup lwip_opts_infrastructure 02731 * Hooks are undefined by default, define them to a function if you need them. 02732 * @{ 02733 */ 02734 02735 /** 02736 * LWIP_HOOK_FILENAME: Custom filename to \#include in files that provide hooks. 02737 * Declare your hook function prototypes in there, you may also \#include all headers 02738 * providing data types that are need in this file. 02739 */ 02740 #ifdef __DOXYGEN__ 02741 #define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" 02742 #endif 02743 02744 /** 02745 * LWIP_HOOK_TCP_ISN: 02746 * Hook for generation of the Initial Sequence Number (ISN) for a new TCP 02747 * connection. The default lwIP ISN generation algorithm is very basic and may 02748 * allow for TCP spoofing attacks. This hook provides the means to implement 02749 * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), 02750 * or any other desired algorithm as a replacement. 02751 * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for 02752 * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n 02753 * Signature:\code{.c} 02754 * 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); 02755 * \endcode 02756 * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n 02757 * Arguments: 02758 * - local_ip: pointer to the local IP address of the connection 02759 * - local_port: local port number of the connection (host-byte order) 02760 * - remote_ip: pointer to the remote IP address of the connection 02761 * - remote_port: remote port number of the connection (host-byte order)\n 02762 * Return value: 02763 * - the 32-bit Initial Sequence Number to use for the new TCP connection. 02764 */ 02765 #ifdef __DOXYGEN__ 02766 #define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) 02767 #endif 02768 02769 /** 02770 * LWIP_HOOK_TCP_INPACKET_PCB: 02771 * Hook for intercepting incoming packets before they are passed to a pcb. This 02772 * allows updating some state or even dropping a packet. 02773 * Signature:\code{.c} 02774 * 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); 02775 * \endcode 02776 * Arguments: 02777 * - pcb: tcp_pcb selected for input of this packet (ATTENTION: this may be 02778 * struct tcp_pcb_listen if pcb->state == LISTEN) 02779 * - hdr: pointer to tcp header (ATTENTION: tcp options may not be in one piece!) 02780 * - optlen: tcp option length 02781 * - opt1len: tcp option length 1st part 02782 * - opt2: if this is != NULL, tcp options are split among 2 pbufs. In that case, 02783 * options start at right after the tcp header ('(u8_t*)(hdr + 1)') for 02784 * the first 'opt1len' bytes and the rest starts at 'opt2'. opt2len can 02785 * be simply calculated: 'opt2len = optlen - opt1len;' 02786 * - p: input packet, p->payload points to application data (that's why tcp hdr 02787 * and options are passed in seperately) 02788 * Return value: 02789 * - ERR_OK: continue input of this packet as normal 02790 * - != ERR_OK: drop this packet for input (don't continue input processing) 02791 * 02792 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 02793 * state or any pcb lists) from this callback! 02794 */ 02795 #ifdef __DOXYGEN__ 02796 #define LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p) 02797 #endif 02798 02799 /** 02800 * LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH: 02801 * Hook for increasing the size of the options allocated with a tcp header. 02802 * Together with LWIP_HOOK_TCP_OUT_ADD_TCPOPTS, this can be used to add custom 02803 * options to outgoing tcp segments. 02804 * Signature:\code{.c} 02805 * u8_t my_hook_tcp_out_tcpopt_length(const struct tcp_pcb *pcb, u8_t internal_option_length); 02806 * \endcode 02807 * Arguments: 02808 * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or 02809 * struct tcp_pcb_listen if pcb->state == LISTEN) 02810 * - internal_option_length: tcp option length used by the stack internally 02811 * Return value: 02812 * - a number of bytes to allocate for tcp options (internal_option_length <= ret <= 40) 02813 * 02814 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 02815 * state or any pcb lists) from this callback! 02816 */ 02817 #ifdef __DOXYGEN__ 02818 #define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len) 02819 #endif 02820 02821 /** 02822 * LWIP_HOOK_TCP_OUT_ADD_TCPOPTS: 02823 * Hook for adding custom options to outgoing tcp segments. 02824 * Space for these custom options has to be reserved via LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH. 02825 * Signature:\code{.c} 02826 * u32_t *my_hook_tcp_out_add_tcpopts(struct pbuf *p, struct tcp_hdr *hdr, const struct tcp_pcb *pcb, u32_t *opts); 02827 * \endcode 02828 * Arguments: 02829 * - p: output packet, p->payload pointing to tcp header, data follows 02830 * - hdr: tcp header 02831 * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or 02832 * struct tcp_pcb_listen if pcb->state == LISTEN) 02833 * - opts: pointer where to add the custom options (there may already be options 02834 * between the header and these) 02835 * Return value: 02836 * - pointer pointing directly after the inserted options 02837 * 02838 * ATTENTION: don't call any tcp api functions that might change tcp state (pcb 02839 * state or any pcb lists) from this callback! 02840 */ 02841 #ifdef __DOXYGEN__ 02842 #define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts) 02843 #endif 02844 02845 /** 02846 * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): 02847 * Called from ip_input() (IPv4) 02848 * Signature:\code{.c} 02849 * int my_hook(struct pbuf *pbuf, struct netif *input_netif); 02850 * \endcode 02851 * Arguments: 02852 * - pbuf: received struct pbuf passed to ip_input() 02853 * - input_netif: struct netif on which the packet has been received 02854 * Return values: 02855 * - 0: Hook has not consumed the packet, packet is processed as normal 02856 * - != 0: Hook has consumed the packet. 02857 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 02858 * (i.e. free it when done). 02859 */ 02860 #ifdef __DOXYGEN__ 02861 #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) 02862 #endif 02863 02864 /** 02865 * LWIP_HOOK_IP4_ROUTE(dest): 02866 * Called from ip_route() (IPv4) 02867 * Signature:\code{.c} 02868 * struct netif *my_hook(const ip4_addr_t *dest); 02869 * \endcode 02870 * Arguments: 02871 * - dest: destination IPv4 address 02872 * Returns values: 02873 * - the destination netif 02874 * - NULL if no destination netif is found. In that case, ip_route() continues as normal. 02875 */ 02876 #ifdef __DOXYGEN__ 02877 #define LWIP_HOOK_IP4_ROUTE() 02878 #endif 02879 02880 /** 02881 * LWIP_HOOK_IP4_ROUTE_SRC(src, dest): 02882 * Source-based routing for IPv4 - called from ip_route() (IPv4) 02883 * Signature:\code{.c} 02884 * struct netif *my_hook(const ip4_addr_t *src, const ip4_addr_t *dest); 02885 * \endcode 02886 * Arguments: 02887 * - src: local/source IPv4 address 02888 * - dest: destination IPv4 address 02889 * Returns values: 02890 * - the destination netif 02891 * - NULL if no destination netif is found. In that case, ip_route() continues as normal. 02892 */ 02893 #ifdef __DOXYGEN__ 02894 #define LWIP_HOOK_IP4_ROUTE_SRC(src, dest) 02895 #endif 02896 02897 /** 02898 * LWIP_HOOK_IP4_CANFORWARD(src, dest): 02899 * Check if an IPv4 can be forwarded - called from: 02900 * ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4) 02901 * - source address is available via ip4_current_src_addr() 02902 * - calling an output function in this context (e.g. multicast router) is allowed 02903 * Signature:\code{.c} 02904 * int my_hook(struct pbuf *p, u32_t dest_addr_hostorder); 02905 * \endcode 02906 * Arguments: 02907 * - p: packet to forward 02908 * - dest: destination IPv4 address 02909 * Returns values: 02910 * - 1: forward 02911 * - 0: don't forward 02912 * - -1: no decision. In that case, ip4_canforward() continues as normal. 02913 */ 02914 #ifdef __DOXYGEN__ 02915 #define LWIP_HOOK_IP4_CANFORWARD(src, dest) 02916 #endif 02917 02918 /** 02919 * LWIP_HOOK_ETHARP_GET_GW(netif, dest): 02920 * Called from etharp_output() (IPv4) 02921 * Signature:\code{.c} 02922 * const ip4_addr_t *my_hook(struct netif *netif, const ip4_addr_t *dest); 02923 * \endcode 02924 * Arguments: 02925 * - netif: the netif used for sending 02926 * - dest: the destination IPv4 address 02927 * Return values: 02928 * - the IPv4 address of the gateway to handle the specified destination IPv4 address 02929 * - NULL, in which case the netif's default gateway is used 02930 * 02931 * The returned address MUST be directly reachable on the specified netif! 02932 * This function is meant to implement advanced IPv4 routing together with 02933 * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is 02934 * not part of lwIP but can e.g. be hidden in the netif's state argument. 02935 */ 02936 #ifdef __DOXYGEN__ 02937 #define LWIP_HOOK_ETHARP_GET_GW(netif, dest) 02938 #endif 02939 02940 /** 02941 * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): 02942 * Called from ip6_input() (IPv6) 02943 * Signature:\code{.c} 02944 * int my_hook(struct pbuf *pbuf, struct netif *input_netif); 02945 * \endcode 02946 * Arguments: 02947 * - pbuf: received struct pbuf passed to ip6_input() 02948 * - input_netif: struct netif on which the packet has been received 02949 * Return values: 02950 * - 0: Hook has not consumed the packet, packet is processed as normal 02951 * - != 0: Hook has consumed the packet. 02952 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 02953 * (i.e. free it when done). 02954 */ 02955 #ifdef __DOXYGEN__ 02956 #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) 02957 #endif 02958 02959 /** 02960 * LWIP_HOOK_IP6_ROUTE(src, dest): 02961 * Called from ip_route() (IPv6) 02962 * Signature:\code{.c} 02963 * struct netif *my_hook(const ip6_addr_t *dest, const ip6_addr_t *src); 02964 * \endcode 02965 * Arguments: 02966 * - src: source IPv6 address 02967 * - dest: destination IPv6 address 02968 * Return values: 02969 * - the destination netif 02970 * - NULL if no destination netif is found. In that case, ip6_route() continues as normal. 02971 */ 02972 #ifdef __DOXYGEN__ 02973 #define LWIP_HOOK_IP6_ROUTE(src, dest) 02974 #endif 02975 02976 /** 02977 * LWIP_HOOK_ND6_GET_GW(netif, dest): 02978 * Called from nd6_get_next_hop_entry() (IPv6) 02979 * Signature:\code{.c} 02980 * const ip6_addr_t *my_hook(struct netif *netif, const ip6_addr_t *dest); 02981 * \endcode 02982 * Arguments: 02983 * - netif: the netif used for sending 02984 * - dest: the destination IPv6 address 02985 * Return values: 02986 * - the IPv6 address of the next hop to handle the specified destination IPv6 address 02987 * - NULL, in which case a NDP-discovered router is used instead 02988 * 02989 * The returned address MUST be directly reachable on the specified netif! 02990 * This function is meant to implement advanced IPv6 routing together with 02991 * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is 02992 * not part of lwIP but can e.g. be hidden in the netif's state argument. 02993 */ 02994 #ifdef __DOXYGEN__ 02995 #define LWIP_HOOK_ND6_GET_GW(netif, dest) 02996 #endif 02997 02998 /** 02999 * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): 03000 * Called from ethernet_input() if VLAN support is enabled 03001 * Signature:\code{.c} 03002 * int my_hook(struct netif *netif, struct eth_hdr *eth_hdr, struct eth_vlan_hdr *vlan_hdr); 03003 * \endcode 03004 * Arguments: 03005 * - netif: struct netif on which the packet has been received 03006 * - eth_hdr: struct eth_hdr of the packet 03007 * - vlan_hdr: struct eth_vlan_hdr of the packet 03008 * Return values: 03009 * - 0: Packet must be dropped. 03010 * - != 0: Packet must be accepted. 03011 */ 03012 #ifdef __DOXYGEN__ 03013 #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) 03014 #endif 03015 03016 /** 03017 * LWIP_HOOK_VLAN_SET: 03018 * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data 03019 * on per-netif basis to implement this callback, see @ref netif_cd. 03020 * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n 03021 * Signature:\code{.c} 03022 * s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n 03023 * \endcode 03024 * Arguments: 03025 * - netif: struct netif that the packet will be sent through 03026 * - p: struct pbuf packet to be sent 03027 * - src: source eth address 03028 * - dst: destination eth address 03029 * - eth_type: ethernet type to packet to be sent\n 03030 * 03031 * 03032 * Return values: 03033 * - <0: Packet shall not contain VLAN header. 03034 * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. 03035 */ 03036 #ifdef __DOXYGEN__ 03037 #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) 03038 #endif 03039 03040 /** 03041 * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): 03042 * Called from memp_free() when a memp pool was empty and an item is now available 03043 * Signature:\code{.c} 03044 * void my_hook(memp_t type); 03045 * \endcode 03046 */ 03047 #ifdef __DOXYGEN__ 03048 #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) 03049 #endif 03050 03051 /** 03052 * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): 03053 * Called from ethernet_input() when an unknown eth type is encountered. 03054 * Signature:\code{.c} 03055 * err_t my_hook(struct pbuf* pbuf, struct netif* netif); 03056 * \endcode 03057 * Arguments: 03058 * - p: rx packet with unknown eth type 03059 * - netif: netif on which the packet has been received 03060 * Return values: 03061 * - ERR_OK if packet is accepted (hook function now owns the pbuf) 03062 * - any error code otherwise (pbuf is freed) 03063 * 03064 * Payload points to ethernet header! 03065 */ 03066 #ifdef __DOXYGEN__ 03067 #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) 03068 #endif 03069 03070 /** 03071 * LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr): 03072 * Called from various dhcp functions when sending a DHCP message. 03073 * This hook is called just before the DHCP message trailer is added, so the 03074 * options are at the end of a DHCP message. 03075 * Signature:\code{.c} 03076 * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg, 03077 * u8_t msg_type, u16_t *options_len_ptr); 03078 * \endcode 03079 * Arguments: 03080 * - netif: struct netif that the packet will be sent through 03081 * - dhcp: struct dhcp on that netif 03082 * - state: current dhcp state (dhcp_state_enum_t as an u8_t) 03083 * - msg: struct dhcp_msg that will be sent 03084 * - msg_type: dhcp message type to be sent (u8_t) 03085 * - options_len_ptr: pointer to the current length of options in the dhcp_msg "msg" 03086 * (must be increased when options are added!) 03087 * 03088 * Options need to appended like this: 03089 * LWIP_ASSERT("dhcp option overflow", *options_len_ptr + option_len + 2 <= DHCP_OPTIONS_LEN); 03090 * msg->options[(*options_len_ptr)++] = <option_number>; 03091 * msg->options[(*options_len_ptr)++] = <option_len>; 03092 * msg->options[(*options_len_ptr)++] = <option_bytes>; 03093 * [...] 03094 */ 03095 #ifdef __DOXYGEN__ 03096 #define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr) 03097 #endif 03098 03099 /** 03100 * LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset): 03101 * Called from dhcp_parse_reply when receiving a DHCP message. 03102 * This hook is called for every option in the received message that is not handled internally. 03103 * Signature:\code{.c} 03104 * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg, 03105 * u8_t msg_type, u8_t option, u8_t option_len, struct pbuf *pbuf, u16_t option_value_offset); 03106 * \endcode 03107 * Arguments: 03108 * - netif: struct netif that the packet will be sent through 03109 * - dhcp: struct dhcp on that netif 03110 * - state: current dhcp state (dhcp_state_enum_t as an u8_t) 03111 * - msg: struct dhcp_msg that was received 03112 * - msg_type: dhcp message type received (u8_t, ATTENTION: only valid after 03113 * the message type option has been parsed!) 03114 * - option: option value (u8_t) 03115 * - len: option data length (u8_t) 03116 * - pbuf: pbuf where option data is contained 03117 * - option_value_offset: offset in pbuf where option data begins 03118 * 03119 * A nice way to get the option contents is pbuf_get_contiguous(): 03120 * u8_t buf[32]; 03121 * u8_t *ptr = (u8_t*)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset); 03122 */ 03123 #ifdef __DOXYGEN__ 03124 #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) 03125 #endif 03126 03127 /** 03128 * LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len): 03129 * Called from various dhcp6 functions when sending a DHCP6 message. 03130 * This hook is called just before the DHCP6 message is sent, so the 03131 * options are at the end of a DHCP6 message. 03132 * Signature:\code{.c} 03133 * void my_hook(struct netif *netif, struct dhcp6 *dhcp, u8_t state, struct dhcp6_msg *msg, 03134 * u8_t msg_type, u16_t *options_len_ptr); 03135 * \endcode 03136 * Arguments: 03137 * - netif: struct netif that the packet will be sent through 03138 * - dhcp6: struct dhcp6 on that netif 03139 * - state: current dhcp6 state (dhcp6_state_enum_t as an u8_t) 03140 * - msg: struct dhcp6_msg that will be sent 03141 * - msg_type: dhcp6 message type to be sent (u8_t) 03142 * - options_len_ptr: pointer to the current length of options in the dhcp6_msg "msg" 03143 * (must be increased when options are added!) 03144 * 03145 * Options need to appended like this: 03146 * u8_t *options = (u8_t *)(msg + 1); 03147 * LWIP_ASSERT("dhcp option overflow", sizeof(struct dhcp6_msg) + *options_len_ptr + newoptlen <= max_len); 03148 * options[(*options_len_ptr)++] = <option_data>; 03149 * [...] 03150 */ 03151 #ifdef __DOXYGEN__ 03152 #define LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len) 03153 #endif 03154 03155 /** 03156 * LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) 03157 * Called from socket API to implement setsockopt() for options not provided by lwIP. 03158 * Core lock is held when this hook is called. 03159 * Signature:\code{.c} 03160 * int my_hook(int s, struct lwip_sock *sock, int level, int optname, const void *optval, socklen_t optlen, int *err) 03161 * \endcode 03162 * Arguments: 03163 * - s: socket file descriptor 03164 * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h) 03165 * - level: protocol level at which the option resides 03166 * - optname: option to set 03167 * - optval: value to set 03168 * - optlen: size of optval 03169 * - err: output error 03170 * Return values: 03171 * - 0: Hook has not consumed the option, code continues as normal (to internal options) 03172 * - != 0: Hook has consumed the option, 'err' is returned 03173 */ 03174 #ifdef __DOXYGEN__ 03175 #define LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err) 03176 #endif 03177 03178 /** 03179 * LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) 03180 * Called from socket API to implement getsockopt() for options not provided by lwIP. 03181 * Core lock is held when this hook is called. 03182 * Signature:\code{.c} 03183 * int my_hook(int s, struct lwip_sock *sock, int level, int optname, void *optval, socklen_t *optlen, int *err) 03184 * \endcode 03185 * Arguments: 03186 * - s: socket file descriptor 03187 * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h) 03188 * - level: protocol level at which the option resides 03189 * - optname: option to get 03190 * - optval: value to get 03191 * - optlen: size of optval 03192 * - err: output error 03193 * Return values: 03194 * - 0: Hook has not consumed the option, code continues as normal (to internal options) 03195 * - != 0: Hook has consumed the option, 'err' is returned 03196 */ 03197 #ifdef __DOXYGEN__ 03198 #define LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err) 03199 #endif 03200 03201 /** 03202 * LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) 03203 * Called from netconn APIs (not usable with callback apps) allowing an 03204 * external DNS resolver (which uses sequential API) to handle the query. 03205 * Signature:\code{.c} 03206 * int my_hook(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err) 03207 * \endcode 03208 * Arguments: 03209 * - name: hostname to resolve 03210 * - addr: output host address 03211 * - addrtype: type of address to query 03212 * - err: output error 03213 * Return values: 03214 * - 0: Hook has not consumed hostname query, query continues into DNS module 03215 * - != 0: Hook has consumed the query 03216 * 03217 * err must also be checked to determine if the hook consumed the query, but 03218 * the query failed 03219 */ 03220 #ifdef __DOXYGEN__ 03221 #define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err) 03222 #endif 03223 /** 03224 * @} 03225 */ 03226 03227 /* 03228 --------------------------------------- 03229 ---------- Debugging options ---------- 03230 --------------------------------------- 03231 */ 03232 /** 03233 * @defgroup lwip_opts_debugmsg Debug messages 03234 * @ingroup lwip_opts_debug 03235 * @{ 03236 */ 03237 /** 03238 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is 03239 * compared against this value. If it is smaller, then debugging 03240 * messages are written. 03241 * @see debugging_levels 03242 */ 03243 #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ 03244 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 03245 #endif 03246 03247 /** 03248 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable 03249 * debug messages of certain types. 03250 * @see debugging_levels 03251 */ 03252 #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ 03253 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 03254 #endif 03255 03256 /** 03257 * ETHARP_DEBUG: Enable debugging in etharp.c. 03258 */ 03259 #if !defined ETHARP_DEBUG || defined __DOXYGEN__ 03260 #define ETHARP_DEBUG LWIP_DBG_OFF 03261 #endif 03262 03263 /** 03264 * NETIF_DEBUG: Enable debugging in netif.c. 03265 */ 03266 #if !defined NETIF_DEBUG || defined __DOXYGEN__ 03267 #define NETIF_DEBUG LWIP_DBG_OFF 03268 #endif 03269 03270 /** 03271 * PBUF_DEBUG: Enable debugging in pbuf.c. 03272 */ 03273 #if !defined PBUF_DEBUG || defined __DOXYGEN__ 03274 #define PBUF_DEBUG LWIP_DBG_OFF 03275 #endif 03276 03277 /** 03278 * API_LIB_DEBUG: Enable debugging in api_lib.c. 03279 */ 03280 #if !defined API_LIB_DEBUG || defined __DOXYGEN__ 03281 #define API_LIB_DEBUG LWIP_DBG_OFF 03282 #endif 03283 03284 /** 03285 * API_MSG_DEBUG: Enable debugging in api_msg.c. 03286 */ 03287 #if !defined API_MSG_DEBUG || defined __DOXYGEN__ 03288 #define API_MSG_DEBUG LWIP_DBG_OFF 03289 #endif 03290 03291 /** 03292 * SOCKETS_DEBUG: Enable debugging in sockets.c. 03293 */ 03294 #if !defined SOCKETS_DEBUG || defined __DOXYGEN__ 03295 #define SOCKETS_DEBUG LWIP_DBG_OFF 03296 #endif 03297 03298 /** 03299 * ICMP_DEBUG: Enable debugging in icmp.c. 03300 */ 03301 #if !defined ICMP_DEBUG || defined __DOXYGEN__ 03302 #define ICMP_DEBUG LWIP_DBG_OFF 03303 #endif 03304 03305 /** 03306 * IGMP_DEBUG: Enable debugging in igmp.c. 03307 */ 03308 #if !defined IGMP_DEBUG || defined __DOXYGEN__ 03309 #define IGMP_DEBUG LWIP_DBG_OFF 03310 #endif 03311 03312 /** 03313 * INET_DEBUG: Enable debugging in inet.c. 03314 */ 03315 #if !defined INET_DEBUG || defined __DOXYGEN__ 03316 #define INET_DEBUG LWIP_DBG_OFF 03317 #endif 03318 03319 /** 03320 * IP_DEBUG: Enable debugging for IP. 03321 */ 03322 #if !defined IP_DEBUG || defined __DOXYGEN__ 03323 #define IP_DEBUG LWIP_DBG_OFF 03324 #endif 03325 03326 /** 03327 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. 03328 */ 03329 #if !defined IP_REASS_DEBUG || defined __DOXYGEN__ 03330 #define IP_REASS_DEBUG LWIP_DBG_OFF 03331 #endif 03332 03333 /** 03334 * RAW_DEBUG: Enable debugging in raw.c. 03335 */ 03336 #if !defined RAW_DEBUG || defined __DOXYGEN__ 03337 #define RAW_DEBUG LWIP_DBG_OFF 03338 #endif 03339 03340 /** 03341 * MEM_DEBUG: Enable debugging in mem.c. 03342 */ 03343 #if !defined MEM_DEBUG || defined __DOXYGEN__ 03344 #define MEM_DEBUG LWIP_DBG_OFF 03345 #endif 03346 03347 /** 03348 * MEMP_DEBUG: Enable debugging in memp.c. 03349 */ 03350 #if !defined MEMP_DEBUG || defined __DOXYGEN__ 03351 #define MEMP_DEBUG LWIP_DBG_OFF 03352 #endif 03353 03354 /** 03355 * SYS_DEBUG: Enable debugging in sys.c. 03356 */ 03357 #if !defined SYS_DEBUG || defined __DOXYGEN__ 03358 #define SYS_DEBUG LWIP_DBG_OFF 03359 #endif 03360 03361 /** 03362 * TIMERS_DEBUG: Enable debugging in timers.c. 03363 */ 03364 #if !defined TIMERS_DEBUG || defined __DOXYGEN__ 03365 #define TIMERS_DEBUG LWIP_DBG_OFF 03366 #endif 03367 03368 /** 03369 * TCP_DEBUG: Enable debugging for TCP. 03370 */ 03371 #if !defined TCP_DEBUG || defined __DOXYGEN__ 03372 #define TCP_DEBUG LWIP_DBG_OFF 03373 #endif 03374 03375 /** 03376 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. 03377 */ 03378 #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ 03379 #define TCP_INPUT_DEBUG LWIP_DBG_OFF 03380 #endif 03381 03382 /** 03383 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. 03384 */ 03385 #if !defined TCP_FR_DEBUG || defined __DOXYGEN__ 03386 #define TCP_FR_DEBUG LWIP_DBG_OFF 03387 #endif 03388 03389 /** 03390 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit 03391 * timeout. 03392 */ 03393 #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ 03394 #define TCP_RTO_DEBUG LWIP_DBG_OFF 03395 #endif 03396 03397 /** 03398 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. 03399 */ 03400 #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ 03401 #define TCP_CWND_DEBUG LWIP_DBG_OFF 03402 #endif 03403 03404 /** 03405 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. 03406 */ 03407 #if !defined TCP_WND_DEBUG || defined __DOXYGEN__ 03408 #define TCP_WND_DEBUG LWIP_DBG_OFF 03409 #endif 03410 03411 /** 03412 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. 03413 */ 03414 #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ 03415 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF 03416 #endif 03417 03418 /** 03419 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. 03420 */ 03421 #if !defined TCP_RST_DEBUG || defined __DOXYGEN__ 03422 #define TCP_RST_DEBUG LWIP_DBG_OFF 03423 #endif 03424 03425 /** 03426 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. 03427 */ 03428 #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ 03429 #define TCP_QLEN_DEBUG LWIP_DBG_OFF 03430 #endif 03431 03432 /** 03433 * UDP_DEBUG: Enable debugging in UDP. 03434 */ 03435 #if !defined UDP_DEBUG || defined __DOXYGEN__ 03436 #define UDP_DEBUG LWIP_DBG_OFF 03437 #endif 03438 03439 /** 03440 * TCPIP_DEBUG: Enable debugging in tcpip.c. 03441 */ 03442 #if !defined TCPIP_DEBUG || defined __DOXYGEN__ 03443 #define TCPIP_DEBUG LWIP_DBG_OFF 03444 #endif 03445 03446 /** 03447 * SLIP_DEBUG: Enable debugging in slipif.c. 03448 */ 03449 #if !defined SLIP_DEBUG || defined __DOXYGEN__ 03450 #define SLIP_DEBUG LWIP_DBG_OFF 03451 #endif 03452 03453 /** 03454 * DHCP_DEBUG: Enable debugging in dhcp.c. 03455 */ 03456 #if !defined DHCP_DEBUG || defined __DOXYGEN__ 03457 #define DHCP_DEBUG LWIP_DBG_OFF 03458 #endif 03459 03460 /** 03461 * AUTOIP_DEBUG: Enable debugging in autoip.c. 03462 */ 03463 #if !defined AUTOIP_DEBUG || defined __DOXYGEN__ 03464 #define AUTOIP_DEBUG LWIP_DBG_OFF 03465 #endif 03466 03467 /** 03468 * DNS_DEBUG: Enable debugging for DNS. 03469 */ 03470 #if !defined DNS_DEBUG || defined __DOXYGEN__ 03471 #define DNS_DEBUG LWIP_DBG_OFF 03472 #endif 03473 03474 /** 03475 * IP6_DEBUG: Enable debugging for IPv6. 03476 */ 03477 #if !defined IP6_DEBUG || defined __DOXYGEN__ 03478 #define IP6_DEBUG LWIP_DBG_OFF 03479 #endif 03480 03481 /** 03482 * DHCP6_DEBUG: Enable debugging in dhcp6.c. 03483 */ 03484 #if !defined DHCP6_DEBUG || defined __DOXYGEN__ 03485 #define DHCP6_DEBUG LWIP_DBG_OFF 03486 #endif 03487 /** 03488 * @} 03489 */ 03490 03491 /** 03492 * LWIP_TESTMODE: Changes to make unit test possible 03493 */ 03494 #if !defined LWIP_TESTMODE 03495 #define LWIP_TESTMODE 0 03496 #endif 03497 03498 /* 03499 -------------------------------------------------- 03500 ---------- Performance tracking options ---------- 03501 -------------------------------------------------- 03502 */ 03503 /** 03504 * @defgroup lwip_opts_perf Performance 03505 * @ingroup lwip_opts_debug 03506 * @{ 03507 */ 03508 /** 03509 * LWIP_PERF: Enable performance testing for lwIP 03510 * (if enabled, arch/perf.h is included) 03511 */ 03512 #if !defined LWIP_PERF || defined __DOXYGEN__ 03513 #define LWIP_PERF 0 03514 #endif 03515 /** 03516 * @} 03517 */ 03518 03519 #endif /* LWIP_HDR_OPT_H */
Generated on Tue Jul 12 2022 13:54:40 by
