Version of http://mbed.org/cookbook/NetServicesTribute with setting set the same for LPC2368

Dependents:   UDPSocketExample 24LCxx_I2CApp WeatherPlatform_pachube HvZServerLib ... more

Committer:
simon
Date:
Tue Nov 23 14:15:36 2010 +0000
Revision:
0:350011bf8be7
Experimental version for testing UDP

Who changed what in which revision?

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