SAMV71 Xplained Ultra Software Package 1.4

lwipopts.h

00001 /* ----------------------------------------------------------------------------
00002  *         ATMEL Microcontroller Software Support
00003  * ----------------------------------------------------------------------------
00004  * Copyright (c) 2010, Atmel Corporation
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are met:
00010  *
00011  * - Redistributions of source code must retain the above copyright notice,
00012  * this list of conditions and the disclaimer below.
00013  *
00014  * Atmel's name may not be used to endorse or promote products derived from
00015  * this software without specific prior written permission.
00016  *
00017  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
00020  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00023  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00024  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00025  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00026  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  * ----------------------------------------------------------------------------
00028  */
00029 
00030 #ifndef _LWIPOPTS_H
00031 #define _LWIPOPTS_H
00032 
00033 /*
00034    -----------------------------------------------
00035    ---------- Platform specific locking ----------
00036    -----------------------------------------------
00037 */
00038 
00039 /**
00040  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
00041  * use lwIP facilities.
00042  */
00043 #define NO_SYS                          1
00044 
00045 
00046 /*
00047    ------------------------------------
00048    ---------- Memory options ----------
00049    ------------------------------------
00050 */
00051 /**
00052  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
00053  * instead of the lwip internal allocator. Can save code size if you
00054  * already use it.
00055  */
00056 #define MEM_LIBC_MALLOC                 0
00057 
00058 /**
00059  * MEM_ALIGNMENT: should be set to the alignment of the CPU
00060  *    4 byte alignment -> #define MEM_ALIGNMENT 4
00061  *    2 byte alignment -> #define MEM_ALIGNMENT 2
00062  */
00063 #define MEM_ALIGNMENT                   4
00064 
00065 /**
00066  * MEM_SIZE: the size of the heap memory. If the application will send
00067  * a lot of data that needs to be copied, this should be set high.
00068  */
00069 #define MEM_SIZE                        1600
00070 
00071 /**
00072  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
00073  * amount of bytes before and after each memp element in every pool and fills
00074  * it with a prominent default value.
00075  *    MEMP_OVERFLOW_CHECK == 0 no checking
00076  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
00077  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
00078  *      memp_malloc() or memp_free() is called (useful but slow!)
00079  */
00080 #define MEMP_OVERFLOW_CHECK             0
00081 
00082 /**
00083  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
00084  * sure that there are no cycles in the linked lists.
00085  */
00086 #define MEMP_SANITY_CHECK               0
00087 
00088 /*
00089    ------------------------------------------------
00090    ---------- Internal Memory Pool Sizes ----------
00091    ------------------------------------------------
00092 */
00093 /**
00094  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
00095  * If the application sends a lot of data out of ROM (or other static memory),
00096  * this should be set high.
00097  */
00098 #define MEMP_NUM_PBUF                   4
00099 
00100 /**
00101  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
00102  * (requires the LWIP_RAW option)
00103  */
00104 #define MEMP_NUM_RAW_PCB                0
00105 
00106 /**
00107  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00108  * per active UDP "connection".
00109  * (requires the LWIP_UDP option)
00110  */
00111 #define MEMP_NUM_UDP_PCB                1
00112 
00113 /**
00114  * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
00115  * (requires the LWIP_TCP option)
00116  */
00117 #define MEMP_NUM_TCP_PCB                2
00118 
00119 /**
00120  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
00121  * (requires the LWIP_TCP option)
00122  */
00123 #define MEMP_NUM_TCP_PCB_LISTEN         2
00124 
00125 /**
00126  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
00127  * (requires the LWIP_TCP option)
00128  */
00129 #define MEMP_NUM_TCP_SEG                5
00130 
00131 /**
00132  * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
00133  * (requires NO_SYS==0)
00134  */
00135 #define MEMP_NUM_SYS_TIMEOUT            2
00136 
00137 /**
00138  * MEMP_NUM_NETBUF: the number of struct netbufs.
00139  * (only needed if you use the sequential API, like api_lib.c)
00140  */
00141 #define MEMP_NUM_NETBUF                 0
00142 /**
00143  * MEMP_NUM_NETCONN: the number of struct netconns.
00144  * (only needed if you use the sequential API, like api_lib.c)
00145  */
00146 #define MEMP_NUM_NETCONN                0
00147 
00148 /**
00149  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
00150  */
00151 #define PBUF_POOL_SIZE                  6
00152 
00153 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
00154 #define PBUF_POOL_BUFSIZE               256
00155 
00156 /*
00157    ---------------------------------
00158    ---------- ARP options ----------
00159    ---------------------------------
00160 */
00161 /**
00162  * LWIP_ARP==1: Enable ARP functionality.
00163  */
00164 #define LWIP_ARP                        1
00165 
00166 /**
00167  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
00168  */
00169 #define ARP_TABLE_SIZE                  2
00170 
00171 /**
00172  * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
00173  * resolution.
00174  */
00175 #define ARP_QUEUEING                    0
00176 
00177 /*
00178    --------------------------------
00179    ---------- IP options ----------
00180    --------------------------------
00181 */
00182 /**
00183  * IP_FORWARD==1: Enables the ability to forward IP packets across network
00184  * interfaces. If you are going to run lwIP on a device with only one network
00185  * interface, define this to 0.
00186  */
00187 #define IP_FORWARD                      0
00188 
00189 /**
00190  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
00191  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
00192  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
00193  */
00194 #define IP_OPTIONS_ALLOWED              0
00195 
00196 /**
00197  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
00198  * this option does not affect outgoing packet sizes, which can be controlled
00199  * via IP_FRAG.
00200  */
00201 #define IP_REASSEMBLY                   0
00202 
00203 /**
00204  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
00205  * that this option does not affect incoming packet sizes, which can be
00206  * controlled via IP_REASSEMBLY.
00207  */
00208 #define IP_FRAG                         0
00209 
00210 /**
00211  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
00212  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
00213  * in this time, the whole packet is discarded.
00214  */
00215 #define IP_REASS_MAXAGE                 3
00216 
00217 /**
00218  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
00219  * Since the received pbufs are enqueued, be sure to configure
00220  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
00221  * packets even if the maximum amount of fragments is enqueued for reassembly!
00222  */
00223 #define IP_REASS_BUFSIZE                2048
00224 
00225 /**
00226  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
00227  * (requires IP_FRAG_USES_STATIC_BUF==1)
00228  */
00229 #define IP_FRAG_MAX_MTU                 1500
00230 
00231 /*
00232    ----------------------------------
00233    ---------- ICMP options ----------
00234    ----------------------------------
00235 */
00236 /**
00237  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
00238  * Be careful, disable that make your product non-compliant to RFC1122
00239  */
00240 #define LWIP_ICMP                       1
00241 
00242 /**
00243  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
00244  */
00245 #define ICMP_TTL                       (IP_DEFAULT_TTL)
00246 
00247 
00248 /*
00249    ---------------------------------
00250    ---------- RAW options ----------
00251    ---------------------------------
00252 */
00253 /**
00254  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
00255  */
00256 #define LWIP_RAW                        0
00257 
00258 /*
00259    ----------------------------------
00260    ---------- DHCP options ----------
00261    ----------------------------------
00262 */
00263 /**
00264  * LWIP_DHCP==1: Enable DHCP module.
00265  */
00266 #define LWIP_DHCP                       0
00267 
00268 /*
00269    ----------------------------------
00270    ---------- SNMP options ----------
00271    ----------------------------------
00272 */
00273 /**
00274  * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
00275  * transport.
00276  */
00277 #define LWIP_SNMP                       0
00278 
00279 /*
00280    ---------------------------------
00281    ---------- UDP options ----------
00282    ---------------------------------
00283 */
00284 /**
00285  * LWIP_UDP==1: Turn on UDP.
00286  */
00287 #define LWIP_UDP                        0
00288 
00289 /*
00290    ---------------------------------
00291    ---------- TCP options ----------
00292    ---------------------------------
00293 */
00294 /**
00295  * LWIP_TCP==1: Turn on TCP.
00296  */
00297 #define LWIP_TCP                        1
00298 
00299 
00300 /**
00301  * TCP_WND: The size of a TCP window.  This must be at least
00302  * (2 * TCP_MSS) for things to work well
00303  */
00304 #define TCP_WND                         1024
00305 
00306 /**
00307  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
00308  */
00309 #define TCP_SYNMAXRTX                   2
00310 
00311 /**
00312  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
00313  * Define to 0 if your device is low on memory.
00314  */
00315 #define TCP_QUEUE_OOSEQ                 0
00316 
00317 /**
00318  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
00319  * you might want to increase this.)
00320  * For the receive side, this MSS is advertised to the remote side
00321  * when opening a connection. For the transmit size, this MSS sets
00322  * an upper limit on the MSS advertised by the remote host.
00323  */
00324 #define TCP_MSS                         128
00325 
00326 /**
00327  * TCP_SND_BUF: TCP sender buffer space (bytes).
00328  */
00329 #define TCP_SND_BUF                     1536
00330 
00331 /**
00332  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
00333  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
00334  */
00335 #define TCP_SND_QUEUELEN                2 * TCP_SND_BUF/TCP_MSS
00336 
00337 /*
00338    ------------------------------------
00339    ---------- LOOPIF options ----------
00340    ------------------------------------
00341 */
00342 /**
00343  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
00344  */
00345 #define LWIP_HAVE_LOOPIF                0
00346 
00347 /*
00348    ----------------------------------------------
00349    ---------- Sequential layer options ----------
00350    ----------------------------------------------
00351 */
00352 
00353 /**
00354  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
00355  */
00356 #define LWIP_NETCONN                    0
00357 
00358 /*
00359    ------------------------------------
00360    ---------- Socket options ----------
00361    ------------------------------------
00362 */
00363 /**
00364  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
00365  */
00366 #define LWIP_SOCKET                     0
00367 
00368 
00369 /*
00370    ----------------------------------------
00371    ---------- Statistics options ----------
00372    ----------------------------------------
00373 */
00374 /**
00375  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
00376  */
00377 #define LWIP_STATS                      0
00378 
00379 /*
00380    ---------------------------------------
00381    ---------- Debugging options ----------
00382    ---------------------------------------
00383 */
00384 
00385 /**
00386  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
00387  * debug messages of certain types.
00388  */
00389 #define LWIP_DBG_TYPES_ON               LWIP_DBG_OFF
00390 
00391 /**
00392  * TCP_DEBUG: Enable debugging for TCP.
00393  */
00394 #define TCP_DEBUG                       LWIP_DBG_ON
00395 
00396 /**
00397  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
00398  */
00399 #define TCP_INPUT_DEBUG                 LWIP_DBG_ON
00400 
00401 /**
00402  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
00403  */
00404 #define TCP_OUTPUT_DEBUG                LWIP_DBG_ON
00405 
00406 /*
00407    ---------------------------------------
00408    ---------- Misc ----------
00409    ---------------------------------------
00410 */
00411 
00412 /* No assert */
00413 #define LWIP_NOASSERT
00414 
00415 /* No error output */
00416 #define LWIP_ERROR(message, expression, handler)
00417 
00418 #endif /* #ifndef _LWIPOPTS_H */
00419 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines