# lwipopts.h

Go to the documentation of this file.

    00001 /*
    00002  * Copyright (c) 2001, Swedish Institute of Computer Science.
    00003  * All rights reserved.
    00004  *
    00005  * Redistribution and use in source and binary forms, with or without
    00006  * modification, are permitted provided that the following conditions
    00007  * are met:
    00008  * 1. Redistributions of source code must retain the above copyright
    00009  *    notice, this list of conditions and the following disclaimer.
    00010  * 2. Redistributions in binary form must reproduce the above copyright
    00011  *    notice, this list of conditions and the following disclaimer in the
    00012  *    documentation and/or other materials provided with the distribution.
    00013  * 3. Neither the name of the Institute nor the names of its contributors
    00014  *    may be used to endorse or promote products derived from this software
    00015  *    without specific prior written permission.
    00016  *
    00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
    00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
    00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    00027  * SUCH DAMAGE.
    00028  *
    00029  * This file is part of the lwIP TCP/IP stack.
    00030  *
    00031  * Author: Adam Dunkels <adam@sics.se>
    00032  *
    00033  * $Id: lwipopts_8h-source.html 88 2016-01-12 00:11:29Z reddawg $
    00034  */
    00035 #ifndef __LWIPOPTS_H__
    00036 #define __LWIPOPTS_H__
    00037
    00038 /* ---------- Memory options ---------- */
    00039 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
    00040    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
    00041    byte alignment -> define MEM_ALIGNMENT to 2. */
    00042 #define MEM_ALIGNMENT           2
    00043
    00044 /* MEM_SIZE: the size of the heap memory. If the application will send
    00045 a lot of data that needs to be copied, this should be set high. */
    00046 #define MEM_SIZE                1000
    00047
    00048 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
    00049    sends a lot of data out of ROM (or other static memory), this
    00050    should be set high. */
    00051 #define MEMP_NUM_PBUF           8
    00052 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
    00053    per active UDP "connection". */
    00054 #define MEMP_NUM_UDP_PCB        4
    00055 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
    00056    connections. */
    00057 #define MEMP_NUM_TCP_PCB        5
    00058 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
    00059    connections. */
    00060 #define MEMP_NUM_TCP_PCB_LISTEN 8
    00061 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
    00062    segments. */
    00063 #define MEMP_NUM_TCP_SEG        8
    00064 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
    00065    timeouts. */
    00066 #define MEMP_NUM_SYS_TIMEOUT    3
    00067
    00068
    00069 /* The following four are used only with the sequential API and can be
    00070    set to 0 if the application only will use the raw API. */
    00071 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
    00072 #define MEMP_NUM_NETBUF         2
    00073 /* MEMP_NUM_NETCONN: the number of struct netconns. */
    00074 #define MEMP_NUM_NETCONN        4
    00075 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for
    00076    communication between the TCP/IP stack and the sequential
    00077    programs. */
    00078 #define MEMP_NUM_API_MSG        8
    00079 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
    00080    for sequential API communication and incoming packets. Used in
    00081    src/api/tcpip.c. */
    00082 #define MEMP_NUM_TCPIP_MSG      8
    00083
    00084 /* These two control is reclaimer functions should be compiled
    00085    in. Should always be turned on (1). */
    00086 #define MEM_RECLAIM             1
    00087 #define MEMP_RECLAIM            1
    00088
    00089 /* ---------- Pbuf options ---------- */
    00090 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
    00091 #define PBUF_POOL_SIZE          6
    00092
    00093 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
    00094 #define PBUF_POOL_BUFSIZE       128
    00095
    00096 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
    00097    link level header. */
    00098 #define PBUF_LINK_HLEN          16
    00099
    00100 /* ---------- TCP options ---------- */
    00101 #define LWIP_TCP                1
    00102 #define TCP_TTL                 255
    00103
    00104 /* Controls if TCP should queue segments that arrive out of
    00105    order. Define to 0 if your device is low on memory. */
    00106 #define TCP_QUEUE_OOSEQ         1
    00107
    00108 /* TCP Maximum segment size. */
    00109 #define TCP_MSS                 128
    00110
    00111 /* TCP sender buffer space (bytes). */
    00112 #define TCP_SND_BUF             256
    00113
    00114 /* TCP sender buffer space (pbufs). This must be at least = 2 *
    00115    TCP_SND_BUF/TCP_MSS for things to work. */
    00116 #define TCP_SND_QUEUELEN        4 * TCP_SND_BUF/TCP_MSS
    00117
    00118 /* TCP receive window. */
    00119 #define TCP_WND                 1024
    00120
    00121 /* Maximum number of retransmissions of data segments. */
    00122 #define TCP_MAXRTX              12
    00123
    00124 /* Maximum number of retransmissions of SYN segments. */
    00125 #define TCP_SYNMAXRTX           4
    00126
    00127 /* ---------- ARP options ---------- */
    00128 #define ARP_TABLE_SIZE 10
    00129
    00130 /* ---------- IP options ---------- */
    00131 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
    00132    IP packets across network interfaces. If you are going to run lwIP
    00133    on a device with only one network interface, define this to 0. */
    00134 #define IP_FORWARD              1
    00135
    00136 /* If defined to 1, IP options are allowed (but not parsed). If
    00137    defined to 0, all packets with IP options are dropped. */
    00138 #define IP_OPTIONS              1
    00139
    00140 /* ---------- ICMP options ---------- */
    00141 #define ICMP_TTL                255
    00142
    00143
    00144 /* ---------- DHCP options ---------- */
    00145 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
    00146    interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
    00147    turning this on does currently not work. */
    00148 #define LWIP_DHCP               0
    00149
    00150 /* 1 if you want to do an ARP check on the offered address
    00151    (recommended). */
    00152 #define DHCP_DOES_ARP_CHECK     1
    00153
    00154 /* ---------- UDP options ---------- */
    00155 #define LWIP_UDP                1
    00156 #define UDP_TTL                 255
    00157
    00158
    00159 /* ---------- Statistics options ---------- */
    00160 #define STATS
    00161
    00162 #ifdef STATS
    00163 #define LINK_STATS
    00164 #define IP_STATS
    00165 #define ICMP_STATS
    00166 #define UDP_STATS
    00167 #define TCP_STATS
    00168 #define MEM_STATS
    00169 #define MEMP_STATS
    00170 #define PBUF_STATS
    00171 #define SYS_STATS
    00172 #endif /* STATS */
    00173
    00174 #endif /* __LWIPOPTS_H__ */