- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

# lwipopts.h

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

The Make Controller Kit is an open source project maintained by MakingThings.
MakingThings code is released under the Apache 2.0 license.
Bug tracker, development wiki and status can be found at http://dev.makingthings.com.
This document was last updated on 18 May 2009.