00001 /*This file has been prepared for Doxygen automatic documentation generation.*/ 00015 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions are met: 00019 * 00020 * 1. Redistributions of source code must retain the above copyright notice, this 00021 * list of conditions and the following disclaimer. 00022 * 00023 * 2. Redistributions in binary form must reproduce the above copyright notice, 00024 * this list of conditions and the following disclaimer in the documentation 00025 * and/or other materials provided with the distribution. 00026 * 00027 * 3. The name of Atmel may not be used to endorse or promote products derived 00028 * from this software without specific prior written permission. 00029 * 00030 * 4. This software may only be redistributed and used in connection with an Atmel 00031 * AVR product. 00032 * 00033 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00034 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00035 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00036 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00037 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00038 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00039 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00040 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00041 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00042 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00043 * 00044 */ 00045 #ifndef __LWIPOPTS_H__ 00046 #define __LWIPOPTS_H__ 00047 00048 /* Include user defined options first */ 00049 // #include "conf_eth.h" 00050 #include "conf_lwip_threads.h" 00051 #include "lwip/debug.h" 00052 #include "tracedump.h" 00053 00054 #define LWIP_PLATFORM_DIAG(x) NAKED_TRACE_COM2 x 00055 #define LWIP_PLATFORM_ASSERT(x) NAKED_TRACE_COM2(x) 00056 00057 00058 /* Define default values for unconfigured parameters. */ 00059 #define LWIP_NOASSERT 1 // To suppress some errors for now (no debug output) 00060 00061 /* Platform specific locking */ 00062 00063 /* 00064 * enable SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection 00065 * for certain critical regions during buffer allocation, deallocation and memory 00066 * allocation and deallocation. 00067 */ 00068 #define SYS_LIGHTWEIGHT_PROT 1 00069 00070 /* ---------- Memory options ---------- */ 00071 00072 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which 00073 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 00074 byte alignment -> define MEM_ALIGNMENT to 2. */ 00075 #define MEM_ALIGNMENT 4 00076 00077 /* MEM_SIZE: the size of the heap memory. If the application will send 00078 a lot of data that needs to be copied, this should be set high. */ 00079 #define MEM_SIZE 4 * 1024 00080 00081 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application 00082 sends a lot of data out of ROM (or other static memory), this 00083 should be set high. */ 00084 #define MEMP_NUM_PBUF 0 00085 00086 /* Number of raw connection PCBs */ 00087 #define MEMP_NUM_RAW_PCB 0 00088 00089 #if (TFTP_USED == 1) 00090 /* ---------- UDP options ---------- */ 00091 #define LWIP_UDP 1 00092 #define UDP_TTL 255 00093 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 00094 per active UDP "connection". */ 00095 #define MEMP_NUM_UDP_PCB 1 00096 #else 00097 /* ---------- UDP options ---------- */ 00098 #define LWIP_UDP 0 00099 #define UDP_TTL 0 00100 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 00101 per active UDP "connection". */ 00102 #define MEMP_NUM_UDP_PCB 0 00103 #endif 00104 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP 00105 connections. */ 00106 #define MEMP_NUM_TCP_PCB 15 00107 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP 00108 connections. */ 00109 #define MEMP_NUM_TCP_PCB_LISTEN 1 00110 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP 00111 segments. */ 00112 #define MEMP_NUM_TCP_SEG 9 00113 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active 00114 timeouts. */ 00115 #define MEMP_NUM_SYS_TIMEOUT 4 00116 00117 /* The following four are used only with the sequential API and can be 00118 set to 0 if the application only will use the raw API. */ 00119 /* MEMP_NUM_NETBUF: the number of struct netbufs. */ 00120 #define MEMP_NUM_NETBUF 3 00121 /* MEMP_NUM_NETCONN: the number of struct netconns. */ 00122 #define MEMP_NUM_NETCONN 6 00123 00124 00125 /* ---------- Pbuf options ---------- */ 00126 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ 00127 00128 #define PBUF_POOL_SIZE 10 00129 00130 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ 00131 00132 #define PBUF_POOL_BUFSIZE 512 00133 00134 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a 00135 link level header. Defaults to 14 for Ethernet. */ 00136 00137 #define PBUF_LINK_HLEN 14 00138 00139 00145 #define DEFAULT_RAW_RECVMBOX_SIZE 6 00146 00152 #define DEFAULT_UDP_RECVMBOX_SIZE 6 00153 00159 #define DEFAULT_TCP_RECVMBOX_SIZE 6 00160 00161 00167 #define DEFAULT_ACCEPTMBOX_SIZE 6 00168 00169 /* ---------- ARP options ---------- */ 00170 00172 #define ARP_TABLE_SIZE 5 00173 00186 #undef ARP_QUEUEING 00187 // #define ARP_QUEUEING 0 00188 00189 00190 /* ---------- IP options ---------- */ 00191 /* Define IP_FORWARD to 1 if you wish to have the ability to forward 00192 IP packets across network interfaces. If you are going to run lwIP 00193 on a device with only one network interface, define this to 0. */ 00194 #define IP_FORWARD 0 00195 00196 /* If defined to 1, IP options are allowed (but not parsed). If 00197 defined to 0, all packets with IP options are dropped. */ 00198 #define IP_OPTIONS 1 00199 00206 #define IP_REASSEMBLY 0 00207 00208 00209 /* ---------- ICMP options ---------- */ 00210 00211 #define ICMP_TTL 255 00212 00213 /* ---------- RAW options ---------- */ 00214 00215 #define LWIP_RAW 0 00216 00217 //#define RAW_TTL (IP_DEFAULT_TTL) 00218 00219 /* ---------- DHCP options ---------- */ 00220 00221 #define LWIP_DHCP 0 00222 00223 /* 1 if you want to do an ARP check on the offered address 00224 (recommended). */ 00225 // #define DHCP_DOES_ARP_CHECK 1 00226 00227 /* ---------- SNMP options ---------- */ 00228 00229 00230 /* ---------- TCP options ---------- */ 00231 #define LWIP_TCP 1 00232 00233 #define TCP_TTL 255 00234 00235 #define TCP_WND 2048 00236 00237 00238 /* Controls if TCP should queue segments that arrive out of 00239 order. Define to 0 if your device is low on memory. */ 00240 #define TCP_QUEUE_OOSEQ 1 00241 00242 /* TCP Maximum segment size. */ 00243 #define TCP_MSS 1024 00244 00245 /* TCP sender buffer space (bytes). */ 00246 #define TCP_SND_BUF 2048 00247 00248 /* TCP sender buffer space (pbufs). This must be at least = 2 * 00249 TCP_SND_BUF/TCP_MSS for things to work. */ 00250 #define TCP_SND_QUEUELEN 6 * TCP_SND_BUF/TCP_MSS 00251 00252 00253 /* Maximum number of retransmissions of data segments. */ 00254 #define TCP_MAXRTX 6 00255 00256 /* Maximum number of retransmissions of SYN segments. */ 00257 #define TCP_SYNMAXRTX 6 00258 00259 00260 /* 00261 ------------------------------------ 00262 ---------- Thread options ---------- 00263 ------------------------------------ 00264 */ 00268 #define TCPIP_THREAD_NAME "TCP/IP" 00269 00275 #define TCPIP_THREAD_STACKSIZE lwipINTERFACE_STACK_SIZE 00276 00282 #define TCPIP_THREAD_PRIO lwipINTERFACE_TASK_PRIORITY 00283 00289 #define TCPIP_MBOX_SIZE 6 00290 00291 00297 #define DEFAULT_THREAD_STACKSIZE configMINIMAL_STACK_SIZE 00298 00299 00300 00301 /* ---------- Socket Options ---------- */ 00302 00303 #ifdef __GNUC__ 00304 // Do not use the lwip timeval structure. 00305 #define LWIP_TIMEVAL_PRIVATE 0 00306 // Use the gnu libc struct timeval instead. 00307 #include <sys/time.h> 00308 #endif 00309 00310 00311 /* ---------- Statistics options ---------- */ 00312 #define LWIP_STATS 1 00313 00314 #define LWIP_STATS_DISPLAY 1 00315 00316 #if LWIP_STATS 00317 00318 #define LINK_STATS 1 00319 #define IP_STATS 1 00320 #define ICMP_STATS 1 00321 #define UDP_STATS 1 00322 #define TCP_STATS 1 00323 #define MEM_STATS 1 00324 #define MEMP_STATS 1 00325 #define PBUF_STATS 1 00326 #define SYS_STATS 1 00327 #endif /* LWIP_STATS */ 00328 00329 /* ---------- PPP options ---------- */ 00330 00331 00332 /* ---------- Lwip Debug options ---------- */ 00333 00334 #undef LWIP_DEBUG 00335 00336 00337 00338 #define DBG_TYPES_ON 0xff 00339 00340 #define ETHARP_DEBUG DBG_OFF 00341 00342 #define NETIF_DEBUG DBG_OFF 00343 00344 #define PBUF_DEBUG DBG_ON 00345 00346 #define API_LIB_DEBUG DBG_OFF 00347 00348 #define API_MSG_DEBUG DBG_ON 00349 00350 #define SOCKETS_DEBUG DBG_OFF 00351 00352 #define ICMP_DEBUG DBG_OFF 00353 00354 #define INET_DEBUG DBG_OFF 00355 00356 #define IP_DEBUG DBG_OFF 00357 00358 #define IP_REASS_DEBUG DBG_OFF 00359 00360 #define RAW_DEBUG DBG_OFF 00361 00362 #define MEM_DEBUG DBG_OFF 00363 00364 #define MEMP_DEBUG DBG_OFF 00365 00366 #define SYS_DEBUG DBG_OFF 00367 00368 #define TCP_DEBUG DBG_ON 00369 00370 #define TCP_INPUT_DEBUG DBG_OFF 00371 00372 #define TCP_FR_DEBUG DBG_OFF 00373 00374 #define TCP_RTO_DEBUG DBG_OFF 00375 00376 #define TCP_CWND_DEBUG DBG_OFF 00377 00378 #define TCP_WND_DEBUG DBG_OFF 00379 00380 #define TCP_OUTPUT_DEBUG DBG_OFF 00381 00382 #define TCP_RST_DEBUG DBG_OFF 00383 00384 #define TCP_QLEN_DEBUG DBG_OFF 00385 00386 #define UDP_DEBUG DBG_OFF 00387 00388 #define TCPIP_DEBUG DBG_OFF 00389 00390 #define DBG_MIN_LEVEL LWIP_DBG_LEVEL_SEVERE 00391 00392 00393 #endif /* __LWIPOPTS_H__ */ 00394 00395 00396