| 1 | /* This is part of LWIPv6 |
| 2 | * Developed for the Ale4NET project |
| 3 | * Application Level Environment for Networking |
| 4 | * |
| 5 | * Copyright 2005 Diego Billi University of Bologna - Italy |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | /* |
| 22 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. |
| 23 | * All rights reserved. |
| 24 | * |
| 25 | * Redistribution and use in source and binary forms, with or without modification, |
| 26 | * are permitted provided that the following conditions are met: |
| 27 | * |
| 28 | * 1. Redistributions of source code must retain the above copyright notice, |
| 29 | * this list of conditions and the following disclaimer. |
| 30 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 31 | * this list of conditions and the following disclaimer in the documentation |
| 32 | * and/or other materials provided with the distribution. |
| 33 | * 3. The name of the author may not be used to endorse or promote products |
| 34 | * derived from this software without specific prior written permission. |
| 35 | * |
| 36 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 37 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 38 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
| 39 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 40 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
| 41 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 42 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 43 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 44 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
| 45 | * OF SUCH DAMAGE. |
| 46 | * |
| 47 | * This file is part of the lwIP TCP/IP stack. |
| 48 | * |
| 49 | * Author: Adam Dunkels <[email protected]> |
| 50 | * |
| 51 | */ |
| 52 | #ifndef __LWIPOPTS_H__ |
| 53 | #define __LWIPOPTS_H__ |
| 54 | |
| 55 | |
| 56 | /* |
| 57 | * These are the default options of liblwip.so library. |
| 58 | * Some of these are necessary if you are going to |
| 59 | * use Lwipv6a as UMVIEWOS module (lwipv6.so). |
| 60 | */ |
| 61 | #define LWIP_DEBUG |
| 62 | |
| 63 | /* |
| 64 | * Remove assertions. |
| 65 | */ |
| 66 | #define LWIP_NOASSERT |
| 67 | |
| 68 | /* |
| 69 | * Uncomment this to debug mem/memp |
| 70 | */ |
| 71 | //#define DEBUGMEM |
| 72 | |
| 73 | /* |
| 74 | * LWIPv6 SLIRP |
| 75 | */ |
| 76 | #define LWSLIRP |
| 77 | |
| 78 | /* |
| 79 | * LWIP access control (capability fun) |
| 80 | */ |
| 81 | #define LWIP_CAPABILITIES 1 |
| 82 | |
| 83 | /* Enable NETLINK sockets to support network configuration by using iproute2 tools */ |
| 84 | #define LWIP_NL 1 |
| 85 | |
| 86 | /* Enable PACKET socket if you want to use udhcpc with UMVIEWOS */ |
| 87 | #define LWIP_PACKET 1 |
| 88 | |
| 89 | #define IPv6 1 |
| 90 | #define IPv4_CHECK_CHECKSUM 1 |
| 91 | #define IPv4_FRAGMENTATION 1 |
| 92 | #define IPv6_FRAGMENTATION 1 |
| 93 | |
| 94 | #define IPv6_AUTO_CONFIGURATION 1 |
| 95 | |
| 96 | #define IPv6_ROUTER_ADVERTISEMENT 1 |
| 97 | #define IPv6_RADVCONF 1 |
| 98 | |
| 99 | #define LWIP_USERFILTER 1 |
| 100 | #define LWIP_NAT 1 |
| 101 | |
| 102 | /* Set to 1 to enable DHCP IPv4 */ |
| 103 | #define LWIP_DHCP 1 |
| 104 | |
| 105 | |
| 106 | /* ---------- Memory options ---------- */ |
| 107 | |
| 108 | /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which |
| 109 | lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 |
| 110 | byte alignment -> define MEM_ALIGNMENT to 2. */ |
| 111 | #define MEM_ALIGNMENT 4 |
| 112 | |
| 113 | /* MEM_SIZE: the size of the heap memory. If the application will send |
| 114 | a lot of data that needs to be copied, this should be set high. */ |
| 115 | #define MEM_SIZE 65536 |
| 116 | |
| 117 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
| 118 | sends a lot of data out of ROM (or other static memory), this |
| 119 | should be set high. */ |
| 120 | #define MEMP_NUM_PBUF 256 |
| 121 | |
| 122 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
| 123 | per active UDP "connection". */ |
| 124 | #define MEMP_NUM_UDP_PCB 8 |
| 125 | |
| 126 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
| 127 | connections. */ |
| 128 | #define MEMP_NUM_TCP_PCB 16 |
| 129 | |
| 130 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
| 131 | connections. */ |
| 132 | #define MEMP_NUM_TCP_PCB_LISTEN 8 |
| 133 | |
| 134 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
| 135 | segments. */ |
| 136 | #define MEMP_NUM_TCP_SEG 16 |
| 137 | |
| 138 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
| 139 | timeouts. */ |
| 140 | #define MEMP_NUM_SYS_TIMEOUT 30 |
| 141 | |
| 142 | |
| 143 | /* The following four are used only with the sequential API and can be |
| 144 | set to 0 if the application only will use the raw API. */ |
| 145 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
| 146 | #define MEMP_NUM_NETBUF 8 |
| 147 | |
| 148 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
| 149 | #define MEMP_NUM_NETCONN 8 |
| 150 | |
| 151 | /* MEMP_NUM_APIMSG: the number of struct api_msg, used for |
| 152 | communication between the TCP/IP stack and the sequential |
| 153 | programs. */ |
| 154 | #define MEMP_NUM_API_MSG 64 |
| 155 | |
| 156 | /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used |
| 157 | for sequential API communication and incoming packets. Used in |
| 158 | src/api/tcpip.c. */ |
| 159 | #define MEMP_NUM_TCPIP_MSG 64 |
| 160 | |
| 161 | /* These two control is reclaimer functions should be compiled |
| 162 | in. Should always be turned on (1). */ |
| 163 | #define MEM_RECLAIM 1 |
| 164 | #define MEMP_RECLAIM 1 |
| 165 | |
| 166 | |
| 167 | /* ---------- Pbuf options ---------- */ |
| 168 | |
| 169 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
| 170 | #define PBUF_POOL_SIZE 64 |
| 171 | |
| 172 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
| 173 | #define PBUF_POOL_BUFSIZE 32768 |
| 174 | |
| 175 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
| 176 | link level header. */ |
| 177 | #define PBUF_LINK_HLEN 16 |
| 178 | |
| 179 | |
| 180 | /* ---------- ARP options ---------- */ |
| 181 | |
| 182 | #define ARP_TABLE_SIZE 10 |
| 183 | |
| 184 | #define ARP_QUEUEING 1 |
| 185 | |
| 186 | /* ---------- IP options ---------- */ |
| 187 | |
| 188 | /* Define IP_FORWARD to 1 if you wish to have the ability to forward |
| 189 | IP packets across network interfaces. If you are going to run lwIP |
| 190 | on a device with only one network interface, define this to 0. */ |
| 191 | #define IP_FORWARD 1 |
| 192 | |
| 193 | /* If defined to 1, IP options are allowed (but not parsed). If |
| 194 | defined to 0, all packets with IP options are dropped. */ |
| 195 | #define IP_OPTIONS 1 |
| 196 | |
| 197 | /* # of suspended fragments */ |
| 198 | #define IP_REASS_POOL_SIZE 5 |
| 199 | |
| 200 | /* ---------- ICMP options ---------- */ |
| 201 | |
| 202 | #define ICMP_TTL 255 |
| 203 | |
| 204 | |
| 205 | /* ---------- UDP options ---------- */ |
| 206 | |
| 207 | #define LWIP_UDP 1 |
| 208 | #define UDP_TTL 255 |
| 209 | |
| 210 | |
| 211 | /* ---------- TCP options ---------- */ |
| 212 | |
| 213 | #define LWIP_TCP 1 |
| 214 | #define TCP_TTL 255 |
| 215 | |
| 216 | /* Controls if TCP should queue segments that arrive out of |
| 217 | order. Define to 0 if your device is low on memory. */ |
| 218 | #define TCP_QUEUE_OOSEQ 1 |
| 219 | |
| 220 | /* TCP Maximum segment size. */ |
| 221 | #define TCP_MSS 1488 |
| 222 | |
| 223 | /* TCP sender buffer space (bytes). */ |
| 224 | #define TCP_SND_BUF 32768 |
| 225 | |
| 226 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
| 227 | TCP_SND_BUF/TCP_MSS for things to work. */ |
| 228 | #define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS |
| 229 | |
| 230 | /* TCP receive window. */ |
| 231 | #define TCP_WND 32768 |
| 232 | |
| 233 | /* Maximum number of retransmissions of data segments. */ |
| 234 | #define TCP_MAXRTX 12 |
| 235 | |
| 236 | /* Maximum number of retransmissions of SYN segments. */ |
| 237 | #define TCP_SYNMAXRTX 4 |
| 238 | |
| 239 | |
| 240 | |
| 241 | #ifndef LWIP_COMPAT_SOCKETS |
| 242 | #define LWIP_COMPAT_SOCKETS 0 |
| 243 | #endif |
| 244 | |
| 245 | /* ---------- TCP/UDP sub-system thread ---------- */ |
| 246 | |
| 247 | /* TCP/UDP sub-system thread priority */ |
| 248 | #define TCPIP_THREAD_PRIO 3 |
| 249 | |
| 250 | |
| 251 | /* ---------- Statistics options ---------- */ |
| 252 | |
| 253 | /* By default, statistics are enabled */ |
| 254 | #define LWIP_STATS 0 |
| 255 | #ifdef STATS |
| 256 | #define LINK_STATS 1 |
| 257 | #define IP_STATS 1 |
| 258 | #define ICMP_STATS 1 |
| 259 | #define UDP_STATS 1 |
| 260 | #define TCP_STATS 1 |
| 261 | #define MEM_STATS 1 |
| 262 | #define MEMP_STATS 1 |
| 263 | #define PBUF_STATS 1 |
| 264 | #define SYS_STATS 1 |
| 265 | #endif /* STATS */ |
| 266 | |
| 267 | /* ---------- Debug options ------------- */ |
| 268 | |
| 269 | #define DBG_MIN_LEVEL 0 |
| 270 | |
| 271 | #define DBG_TYPES_ON (DBG_ON|DBG_TRACE|DBG_STATE|DBG_FRESH|DBG_HALT) |
| 272 | |
| 273 | //#define MEMP_DEBUG DBG_ON |
| 274 | //#define PBUF_DEBUG DBG_ON |
| 275 | //#define ETHARP_DEBUG DBG_ON |
| 276 | //#define ROUTE_DEBUG DBG_ON |
| 277 | //#define DHCP_DEBUG DBG_ON |
| 278 | |
| 279 | //#define IP_DEBUG DBG_ON |
| 280 | //#define IP_REASS_DEBUG DBG_ON |
| 281 | //#define IP_AUTOCONF_DEBUG DBG_ON |
| 282 | |
| 283 | //#define PMTU_DEBUG DBG_ON |
| 284 | //#define IPv6_ADDRSELECT_DBG DBG_ON |
| 285 | |
| 286 | |
| 287 | //#define IP_RADV_DEBUG DBG_ON |
| 288 | //#define IP_RADVCONF_DEBUG DBG_ON |
| 289 | |
| 290 | //#define USERFILTER_DEBUG DBG_ON |
| 291 | //#define NAT_DEBUG DBG_ON |
| 292 | |
| 293 | //#define ICMP_DEBUG DBG_ON |
| 294 | //#define UDP_DEBUG DBG_ON |
| 295 | |
| 296 | //#define TCPIP_DEBUG DBG_ON |
| 297 | //#define SOCKETS_DEBUG DBG_ON |
| 298 | //#define LWSLIRP_DEBUG DBG_ON |
| 299 | //#define TCP_INPUT_DEBUG DBG_ON |
| 300 | //#define TCP_DEBUG DBG_ON |
| 301 | //#define NETIF_DEBUG DBG_ON |
| 302 | |
| 303 | /* ---------- Debug options for /contrib/port/unix/netif files ------------- */ |
| 304 | |
| 305 | /* These are not defined in opt.h */ |
| 306 | //#define VDEIF_DEBUG DBG_ON |
| 307 | //#define TUNIF_DEBUG DBG_ON |
| 308 | //#define TAPIF_DEBUG DBG_ON |
| 309 | |
| 310 | |
| 311 | #endif /* __LWIPOPTS_H__ */ |