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.
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 */ 00150 00151 /* 00152 ------------------------------------ 00153 ----------- Core locking ----------- 00154 ------------------------------------ 00155 */ 00156 /** 00157 * @defgroup lwip_opts_lock Core locking and MPU 00158 * @ingroup lwip_opts_infrastructure 00159 * @{ 00160 */ 00161 /** 00162 * LWIP_MPU_COMPATIBLE: enables special memory management mechanism 00163 * which makes lwip able to work on MPU (Memory Protection Unit) system 00164 * by not passing stack-pointers to other threads 00165 * (this decreases performance as memory is allocated from pools instead 00166 * of keeping it on the stack) 00167 */ 00168 #if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__ 00169 #define LWIP_MPU_COMPATIBLE 0 00170 #endif 00171 00172 /** 00173 * LWIP_TCPIP_CORE_LOCKING 00174 * Creates a global mutex that is held during TCPIP thread operations. 00175 * Can be locked by client code to perform lwIP operations without changing 00176 * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and 00177 * UNLOCK_TCPIP_CORE(). 00178 * Your system should provide mutexes supporting priority inversion to use this. 00179 */ 00180 #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ 00181 #define LWIP_TCPIP_CORE_LOCKING 1 00182 #endif 00183 00184 /** 00185 * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, 00186 * this lets tcpip_input() grab the mutex for input packets as well, 00187 * instead of allocating a message and passing it to tcpip_thread. 00188 * 00189 * ATTENTION: this does not work when tcpip_input() is called from 00190 * interrupt context! 00191 */ 00192 #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ 00193 #define LWIP_TCPIP_CORE_LOCKING_INPUT 0 00194 #endif 00195 00196 /** 00197 * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt 00198 * protection) for certain critical regions during buffer allocation, deallocation 00199 * and memory allocation and deallocation. 00200 * ATTENTION: This is required when using lwIP from more than one context! If 00201 * you disable this, you must be sure what you are doing! 00202 */ 00203 #if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__ 00204 #define SYS_LIGHTWEIGHT_PROT 1 00205 #endif 00206 /** 00207 * @} 00208 */ 00209 00210 /* 00211 ------------------------------------ 00212 ---------- Memory options ---------- 00213 ------------------------------------ 00214 */ 00215 /** 00216 * @defgroup lwip_opts_mem Heap and memory pools 00217 * @ingroup lwip_opts_infrastructure 00218 * @{ 00219 */ 00220 /** 00221 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library 00222 * instead of the lwip internal allocator. Can save code size if you 00223 * already use it. 00224 */ 00225 #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ 00226 #define MEM_LIBC_MALLOC 0 00227 #endif 00228 00229 /** 00230 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. 00231 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution 00232 * speed (heap alloc can be much slower than pool alloc) and usage from interrupts 00233 * (especially if your netif driver allocates PBUF_POOL pbufs for received frames 00234 * from interrupt)! 00235 * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, 00236 * not only for internal pools defined in memp_std.h)! 00237 */ 00238 #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ 00239 #define MEMP_MEM_MALLOC 0 00240 #endif 00241 00242 /** 00243 * MEM_ALIGNMENT: should be set to the alignment of the CPU 00244 * 4 byte alignment -> \#define MEM_ALIGNMENT 4 00245 * 2 byte alignment -> \#define MEM_ALIGNMENT 2 00246 */ 00247 #if !defined MEM_ALIGNMENT || defined __DOXYGEN__ 00248 #define MEM_ALIGNMENT 1 00249 #endif 00250 00251 /** 00252 * MEM_SIZE: the size of the heap memory. If the application will send 00253 * a lot of data that needs to be copied, this should be set high. 00254 */ 00255 #if !defined MEM_SIZE || defined __DOXYGEN__ 00256 #define MEM_SIZE 1600 00257 #endif 00258 00259 /** 00260 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable 00261 * amount of bytes before and after each memp element in every pool and fills 00262 * it with a prominent default value. 00263 * MEMP_OVERFLOW_CHECK == 0 no checking 00264 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed 00265 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time 00266 * memp_malloc() or memp_free() is called (useful but slow!) 00267 */ 00268 #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ 00269 #define MEMP_OVERFLOW_CHECK 0 00270 #endif 00271 00272 /** 00273 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make 00274 * sure that there are no cycles in the linked lists. 00275 */ 00276 #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ 00277 #define MEMP_SANITY_CHECK 0 00278 #endif 00279 00280 /** 00281 * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set 00282 * of memory pools of various sizes. When mem_malloc is called, an element of 00283 * the smallest pool that can provide the length needed is returned. 00284 * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. 00285 */ 00286 #if !defined MEM_USE_POOLS || defined __DOXYGEN__ 00287 #define MEM_USE_POOLS 0 00288 #endif 00289 00290 /** 00291 * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next 00292 * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more 00293 * reliable. */ 00294 #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ 00295 #define MEM_USE_POOLS_TRY_BIGGER_POOL 0 00296 #endif 00297 00298 /** 00299 * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h 00300 * that defines additional pools beyond the "standard" ones required 00301 * by lwIP. If you set this to 1, you must have lwippools.h in your 00302 * include path somewhere. 00303 */ 00304 #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ 00305 #define MEMP_USE_CUSTOM_POOLS 0 00306 #endif 00307 00308 /** 00309 * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from 00310 * interrupt context (or another context that doesn't allow waiting for a 00311 * semaphore). 00312 * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, 00313 * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs 00314 * with each loop so that mem_free can run. 00315 * 00316 * ATTENTION: As you can see from the above description, this leads to dis-/ 00317 * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc 00318 * can need longer. 00319 * 00320 * If you don't want that, at least for NO_SYS=0, you can still use the following 00321 * functions to enqueue a deallocation call which then runs in the tcpip_thread 00322 * context: 00323 * - pbuf_free_callback(p); 00324 * - mem_free_callback(m); 00325 */ 00326 #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ 00327 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 00328 #endif 00329 /** 00330 * @} 00331 */ 00332 00333 /* 00334 ------------------------------------------------ 00335 ---------- Internal Memory Pool Sizes ---------- 00336 ------------------------------------------------ 00337 */ 00338 /** 00339 * @defgroup lwip_opts_memp Internal memory pools 00340 * @ingroup lwip_opts_infrastructure 00341 * @{ 00342 */ 00343 /** 00344 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). 00345 * If the application sends a lot of data out of ROM (or other static memory), 00346 * this should be set high. 00347 */ 00348 #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ 00349 #define MEMP_NUM_PBUF 16 00350 #endif 00351 00352 /** 00353 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs 00354 * (requires the LWIP_RAW option) 00355 */ 00356 #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ 00357 #define MEMP_NUM_RAW_PCB 4 00358 #endif 00359 00360 /** 00361 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 00362 * per active UDP "connection". 00363 * (requires the LWIP_UDP option) 00364 */ 00365 #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ 00366 #define MEMP_NUM_UDP_PCB 4 00367 #endif 00368 00369 /** 00370 * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. 00371 * (requires the LWIP_TCP option) 00372 */ 00373 #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ 00374 #define MEMP_NUM_TCP_PCB 5 00375 #endif 00376 00377 /** 00378 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. 00379 * (requires the LWIP_TCP option) 00380 */ 00381 #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ 00382 #define MEMP_NUM_TCP_PCB_LISTEN 8 00383 #endif 00384 00385 /** 00386 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. 00387 * (requires the LWIP_TCP option) 00388 */ 00389 #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ 00390 #define MEMP_NUM_TCP_SEG 16 00391 #endif 00392 00393 /** 00394 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for 00395 * reassembly (whole packets, not fragments!) 00396 */ 00397 #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ 00398 #define MEMP_NUM_REASSDATA 5 00399 #endif 00400 00401 /** 00402 * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent 00403 * (fragments, not whole packets!). 00404 * This is only used with IP_FRAG_USES_STATIC_BUF==0 and 00405 * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs 00406 * where the packet is not yet sent when netif->output returns. 00407 */ 00408 #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ 00409 #define MEMP_NUM_FRAG_PBUF 15 00410 #endif 00411 00412 /** 00413 * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing 00414 * packets (pbufs) that are waiting for an ARP request (to resolve 00415 * their destination address) to finish. 00416 * (requires the ARP_QUEUEING option) 00417 */ 00418 #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ 00419 #define MEMP_NUM_ARP_QUEUE 30 00420 #endif 00421 00422 /** 00423 * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces 00424 * can be members at the same time (one per netif - allsystems group -, plus one 00425 * per netif membership). 00426 * (requires the LWIP_IGMP option) 00427 */ 00428 #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ 00429 #define MEMP_NUM_IGMP_GROUP 8 00430 #endif 00431 00432 /** 00433 * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. 00434 * The default number of timeouts is calculated here for all enabled modules. 00435 * The formula expects settings to be either '0' or '1'. 00436 */ 00437 #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ 00438 #define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) 00439 #endif 00440 00441 /** 00442 * MEMP_NUM_NETBUF: the number of struct netbufs. 00443 * (only needed if you use the sequential API, like api_lib.c) 00444 */ 00445 #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ 00446 #define MEMP_NUM_NETBUF 2 00447 #endif 00448 00449 /** 00450 * MEMP_NUM_NETCONN: the number of struct netconns. 00451 * (only needed if you use the sequential API, like api_lib.c) 00452 */ 00453 #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ 00454 #define MEMP_NUM_NETCONN 4 00455 #endif 00456 00457 /** 00458 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used 00459 * for callback/timeout API communication. 00460 * (only needed if you use tcpip.c) 00461 */ 00462 #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ 00463 #define MEMP_NUM_TCPIP_MSG_API 8 00464 #endif 00465 00466 /** 00467 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used 00468 * for incoming packets. 00469 * (only needed if you use tcpip.c) 00470 */ 00471 #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ 00472 #define MEMP_NUM_TCPIP_MSG_INPKT 8 00473 #endif 00474 00475 /** 00476 * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls 00477 * (before freeing the corresponding memory using lwip_freeaddrinfo()). 00478 */ 00479 #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ 00480 #define MEMP_NUM_NETDB 1 00481 #endif 00482 00483 /** 00484 * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list 00485 * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. 00486 */ 00487 #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ 00488 #define MEMP_NUM_LOCALHOSTLIST 1 00489 #endif 00490 00491 /** 00492 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 00493 */ 00494 #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ 00495 #define PBUF_POOL_SIZE 16 00496 #endif 00497 00498 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various 00499 * socket, netconn, and tcpip functions 00500 */ 00501 #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ 00502 #define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API 00503 #endif 00504 00505 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname 00506 */ 00507 #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ 00508 #define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API 00509 #endif 00510 00511 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls 00512 * to getsockopt/setsockopt 00513 */ 00514 #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ 00515 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API 00516 #endif 00517 00518 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the 00519 * netifapi functions 00520 */ 00521 #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ 00522 #define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API 00523 #endif 00524 /** 00525 * @} 00526 */ 00527 00528 /* 00529 --------------------------------- 00530 ---------- ARP options ---------- 00531 --------------------------------- 00532 */ 00533 /** 00534 * @defgroup lwip_opts_arp ARP 00535 * @ingroup lwip_opts_ipv4 00536 * @{ 00537 */ 00538 /** 00539 * LWIP_ARP==1: Enable ARP functionality. 00540 */ 00541 #if !defined LWIP_ARP || defined __DOXYGEN__ 00542 #define LWIP_ARP 1 00543 #endif 00544 00545 /** 00546 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. 00547 */ 00548 #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ 00549 #define ARP_TABLE_SIZE 10 00550 #endif 00551 00552 /** the time an ARP entry stays valid after its last update, 00553 * for ARP_TMR_INTERVAL = 1000, this is 00554 * (60 * 5) seconds = 5 minutes. 00555 */ 00556 #if !defined ARP_MAXAGE || defined __DOXYGEN__ 00557 #define ARP_MAXAGE 300 00558 #endif 00559 00560 /** 00561 * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address 00562 * resolution. By default, only the most recent packet is queued per IP address. 00563 * This is sufficient for most protocols and mainly reduces TCP connection 00564 * startup time. Set this to 1 if you know your application sends more than one 00565 * packet in a row to an IP address that is not in the ARP cache. 00566 */ 00567 #if !defined ARP_QUEUEING || defined __DOXYGEN__ 00568 #define ARP_QUEUEING 0 00569 #endif 00570 00571 /** The maximum number of packets which may be queued for each 00572 * unresolved address by other network layers. Defaults to 3, 0 means disabled. 00573 * Old packets are dropped, new packets are queued. 00574 */ 00575 #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ 00576 #define ARP_QUEUE_LEN 3 00577 #endif 00578 00579 /** 00580 * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be 00581 * updated with the source MAC and IP addresses supplied in the packet. 00582 * You may want to disable this if you do not trust LAN peers to have the 00583 * correct addresses, or as a limited approach to attempt to handle 00584 * spoofing. If disabled, lwIP will need to make a new ARP request if 00585 * the peer is not already in the ARP table, adding a little latency. 00586 * The peer *is* in the ARP table if it requested our address before. 00587 * Also notice that this slows down input processing of every IP packet! 00588 */ 00589 #if !defined ETHARP_TRUST_IP_MAC || defined __DOXYGEN__ 00590 #define ETHARP_TRUST_IP_MAC 0 00591 #endif 00592 00593 /** 00594 * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with 00595 * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and 00596 * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. 00597 * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. 00598 * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. 00599 * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. 00600 * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) 00601 * that returns 1 to accept a packet or 0 to drop a packet. 00602 */ 00603 #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ 00604 #define ETHARP_SUPPORT_VLAN 0 00605 #endif 00606 00607 /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled 00608 */ 00609 #if !defined LWIP_ETHERNET || defined __DOXYGEN__ 00610 #define LWIP_ETHERNET LWIP_ARP 00611 #endif 00612 00613 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure 00614 * alignment of payload after that header. Since the header is 14 bytes long, 00615 * without this padding e.g. addresses in the IP header will not be aligned 00616 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. 00617 */ 00618 #if !defined ETH_PAD_SIZE || defined __DOXYGEN__ 00619 #define ETH_PAD_SIZE 0 00620 #endif 00621 00622 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table 00623 * entries (using etharp_add_static_entry/etharp_remove_static_entry). 00624 */ 00625 #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ 00626 #define ETHARP_SUPPORT_STATIC_ENTRIES 0 00627 #endif 00628 00629 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. 00630 * If disabled, duplicate IP address on multiple netifs are not supported 00631 * (but this should only occur for AutoIP). 00632 */ 00633 #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ 00634 #define ETHARP_TABLE_MATCH_NETIF 0 00635 #endif 00636 /** 00637 * @} 00638 */ 00639 00640 /* 00641 -------------------------------- 00642 ---------- IP options ---------- 00643 -------------------------------- 00644 */ 00645 /** 00646 * @defgroup lwip_opts_ipv4 IPv4 00647 * @ingroup lwip_opts 00648 * @{ 00649 */ 00650 /** 00651 * LWIP_IPV4==1: Enable IPv4 00652 */ 00653 #if !defined LWIP_IPV4 || defined __DOXYGEN__ 00654 #define LWIP_IPV4 1 00655 #endif 00656 00657 /** 00658 * IP_FORWARD==1: Enables the ability to forward IP packets across network 00659 * interfaces. If you are going to run lwIP on a device with only one network 00660 * interface, define this to 0. 00661 */ 00662 #if !defined IP_FORWARD || defined __DOXYGEN__ 00663 #define IP_FORWARD 0 00664 #endif 00665 00666 /** 00667 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that 00668 * this option does not affect outgoing packet sizes, which can be controlled 00669 * via IP_FRAG. 00670 */ 00671 #if !defined IP_REASSEMBLY || defined __DOXYGEN__ 00672 #define IP_REASSEMBLY 1 00673 #endif 00674 00675 /** 00676 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note 00677 * that this option does not affect incoming packet sizes, which can be 00678 * controlled via IP_REASSEMBLY. 00679 */ 00680 #if !defined IP_FRAG || defined __DOXYGEN__ 00681 #define IP_FRAG 1 00682 #endif 00683 00684 #if !LWIP_IPV4 00685 /* disable IPv4 extensions when IPv4 is disabled */ 00686 #undef IP_FORWARD 00687 #define IP_FORWARD 0 00688 #undef IP_REASSEMBLY 00689 #define IP_REASSEMBLY 0 00690 #undef IP_FRAG 00691 #define IP_FRAG 0 00692 #endif /* !LWIP_IPV4 */ 00693 00694 /** 00695 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. 00696 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. 00697 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). 00698 */ 00699 #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ 00700 #define IP_OPTIONS_ALLOWED 1 00701 #endif 00702 00703 /** 00704 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) 00705 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived 00706 * in this time, the whole packet is discarded. 00707 */ 00708 #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ 00709 #define IP_REASS_MAXAGE 3 00710 #endif 00711 00712 /** 00713 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. 00714 * Since the received pbufs are enqueued, be sure to configure 00715 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive 00716 * packets even if the maximum amount of fragments is enqueued for reassembly! 00717 */ 00718 #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ 00719 #define IP_REASS_MAX_PBUFS 10 00720 #endif 00721 00722 /** 00723 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP 00724 * fragmentation. Otherwise pbufs are allocated and reference the original 00725 * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1, 00726 * new PBUF_RAM pbufs are used for fragments). 00727 * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs! 00728 */ 00729 #if !defined IP_FRAG_USES_STATIC_BUF || defined __DOXYGEN__ 00730 #define IP_FRAG_USES_STATIC_BUF 0 00731 #endif 00732 00733 /** 00734 * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer 00735 * (requires IP_FRAG_USES_STATIC_BUF==1) 00736 */ 00737 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) || defined __DOXYGEN__ 00738 #define IP_FRAG_MAX_MTU 1500 00739 #endif 00740 00741 /** 00742 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. 00743 */ 00744 #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ 00745 #define IP_DEFAULT_TTL 255 00746 #endif 00747 00748 /** 00749 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast 00750 * filter per pcb on udp and raw send operations. To enable broadcast filter 00751 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. 00752 */ 00753 #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ 00754 #define IP_SOF_BROADCAST 0 00755 #endif 00756 00757 /** 00758 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast 00759 * filter on recv operations. 00760 */ 00761 #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ 00762 #define IP_SOF_BROADCAST_RECV 0 00763 #endif 00764 00765 /** 00766 * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back 00767 * out on the netif where it was received. This should only be used for 00768 * wireless networks. 00769 * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming 00770 * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! 00771 */ 00772 #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ 00773 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 00774 #endif 00775 00776 /** 00777 * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first 00778 * local TCP/UDP pcb (default==0). This can prevent creating predictable port 00779 * numbers after booting a device. 00780 */ 00781 #if !defined LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS || defined __DOXYGEN__ 00782 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0 00783 #endif 00784 /** 00785 * @} 00786 */ 00787 00788 /* 00789 ---------------------------------- 00790 ---------- ICMP options ---------- 00791 ---------------------------------- 00792 */ 00793 /** 00794 * @defgroup lwip_opts_icmp ICMP 00795 * @ingroup lwip_opts_ipv4 00796 * @{ 00797 */ 00798 /** 00799 * LWIP_ICMP==1: Enable ICMP module inside the IP stack. 00800 * Be careful, disable that make your product non-compliant to RFC1122 00801 */ 00802 #if !defined LWIP_ICMP || defined __DOXYGEN__ 00803 #define LWIP_ICMP 1 00804 #endif 00805 00806 /** 00807 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. 00808 */ 00809 #if !defined ICMP_TTL || defined __DOXYGEN__ 00810 #define ICMP_TTL (IP_DEFAULT_TTL) 00811 #endif 00812 00813 /** 00814 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) 00815 */ 00816 #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ 00817 #define LWIP_BROADCAST_PING 0 00818 #endif 00819 00820 /** 00821 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) 00822 */ 00823 #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ 00824 #define LWIP_MULTICAST_PING 0 00825 #endif 00826 /** 00827 * @} 00828 */ 00829 00830 /* 00831 --------------------------------- 00832 ---------- RAW options ---------- 00833 --------------------------------- 00834 */ 00835 /** 00836 * @defgroup lwip_opts_raw RAW 00837 * @ingroup lwip_opts_callback 00838 * @{ 00839 */ 00840 /** 00841 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 00842 */ 00843 #if !defined LWIP_RAW || defined __DOXYGEN__ 00844 #define LWIP_RAW 0 00845 #endif 00846 00847 /** 00848 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. 00849 */ 00850 #if !defined RAW_TTL || defined __DOXYGEN__ 00851 #define RAW_TTL (IP_DEFAULT_TTL) 00852 #endif 00853 /** 00854 * @} 00855 */ 00856 00857 /* 00858 ---------------------------------- 00859 ---------- DHCP options ---------- 00860 ---------------------------------- 00861 */ 00862 /** 00863 * @defgroup lwip_opts_dhcp DHCP 00864 * @ingroup lwip_opts_ipv4 00865 * @{ 00866 */ 00867 /** 00868 * LWIP_DHCP==1: Enable DHCP module. 00869 */ 00870 #if !defined LWIP_DHCP || defined __DOXYGEN__ 00871 #define LWIP_DHCP 0 00872 #endif 00873 #if !LWIP_IPV4 00874 /* disable DHCP when IPv4 is disabled */ 00875 #undef LWIP_DHCP 00876 #define LWIP_DHCP 0 00877 #endif /* !LWIP_IPV4 */ 00878 00879 /** 00880 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. 00881 */ 00882 #if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__ 00883 #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) 00884 #endif 00885 00886 /** 00887 * LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has 00888 * NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and 00889 * netif drivers might not set this flag, the default is off. If enabled, 00890 * netif_set_link_up() must be called to continue dhcp starting. 00891 */ 00892 #if !defined LWIP_DHCP_CHECK_LINK_UP 00893 #define LWIP_DHCP_CHECK_LINK_UP 0 00894 #endif 00895 00896 /** 00897 * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. 00898 */ 00899 #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ 00900 #define LWIP_DHCP_BOOTP_FILE 0 00901 #endif 00902 00903 /** 00904 * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each 00905 * response packet, an callback is called, which has to be provided by the port: 00906 * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); 00907 */ 00908 #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ 00909 #define LWIP_DHCP_GET_NTP_SRV 0 00910 #endif 00911 00912 /** 00913 * The maximum of NTP servers requested 00914 */ 00915 #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ 00916 #define LWIP_DHCP_MAX_NTP_SERVERS 1 00917 #endif 00918 /** 00919 * @} 00920 */ 00921 00922 /* 00923 ------------------------------------ 00924 ---------- AUTOIP options ---------- 00925 ------------------------------------ 00926 */ 00927 /** 00928 * @defgroup lwip_opts_autoip AUTOIP 00929 * @ingroup lwip_opts_ipv4 00930 * @{ 00931 */ 00932 /** 00933 * LWIP_AUTOIP==1: Enable AUTOIP module. 00934 */ 00935 #if !defined LWIP_AUTOIP || defined __DOXYGEN__ 00936 #define LWIP_AUTOIP 0 00937 #endif 00938 #if !LWIP_IPV4 00939 /* disable AUTOIP when IPv4 is disabled */ 00940 #undef LWIP_AUTOIP 00941 #define LWIP_AUTOIP 0 00942 #endif /* !LWIP_IPV4 */ 00943 00944 /** 00945 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on 00946 * the same interface at the same time. 00947 */ 00948 #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ 00949 #define LWIP_DHCP_AUTOIP_COOP 0 00950 #endif 00951 00952 /** 00953 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes 00954 * that should be sent before falling back on AUTOIP (the DHCP client keeps 00955 * running in this case). This can be set as low as 1 to get an AutoIP address 00956 * very quickly, but you should be prepared to handle a changing IP address 00957 * when DHCP overrides AutoIP. 00958 */ 00959 #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ 00960 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9 00961 #endif 00962 /** 00963 * @} 00964 */ 00965 00966 /* 00967 ---------------------------------- 00968 ----- SNMP MIB2 support ----- 00969 ---------------------------------- 00970 */ 00971 /** 00972 * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks 00973 * @ingroup lwip_opts_infrastructure 00974 * @{ 00975 */ 00976 /** 00977 * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. 00978 * Turn this on to get callbacks needed to implement MIB2. 00979 * Usually MIB2_STATS should be enabled, too. 00980 */ 00981 #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ 00982 #define LWIP_MIB2_CALLBACKS 0 00983 #endif 00984 /** 00985 * @} 00986 */ 00987 00988 /* 00989 ---------------------------------- 00990 ----- Multicast/IGMP options ----- 00991 ---------------------------------- 00992 */ 00993 /** 00994 * @defgroup lwip_opts_igmp IGMP 00995 * @ingroup lwip_opts_ipv4 00996 * @{ 00997 */ 00998 /** 00999 * LWIP_IGMP==1: Turn on IGMP module. 01000 */ 01001 #if !defined LWIP_IGMP || defined __DOXYGEN__ 01002 #define LWIP_IGMP 0 01003 #endif 01004 #if !LWIP_IPV4 01005 #undef LWIP_IGMP 01006 #define LWIP_IGMP 0 01007 #endif 01008 01009 /** 01010 * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options 01011 * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP 01012 */ 01013 #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ 01014 #define LWIP_MULTICAST_TX_OPTIONS LWIP_IGMP 01015 #endif 01016 /** 01017 * @} 01018 */ 01019 01020 /* 01021 ---------------------------------- 01022 ---------- DNS options ----------- 01023 ---------------------------------- 01024 */ 01025 /** 01026 * @defgroup lwip_opts_dns DNS 01027 * @ingroup lwip_opts_callback 01028 * @{ 01029 */ 01030 /** 01031 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS 01032 * transport. 01033 */ 01034 #if !defined LWIP_DNS || defined __DOXYGEN__ 01035 #define LWIP_DNS 0 01036 #endif 01037 01038 /** DNS maximum number of entries to maintain locally. */ 01039 #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ 01040 #define DNS_TABLE_SIZE 4 01041 #endif 01042 01043 /** DNS maximum host name length supported in the name table. */ 01044 #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ 01045 #define DNS_MAX_NAME_LENGTH 256 01046 #endif 01047 01048 /** The maximum of DNS servers 01049 * The first server can be initialized automatically by defining 01050 * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' 01051 */ 01052 #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ 01053 #define DNS_MAX_SERVERS 2 01054 #endif 01055 01056 /** DNS do a name checking between the query and the response. */ 01057 #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ 01058 #define DNS_DOES_NAME_CHECK 1 01059 #endif 01060 01061 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation 01062 * Use all DNS security features by default. 01063 * This is overridable but should only be needed by very small targets 01064 * or when using against non standard DNS servers. */ 01065 #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ 01066 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) 01067 #endif 01068 01069 /* A list of DNS security features follows */ 01070 #define LWIP_DNS_SECURE_RAND_XID 1 01071 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 01072 #define LWIP_DNS_SECURE_RAND_SRC_PORT 4 01073 01074 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, 01075 * you have to define 01076 * \#define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}} 01077 * (an array of structs name/address, where address is an u32_t in network 01078 * byte order). 01079 * 01080 * Instead, you can also use an external function: 01081 * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) 01082 * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). 01083 */ 01084 #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ 01085 #define DNS_LOCAL_HOSTLIST 0 01086 #endif /* DNS_LOCAL_HOSTLIST */ 01087 01088 /** If this is turned on, the local host-list can be dynamically changed 01089 * at runtime. */ 01090 #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ 01091 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 01092 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ 01093 /** 01094 * @} 01095 */ 01096 01097 /* 01098 --------------------------------- 01099 ---------- UDP options ---------- 01100 --------------------------------- 01101 */ 01102 /** 01103 * @defgroup lwip_opts_udp UDP 01104 * @ingroup lwip_opts_callback 01105 * @{ 01106 */ 01107 /** 01108 * LWIP_UDP==1: Turn on UDP. 01109 */ 01110 #if !defined LWIP_UDP || defined __DOXYGEN__ 01111 #define LWIP_UDP 1 01112 #endif 01113 01114 /** 01115 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) 01116 */ 01117 #if !defined LWIP_UDPLITE || defined __DOXYGEN__ 01118 #define LWIP_UDPLITE 0 01119 #endif 01120 01121 /** 01122 * UDP_TTL: Default Time-To-Live value. 01123 */ 01124 #if !defined UDP_TTL || defined __DOXYGEN__ 01125 #define UDP_TTL (IP_DEFAULT_TTL) 01126 #endif 01127 01128 /** 01129 * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. 01130 */ 01131 #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ 01132 #define LWIP_NETBUF_RECVINFO 0 01133 #endif 01134 /** 01135 * @} 01136 */ 01137 01138 /* 01139 --------------------------------- 01140 ---------- TCP options ---------- 01141 --------------------------------- 01142 */ 01143 /** 01144 * @defgroup lwip_opts_tcp TCP 01145 * @ingroup lwip_opts_callback 01146 * @{ 01147 */ 01148 /** 01149 * LWIP_TCP==1: Turn on TCP. 01150 */ 01151 #if !defined LWIP_TCP || defined __DOXYGEN__ 01152 #define LWIP_TCP 1 01153 #endif 01154 01155 /** 01156 * TCP_TTL: Default Time-To-Live value. 01157 */ 01158 #if !defined TCP_TTL || defined __DOXYGEN__ 01159 #define TCP_TTL (IP_DEFAULT_TTL) 01160 #endif 01161 01162 /** 01163 * TCP_WND: The size of a TCP window. This must be at least 01164 * (2 * TCP_MSS) for things to work well 01165 */ 01166 #if !defined TCP_WND || defined __DOXYGEN__ 01167 #define TCP_WND (4 * TCP_MSS) 01168 #endif 01169 01170 /** 01171 * TCP_MAXRTX: Maximum number of retransmissions of data segments. 01172 */ 01173 #if !defined TCP_MAXRTX || defined __DOXYGEN__ 01174 #define TCP_MAXRTX 12 01175 #endif 01176 01177 /** 01178 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. 01179 */ 01180 #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ 01181 #define TCP_SYNMAXRTX 6 01182 #endif 01183 01184 /** 01185 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. 01186 * Define to 0 if your device is low on memory. 01187 */ 01188 #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ 01189 #define TCP_QUEUE_OOSEQ (LWIP_TCP) 01190 #endif 01191 01192 /** 01193 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, 01194 * you might want to increase this.) 01195 * For the receive side, this MSS is advertised to the remote side 01196 * when opening a connection. For the transmit size, this MSS sets 01197 * an upper limit on the MSS advertised by the remote host. 01198 */ 01199 #if !defined TCP_MSS || defined __DOXYGEN__ 01200 #define TCP_MSS 536 01201 #endif 01202 01203 /** 01204 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really 01205 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which 01206 * reflects the available reassembly buffer size at the remote host) and the 01207 * largest size permitted by the IP layer" (RFC 1122) 01208 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the 01209 * netif used for a connection and limits the MSS if it would be too big otherwise. 01210 */ 01211 #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ 01212 #define TCP_CALCULATE_EFF_SEND_MSS 1 01213 #endif 01214 01215 01216 /** 01217 * TCP_SND_BUF: TCP sender buffer space (bytes). 01218 * To achieve good performance, this should be at least 2 * TCP_MSS. 01219 */ 01220 #if !defined TCP_SND_BUF || defined __DOXYGEN__ 01221 #define TCP_SND_BUF (2 * TCP_MSS) 01222 #endif 01223 01224 /** 01225 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least 01226 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. 01227 */ 01228 #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ 01229 #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) 01230 #endif 01231 01232 /** 01233 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than 01234 * TCP_SND_BUF. It is the amount of space which must be available in the 01235 * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). 01236 */ 01237 #if !defined TCP_SNDLOWAT || defined __DOXYGEN__ 01238 #define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) 01239 #endif 01240 01241 /** 01242 * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less 01243 * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below 01244 * this number, select returns writable (combined with TCP_SNDLOWAT). 01245 */ 01246 #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ 01247 #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) 01248 #endif 01249 01250 /** 01251 * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb. 01252 * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0. 01253 */ 01254 #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ 01255 #define TCP_OOSEQ_MAX_BYTES 0 01256 #endif 01257 01258 /** 01259 * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb. 01260 * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0. 01261 */ 01262 #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ 01263 #define TCP_OOSEQ_MAX_PBUFS 0 01264 #endif 01265 01266 /** 01267 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. 01268 */ 01269 #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ 01270 #define TCP_LISTEN_BACKLOG 0 01271 #endif 01272 01273 /** 01274 * The maximum allowed backlog for TCP listen netconns. 01275 * This backlog is used unless another is explicitly specified. 01276 * 0xff is the maximum (u8_t). 01277 */ 01278 #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ 01279 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff 01280 #endif 01281 01282 /** 01283 * TCP_OVERSIZE: The maximum number of bytes that tcp_write may 01284 * allocate ahead of time in an attempt to create shorter pbuf chains 01285 * for transmission. The meaningful range is 0 to TCP_MSS. Some 01286 * suggested values are: 01287 * 01288 * 0: Disable oversized allocation. Each tcp_write() allocates a new 01289 pbuf (old behaviour). 01290 * 1: Allocate size-aligned pbufs with minimal excess. Use this if your 01291 * scatter-gather DMA requires aligned fragments. 01292 * 128: Limit the pbuf/memory overhead to 20%. 01293 * TCP_MSS: Try to create unfragmented TCP packets. 01294 * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. 01295 */ 01296 #if !defined TCP_OVERSIZE || defined __DOXYGEN__ 01297 #define TCP_OVERSIZE TCP_MSS 01298 #endif 01299 01300 /** 01301 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. 01302 * The timestamp option is currently only used to help remote hosts, it is not 01303 * really used locally. Therefore, it is only enabled when a TS option is 01304 * received in the initial SYN packet from a remote host. 01305 */ 01306 #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ 01307 #define LWIP_TCP_TIMESTAMPS 0 01308 #endif 01309 01310 /** 01311 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an 01312 * explicit window update 01313 */ 01314 #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ 01315 #define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) 01316 #endif 01317 01318 /** 01319 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. 01320 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all 01321 * events (accept, sent, etc) that happen in the system. 01322 * LWIP_CALLBACK_API==1: The PCB callback function is called directly 01323 * for the event. This is the default. 01324 */ 01325 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ 01326 #define LWIP_EVENT_API 0 01327 #define LWIP_CALLBACK_API 1 01328 #endif 01329 01330 /** 01331 * LWIP_WND_SCALE and TCP_RCV_SCALE: 01332 * Set LWIP_WND_SCALE to 1 to enable window scaling. 01333 * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the 01334 * range of [0..14]). 01335 * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large 01336 * send window while having a small receive window only. 01337 */ 01338 #if !defined LWIP_WND_SCALE || defined __DOXYGEN__ 01339 #define LWIP_WND_SCALE 0 01340 #define TCP_RCV_SCALE 0 01341 #endif 01342 /** 01343 * @} 01344 */ 01345 01346 /* 01347 ---------------------------------- 01348 ---------- Pbuf options ---------- 01349 ---------------------------------- 01350 */ 01351 /** 01352 * @defgroup lwip_opts_pbuf PBUF 01353 * @ingroup lwip_opts 01354 * @{ 01355 */ 01356 /** 01357 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a 01358 * link level header. The default is 14, the standard value for 01359 * Ethernet. 01360 */ 01361 #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ 01362 #if defined LWIP_HOOK_VLAN_SET || defined __DOXYGEN__ 01363 #define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) 01364 #else /* LWIP_HOOK_VLAN_SET */ 01365 #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) 01366 #endif /* LWIP_HOOK_VLAN_SET */ 01367 #endif 01368 01369 /** 01370 * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated 01371 * for an additional encapsulation header before ethernet headers (e.g. 802.11) 01372 */ 01373 #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ 01374 #define PBUF_LINK_ENCAPSULATION_HLEN 0 01375 #endif 01376 01377 /** 01378 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is 01379 * designed to accommodate single full size TCP frame in one pbuf, including 01380 * TCP_MSS, IP header, and link header. 01381 */ 01382 #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ 01383 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) 01384 #endif 01385 /** 01386 * @} 01387 */ 01388 01389 /* 01390 ------------------------------------------------ 01391 ---------- Network Interfaces options ---------- 01392 ------------------------------------------------ 01393 */ 01394 /** 01395 * @defgroup lwip_opts_netif NETIF 01396 * @ingroup lwip_opts 01397 * @{ 01398 */ 01399 /** 01400 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname 01401 * field. 01402 */ 01403 #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ 01404 #define LWIP_NETIF_HOSTNAME 0 01405 #endif 01406 01407 /** 01408 * LWIP_NETIF_API==1: Support netif api (in netifapi.c) 01409 */ 01410 #if !defined LWIP_NETIF_API || defined __DOXYGEN__ 01411 #define LWIP_NETIF_API 0 01412 #endif 01413 01414 /** 01415 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface 01416 * changes its up/down status (i.e., due to DHCP IP acquisition) 01417 */ 01418 #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ 01419 #define LWIP_NETIF_STATUS_CALLBACK 0 01420 #endif 01421 01422 /** 01423 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface 01424 * whenever the link changes (i.e., link down) 01425 */ 01426 #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ 01427 #define LWIP_NETIF_LINK_CALLBACK 0 01428 #endif 01429 01430 /** 01431 * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called 01432 * when a netif has been removed 01433 */ 01434 #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ 01435 #define LWIP_NETIF_REMOVE_CALLBACK 0 01436 #endif 01437 01438 /** 01439 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table 01440 * indices) in struct netif. TCP and UDP can make use of this to prevent 01441 * scanning the ARP table for every sent packet. While this is faster for big 01442 * ARP tables or many concurrent connections, it might be counterproductive 01443 * if you have a tiny ARP table or if there never are concurrent connections. 01444 */ 01445 #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ 01446 #define LWIP_NETIF_HWADDRHINT 0 01447 #endif 01448 01449 /** 01450 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data 01451 * to be sent into one single pbuf. This is for compatibility with DMA-enabled 01452 * MACs that do not support scatter-gather. 01453 * Beware that this might involve CPU-memcpy before transmitting that would not 01454 * be needed without this flag! Use this only if you need to! 01455 * 01456 * @todo: TCP and IP-frag do not work with this, yet: 01457 */ 01458 #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ 01459 #define LWIP_NETIF_TX_SINGLE_PBUF 0 01460 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */ 01461 /** 01462 * @} 01463 */ 01464 01465 /* 01466 ------------------------------------ 01467 ---------- LOOPIF options ---------- 01468 ------------------------------------ 01469 */ 01470 /** 01471 * @defgroup lwip_opts_loop Loopback interface 01472 * @ingroup lwip_opts_netif 01473 * @{ 01474 */ 01475 /** 01476 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). 01477 * This is only needed when no real netifs are available. If at least one other 01478 * netif is available, loopback traffic uses this netif. 01479 */ 01480 #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ 01481 #define LWIP_HAVE_LOOPIF LWIP_NETIF_LOOPBACK 01482 #endif 01483 01484 /** 01485 * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). 01486 */ 01487 #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ 01488 #define LWIP_LOOPIF_MULTICAST 0 01489 #endif 01490 01491 /** 01492 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP 01493 * address equal to the netif IP address, looping them back up the stack. 01494 */ 01495 #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ 01496 #define LWIP_NETIF_LOOPBACK 0 01497 #endif 01498 01499 /** 01500 * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback 01501 * sending for each netif (0 = disabled) 01502 */ 01503 #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ 01504 #define LWIP_LOOPBACK_MAX_PBUFS 0 01505 #endif 01506 01507 /** 01508 * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in 01509 * the system, as netifs must change how they behave depending on this setting 01510 * for the LWIP_NETIF_LOOPBACK option to work. 01511 * Setting this is needed to avoid reentering non-reentrant functions like 01512 * tcp_input(). 01513 * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a 01514 * multithreaded environment like tcpip.c. In this case, netif->input() 01515 * is called directly. 01516 * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. 01517 * The packets are put on a list and netif_poll() must be called in 01518 * the main application loop. 01519 */ 01520 #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ 01521 #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) 01522 #endif 01523 /** 01524 * @} 01525 */ 01526 01527 /* 01528 ------------------------------------ 01529 ---------- Thread options ---------- 01530 ------------------------------------ 01531 */ 01532 /** 01533 * @defgroup lwip_opts_thread Threading 01534 * @ingroup lwip_opts_infrastructure 01535 * @{ 01536 */ 01537 /** 01538 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. 01539 */ 01540 #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ 01541 #define TCPIP_THREAD_NAME "tcpip_thread" 01542 #endif 01543 01544 /** 01545 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. 01546 * The stack size value itself is platform-dependent, but is passed to 01547 * sys_thread_new() when the thread is created. 01548 */ 01549 #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ 01550 #define TCPIP_THREAD_STACKSIZE 0 01551 #endif 01552 01553 /** 01554 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. 01555 * The priority value itself is platform-dependent, but is passed to 01556 * sys_thread_new() when the thread is created. 01557 */ 01558 #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ 01559 #define TCPIP_THREAD_PRIO 1 01560 #endif 01561 01562 /** 01563 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages 01564 * The queue size value itself is platform-dependent, but is passed to 01565 * sys_mbox_new() when tcpip_init is called. 01566 */ 01567 #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ 01568 #define TCPIP_MBOX_SIZE 0 01569 #endif 01570 01571 /** 01572 * Define this to something that triggers a watchdog. This is called from 01573 * tcpip_thread after processing a message. 01574 */ 01575 #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ 01576 #define LWIP_TCPIP_THREAD_ALIVE() 01577 #endif 01578 01579 /** 01580 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. 01581 */ 01582 #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ 01583 #define SLIPIF_THREAD_NAME "slipif_loop" 01584 #endif 01585 01586 /** 01587 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. 01588 * The stack size value itself is platform-dependent, but is passed to 01589 * sys_thread_new() when the thread is created. 01590 */ 01591 #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ 01592 #define SLIPIF_THREAD_STACKSIZE 0 01593 #endif 01594 01595 /** 01596 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. 01597 * The priority value itself is platform-dependent, but is passed to 01598 * sys_thread_new() when the thread is created. 01599 */ 01600 #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ 01601 #define SLIPIF_THREAD_PRIO 1 01602 #endif 01603 01604 /** 01605 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. 01606 */ 01607 #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ 01608 #define DEFAULT_THREAD_NAME "lwIP" 01609 #endif 01610 01611 /** 01612 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. 01613 * The stack size value itself is platform-dependent, but is passed to 01614 * sys_thread_new() when the thread is created. 01615 */ 01616 #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ 01617 #define DEFAULT_THREAD_STACKSIZE 0 01618 #endif 01619 01620 /** 01621 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. 01622 * The priority value itself is platform-dependent, but is passed to 01623 * sys_thread_new() when the thread is created. 01624 */ 01625 #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ 01626 #define DEFAULT_THREAD_PRIO 1 01627 #endif 01628 01629 /** 01630 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01631 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed 01632 * to sys_mbox_new() when the recvmbox is created. 01633 */ 01634 #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ 01635 #define DEFAULT_RAW_RECVMBOX_SIZE 0 01636 #endif 01637 01638 /** 01639 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01640 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed 01641 * to sys_mbox_new() when the recvmbox is created. 01642 */ 01643 #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ 01644 #define DEFAULT_UDP_RECVMBOX_SIZE 0 01645 #endif 01646 01647 /** 01648 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a 01649 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed 01650 * to sys_mbox_new() when the recvmbox is created. 01651 */ 01652 #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ 01653 #define DEFAULT_TCP_RECVMBOX_SIZE 0 01654 #endif 01655 01656 /** 01657 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. 01658 * The queue size value itself is platform-dependent, but is passed to 01659 * sys_mbox_new() when the acceptmbox is created. 01660 */ 01661 #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ 01662 #define DEFAULT_ACCEPTMBOX_SIZE 0 01663 #endif 01664 /** 01665 * @} 01666 */ 01667 01668 /* 01669 ---------------------------------------------- 01670 ---------- Sequential layer options ---------- 01671 ---------------------------------------------- 01672 */ 01673 /** 01674 * @defgroup lwip_opts_netconn Netconn 01675 * @ingroup lwip_opts_threadsafe_apis 01676 * @{ 01677 */ 01678 /** 01679 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) 01680 */ 01681 #if !defined LWIP_NETCONN || defined __DOXYGEN__ 01682 #define LWIP_NETCONN 1 01683 #endif 01684 01685 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create 01686 * timers running in tcpip_thread from another thread. 01687 */ 01688 #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ 01689 #define LWIP_TCPIP_TIMEOUT 0 01690 #endif 01691 01692 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per 01693 * thread calling socket/netconn functions instead of allocating one 01694 * semaphore per netconn (and per select etc.) 01695 * ATTENTION: a thread-local semaphore for API calls is needed: 01696 * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* 01697 * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore 01698 * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore 01699 * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). 01700 * Ports may call these for threads created with sys_thread_new(). 01701 */ 01702 #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ 01703 #define LWIP_NETCONN_SEM_PER_THREAD 0 01704 #endif 01705 01706 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, 01707 * writing from a 2nd thread and closing from a 3rd thread at the same time. 01708 * ATTENTION: This is currently really alpha! Some requirements: 01709 * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from 01710 * multiple threads at once 01711 * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox 01712 * and prevent a task pending on this during/after deletion 01713 */ 01714 #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ 01715 #define LWIP_NETCONN_FULLDUPLEX 0 01716 #endif 01717 /** 01718 * @} 01719 */ 01720 01721 /* 01722 ------------------------------------ 01723 ---------- Socket options ---------- 01724 ------------------------------------ 01725 */ 01726 /** 01727 * @defgroup lwip_opts_socket Sockets 01728 * @ingroup lwip_opts_threadsafe_apis 01729 * @{ 01730 */ 01731 /** 01732 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) 01733 */ 01734 #if !defined LWIP_SOCKET || defined __DOXYGEN__ 01735 #define LWIP_SOCKET 1 01736 #endif 01737 01738 /* LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete 01739 * successfully, as required by POSIX. Default is POSIX-compliant. 01740 */ 01741 #if !defined LWIP_SOCKET_SET_ERRNO || defined __DOXYGEN__ 01742 #define LWIP_SOCKET_SET_ERRNO 1 01743 #endif 01744 01745 /** 01746 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. 01747 * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. 01748 * While this helps code completion, it might conflict with existing libraries. 01749 * (only used if you use sockets.c) 01750 */ 01751 #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ 01752 #define LWIP_COMPAT_SOCKETS 1 01753 #endif 01754 01755 /** 01756 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. 01757 * Disable this option if you use a POSIX operating system that uses the same 01758 * names (read, write & close). (only used if you use sockets.c) 01759 */ 01760 #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ 01761 #define LWIP_POSIX_SOCKETS_IO_NAMES 1 01762 #endif 01763 01764 /** 01765 * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. 01766 * This can be useful when there are multiple APIs which create file descriptors. 01767 * When they all start with a different offset and you won't make them overlap you can 01768 * re implement read/write/close/ioctl/fnctl to send the requested action to the right 01769 * library (sharing select will need more work though). 01770 */ 01771 #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ 01772 #define LWIP_SOCKET_OFFSET 0 01773 #endif 01774 01775 /** 01776 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT 01777 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set 01778 * in seconds. (does not require sockets.c, and will affect tcp.c) 01779 */ 01780 #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ 01781 #define LWIP_TCP_KEEPALIVE 0 01782 #endif 01783 01784 /** 01785 * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and 01786 * SO_SNDTIMEO processing. 01787 */ 01788 #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ 01789 #define LWIP_SO_SNDTIMEO 0 01790 #endif 01791 01792 /** 01793 * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and 01794 * SO_RCVTIMEO processing. 01795 */ 01796 #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ 01797 #define LWIP_SO_RCVTIMEO 0 01798 #endif 01799 01800 /** 01801 * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int 01802 * (milliseconds, much like winsock does) instead of a struct timeval (default). 01803 */ 01804 #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ 01805 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 01806 #endif 01807 01808 /** 01809 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. 01810 */ 01811 #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ 01812 #define LWIP_SO_RCVBUF 0 01813 #endif 01814 01815 /** 01816 * LWIP_SO_LINGER==1: Enable SO_LINGER processing. 01817 */ 01818 #if !defined LWIP_SO_LINGER || defined __DOXYGEN__ 01819 #define LWIP_SO_LINGER 0 01820 #endif 01821 01822 /** 01823 * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. 01824 */ 01825 #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ 01826 #define RECV_BUFSIZE_DEFAULT INT_MAX 01827 #endif 01828 01829 /** 01830 * By default, TCP socket/netconn close waits 20 seconds max to send the FIN 01831 */ 01832 #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ 01833 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 01834 #endif 01835 01836 /** 01837 * SO_REUSE==1: Enable SO_REUSEADDR option. 01838 */ 01839 #if !defined SO_REUSE || defined __DOXYGEN__ 01840 #define SO_REUSE 0 01841 #endif 01842 01843 /** 01844 * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets 01845 * to all local matches if SO_REUSEADDR is turned on. 01846 * WARNING: Adds a memcpy for every packet if passing to more than one pcb! 01847 */ 01848 #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ 01849 #define SO_REUSE_RXTOALL 0 01850 #endif 01851 01852 /** 01853 * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of 01854 * pending data in the network buffer. This is the way windows does it. It's 01855 * the default for lwIP since it is smaller. 01856 * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next 01857 * pending datagram in bytes. This is the way linux does it. This code is only 01858 * here for compatibility. 01859 */ 01860 #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ 01861 #define LWIP_FIONREAD_LINUXMODE 0 01862 #endif 01863 /** 01864 * @} 01865 */ 01866 01867 /* 01868 ---------------------------------------- 01869 ---------- Statistics options ---------- 01870 ---------------------------------------- 01871 */ 01872 /** 01873 * @defgroup lwip_opts_stats Statistics 01874 * @ingroup lwip_opts_debug 01875 * @{ 01876 */ 01877 /** 01878 * LWIP_STATS==1: Enable statistics collection in lwip_stats. 01879 */ 01880 #if !defined LWIP_STATS || defined __DOXYGEN__ 01881 #define LWIP_STATS 1 01882 #endif 01883 01884 #if LWIP_STATS 01885 01886 /** 01887 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. 01888 */ 01889 #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ 01890 #define LWIP_STATS_DISPLAY 0 01891 #endif 01892 01893 /** 01894 * LINK_STATS==1: Enable link stats. 01895 */ 01896 #if !defined LINK_STATS || defined __DOXYGEN__ 01897 #define LINK_STATS 1 01898 #endif 01899 01900 /** 01901 * ETHARP_STATS==1: Enable etharp stats. 01902 */ 01903 #if !defined ETHARP_STATS || defined __DOXYGEN__ 01904 #define ETHARP_STATS (LWIP_ARP) 01905 #endif 01906 01907 /** 01908 * IP_STATS==1: Enable IP stats. 01909 */ 01910 #if !defined IP_STATS || defined __DOXYGEN__ 01911 #define IP_STATS 1 01912 #endif 01913 01914 /** 01915 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is 01916 * on if using either frag or reass. 01917 */ 01918 #if !defined IPFRAG_STATS || defined __DOXYGEN__ 01919 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) 01920 #endif 01921 01922 /** 01923 * ICMP_STATS==1: Enable ICMP stats. 01924 */ 01925 #if !defined ICMP_STATS || defined __DOXYGEN__ 01926 #define ICMP_STATS 1 01927 #endif 01928 01929 /** 01930 * IGMP_STATS==1: Enable IGMP stats. 01931 */ 01932 #if !defined IGMP_STATS || defined __DOXYGEN__ 01933 #define IGMP_STATS (LWIP_IGMP) 01934 #endif 01935 01936 /** 01937 * UDP_STATS==1: Enable UDP stats. Default is on if 01938 * UDP enabled, otherwise off. 01939 */ 01940 #if !defined UDP_STATS || defined __DOXYGEN__ 01941 #define UDP_STATS (LWIP_UDP) 01942 #endif 01943 01944 /** 01945 * TCP_STATS==1: Enable TCP stats. Default is on if TCP 01946 * enabled, otherwise off. 01947 */ 01948 #if !defined TCP_STATS || defined __DOXYGEN__ 01949 #define TCP_STATS (LWIP_TCP) 01950 #endif 01951 01952 /** 01953 * MEM_STATS==1: Enable mem.c stats. 01954 */ 01955 #if !defined MEM_STATS || defined __DOXYGEN__ 01956 #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) 01957 #endif 01958 01959 /** 01960 * MEMP_STATS==1: Enable memp.c pool stats. 01961 */ 01962 #if !defined MEMP_STATS || defined __DOXYGEN__ 01963 #define MEMP_STATS (MEMP_MEM_MALLOC == 0) 01964 #endif 01965 01966 /** 01967 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). 01968 */ 01969 #if !defined SYS_STATS || defined __DOXYGEN__ 01970 #define SYS_STATS (NO_SYS == 0) 01971 #endif 01972 01973 /** 01974 * IP6_STATS==1: Enable IPv6 stats. 01975 */ 01976 #if !defined IP6_STATS || defined __DOXYGEN__ 01977 #define IP6_STATS (LWIP_IPV6) 01978 #endif 01979 01980 /** 01981 * ICMP6_STATS==1: Enable ICMP for IPv6 stats. 01982 */ 01983 #if !defined ICMP6_STATS || defined __DOXYGEN__ 01984 #define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) 01985 #endif 01986 01987 /** 01988 * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. 01989 */ 01990 #if !defined IP6_FRAG_STATS || defined __DOXYGEN__ 01991 #define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) 01992 #endif 01993 01994 /** 01995 * MLD6_STATS==1: Enable MLD for IPv6 stats. 01996 */ 01997 #if !defined MLD6_STATS || defined __DOXYGEN__ 01998 #define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) 01999 #endif 02000 02001 /** 02002 * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. 02003 */ 02004 #if !defined ND6_STATS || defined __DOXYGEN__ 02005 #define ND6_STATS (LWIP_IPV6) 02006 #endif 02007 02008 /** 02009 * MIB2_STATS==1: Stats for SNMP MIB2. 02010 */ 02011 #if !defined MIB2_STATS || defined __DOXYGEN__ 02012 #define MIB2_STATS 0 02013 #endif 02014 02015 #else 02016 02017 #define LINK_STATS 0 02018 #define ETHARP_STATS 0 02019 #define IP_STATS 0 02020 #define IPFRAG_STATS 0 02021 #define ICMP_STATS 0 02022 #define IGMP_STATS 0 02023 #define UDP_STATS 0 02024 #define TCP_STATS 0 02025 #define MEM_STATS 0 02026 #define MEMP_STATS 0 02027 #define SYS_STATS 0 02028 #define LWIP_STATS_DISPLAY 0 02029 #define IP6_STATS 0 02030 #define ICMP6_STATS 0 02031 #define IP6_FRAG_STATS 0 02032 #define MLD6_STATS 0 02033 #define ND6_STATS 0 02034 #define MIB2_STATS 0 02035 02036 #endif /* LWIP_STATS */ 02037 /** 02038 * @} 02039 */ 02040 02041 /* 02042 -------------------------------------- 02043 ---------- Checksum options ---------- 02044 -------------------------------------- 02045 */ 02046 /** 02047 * @defgroup lwip_opts_checksum Checksum 02048 * @ingroup lwip_opts_infrastructure 02049 * @{ 02050 */ 02051 /** 02052 * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled 02053 * per netif. 02054 * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! 02055 */ 02056 #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ 02057 #define LWIP_CHECKSUM_CTRL_PER_NETIF 0 02058 #endif 02059 02060 /** 02061 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. 02062 */ 02063 #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ 02064 #define CHECKSUM_GEN_IP 1 02065 #endif 02066 02067 /** 02068 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. 02069 */ 02070 #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ 02071 #define CHECKSUM_GEN_UDP 1 02072 #endif 02073 02074 /** 02075 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. 02076 */ 02077 #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ 02078 #define CHECKSUM_GEN_TCP 1 02079 #endif 02080 02081 /** 02082 * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. 02083 */ 02084 #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ 02085 #define CHECKSUM_GEN_ICMP 1 02086 #endif 02087 02088 /** 02089 * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. 02090 */ 02091 #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ 02092 #define CHECKSUM_GEN_ICMP6 1 02093 #endif 02094 02095 /** 02096 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. 02097 */ 02098 #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ 02099 #define CHECKSUM_CHECK_IP 1 02100 #endif 02101 02102 /** 02103 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. 02104 */ 02105 #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ 02106 #define CHECKSUM_CHECK_UDP 1 02107 #endif 02108 02109 /** 02110 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. 02111 */ 02112 #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ 02113 #define CHECKSUM_CHECK_TCP 1 02114 #endif 02115 02116 /** 02117 * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. 02118 */ 02119 #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ 02120 #define CHECKSUM_CHECK_ICMP 1 02121 #endif 02122 02123 /** 02124 * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets 02125 */ 02126 #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ 02127 #define CHECKSUM_CHECK_ICMP6 1 02128 #endif 02129 02130 /** 02131 * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from 02132 * application buffers to pbufs. 02133 */ 02134 #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ 02135 #define LWIP_CHECKSUM_ON_COPY 0 02136 #endif 02137 /** 02138 * @} 02139 */ 02140 02141 /* 02142 --------------------------------------- 02143 ---------- IPv6 options --------------- 02144 --------------------------------------- 02145 */ 02146 /** 02147 * @defgroup lwip_opts_ipv6 IPv6 02148 * @ingroup lwip_opts 02149 * @{ 02150 */ 02151 /** 02152 * LWIP_IPV6==1: Enable IPv6 02153 */ 02154 #if !defined LWIP_IPV6 || defined __DOXYGEN__ 02155 #define LWIP_IPV6 0 02156 #endif 02157 02158 /** 02159 * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. 02160 */ 02161 #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ 02162 #define LWIP_IPV6_NUM_ADDRESSES 3 02163 #endif 02164 02165 /** 02166 * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs 02167 */ 02168 #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ 02169 #define LWIP_IPV6_FORWARD 0 02170 #endif 02171 02172 /** 02173 * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. 02174 */ 02175 #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ 02176 #define LWIP_IPV6_FRAG 0 02177 #endif 02178 02179 /** 02180 * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented 02181 */ 02182 #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ || defined __DOXYGEN__ 02183 #define LWIP_IPV6_REASS (LWIP_IPV6) 02184 #endif 02185 02186 /** 02187 * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during 02188 * network startup. 02189 */ 02190 #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ 02191 #define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 02192 #endif 02193 02194 /** 02195 * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. 02196 */ 02197 #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ 02198 #define LWIP_IPV6_AUTOCONFIG (LWIP_IPV6) 02199 #endif 02200 02201 /** 02202 * LWIP_IPV6_DUP_DETECT_ATTEMPTS: Number of duplicate address detection attempts. 02203 */ 02204 #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ 02205 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 02206 #endif 02207 /** 02208 * @} 02209 */ 02210 02211 /** 02212 * @defgroup lwip_opts_icmp6 ICMP6 02213 * @ingroup lwip_opts_ipv6 02214 * @{ 02215 */ 02216 /** 02217 * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) 02218 */ 02219 #if !defined LWIP_ICMP6 || defined __DOXYGEN__ 02220 #define LWIP_ICMP6 (LWIP_IPV6) 02221 #endif 02222 02223 /** 02224 * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in 02225 * ICMPv6 error messages. 02226 */ 02227 #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ 02228 #define LWIP_ICMP6_DATASIZE 8 02229 #endif 02230 02231 /** 02232 * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages 02233 */ 02234 #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ 02235 #define LWIP_ICMP6_HL 255 02236 #endif 02237 /** 02238 * @} 02239 */ 02240 02241 /** 02242 * @defgroup lwip_opts_mld6 Multicast listener discovery 02243 * @ingroup lwip_opts_ipv6 02244 * @{ 02245 */ 02246 /** 02247 * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. 02248 */ 02249 #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ 02250 #define LWIP_IPV6_MLD (LWIP_IPV6) 02251 #endif 02252 02253 /** 02254 * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast that can be joined. 02255 */ 02256 #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ 02257 #define MEMP_NUM_MLD6_GROUP 4 02258 #endif 02259 /** 02260 * @} 02261 */ 02262 02263 /** 02264 * @defgroup lwip_opts_nd6 Neighbor discovery 02265 * @ingroup lwip_opts_ipv6 02266 * @{ 02267 */ 02268 /** 02269 * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address 02270 * is being resolved. 02271 */ 02272 #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ 02273 #define LWIP_ND6_QUEUEING (LWIP_IPV6) 02274 #endif 02275 02276 /** 02277 * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. 02278 */ 02279 #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ 02280 #define MEMP_NUM_ND6_QUEUE 20 02281 #endif 02282 02283 /** 02284 * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache 02285 */ 02286 #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ 02287 #define LWIP_ND6_NUM_NEIGHBORS 10 02288 #endif 02289 02290 /** 02291 * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache 02292 */ 02293 #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ 02294 #define LWIP_ND6_NUM_DESTINATIONS 10 02295 #endif 02296 02297 /** 02298 * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache 02299 */ 02300 #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ 02301 #define LWIP_ND6_NUM_PREFIXES 5 02302 #endif 02303 02304 /** 02305 * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache 02306 */ 02307 #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ 02308 #define LWIP_ND6_NUM_ROUTERS 3 02309 #endif 02310 02311 /** 02312 * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send 02313 * (neighbor solicit and router solicit) 02314 */ 02315 #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ 02316 #define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 02317 #endif 02318 02319 /** 02320 * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages 02321 * to send during neighbor reachability detection. 02322 */ 02323 #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ 02324 #define LWIP_ND6_MAX_UNICAST_SOLICIT 3 02325 #endif 02326 02327 /** 02328 * Unused: See ND RFC (time in milliseconds). 02329 */ 02330 #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ 02331 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 02332 #endif 02333 02334 /** 02335 * Unused: See ND RFC 02336 */ 02337 #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ 02338 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 02339 #endif 02340 02341 /** 02342 * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). 02343 * May be updated by router advertisement messages. 02344 */ 02345 #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ 02346 #define LWIP_ND6_REACHABLE_TIME 30000 02347 #endif 02348 02349 /** 02350 * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages 02351 */ 02352 #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ 02353 #define LWIP_ND6_RETRANS_TIMER 1000 02354 #endif 02355 02356 /** 02357 * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation 02358 * message is sent, during neighbor reachability detection. 02359 */ 02360 #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__s 02361 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 02362 #endif 02363 02364 /** 02365 * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update 02366 * Reachable time and retransmission timers, and netif MTU. 02367 */ 02368 #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ 02369 #define LWIP_ND6_ALLOW_RA_UPDATES 1 02370 #endif 02371 02372 /** 02373 * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery 02374 * with reachability hints for connected destinations. This helps avoid sending 02375 * unicast neighbor solicitation messages. 02376 */ 02377 #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ || defined __DOXYGEN__ 02378 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1 02379 #endif 02380 /** 02381 * @} 02382 */ 02383 02384 /** 02385 * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration. 02386 */ 02387 #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ 02388 #define LWIP_IPV6_DHCP6 0 02389 #endif 02390 02391 /* 02392 --------------------------------------- 02393 ---------- Hook options --------------- 02394 --------------------------------------- 02395 */ 02396 02397 /** 02398 * @defgroup lwip_opts_hooks Hooks 02399 * @ingroup lwip_opts_infrastructure 02400 * Hooks are undefined by default, define them to a function if you need them. 02401 * @{ 02402 */ 02403 02404 /** 02405 * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): 02406 * - called from ip_input() (IPv4) 02407 * - pbuf: received struct pbuf passed to ip_input() 02408 * - input_netif: struct netif on which the packet has been received 02409 * Return values: 02410 * - 0: Hook has not consumed the packet, packet is processed as normal 02411 * - != 0: Hook has consumed the packet. 02412 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 02413 * (i.e. free it when done). 02414 */ 02415 #ifdef __DOXYGEN__ 02416 #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) 02417 #endif 02418 02419 /** 02420 * LWIP_HOOK_IP4_ROUTE(dest): 02421 * - called from ip_route() (IPv4) 02422 * - dest: destination IPv4 address 02423 * Returns the destination netif or NULL if no destination netif is found. In 02424 * that case, ip_route() continues as normal. 02425 */ 02426 #ifdef __DOXYGEN__ 02427 #define LWIP_HOOK_IP4_ROUTE() 02428 #endif 02429 02430 /** 02431 * LWIP_HOOK_IP4_ROUTE_SRC(dest, src): 02432 * - source-based routing for IPv4 (see LWIP_HOOK_IP4_ROUTE(), src may be NULL) 02433 */ 02434 #ifdef __DOXYGEN__ 02435 #define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) 02436 #endif 02437 02438 /** 02439 * LWIP_HOOK_ETHARP_GET_GW(netif, dest): 02440 * - called from etharp_output() (IPv4) 02441 * - netif: the netif used for sending 02442 * - dest: the destination IPv4 address 02443 * Returns the IPv4 address of the gateway to handle the specified destination 02444 * IPv4 address. If NULL is returned, the netif's default gateway is used. 02445 * The returned address MUST be reachable on the specified netif! 02446 * This function is meant to implement advanced IPv4 routing together with 02447 * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is 02448 * not part of lwIP but can e.g. be hidden in the netif's state argument. 02449 */ 02450 #ifdef __DOXYGEN__ 02451 #define LWIP_HOOK_ETHARP_GET_GW(netif, dest) 02452 #endif 02453 02454 /** 02455 * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): 02456 * - called from ip6_input() (IPv6) 02457 * - pbuf: received struct pbuf passed to ip6_input() 02458 * - input_netif: struct netif on which the packet has been received 02459 * Return values: 02460 * - 0: Hook has not consumed the packet, packet is processed as normal 02461 * - != 0: Hook has consumed the packet. 02462 * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook 02463 * (i.e. free it when done). 02464 */ 02465 #ifdef __DOXYGEN__ 02466 #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) 02467 #endif 02468 02469 /** 02470 * LWIP_HOOK_IP6_ROUTE(src, dest): 02471 * - called from ip6_route() (IPv6) 02472 * - src: sourc IPv6 address 02473 * - dest: destination IPv6 address 02474 * Returns the destination netif or NULL if no destination netif is found. In 02475 * that case, ip6_route() continues as normal. 02476 */ 02477 #ifdef __DOXYGEN__ 02478 #define LWIP_HOOK_IP6_ROUTE(src, dest) 02479 #endif 02480 02481 /** 02482 * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): 02483 * - called from ethernet_input() if VLAN support is enabled 02484 * - netif: struct netif on which the packet has been received 02485 * - eth_hdr: struct eth_hdr of the packet 02486 * - vlan_hdr: struct eth_vlan_hdr of the packet 02487 * Return values: 02488 * - 0: Packet must be dropped. 02489 * - != 0: Packet must be accepted. 02490 */ 02491 #ifdef __DOXYGEN__ 02492 #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) 02493 #endif 02494 02495 /** 02496 * LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr): 02497 * - called from etharp_raw() and etharp_send_ip() if VLAN support is enabled 02498 * - netif: struct netif that the packet will be sent through 02499 * - eth_hdr: struct eth_hdr of the packet 02500 * - vlan_hdr: struct eth_vlan_hdr of the packet 02501 * Return values: 02502 * - 0: Packet shall not contain VLAN header. 02503 * - != 0: Packet shall contain VLAN header. 02504 * Hook can be used to set prio_vid field of vlan_hdr. 02505 */ 02506 #ifdef __DOXYGEN__ 02507 #define LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr) 02508 #endif 02509 02510 /** 02511 * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): 02512 * - called from memp_free() when a memp pool was empty and an item is now available 02513 */ 02514 #ifdef __DOXYGEN__ 02515 #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) 02516 #endif 02517 /** 02518 * @} 02519 */ 02520 02521 /* 02522 --------------------------------------- 02523 ---------- Debugging options ---------- 02524 --------------------------------------- 02525 */ 02526 /** 02527 * @defgroup lwip_opts_debugmsg Debugging 02528 * @ingroup lwip_opts_debug 02529 * @{ 02530 */ 02531 /** 02532 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is 02533 * compared against this value. If it is smaller, then debugging 02534 * messages are written. 02535 */ 02536 #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ || defined __DOXYGEN__ 02537 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 02538 #endif 02539 02540 /** 02541 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable 02542 * debug messages of certain types. 02543 */ 02544 #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ 02545 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 02546 #endif 02547 02548 /** 02549 * ETHARP_DEBUG: Enable debugging in etharp.c. 02550 */ 02551 #if !defined ETHARP_DEBUG || defined __DOXYGEN__ 02552 #define ETHARP_DEBUG LWIP_DBG_OFF 02553 #endif 02554 02555 /** 02556 * NETIF_DEBUG: Enable debugging in netif.c. 02557 */ 02558 #if !defined NETIF_DEBUG || defined __DOXYGEN__ 02559 #define NETIF_DEBUG LWIP_DBG_OFF 02560 #endif 02561 02562 /** 02563 * PBUF_DEBUG: Enable debugging in pbuf.c. 02564 */ 02565 #if !defined PBUF_DEBUG || defined __DOXYGEN__ 02566 #define PBUF_DEBUG LWIP_DBG_OFF 02567 #endif 02568 02569 /** 02570 * API_LIB_DEBUG: Enable debugging in api_lib.c. 02571 */ 02572 #if !defined API_LIB_DEBUG || defined __DOXYGEN__ 02573 #define API_LIB_DEBUG LWIP_DBG_OFF 02574 #endif 02575 02576 /** 02577 * API_MSG_DEBUG: Enable debugging in api_msg.c. 02578 */ 02579 #if !defined API_MSG_DEBUG || defined __DOXYGEN__ 02580 #define API_MSG_DEBUG LWIP_DBG_OFF 02581 #endif 02582 02583 /** 02584 * SOCKETS_DEBUG: Enable debugging in sockets.c. 02585 */ 02586 #if !defined SOCKETS_DEBUG || defined __DOXYGEN__ 02587 #define SOCKETS_DEBUG LWIP_DBG_OFF 02588 #endif 02589 02590 /** 02591 * ICMP_DEBUG: Enable debugging in icmp.c. 02592 */ 02593 #if !defined ICMP_DEBUG || defined __DOXYGEN__ 02594 #define ICMP_DEBUG LWIP_DBG_OFF 02595 #endif 02596 02597 /** 02598 * IGMP_DEBUG: Enable debugging in igmp.c. 02599 */ 02600 #if !defined IGMP_DEBUG || defined __DOXYGEN__ 02601 #define IGMP_DEBUG LWIP_DBG_OFF 02602 #endif 02603 02604 /** 02605 * INET_DEBUG: Enable debugging in inet.c. 02606 */ 02607 #if !defined INET_DEBUG || defined __DOXYGEN__ 02608 #define INET_DEBUG LWIP_DBG_OFF 02609 #endif 02610 02611 /** 02612 * IP_DEBUG: Enable debugging for IP. 02613 */ 02614 #if !defined IP_DEBUG || defined __DOXYGEN__ 02615 #define IP_DEBUG LWIP_DBG_OFF 02616 #endif 02617 02618 /** 02619 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. 02620 */ 02621 #if !defined IP_REASS_DEBUG || defined __DOXYGEN__ 02622 #define IP_REASS_DEBUG LWIP_DBG_OFF 02623 #endif 02624 02625 /** 02626 * RAW_DEBUG: Enable debugging in raw.c. 02627 */ 02628 #if !defined RAW_DEBUG || defined __DOXYGEN__ 02629 #define RAW_DEBUG LWIP_DBG_OFF 02630 #endif 02631 02632 /** 02633 * MEM_DEBUG: Enable debugging in mem.c. 02634 */ 02635 #if !defined MEM_DEBUG || defined __DOXYGEN__ 02636 #define MEM_DEBUG LWIP_DBG_OFF 02637 #endif 02638 02639 /** 02640 * MEMP_DEBUG: Enable debugging in memp.c. 02641 */ 02642 #if !defined MEMP_DEBUG || defined __DOXYGEN__ 02643 #define MEMP_DEBUG LWIP_DBG_OFF 02644 #endif 02645 02646 /** 02647 * SYS_DEBUG: Enable debugging in sys.c. 02648 */ 02649 #if !defined SYS_DEBUG || defined __DOXYGEN__ 02650 #define SYS_DEBUG LWIP_DBG_OFF 02651 #endif 02652 02653 /** 02654 * TIMERS_DEBUG: Enable debugging in timers.c. 02655 */ 02656 #if !defined TIMERS_DEBUG || defined __DOXYGEN__ 02657 #define TIMERS_DEBUG LWIP_DBG_OFF 02658 #endif 02659 02660 /** 02661 * TCP_DEBUG: Enable debugging for TCP. 02662 */ 02663 #if !defined TCP_DEBUG || defined __DOXYGEN__ 02664 #define TCP_DEBUG LWIP_DBG_OFF 02665 #endif 02666 02667 /** 02668 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. 02669 */ 02670 #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ 02671 #define TCP_INPUT_DEBUG LWIP_DBG_OFF 02672 #endif 02673 02674 /** 02675 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. 02676 */ 02677 #if !defined TCP_FR_DEBUG || defined __DOXYGEN__ 02678 #define TCP_FR_DEBUG LWIP_DBG_OFF 02679 #endif 02680 02681 /** 02682 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit 02683 * timeout. 02684 */ 02685 #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ 02686 #define TCP_RTO_DEBUG LWIP_DBG_OFF 02687 #endif 02688 02689 /** 02690 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. 02691 */ 02692 #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ 02693 #define TCP_CWND_DEBUG LWIP_DBG_OFF 02694 #endif 02695 02696 /** 02697 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. 02698 */ 02699 #if !defined TCP_WND_DEBUG || defined __DOXYGEN__ 02700 #define TCP_WND_DEBUG LWIP_DBG_OFF 02701 #endif 02702 02703 /** 02704 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. 02705 */ 02706 #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ 02707 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF 02708 #endif 02709 02710 /** 02711 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. 02712 */ 02713 #if !defined TCP_RST_DEBUG || defined __DOXYGEN__ 02714 #define TCP_RST_DEBUG LWIP_DBG_OFF 02715 #endif 02716 02717 /** 02718 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. 02719 */ 02720 #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ 02721 #define TCP_QLEN_DEBUG LWIP_DBG_OFF 02722 #endif 02723 02724 /** 02725 * UDP_DEBUG: Enable debugging in UDP. 02726 */ 02727 #if !defined UDP_DEBUG || defined __DOXYGEN__ 02728 #define UDP_DEBUG LWIP_DBG_OFF 02729 #endif 02730 02731 /** 02732 * TCPIP_DEBUG: Enable debugging in tcpip.c. 02733 */ 02734 #if !defined TCPIP_DEBUG || defined __DOXYGEN__ 02735 #define TCPIP_DEBUG LWIP_DBG_OFF 02736 #endif 02737 02738 /** 02739 * SLIP_DEBUG: Enable debugging in slipif.c. 02740 */ 02741 #if !defined SLIP_DEBUG || defined __DOXYGEN__ 02742 #define SLIP_DEBUG LWIP_DBG_OFF 02743 #endif 02744 02745 /** 02746 * DHCP_DEBUG: Enable debugging in dhcp.c. 02747 */ 02748 #if !defined DHCP_DEBUG || defined __DOXYGEN__ 02749 #define DHCP_DEBUG LWIP_DBG_OFF 02750 #endif 02751 02752 /** 02753 * AUTOIP_DEBUG: Enable debugging in autoip.c. 02754 */ 02755 #if !defined AUTOIP_DEBUG || defined __DOXYGEN__ 02756 #define AUTOIP_DEBUG LWIP_DBG_OFF 02757 #endif 02758 02759 /** 02760 * DNS_DEBUG: Enable debugging for DNS. 02761 */ 02762 #if !defined DNS_DEBUG || defined __DOXYGEN__ 02763 #define DNS_DEBUG LWIP_DBG_OFF 02764 #endif 02765 02766 /** 02767 * IP6_DEBUG: Enable debugging for IPv6. 02768 */ 02769 #if !defined IP6_DEBUG || defined __DOXYGEN__ 02770 #define IP6_DEBUG LWIP_DBG_OFF 02771 #endif 02772 /** 02773 * @} 02774 */ 02775 02776 /* 02777 -------------------------------------------------- 02778 ---------- Performance tracking options ---------- 02779 -------------------------------------------------- 02780 */ 02781 /** 02782 * @defgroup lwip_opts_perf Performance 02783 * @ingroup lwip_opts_debug 02784 * @{ 02785 */ 02786 /** 02787 * LWIP_PERF: Enable performance testing for lwIP 02788 * (if enabled, arch/perf.h is included) 02789 */ 02790 #if !defined LWIP_PERF || defined __DOXYGEN__ 02791 #define LWIP_PERF 0 02792 #endif 02793 /** 02794 * @} 02795 */ 02796 02797 #endif /* LWIP_HDR_OPT_H */
Generated on Tue Jul 12 2022 18:19:32 by
1.7.2