/* * Copyright (c) 2001-2003 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 __LWIPOPTS_H__ #define __LWIPOPTS_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. */ #define SYS_LIGHTWEIGHT_PROT 1 /* ------------------------------------ ---------- Memory options ---------- ------------------------------------ */ /** * 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 */ #define MEM_ALIGNMENT 4 /* 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. */ #define MEM_SIZE 8192 /* ------------------------------------------------ ---------- 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. */ #define MEMP_NUM_PBUF 16 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. */ #define MEMP_NUM_TCP_PCB 10 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */ #define MEMP_NUM_TCP_SEG 8 /** * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #define PBUF_POOL_SIZE 12 /* --------------------------------- ---------- ARP options ---------- --------------------------------- */ /* -------------------------------- ---------- IP options ---------- -------------------------------- */ /* ---------------------------------- ---------- ICMP options ---------- ---------------------------------- */ /* --------------------------------- ---------- RAW options ---------- --------------------------------- */ /** * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. */ #define LWIP_RAW 0 /* ---------------------------------- ---------- DHCP options ---------- ---------------------------------- */ /* ------------------------------------ ---------- AUTOIP options ---------- ------------------------------------ */ /* ---------------------------------- ---------- SNMP options ---------- ---------------------------------- */ /* ---------------------------------- ---------- IGMP options ---------- ---------------------------------- */ /* ---------------------------------- ---------- DNS options ----------- ---------------------------------- */ /* --------------------------------- ---------- UDP options ---------- --------------------------------- */ /* --------------------------------- ---------- TCP options ---------- --------------------------------- */ /** * TCP_WND: The size of a TCP window. This must be at least * (2 * TCP_MSS) for things to work well */ #define TCP_WND (4 * TCP_MSS) /** * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, * you might want to increase this.) * For the receive side, this MSS is advertised to the remote side * when opening a connection. For the transmit size, this MSS sets * an upper limit on the MSS advertised by the remote host. */ #define TCP_MSS LWIP_MEM_ALIGN_SIZE(1500 - PBUF_LINK_HLEN - 40) /** * TCP_SND_BUF: TCP sender buffer space (bytes). */ #define TCP_SND_BUF (4 * TCP_MSS) /** * 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. */ #define TCP_SND_QUEUELEN 12 /* ---------------------------------- ---------- 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. */ #define PBUF_POOL_BUFSIZE 640 /* ------------------------------------------------ ---------- Network Interfaces options ---------- ------------------------------------------------ */ /* ------------------------------------ ---------- LOOPIF options ---------- ------------------------------------ */ /* ------------------------------------ ---------- SLIPIF options ---------- ------------------------------------ */ /* ------------------------------------ ---------- Thread options ---------- ------------------------------------ */ /** * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. */ #define TCPIP_THREAD_NAME "lwIP" /** * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. * The stack size value itself is platform-dependent, but is passed to * sys_thread_new() when the thread is created. */ #define TCPIP_THREAD_STACKSIZE 2048 /** * 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 the thread is created. */ #define TCPIP_THREAD_PRIO 3 /** * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages * The queue size value itself is platform-dependent, but is passed to * sys_mbox_new() when tcpip_init is called. */ #define TCPIP_MBOX_SIZE 6 /** * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. */ #define DEFAULT_UDP_RECVMBOX_SIZE 6 /** * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. */ #define DEFAULT_TCP_RECVMBOX_SIZE 6 /** * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. * The queue size value itself is platform-dependent, but is passed to * sys_mbox_new() when the acceptmbox is created. */ #define DEFAULT_ACCEPTMBOX_SIZE 4 /* ---------------------------------------------- ---------- Sequential layer options ---------- ---------------------------------------------- */ /* ------------------------------------ ---------- Socket options ---------- ------------------------------------ */ /** * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) */ #define LWIP_SOCKET 0 /* ---------------------------------------- ---------- Statistics options ---------- ---------------------------------------- */ /** * LWIP_STATS==1: Enable statistics collection in lwip_stats. */ #define LWIP_STATS 1 /** * ETHARP_STATS==1: Enable etharp stats. */ #define ETHARP_STATS 0 /** * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is * on if using either frag or reass. */ #define IPFRAG_STATS 0 /** * ICMP_STATS==1: Enable ICMP stats. */ #define ICMP_STATS 0 /** * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). */ #define SYS_STATS 0 /* --------------------------------------- ---------- Debugging options ---------- --------------------------------------- */ /** * To suppress some errors for now (no debug output) */ #define LWIP_NOASSERT //#define LWIP_DEBUG /** * MEM_DEBUG: Enable debugging in mem.c. */ #define MEM_DEBUG LWIP_DBG_ON /** * MEMP_DEBUG: Enable debugging in memp.c. */ #define MEMP_DEBUG LWIP_DBG_ON /** * TCP_DEBUG: Enable debugging for TCP. */ #define TCP_DEBUG LWIP_DBG_ON /** * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. */ #define TCP_OUTPUT_DEBUG LWIP_DBG_ON /** * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. */ #define TCP_QLEN_DEBUG LWIP_DBG_ON #endif /* __LWIPOPTS_H__ */