| 1 | /* |
| 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without modification, |
| 6 | * are permitted provided that the following conditions are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| 9 | * this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * 3. The name of the author may not be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
| 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
| 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
| 25 | * OF SUCH DAMAGE. |
| 26 | * |
| 27 | * This file is part of the lwIP TCP/IP stack. |
| 28 | * |
| 29 | * Author: Adam Dunkels <[email protected]> |
| 30 | * |
| 31 | */ |
| 32 | #ifndef LWIP_LWIPOPTS_H |
| 33 | #define LWIP_LWIPOPTS_H |
| 34 | |
| 35 | #define LWIP_DBG_MIN_LEVEL 0 |
| 36 | #define LWIP_COMPAT_SOCKETS 1 |
| 37 | #define TAPIF_DEBUG LWIP_DBG_ON |
| 38 | #define TUNIF_DEBUG LWIP_DBG_OFF |
| 39 | #define UNIXIF_DEBUG LWIP_DBG_OFF |
| 40 | #define DELIF_DEBUG LWIP_DBG_OFF |
| 41 | #define SIO_FIFO_DEBUG LWIP_DBG_OFF |
| 42 | #define TCPDUMP_DEBUG LWIP_DBG_ON |
| 43 | |
| 44 | #define PPP_DEBUG LWIP_DBG_OFF |
| 45 | #define MEM_DEBUG LWIP_DBG_OFF |
| 46 | #define MEMP_DEBUG LWIP_DBG_OFF |
| 47 | #define PBUF_DEBUG LWIP_DBG_OFF |
| 48 | #define API_LIB_DEBUG LWIP_DBG_ON |
| 49 | #define API_MSG_DEBUG LWIP_DBG_ON |
| 50 | #define TCPIP_DEBUG LWIP_DBG_ON |
| 51 | #define NETIF_DEBUG LWIP_DBG_ON |
| 52 | #define SOCKETS_DEBUG LWIP_DBG_ON |
| 53 | #define DEMO_DEBUG LWIP_DBG_ON |
| 54 | #define IP_DEBUG LWIP_DBG_ON |
| 55 | #define IP_REASS_DEBUG LWIP_DBG_ON |
| 56 | #define RAW_DEBUG LWIP_DBG_ON |
| 57 | #define ICMP_DEBUG LWIP_DBG_ON |
| 58 | #define UDP_DEBUG LWIP_DBG_ON |
| 59 | #define TCP_DEBUG LWIP_DBG_ON |
| 60 | #define TCP_INPUT_DEBUG LWIP_DBG_ON |
| 61 | #define TCP_OUTPUT_DEBUG LWIP_DBG_ON |
| 62 | #define TCP_RTO_DEBUG LWIP_DBG_ON |
| 63 | #define TCP_CWND_DEBUG LWIP_DBG_ON |
| 64 | #define TCP_WND_DEBUG LWIP_DBG_ON |
| 65 | #define TCP_FR_DEBUG LWIP_DBG_ON |
| 66 | #define TCP_QLEN_DEBUG LWIP_DBG_ON |
| 67 | #define TCP_RST_DEBUG LWIP_DBG_ON |
| 68 | |
| 69 | extern unsigned char debug_flags; |
| 70 | #define LWIP_DBG_TYPES_ON debug_flags |
| 71 | |
| 72 | #define NO_SYS 0 |
| 73 | #define LWIP_SOCKET (NO_SYS==0) |
| 74 | #define LWIP_NETCONN (NO_SYS==0) |
| 75 | |
| 76 | |
| 77 | /* ---------- Memory options ---------- */ |
| 78 | /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which |
| 79 | lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 |
| 80 | byte alignment -> define MEM_ALIGNMENT to 2. */ |
| 81 | /* MSVC port: intel processors don't need 4-byte alignment, |
| 82 | but are faster that way! */ |
| 83 | #define MEM_ALIGNMENT 4 |
| 84 | |
| 85 | /* MEM_SIZE: the size of the heap memory. If the application will send |
| 86 | a lot of data that needs to be copied, this should be set high. */ |
| 87 | #define MEM_SIZE 10240 |
| 88 | |
| 89 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
| 90 | sends a lot of data out of ROM (or other static memory), this |
| 91 | should be set high. */ |
| 92 | #define MEMP_NUM_PBUF 16 |
| 93 | /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One |
| 94 | per active RAW "connection". */ |
| 95 | #define MEMP_NUM_RAW_PCB 3 |
| 96 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
| 97 | per active UDP "connection". */ |
| 98 | #define MEMP_NUM_UDP_PCB 4 |
| 99 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
| 100 | connections. */ |
| 101 | #define MEMP_NUM_TCP_PCB 5 |
| 102 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
| 103 | connections. */ |
| 104 | #define MEMP_NUM_TCP_PCB_LISTEN 8 |
| 105 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
| 106 | segments. */ |
| 107 | #define MEMP_NUM_TCP_SEG 16 |
| 108 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
| 109 | timeouts. */ |
| 110 | #define MEMP_NUM_SYS_TIMEOUT 3 |
| 111 | |
| 112 | /* The following four are used only with the sequential API and can be |
| 113 | set to 0 if the application only will use the raw API. */ |
| 114 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
| 115 | #define MEMP_NUM_NETBUF 2 |
| 116 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
| 117 | #define MEMP_NUM_NETCONN 10 |
| 118 | /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used |
| 119 | for sequential API communication and incoming packets. Used in |
| 120 | src/api/tcpip.c. */ |
| 121 | #define MEMP_NUM_TCPIP_MSG_API 16 |
| 122 | #define MEMP_NUM_TCPIP_MSG_INPKT 16 |
| 123 | |
| 124 | /* ---------- Pbuf options ---------- */ |
| 125 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
| 126 | #define PBUF_POOL_SIZE 120 |
| 127 | |
| 128 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
| 129 | #define PBUF_POOL_BUFSIZE 128 |
| 130 | |
| 131 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
| 132 | link level header. */ |
| 133 | #define PBUF_LINK_HLEN 16 |
| 134 | |
| 135 | /** SYS_LIGHTWEIGHT_PROT |
| 136 | * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection |
| 137 | * for certain critical regions during buffer allocation, deallocation and memory |
| 138 | * allocation and deallocation. |
| 139 | */ |
| 140 | #define SYS_LIGHTWEIGHT_PROT 1 |
| 141 | |
| 142 | /* ---------- TCP options ---------- */ |
| 143 | #define LWIP_TCP 1 |
| 144 | #define TCP_TTL 255 |
| 145 | |
| 146 | /* Controls if TCP should queue segments that arrive out of |
| 147 | order. Define to 0 if your device is low on memory. */ |
| 148 | #define TCP_QUEUE_OOSEQ 1 |
| 149 | |
| 150 | /* TCP Maximum segment size. */ |
| 151 | #define TCP_MSS 1024 |
| 152 | |
| 153 | /* TCP sender buffer space (bytes). */ |
| 154 | #define TCP_SND_BUF 2048 |
| 155 | |
| 156 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
| 157 | TCP_SND_BUF/TCP_MSS for things to work. */ |
| 158 | #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS) |
| 159 | |
| 160 | /* TCP writable space (bytes). This must be less than or equal |
| 161 | to TCP_SND_BUF. It is the amount of space which must be |
| 162 | available in the tcp snd_buf for select to return writable */ |
| 163 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) |
| 164 | |
| 165 | /* TCP receive window. */ |
| 166 | #define TCP_WND 8096 |
| 167 | |
| 168 | /* Maximum number of retransmissions of data segments. */ |
| 169 | #define TCP_MAXRTX 12 |
| 170 | |
| 171 | /* Maximum number of retransmissions of SYN segments. */ |
| 172 | #define TCP_SYNMAXRTX 4 |
| 173 | |
| 174 | /* ---------- ARP options ---------- */ |
| 175 | #define LWIP_ARP 1 |
| 176 | #define ARP_TABLE_SIZE 10 |
| 177 | #define ARP_QUEUEING 1 |
| 178 | |
| 179 | /* ---------- IP options ---------- */ |
| 180 | /* Define IP_FORWARD to 1 if you wish to have the ability to forward |
| 181 | IP packets across network interfaces. If you are going to run lwIP |
| 182 | on a device with only one network interface, define this to 0. */ |
| 183 | #define IP_FORWARD 1 |
| 184 | |
| 185 | |
| 186 | /* IP reassembly and segmentation.These are orthogonal even |
| 187 | * if they both deal with IP fragments */ |
| 188 | #define IP_REASSEMBLY 1 |
| 189 | #define IP_REASS_MAX_PBUFS 10 |
| 190 | #define MEMP_NUM_REASSDATA 10 |
| 191 | #define IP_FRAG 1 |
| 192 | |
| 193 | /* ---------- ICMP options ---------- */ |
| 194 | #define ICMP_TTL 255 |
| 195 | |
| 196 | /* ---------- DHCP options ---------- */ |
| 197 | /* Define LWIP_DHCP to 1 if you want DHCP configuration of |
| 198 | interfaces. */ |
| 199 | #define LWIP_DHCP 0 |
| 200 | |
| 201 | /* 1 if you want to do an ARP check on the offered address |
| 202 | (recommended if using DHCP). */ |
| 203 | #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) |
| 204 | |
| 205 | /* ---------- AUTOIP options ------- */ |
| 206 | #define LWIP_AUTOIP 0 |
| 207 | |
| 208 | /* ---------- SNMP options ---------- */ |
| 209 | /** @todo SNMP is experimental for now |
| 210 | @note UDP must be available for SNMP transport */ |
| 211 | #ifndef LWIP_SNMP |
| 212 | #define LWIP_SNMP 0 |
| 213 | #endif |
| 214 | |
| 215 | #ifndef SNMP_PRIVATE_MIB |
| 216 | #define SNMP_PRIVATE_MIB 0 |
| 217 | #endif |
| 218 | |
| 219 | /* ---------- UDP options ---------- */ |
| 220 | #define LWIP_UDP 1 |
| 221 | #define UDP_TTL 255 |
| 222 | |
| 223 | /* ---------- RAW options ---------- */ |
| 224 | #define LWIP_RAW 1 |
| 225 | #define RAW_TTL 255 |
| 226 | |
| 227 | /* ---------- Statistics options ---------- */ |
| 228 | /* individual STATS options can be turned off by defining them to 0 |
| 229 | * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS |
| 230 | * is 0 |
| 231 | * */ |
| 232 | |
| 233 | #define LWIP_STATS 1 |
| 234 | |
| 235 | /* ---------- PPP options ---------- */ |
| 236 | |
| 237 | #define PPP_SUPPORT 0 /* Set > 0 for PPP */ |
| 238 | |
| 239 | #if PPP_SUPPORT > 0 |
| 240 | |
| 241 | #define NUM_PPP 1 /* Max PPP sessions. */ |
| 242 | |
| 243 | |
| 244 | /* Select modules to enable. Ideally these would be set in the makefile but |
| 245 | * we're limited by the command line length so you need to modify the settings |
| 246 | * in this file. |
| 247 | */ |
| 248 | #define PAP_SUPPORT 1 /* Set > 0 for PAP. */ |
| 249 | #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ |
| 250 | #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */ |
| 251 | #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ |
| 252 | #define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */ |
| 253 | #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ |
| 254 | #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ |
| 255 | |
| 256 | |
| 257 | /* |
| 258 | * Timeouts. |
| 259 | */ |
| 260 | #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ |
| 261 | #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ |
| 262 | #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ |
| 263 | #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ |
| 264 | |
| 265 | #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ |
| 266 | #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ |
| 267 | |
| 268 | #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ |
| 269 | #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ |
| 270 | |
| 271 | |
| 272 | /* Interval in seconds between keepalive echo requests, 0 to disable. */ |
| 273 | #if 1 |
| 274 | #define LCP_ECHOINTERVAL 0 |
| 275 | #else |
| 276 | #define LCP_ECHOINTERVAL 10 |
| 277 | #endif |
| 278 | |
| 279 | /* Number of unanswered echo requests before failure. */ |
| 280 | #define LCP_MAXECHOFAILS 3 |
| 281 | |
| 282 | /* Max Xmit idle time (in jiffies) before resend flag char. */ |
| 283 | #define PPP_MAXIDLEFLAG 100 |
| 284 | |
| 285 | /* |
| 286 | * Packet sizes |
| 287 | * |
| 288 | * Note - lcp shouldn't be allowed to negotiate stuff outside these |
| 289 | * limits. See lcp.h in the pppd directory. |
| 290 | * (XXX - these constants should simply be shared by lcp.c instead |
| 291 | * of living in lcp.h) |
| 292 | */ |
| 293 | #define PPP_MTU 1500 /* Default MTU (size of Info field) */ |
| 294 | #if 0 |
| 295 | #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) |
| 296 | #else |
| 297 | #define PPP_MAXMTU 1500 /* Largest MTU we allow */ |
| 298 | #endif |
| 299 | #define PPP_MINMTU 64 |
| 300 | #define PPP_MRU 1500 /* default MRU = max length of info field */ |
| 301 | #define PPP_MAXMRU 1500 /* Largest MRU we allow */ |
| 302 | #define PPP_DEFMRU 296 /* Try for this */ |
| 303 | #define PPP_MINMRU 128 /* No MRUs below this */ |
| 304 | |
| 305 | |
| 306 | #define MAXNAMELEN 256 /* max length of hostname or name for auth */ |
| 307 | #define MAXSECRETLEN 256 /* max length of password or secret */ |
| 308 | |
| 309 | #endif /* PPP_SUPPORT > 0 */ |
| 310 | |
| 311 | #endif /* LWIP_LWIPOPTS_H */ |