/* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Adam Dunkels * */ #ifndef __LWIP_OPT_H__ #define __LWIP_OPT_H__ /* Include user defined options first. Anything not defined in these files * will be set to standard values. Override anything you dont like! */ #include "lwipopts.h" #include "lwip/debug.h" /* ----------------------------------------------- ---------- Platform specific locking ---------- ----------------------------------------------- */ /** * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain * critical regions during buffer allocation, deallocation and memory * allocation and deallocation. * * Default: 0 (off) */ #ifndef SYS_LIGHTWEIGHT_PROT #define SYS_LIGHTWEIGHT_PROT 0 #endif /** * NO_SYS==1: Provides VERY minimal functionality. * * Default: 0 (use lwIP system functions) */ #ifndef NO_SYS #define NO_SYS 0 #endif /** * MEMCPY: override this if you have a faster implementation at hand than the * one included in your C library * * Default: use standard memcpy */ #ifndef MEMCPY #define MEMCPY(dst,src,len) memcpy(dst,src,len) #endif /** * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a * call to memcpy() if the length is known at compile time and is small. * * Default: use standard memcpy */ #ifndef SMEMCPY #define SMEMCPY(dst,src,len) memcpy(dst,src,len) #endif /* ------------------------------------ ---------- Memory options ---------- ------------------------------------ */ /** * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library * instead of the lwip internal allocator. Can save code size if you * already use it. * * Default: 0 (use lwIP's mem_malloc) */ #ifndef MEM_LIBC_MALLOC #define MEM_LIBC_MALLOC 0 #endif /** * MEM_ALIGNMENT: should be set to the alignment of the CPU * 4 byte alignment -> #define MEM_ALIGNMENT 4 * 2 byte alignment -> #define MEM_ALIGNMENT 2 * * Default: 1 (1-byte alignment) */ #ifndef MEM_ALIGNMENT #define MEM_ALIGNMENT 1 #endif /** * MEM_SIZE: the size of the heap memory. If the application will send * a lot of data that needs to be copied, this should be set high. * * Default: 1600 */ #ifndef MEM_SIZE #define MEM_SIZE 1600 #endif /** * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable * amount of bytes before and after each memp element in every pool and fills * it with a prominent default value. * MEMP_OVERFLOW_CHECK == 0 no checking * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time * memp_malloc() or memp_free() is called (useful but slow!) * * Default: 0 (no checking) */ #ifndef MEMP_OVERFLOW_CHECK #define MEMP_OVERFLOW_CHECK 0 #endif /** * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make * sure that there are no cycles in the linked lists. * * Default: 0 (no checking) */ #ifndef MEMP_SANITY_CHECK #define MEMP_SANITY_CHECK 0 #endif /** * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set * of memory pools of various sizes. When mem_malloc is called, an element of * the smallest pool that can provide the lenght needed is returned. * * Default: 0 (do not use pools instead of malloc) */ #ifndef MEM_USE_POOLS #define MEM_USE_POOLS 0 #endif #if MEM_USE_POOLS /* The element sizes of the 4 pools. The sizes must be increasing, e.g. the elements in pool 2 must be bigger than the elements in pool 1 and so on. If this is not the case, mem_malloc will not work correctly. */ #ifndef MEM_POOL_SIZE_1 #error You must have at least one pool if MEM_USE_POOLS is set to 1! #endif #ifndef MEM_POOL_SIZE_2 #define MEM_POOL_SIZE_2 0 #endif #ifndef MEM_POOL_SIZE_3 #define MEM_POOL_SIZE_3 0 #endif #ifndef MEM_POOL_SIZE_4 #define MEM_POOL_SIZE_4 0 #endif /* The element count of the 4 pools */ #ifndef MEM_POOL_NUM_1 #error You must have at least one pool if MEM_USE_POOLS is set to 1! #endif #ifndef MEM_POOL_NUM_2 #define MEM_POOL_NUM_2 0 #endif #ifndef MEM_POOL_NUM_3 #define MEM_POOL_NUM_3 0 #endif #ifndef MEM_POOL_NUM_4 #define MEM_POOL_NUM_4 0 #endif #endif /* ------------------------------------------------ ---------- Internal Memory Pool Sizes ---------- ------------------------------------------------ */ /** * MEMP_NUM_PBUF: the number of memp struct pbufs. If the application * sends a lot of data out of ROM (or other static memory), this * should be set high. * * Default: 16 */ #ifndef MEMP_NUM_PBUF #define MEMP_NUM_PBUF 16 #endif /** * MEMP_NUM_RAW_PCB: Number of raw connection PCBs * (requires the LWIP_RAW option) * * Default: 4 */ #ifndef MEMP_NUM_RAW_PCB #define MEMP_NUM_RAW_PCB 4 #endif /** * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One * per active UDP "connection". * (requires the LWIP_UDP option) * * Default: 4 */ #ifndef MEMP_NUM_UDP_PCB #define MEMP_NUM_UDP_PCB 4 #endif /** * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. * (requires the LWIP_TCP option) * * Default: 5 */ #ifndef MEMP_NUM_TCP_PCB #define MEMP_NUM_TCP_PCB 5 #endif /** * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. * (requires the LWIP_TCP option) * * Default: 8 */ #ifndef MEMP_NUM_TCP_PCB_LISTEN #define MEMP_NUM_TCP_PCB_LISTEN 8 #endif /** * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. * (requires the LWIP_TCP option) * * Default: 16 */ #ifndef MEMP_NUM_TCP_SEG #define MEMP_NUM_TCP_SEG 16 #endif /** * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing * packets (pbufs) that are waiting for an ARP request (to resolve * their destination address) to finish. * (requires the ARP_QUEUEING option) * * Default: 30 */ #ifndef MEMP_NUM_ARP_QUEUE #define MEMP_NUM_ARP_QUEUE 30 #endif /** * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. * (requires NO_SYS==0) * * Default: 3 */ #ifndef MEMP_NUM_SYS_TIMEOUT #define MEMP_NUM_SYS_TIMEOUT 3 #endif /** * MEMP_NUM_NETBUF: the number of struct netbufs. * (only needed if you use the sequential API, like api_lib.c) * * Default: 2 */ #ifndef MEMP_NUM_NETBUF #define MEMP_NUM_NETBUF 2 #endif /** * MEMP_NUM_NETCONN: the number of struct netconns. * (only needed if you use the sequential API, like api_lib.c) * * Default: 4 */ #ifndef MEMP_NUM_NETCONN #define MEMP_NUM_NETCONN 4 #endif /** * MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used * for sequential API communication and incoming packets. * (only needed if you use tcpip.c) * * Default: 8 */ #ifndef MEMP_NUM_TCPIP_MSG #define MEMP_NUM_TCPIP_MSG 8 #endif /** * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. * * Default: 16 */ #ifndef PBUF_POOL_SIZE #define PBUF_POOL_SIZE 16 #endif /* --------------------------------- ---------- ARP options ---------- --------------------------------- */ /** * LWIP_ARP==1: Enable ARP functionality. * * Default: 1 (on) */ #ifndef LWIP_ARP #define LWIP_ARP 1 #endif /** * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. * * Default: 10 */ #ifndef ARP_TABLE_SIZE #define ARP_TABLE_SIZE 10 #endif /** * ARP_QUEUEING==1: Outgoing packets are queued during hardware address * resolution. * * Default: 1 (on) */ #ifndef ARP_QUEUEING #define ARP_QUEUEING 1 #endif /** * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be * updated with the source MAC and IP addresses supplied in the packet. * You may want to disable this if you do not trust LAN peers to have the * correct addresses, or as a limited approach to attempt to handle * spoofing. If disabled, lwIP will need to make a new ARP request if * the peer is not already in the ARP table, adding a little latency. * * Default: 1 (on) */ #ifndef ETHARP_TRUST_IP_MAC #define ETHARP_TRUST_IP_MAC 1 #endif /** * ETHARP_TCPIP_INPUT==1: Driver can pass packets to tcpip_input after it * has processed any incoming ARP packets. Incoming IP packets are then * processed in tcpip_thread context. It is recommended that you use * ETHARP_TCPIP_ETHINPUT instead; see that option for explanation. * (only useful if you use tcpip.c) * * Default: 1 (on) */ #ifndef ETHARP_TCPIP_INPUT #define ETHARP_TCPIP_INPUT 1 #endif /** * ETHARP_TCPIP_ETHINPUT==1: Driver passes *all* packets to tcpip_ethinput * (and not tcpip_input). IP and ARP packets will be both processed inside * tcpip_thread context. The aim is to protect ARP layer against concurrent * access. Older ports have to be updated to use tcpip_ethinput. * * Default: 1 (on) */ #ifndef ETHARP_TCPIP_ETHINPUT #define ETHARP_TCPIP_ETHINPUT 1 #endif /** * ETHARP_QUEUE_FIRST is deprecated */ #ifdef ETHARP_QUEUE_FIRST #error ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h. #endif /** * ETHARP_ALWAYS_INSERT is removed to comply with the ARP standard */ #ifdef ETHARP_ALWAYS_INSERT #error ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h. #endif /* -------------------------------- ---------- IP options ---------- -------------------------------- */ /** * IP_FORWARD==1: Enables the ability to forward IP packets across network * interfaces. If you are going to run lwIP on a device with only one network * interface, define this to 0. * * Default: 0 (off) */ #ifndef IP_FORWARD #define IP_FORWARD 0 #endif /** * IP_OPTIONS: Defines the behavior for IP options. * IP_OPTIONS==0: All packets with IP options are dropped. * IP_OPTIONS==1: IP options are allowed (but not parsed). * * Default: 1 (allow) */ #ifndef IP_OPTIONS #define IP_OPTIONS 1 #endif /** * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that * this option does not affect outgoing packet sizes, which can be controlled * via IP_FRAG. * * Default: 1 (on) */ #ifndef IP_REASSEMBLY #define IP_REASSEMBLY 1 #endif /** * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP_REASSEMBLY. * * Default: 1 */ #ifndef IP_FRAG #define IP_FRAG 1 #endif /** * IP_REASS_MAXAGE: IP reassemly default age in seconds. * * Default: 3 seconds */ #ifndef IP_REASS_MAXAGE #define IP_REASS_MAXAGE 3 #endif /** * IP_REASS_BUFSIZE: IP reassembly buffer size (minus IP header). * * Default: 5760 */ #ifndef IP_REASS_BUFSIZE #define IP_REASS_BUFSIZE 5760 #endif /** * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP * fragmentation. Otherwise pbufs are allocated and reference the original * packet data to be fragmented. * * Default: 1 (on) */ #ifndef IP_FRAG_USES_STATIC_BUF #define IP_FRAG_USES_STATIC_BUF 1 #endif /** * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer * (requires IP_FRAG_USES_STATIC_BUF==1) * * Default: 1500 */ #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) #define IP_FRAG_MAX_MTU 1500 #endif /** * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. * * Default: 255 */ #ifndef IP_DEFAULT_TTL #define IP_DEFAULT_TTL 255 #endif /* ---------------------------------- ---------- ICMP options ---------- ---------------------------------- */ /** * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. * * Default: IP_DEFAULT_TTL */ #ifndef ICMP_TTL #define ICMP_TTL (IP_DEFAULT_TTL) #endif /* --------------------------------- ---------- RAW options ---------- --------------------------------- */ /** * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. * * Default: 1 (on) */ #ifndef LWIP_RAW #define LWIP_RAW 1 #endif /** * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. * * Default: IP_DEFAULT_TTL */ #ifndef RAW_TTL #define RAW_TTL (IP_DEFAULT_TTL) #endif /* ---------------------------------- ---------- DHCP options ---------- ---------------------------------- */ /** * LWIP_DHCP==1: Enable DHCP module. * * Default: 0 (off) */ #ifndef LWIP_DHCP #define LWIP_DHCP 0 #endif /** * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. * * Default: 1 (on) */ #ifndef DHCP_DOES_ARP_CHECK #define DHCP_DOES_ARP_CHECK 1 #endif /* ------------------------------------ ---------- AUTOIP options ---------- ------------------------------------ */ /** * LWIP_AUTOIP==1: Enable AUTOIP module. * * Default: 0 (off) */ #ifndef LWIP_AUTOIP #define LWIP_AUTOIP 0 #endif /** * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on * the same interface at the same time. * * Default: 0 (off) */ #ifndef LWIP_DHCP_AUTOIP_COOP #define LWIP_DHCP_AUTOIP_COOP 0 #endif /* ---------------------------------- ---------- SNMP options ---------- ---------------------------------- */ /** * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP * transport. * * Default: 0 (off) */ #ifndef LWIP_SNMP #define LWIP_SNMP 0 #endif /** * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will * allow. At least one request buffer is required. * * Default: 1 */ #ifndef SNMP_CONCURRENT_REQUESTS #define SNMP_CONCURRENT_REQUESTS 1 #endif /** * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap * destination is required * * Default: 1 */ #ifndef SNMP_TRAP_DESTINATIONS #define SNMP_TRAP_DESTINATIONS 1 #endif /** * SNMP_PRIVATE_MIB: * * Default: 0 */ #ifndef SNMP_PRIVATE_MIB #define SNMP_PRIVATE_MIB 0 #endif /* ---------------------------------- ---------- IGMP options ---------- ---------------------------------- */ /** * LWIP_IGMP==1: Turn on IGMP module. * * Default: 0 (off) */ #ifndef LWIP_IGMP #define LWIP_IGMP 0 #endif /* --------------------------------- ---------- UDP options ---------- --------------------------------- */ /** * LWIP_UDP==1: Turn on UDP. * * Default: 1 (on) */ #ifndef LWIP_UDP #define LWIP_UDP 1 #endif /** * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) * * Default: 1 (on) */ #ifndef LWIP_UDPLITE #define LWIP_UDPLITE 1 #endif /** * UDP_TTL: Default Time-To-Live value. * * Default: IP_DEFAULT_TTL */ #ifndef UDP_TTL #define UDP_TTL (IP_DEFAULT_TTL) #endif /* --------------------------------- ---------- TCP options ---------- --------------------------------- */ /** * LWIP_TCP==1: Turn on TCP. * * Default: 1 (on) */ #ifndef LWIP_TCP #define LWIP_TCP 1 #endif /** * TCP_TTL: Default Time-To-Live value. * * Default: IP_DEFAULT_TTL */ #ifndef TCP_TTL #define TCP_TTL (IP_DEFAULT_TTL) #endif /** * TCP_WND: The size of a TCP window. * * Default: 2048 */ #ifndef TCP_WND #define TCP_WND 2048 #endif /** * TCP_MAXRTX: Maximum number of retransmissions of data segments. * * Default: 12 */ #ifndef TCP_MAXRTX #define TCP_MAXRTX 12 #endif /** * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. * * Default: 6 */ #ifndef TCP_SYNMAXRTX #define TCP_SYNMAXRTX 6 #endif /** * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. * Define to 0 if your device is low on memory. * * Default: 1 (on) */ #ifndef TCP_QUEUE_OOSEQ #define TCP_QUEUE_OOSEQ 1 #endif /** * TCP_MSS: TCP Maximum segment size. * * Default: 128, a *very* conservative default. */ #ifndef TCP_MSS #define TCP_MSS 128 #endif /** * TCP_SND_BUF: TCP sender buffer space (bytes). * * Default: 256 */ #ifndef TCP_SND_BUF #define TCP_SND_BUF 256 #endif /** * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. * * Default: 4 * TCP_SND_BUF/TCP_MSS */ #ifndef TCP_SND_QUEUELEN #define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS #endif /** * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal * to TCP_SND_BUF. It is the amount of space which must be available in the * TCP snd_buf for select to return writable. * * Default: TCP_SND_BUF/2 */ #ifndef TCP_SNDLOWAT #define TCP_SNDLOWAT TCP_SND_BUF/2 #endif /** * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all * events (accept, sent, etc) that happen in the system. * LWIP_CALLBACK_API==1: The PCB callback function is called directly * for the event. * * Default: LWIP_CALLBACK_API=1, LWIP_EVENT_API=0: use callback. */ #ifndef LWIP_EVENT_API #define LWIP_EVENT_API 0 #define LWIP_CALLBACK_API 1 #else #define LWIP_EVENT_API 1 #define LWIP_CALLBACK_API 0 #endif /* ---------------------------------- ---------- Pbuf options ---------- ---------------------------------- */ /** * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is * designed to accomodate single full size TCP frame in one pbuf, including * TCP_MSS, IP header, and link header. * * Default: LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN). * */ #ifndef PBUF_POOL_BUFSIZE #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) #endif /** * PBUF_LINK_HLEN: the number of bytes that should be allocated for a * link level header. * * Default: 14 (the standard value for Ethernet) */ #ifndef PBUF_LINK_HLEN #define PBUF_LINK_HLEN 14 #endif /* ------------------------------------------------ ---------- Network Interfaces options ---------- ------------------------------------------------ */ /** * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname * field. * * Default: 0 (off) * */ #ifndef LWIP_NETIF_HOSTNAME #define LWIP_NETIF_HOSTNAME 0 #endif /** * LWIP_NETIF_API==1: Support netif api (in netifapi.c) * * Default: 0 (off) * */ #ifndef LWIP_NETIF_API #define LWIP_NETIF_API 0 #endif /** * LWIP_NETIF_CALLBACK==1: Support a callback function whenever an interface * changes its up/down status (i.e., due to DHCP IP acquistion) * * Default: 0 (off) * */ #ifndef LWIP_NETIF_CALLBACK #define LWIP_NETIF_CALLBACK 0 #endif /** * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface * whenever the link changes (i.e., link down) * * Default: 0 (off) * */ #ifndef LWIP_NETIF_LINK_CALLBACK #define LWIP_NETIF_LINK_CALLBACK 0 #endif /** * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table * indices) in struct netif. TCP and UDP can make use of this to prevent * scanning the ARP table for every sent packet. While this is faster for big * ARP tables or many concurrent connections, it might be counterproductive * if you have a tiny ARP table or if there never are concurrent connections. * * Default: 0 (off) */ #ifndef LWIP_NETIF_HWADDRHINT #define LWIP_NETIF_HWADDRHINT 0 #endif /* ------------------------------------ ---------- LOOPIF options ---------- ------------------------------------ */ /** * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c * * Default: 0 (off) */ #ifndef LWIP_HAVE_LOOPIF #define LWIP_HAVE_LOOPIF 0 #endif /** * LWIP_LOOPIF_MULTITHREADING: Indicates whether threading is enabled in * the system, as LOOPIF must change how it behaves depending on this setting. * Setting this is needed to avoid reentering non-reentrant functions like * tcp_input(). * LWIP_LOOPIF_MULTITHREADING==1: Indicates that the user is using a * multithreaded environment like tcpip.c. In this case, netif->input() * is called directly. * LWIP_LOOPIF_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. * The packets are put on a list and loopif_poll() must be called in * the main application loop. * * Default: 1 (threaded environment) */ #ifndef LWIP_LOOPIF_MULTITHREADING #define LWIP_LOOPIF_MULTITHREADING 1 #endif /* ------------------------------------ ---------- Thread options ---------- ------------------------------------ */ /** * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when tcpip_thread is created. * * Default: 1 */ #ifndef TCPIP_THREAD_PRIO #define TCPIP_THREAD_PRIO 1 #endif /** * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when slipif_loop is created. * * Default: 1 */ #ifndef SLIPIF_THREAD_PRIO #define SLIPIF_THREAD_PRIO 1 #endif /** * PPP_THREAD_PRIO: The priority assigned to the pppMain thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when pppMain is created. * * Default: 1 */ #ifndef PPP_THREAD_PRIO #define PPP_THREAD_PRIO 1 #endif /** * DEFAULT_THREAD_PRIO: The priority assigned to the pppMain thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when pppMain is created. * * Default: 1 */ #ifndef DEFAULT_THREAD_PRIO #define DEFAULT_THREAD_PRIO 1 #endif /* ---------------------------------------------- ---------- Sequential layer options ---------- ---------------------------------------------- */ /** * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) * Don't use it if you're not an active lwIP project member * * Default: 0 */ #ifndef LWIP_TCPIP_CORE_LOCKING #define LWIP_TCPIP_CORE_LOCKING 0 #endif /* ------------------------------------ ---------- Socket options ---------- ------------------------------------ */ /** * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. * (only used if you use sockets.c) * * Default: 1 (on) */ #ifndef LWIP_COMPAT_SOCKETS #define LWIP_COMPAT_SOCKETS 1 #endif /** * LWIP_COMPAT_SOCKETS==1: Enable POSIX-style sockets functions names. Disable * this option if you use a POSIX operating system that uses the same names * (read, write & close). (only used if you use sockets.c) * * Default: 1 (on) */ #ifndef LWIP_POSIX_SOCKETS_IO_NAMES #define LWIP_POSIX_SOCKETS_IO_NAMES 1 #endif /** * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set * in seconds. (does not require sockets.c, and will affect tcp.c) * * Default: 0 (off) */ #ifndef LWIP_TCP_KEEPALIVE #define LWIP_TCP_KEEPALIVE 0 #endif /** * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. * * Default: 0 (off) */ #ifndef LWIP_SO_RCVTIMEO #define LWIP_SO_RCVTIMEO 0 #endif /** * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE! * * Default: 0 (off) */ #ifndef SO_REUSE #define SO_REUSE 0 #endif #if SO_REUSE /* I removed the lot since this was an ugly hack. It broke the raw-API. It also came with many ugly goto's, Christiaan Simons. */ #error "SO_REUSE currently unavailable, this was a hack" #endif /* ---------------------------------------- ---------- Statistics options ---------- ---------------------------------------- */ /** * LWIP_STATS==1: Enable statistics collection in lwip_stats. * * Default: 1 (on) */ #ifndef LWIP_STATS #define LWIP_STATS 1 #endif #if LWIP_STATS /** * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. * * Default: 0 (off) */ #ifndef LWIP_STATS_DISPLAY #define LWIP_STATS_DISPLAY 0 #endif /** * LINK_STATS==1: Enable link stats. * * Default: 1 (on) */ #ifndef LINK_STATS #define LINK_STATS 1 #endif /** * IP_STATS==1: Enable IP stats. * * Default: 1 (on) */ #ifndef IP_STATS #define IP_STATS 1 #endif /** * IPFRAG_STATS==1: Enable IP fragmentation stats. * * Default: 1 (on) */ #ifndef IPFRAG_STATS #define IPFRAG_STATS 1 #endif /** * ICMP_STATS==1: Enable ICMP stats. * * Default: 1 (on) */ #ifndef ICMP_STATS #define ICMP_STATS 1 #endif /** * UDP_STATS==1: Enable UDP stats. * * Default: LWIP_UDP (on if UDP enabled, otherwise off) */ #ifndef UDP_STATS #define UDP_STATS (LWIP_UDP) #endif /** * TCP_STATS==1: Enable TCP stats. * * Default: LWIP_TCP (on if TCP enabled, otherwise off) */ #ifndef TCP_STATS #define TCP_STATS (LWIP_TCP) #endif /** * MEM_STATS==1: Enable mem.c stats. * * Default: 1 (on) */ #ifndef MEM_STATS #define MEM_STATS 1 #endif /** * MEMP_STATS==1: Enable memp.c pool stats. * * Default: 1 (on) */ #ifndef MEMP_STATS #define MEMP_STATS 1 #endif /** * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). * * Default: 1 (on) */ #ifndef SYS_STATS #define SYS_STATS 1 #endif #else #define LINK_STATS 0 #define IP_STATS 0 #define IPFRAG_STATS 0 #define ICMP_STATS 0 #define UDP_STATS 0 #define TCP_STATS 0 #define MEM_STATS 0 #define MEMP_STATS 0 #define SYS_STATS 0 #define LWIP_STATS_DISPLAY 0 #endif /* LWIP_STATS */ /* --------------------------------- ---------- PPP options ---------- --------------------------------- */ /** * PPP_SUPPORT==1: Enable PPP. * * Default: 0 (off) */ #ifndef PPP_SUPPORT #define PPP_SUPPORT 0 #endif #if PPP_SUPPORT /** * NUM_PPP: Max PPP sessions. * * Default: 1 */ #define NUM_PPP 1 /** * PAP_SUPPORT==1: Support PAP. * * Default: 0 (off) */ #ifndef PAP_SUPPORT #define PAP_SUPPORT 0 /* Set for PAP. */ #endif /** * CHAP_SUPPORT==1: Support CHAP. * * Default: 0 (off) */ #ifndef CHAP_SUPPORT #define CHAP_SUPPORT 0 #endif /** * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! * * Default: 0 (off) */ #define MSCHAP_SUPPORT 0 /** * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! * * Default: 0 (off) */ #define CBCP_SUPPORT 0 /** * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! * * Default: 0 (off) */ #define CCP_SUPPORT 0 /** * VJ_SUPPORT==1: Support VJ header compression. * * Default: 0 (off) */ #ifndef VJ_SUPPORT #define VJ_SUPPORT 0 #endif /** * MD5_SUPPORT==1: Support MD5 (see also CHAP). * * Default: 0 (off) */ #ifndef MD5_SUPPORT #define MD5_SUPPORT 0 #endif /* * Timeouts. */ #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ /* Interval in seconds between keepalive echo requests, 0 to disable. */ #if 1 #define LCP_ECHOINTERVAL 0 #else #define LCP_ECHOINTERVAL 10 #endif /* Number of unanswered echo requests before failure. */ #define LCP_MAXECHOFAILS 3 /* Max Xmit idle time (in jiffies) before resend flag char. */ #define PPP_MAXIDLEFLAG 100 /* * Packet sizes * * Note - lcp shouldn't be allowed to negotiate stuff outside these * limits. See lcp.h in the pppd directory. * (XXX - these constants should simply be shared by lcp.c instead * of living in lcp.h) */ #define PPP_MTU 1500 /* Default MTU (size of Info field) */ #if 0 #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) #else #define PPP_MAXMTU 1500 /* Largest MTU we allow */ #endif #define PPP_MINMTU 64 #define PPP_MRU 1500 /* default MRU = max length of info field */ #define PPP_MAXMRU 1500 /* Largest MRU we allow */ #define PPP_DEFMRU 296 /* Try for this */ #define PPP_MINMRU 128 /* No MRUs below this */ #define MAXNAMELEN 256 /* max length of hostname or name for auth */ #define MAXSECRETLEN 256 /* max length of password or secret */ #endif /* PPP_SUPPORT */ /* -------------------------------------- ---------- Checksum options ---------- -------------------------------------- */ /** * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_GEN_IP #define CHECKSUM_GEN_IP 1 #endif /** * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_GEN_UDP #define CHECKSUM_GEN_UDP 1 #endif /** * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_GEN_TCP #define CHECKSUM_GEN_TCP 1 #endif /** * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_CHECK_IP #define CHECKSUM_CHECK_IP 1 #endif /** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_CHECK_UDP #define CHECKSUM_CHECK_UDP 1 #endif /** * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. * * Default: 1 (on) */ #ifndef CHECKSUM_CHECK_TCP #define CHECKSUM_CHECK_TCP 1 #endif /* --------------------------------------- ---------- Debugging options ---------- --------------------------------------- */ /** * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable * debug messages of certain types. * * Default: 0 (no check) */ #ifndef LWIP_DBG_TYPES_ON #define LWIP_DBG_TYPES_ON 0 #endif /** * ETHARP_DEBUG: Enable debugging in etharp.c. * * Default: LWIP_DBG_OFF */ #ifndef ETHARP_DEBUG #define ETHARP_DEBUG LWIP_DBG_OFF #endif /** * NETIF_DEBUG: Enable debugging in netif.c. * * Default: LWIP_DBG_OFF */ #ifndef NETIF_DEBUG #define NETIF_DEBUG LWIP_DBG_OFF #endif /** * PBUF_DEBUG: Enable debugging in pbuf.c. * * Default: LWIP_DBG_OFF */ #ifndef PBUF_DEBUG #define PBUF_DEBUG LWIP_DBG_OFF #endif /** * API_LIB_DEBUG: Enable debugging in api_lib.c. * * Default: LWIP_DBG_OFF */ #ifndef API_LIB_DEBUG #define API_LIB_DEBUG LWIP_DBG_OFF #endif /** * API_MSG_DEBUG: Enable debugging in api_msg.c. * * Default: LWIP_DBG_OFF */ #ifndef API_MSG_DEBUG #define API_MSG_DEBUG LWIP_DBG_OFF #endif /** * SOCKETS_DEBUG: Enable debugging in sockets.c. * * Default: LWIP_DBG_OFF */ #ifndef SOCKETS_DEBUG #define SOCKETS_DEBUG LWIP_DBG_OFF #endif /** * ICMP_DEBUG: Enable debugging in icmp.c. * * Default: LWIP_DBG_OFF */ #ifndef ICMP_DEBUG #define ICMP_DEBUG LWIP_DBG_OFF #endif /** * IGMP_DEBUG: Enable debugging in igmp.c. * * Default: LWIP_DBG_OFF */ #ifndef IGMP_DEBUG #define IGMP_DEBUG LWIP_DBG_OFF #endif /** * INET_DEBUG: Enable debugging in inet.c. * * Default: LWIP_DBG_OFF */ #ifndef INET_DEBUG #define INET_DEBUG LWIP_DBG_OFF #endif /** * IP_DEBUG: Enable debugging for IP. * * Default: LWIP_DBG_OFF */ #ifndef IP_DEBUG #define IP_DEBUG LWIP_DBG_OFF #endif /** * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. * * Default: LWIP_DBG_OFF */ #ifndef IP_REASS_DEBUG #define IP_REASS_DEBUG LWIP_DBG_OFF #endif /** * RAW_DEBUG: Enable debugging in raw.c. * * Default: LWIP_DBG_OFF */ #ifndef RAW_DEBUG #define RAW_DEBUG LWIP_DBG_OFF #endif /** * MEM_DEBUG: Enable debugging in mem.c. * * Default: LWIP_DBG_OFF */ #ifndef MEM_DEBUG #define MEM_DEBUG LWIP_DBG_OFF #endif /** * MEMP_DEBUG: Enable debugging in memp.c. * * Default: LWIP_DBG_OFF */ #ifndef MEMP_DEBUG #define MEMP_DEBUG LWIP_DBG_OFF #endif /** * SYS_DEBUG: Enable debugging in sys.c. * * Default: LWIP_DBG_OFF */ #ifndef SYS_DEBUG #define SYS_DEBUG LWIP_DBG_OFF #endif /** * TCP_DEBUG: Enable debugging for TCP. * * Default: LWIP_DBG_OFF */ #ifndef TCP_DEBUG #define TCP_DEBUG LWIP_DBG_OFF #endif /** * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. * * Default: LWIP_DBG_OFF */ #ifndef TCP_INPUT_DEBUG #define TCP_INPUT_DEBUG LWIP_DBG_OFF #endif /** * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. * * Default: LWIP_DBG_OFF */ #ifndef TCP_FR_DEBUG #define TCP_FR_DEBUG LWIP_DBG_OFF #endif /** * TCP_RTO_DEBUG: Unused. * * Default: LWIP_DBG_OFF */ #ifndef TCP_RTO_DEBUG #define TCP_RTO_DEBUG LWIP_DBG_OFF #endif /** * TCP_REXMIT_DEBUG: Unused. * * Default: LWIP_DBG_OFF */ #ifndef TCP_REXMIT_DEBUG #define TCP_REXMIT_DEBUG LWIP_DBG_OFF #endif /** * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. * * Default: LWIP_DBG_OFF */ #ifndef TCP_CWND_DEBUG #define TCP_CWND_DEBUG LWIP_DBG_OFF #endif /** * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. * * Default: LWIP_DBG_OFF */ #ifndef TCP_WND_DEBUG #define TCP_WND_DEBUG LWIP_DBG_OFF #endif /** * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. * * Default: LWIP_DBG_OFF */ #ifndef TCP_OUTPUT_DEBUG #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF #endif /** * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. * * Default: LWIP_DBG_OFF */ #ifndef TCP_RST_DEBUG #define TCP_RST_DEBUG LWIP_DBG_OFF #endif /** * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. * * Default: LWIP_DBG_OFF */ #ifndef TCP_QLEN_DEBUG #define TCP_QLEN_DEBUG LWIP_DBG_OFF #endif /** * UDP_DEBUG: Enable debugging in UDP. * * Default: LWIP_DBG_OFF */ #ifndef UDP_DEBUG #define UDP_DEBUG LWIP_DBG_OFF #endif /** * TCPIP_DEBUG: Enable debugging in tcpip.c. * * Default: LWIP_DBG_OFF */ #ifndef TCPIP_DEBUG #define TCPIP_DEBUG LWIP_DBG_OFF #endif /** * PPP_DEBUG: Enable debugging for PPP. * * Default: LWIP_DBG_OFF */ #ifndef PPP_DEBUG #define PPP_DEBUG LWIP_DBG_OFF #endif /** * SLIP_DEBUG: unused. * * Default: LWIP_DBG_OFF */ #ifndef SLIP_DEBUG #define SLIP_DEBUG LWIP_DBG_OFF #endif /** * DHCP_DEBUG: Enable debugging in dhcp.c. * * Default: LWIP_DBG_OFF */ #ifndef DHCP_DEBUG #define DHCP_DEBUG LWIP_DBG_OFF #endif /** * AUTOIP_DEBUG: Enable debugging in autoip.c. * * Default: LWIP_DBG_OFF */ #ifndef AUTOIP_DEBUG #define AUTOIP_DEBUG LWIP_DBG_OFF #endif /** * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. * * Default: LWIP_DBG_OFF */ #ifndef SNMP_MSG_DEBUG #define SNMP_MSG_DEBUG LWIP_DBG_OFF #endif /** * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. * * Default: LWIP_DBG_OFF */ #ifndef SNMP_MIB_DEBUG #define SNMP_MIB_DEBUG LWIP_DBG_OFF #endif /** * LWIP_DBG_MIN_LEVEL: Unused. * * Default: LWIP_DBG_LEVEL_OFF */ #ifndef LWIP_DBG_MIN_LEVEL #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF #endif #endif /* __LWIP_OPT_H__ */