- Main Page
- Data Structures
- Files

# lwipopts.h

Go to the documentation of this file.

    00001
    00014 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
    00015  *
    00016  * Redistribution and use in source and binary forms, with or without
    00017  * modification, are permitted provided that the following conditions are met:
    00018  *
    00019  * 1. Redistributions of source code must retain the above copyright notice, this
    00020  * list of conditions and the following disclaimer.
    00021  *
    00022  * 2. Redistributions in binary form must reproduce the above copyright notice,
    00023  * this list of conditions and the following disclaimer in the documentation
    00024  * and/or other materials provided with the distribution.
    00025  *
    00026  * 3. The name of Atmel may not be used to endorse or promote products derived
    00027  * from this software without specific prior written permission.
    00028  *
    00029  * 4. This software may only be redistributed and used in connection with an Atmel
    00030  * AVR product.
    00031  *
    00032  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
    00033  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00034  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
    00035  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
    00036  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00037  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00038  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00039  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00040  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    00041  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
    00042  *
    00043  */
    00044
    00045
    00046 #ifndef __LWIPOPTS_H__
    00047 #define __LWIPOPTS_H__
    00048
    00049 /* Include user defined options first */
    00050 // #include "conf_eth.h"
    00051 #include "conf_lwip_threads.h"
    00052
    00053
    00054 /* Define default values for unconfigured parameters. */
    00055 #define LWIP_NOASSERT 1 // To suppress some errors for now (no debug output)
    00056
    00057 /* These two control is reclaimer functions should be compiled
    00058    in. Should always be turned on (1). */
    00059 #define MEM_RECLAIM             1
    00060 #define MEMP_RECLAIM            1
    00061
    00062
    00063 /* Platform specific locking */
    00064
    00065 /*
    00066  * enable SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
    00067  * for certain critical regions during buffer allocation, deallocation and memory
    00068  * allocation and deallocation.
    00069  */
    00070 #define SYS_LIGHTWEIGHT_PROT            1
    00071
    00072 /* ---------- DHCP options ---------- */
    00073 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
    00074    interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
    00075    turning this on does currently not work. */
    00076 #define LWIP_DHCP               0
    00077
    00078 /* 1 if you want to do an ARP check on the offered address
    00079    (recommended). */
    00080 // #define DHCP_DOES_ARP_CHECK     1
    00081
    00082 /* ---------- DNS options ---------- */
    00083 /* LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
    00084  * transport.
    00085  */
    00086 #define LWIP_DNS                        0
    00087
    00089 #define DNS_SERVER_ADDRESS        inet_addr("10.172.30.11") /* corp.atmel.com */
    00090
    00091
    00092 /* ---------- HOSTNAME options ---------- */
    00093 /* LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
    00094  * field.
    00095  */
    00096 #define LWIP_NETIF_HOSTNAME             1
    00097
    00098 /* ---------- Memory options ---------- */
    00099
    00100 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
    00101    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
    00102    byte alignment -> define MEM_ALIGNMENT to 2. */
    00103 #define MEM_ALIGNMENT           4
    00104
    00105 /* MEM_SIZE: the size of the heap memory. If the application will send
    00106 a lot of data that needs to be copied, this should be set high. */
    00107 #define MEM_SIZE                3 * 1024
    00108
    00109
    00110 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
    00111    sends a lot of data out of ROM (or other static memory), this
    00112    should be set high. */
    00113 #define MEMP_NUM_PBUF           6
    00114
    00115 /* Number of raw connection PCBs */
    00116 #define MEMP_NUM_RAW_PCB                1
    00117
    00118 #if (TFTP_USED == 1)||(LWIP_DHCP ==1)
    00119   /* ---------- UDP options ---------- */
    00120   #define LWIP_UDP                1
    00121   #define UDP_TTL                 255
    00122   /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
    00123      per active UDP "connection". */
    00124
    00125   #define MEMP_NUM_UDP_PCB        1
    00126 #else
    00127   /* ---------- UDP options ---------- */
    00128   #define LWIP_UDP                0
    00129   #define UDP_TTL                 0
    00130   /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
    00131      per active UDP "connection". */
    00132
    00133   #define MEMP_NUM_UDP_PCB        0
    00134 #endif
    00135
    00136 /* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. */
    00137 #define MEMP_NUM_TCP_PCB        2
    00138 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */
    00139 #define MEMP_NUM_TCP_PCB_LISTEN 1
    00140 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */
    00141 #define MEMP_NUM_TCP_SEG        9
    00142 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */
    00143 #define MEMP_NUM_SYS_TIMEOUT    6
    00144
    00145 /* The following four are used only with the sequential API and can be
    00146    set to 0 if the application only will use the raw API. */
    00147 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
    00148 #define MEMP_NUM_NETBUF         3
    00149 /* MEMP_NUM_NETCONN: the number of struct netconns. */
    00150 #define MEMP_NUM_NETCONN        4
    00151
    00152
    00153 /* ---------- Pbuf options ---------- */
    00154 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
    00155
    00156 #define PBUF_POOL_SIZE          6
    00157
    00158 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
    00159
    00160 #define PBUF_POOL_BUFSIZE       500
    00161
    00162 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
    00163    link level header. */
    00164 #define PBUF_LINK_HLEN          16
    00165
    00166 /* ---------- TCP options ---------- */
    00167 #define LWIP_TCP                1
    00168 #define TCP_TTL                 255
    00169 /* TCP receive window. */
    00170 #define TCP_WND                 1500
    00171 /* Controls if TCP should queue segments that arrive out of
    00172    order. Define to 0 if your device is low on memory. */
    00173 #define TCP_QUEUE_OOSEQ         1
    00174
    00175 /* TCP Maximum segment size. */
    00176 #define TCP_MSS                 1500
    00177
    00178 /* TCP sender buffer space (bytes). */
    00179 #define TCP_SND_BUF             2150
    00180
    00181 /* TCP sender buffer space (pbufs). This must be at least = 2 *
    00182    TCP_SND_BUF/TCP_MSS for things to work. */
    00183 #define TCP_SND_QUEUELEN        6 * TCP_SND_BUF/TCP_MSS
    00184
    00185
    00186
    00187 /* Maximum number of retransmissions of data segments. */
    00188 #define TCP_MAXRTX              12
    00189
    00190 /* Maximum number of retransmissions of SYN segments. */
    00191 #define TCP_SYNMAXRTX           4
    00192
    00193
    00199 #define DEFAULT_RAW_RECVMBOX_SIZE       6
    00200
    00206 #define DEFAULT_UDP_RECVMBOX_SIZE       6
    00207
    00213 #define DEFAULT_TCP_RECVMBOX_SIZE       6
    00214
    00215
    00221 #define DEFAULT_ACCEPTMBOX_SIZE         6
    00222
    00223 /* ---------- ARP options ---------- */
    00224 #define ARP_TABLE_SIZE 10
    00225 #define ARP_QUEUEING 0
    00226
    00227 /* ---------- IP options ---------- */
    00228 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
    00229    IP packets across network interfaces. If you are going to run lwIP
    00230    on a device with only one network interface, define this to 0. */
    00231 #define IP_FORWARD              0
    00232
    00233 /* If defined to 1, IP options are allowed (but not parsed). If
    00234    defined to 0, all packets with IP options are dropped. */
    00235 #define IP_OPTIONS              1
    00236
    00237 /* ---------- ICMP options ---------- */
    00238 #define ICMP_TTL                255
    00239
    00240 /* ---------- CallBack options ---------- */
    00241 #define LWIP_NETIF_STATUS_CALLBACK 1
    00242
    00243
    00244
    00245
    00246 /*
    00247    ------------------------------------
    00248    ---------- Thread options ----------
    00249    ------------------------------------
    00250 */
    00254 #define TCPIP_THREAD_NAME              "TCP/IP"
    00255
    00261 #define TCPIP_THREAD_STACKSIZE          lwipINTERFACE_STACK_SIZE
    00262
    00268 #define TCPIP_THREAD_PRIO               lwipINTERFACE_TASK_PRIORITY
    00269
    00275 #define TCPIP_MBOX_SIZE                 6
    00276
    00280 #define SLIPIF_THREAD_NAME             "slipif"
    00281
    00287 #define SLIPIF_THREAD_STACKSIZE         configMINIMAL_STACK_SIZE
    00288
    00294 #define SLIPIF_THREAD_PRIO              1
    00295
    00299 #define PPP_THREAD_NAME                "pppMain"
    00300
    00306 #define PPP_THREAD_STACKSIZE            configMINIMAL_STACK_SIZE
    00307
    00313 #define PPP_THREAD_PRIO                 1
    00314
    00318 #define DEFAULT_THREAD_NAME            "lwIP"
    00319
    00325 #define DEFAULT_THREAD_STACKSIZE        configMINIMAL_STACK_SIZE
    00326
    00332 #define DEFAULT_THREAD_PRIO             1
    00333
    00334
    00335 /* ---------- Statistics options ---------- */
    00336 #define LWIP_STATS 1
    00337
    00338 #define LWIP_STATS_DISPLAY 1
    00339
    00340 #if LWIP_STATS
    00341 #define LINK_STATS 1
    00342 #define IP_STATS   1
    00343 #define ICMP_STATS 1
    00344 #define UDP_STATS  1
    00345 #define TCP_STATS  1
    00346 #define MEM_STATS  1
    00347 #define MEMP_STATS 1
    00348 #define PBUF_STATS 1
    00349 #define SYS_STATS  1
    00350 #endif /* STATS */
    00351
    00352 /* ---------- Lwip Debug options ---------- */
    00353 #ifdef LWIP_DEBUG
    00354
    00355 #define LWIP_DBG_MIN_LEVEL         LWIP_DBG_LEVEL_SEVERE
    00356 #define PPP_DEBUG                  LWIP_DBG_OFF
    00357 #define MEM_DEBUG                  LWIP_DBG_OFF
    00358 #define MEMP_DEBUG                 LWIP_DBG_OFF
    00359 #define PBUF_DEBUG                 LWIP_DBG_OFF
    00360 #define API_LIB_DEBUG              LWIP_DBG_OFF
    00361 #define API_MSG_DEBUG              LWIP_DBG_OFF
    00362 #define TCPIP_DEBUG                LWIP_DBG_OFF
    00363 #define NETIF_DEBUG                LWIP_DBG_OFF
    00364 #define SOCKETS_DEBUG              LWIP_DBG_OFF
    00365 #define DNS_DEBUG                  LWIP_DBG_ON
    00366 #define AUTOIP_DEBUG               LWIP_DBG_OFF
    00367 #define DHCP_DEBUG                 LWIP_DBG_ON
    00368 #define IP_DEBUG                   LWIP_DBG_OFF
    00369 #define IP_REASS_DEBUG             LWIP_DBG_OFF
    00370 #define ICMP_DEBUG                 LWIP_DBG_OFF
    00371 #define IGMP_DEBUG                 LWIP_DBG_OFF
    00372 #define UDP_DEBUG                  LWIP_DBG_ON
    00373 #define TCP_DEBUG                  LWIP_DBG_ON
    00374 #define TCP_INPUT_DEBUG            LWIP_DBG_OFF
    00375 #define TCP_OUTPUT_DEBUG           LWIP_DBG_OFF
    00376 #define TCP_RTO_DEBUG              LWIP_DBG_OFF
    00377 #define TCP_CWND_DEBUG             LWIP_DBG_OFF
    00378 #define TCP_WND_DEBUG              LWIP_DBG_OFF
    00379 #define TCP_FR_DEBUG               LWIP_DBG_OFF
    00380 #define TCP_QLEN_DEBUG             LWIP_DBG_OFF
    00381 #define TCP_RST_DEBUG              LWIP_DBG_OFF
    00382 #endif /* LWIP_DEBUG */
    00383
    00384 //#define LWIP_DBG_TYPES_ON         (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
    00385 #define LWIP_DBG_TYPES_ON         (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH)
    00386 #endif /* __LWIPOPTS_H__ */