code that uses Watchdog to reset Mbed every 30seconds. After 30-60mins, the ethernet interface fails to setup() after WatchDog reset.

Dependencies:   mbed

Committer:
eqon
Date:
Thu Jun 07 05:44:29 2012 +0000
Revision:
0:0ce833f21e63

        

Who changed what in which revision?

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