![](/media/cache/profiles/3f4243a6f681f2920ac3e95a63517274.50x50_q85.jpg)
code that uses Watchdog to reset Mbed every 30seconds. After 30-60mins, the ethernet interface fails to setup() after WatchDog reset.
EthernetNetIf/LPC2368/lwip/lwipopts2.h@0:0ce833f21e63, 2012-06-07 (annotated)
- Committer:
- eqon
- Date:
- Thu Jun 07 05:44:29 2012 +0000
- Revision:
- 0:0ce833f21e63
Who changed what in which revision?
User | Revision | Line number | New 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_OFF |
eqon | 0:0ce833f21e63 | 57 | #define TCPDUMP_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 58 | |
eqon | 0:0ce833f21e63 | 59 | #define PPP_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 60 | #define MEM_DEBUG LWIP_DBG_ON |
eqon | 0:0ce833f21e63 | 61 | #define MEMP_DEBUG LWIP_DBG_ON |
eqon | 0:0ce833f21e63 | 62 | #define PBUF_DEBUG LWIP_DBG_ON |
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 UDP_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 74 | #define TCP_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 75 | #define TCP_INPUT_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 76 | #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 77 | #define TCP_RTO_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 78 | #define TCP_CWND_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 79 | #define TCP_WND_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 80 | #define TCP_FR_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 81 | #define TCP_QLEN_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 82 | #define TCP_RST_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 83 | #define ETHARP_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 84 | #define DNS_DEBUG LWIP_DBG_OFF |
eqon | 0:0ce833f21e63 | 85 | |
eqon | 0:0ce833f21e63 | 86 | #endif |
eqon | 0:0ce833f21e63 | 87 | |
eqon | 0:0ce833f21e63 | 88 | /* |
eqon | 0:0ce833f21e63 | 89 | extern unsigned char debug_flags; |
eqon | 0:0ce833f21e63 | 90 | #define LWIP_DBG_TYPES_ON debug_flags |
eqon | 0:0ce833f21e63 | 91 | */ |
eqon | 0:0ce833f21e63 | 92 | #define NO_SYS 1 |
eqon | 0:0ce833f21e63 | 93 | #define LWIP_SOCKET (NO_SYS==0) |
eqon | 0:0ce833f21e63 | 94 | #define LWIP_NETCONN (NO_SYS==0) |
eqon | 0:0ce833f21e63 | 95 | |
eqon | 0:0ce833f21e63 | 96 | |
eqon | 0:0ce833f21e63 | 97 | #define IP_FRAG_USES_STATIC_BUF 0 |
eqon | 0:0ce833f21e63 | 98 | |
eqon | 0:0ce833f21e63 | 99 | |
eqon | 0:0ce833f21e63 | 100 | |
eqon | 0:0ce833f21e63 | 101 | /* ---------- Memory options ---------- */ |
eqon | 0:0ce833f21e63 | 102 | /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which |
eqon | 0:0ce833f21e63 | 103 | lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 |
eqon | 0:0ce833f21e63 | 104 | byte alignment -> define MEM_ALIGNMENT to 2. */ |
eqon | 0:0ce833f21e63 | 105 | /* MSVC port: intel processors don't need 4-byte alignment, |
eqon | 0:0ce833f21e63 | 106 | but are faster that way! */ |
eqon | 0:0ce833f21e63 | 107 | #define MEM_ALIGNMENT 4 |
eqon | 0:0ce833f21e63 | 108 | |
eqon | 0:0ce833f21e63 | 109 | /* MEM_SIZE: the size of the heap memory. If the application will send |
eqon | 0:0ce833f21e63 | 110 | a lot of data that needs to be copied, this should be set high. */ |
eqon | 0:0ce833f21e63 | 111 | //#define MEM_SIZE 10240 |
eqon | 0:0ce833f21e63 | 112 | |
eqon | 0:0ce833f21e63 | 113 | #if TARGET_LPC1768 |
eqon | 0:0ce833f21e63 | 114 | |
eqon | 0:0ce833f21e63 | 115 | |
eqon | 0:0ce833f21e63 | 116 | #define MEM_SIZE 4000 |
eqon | 0:0ce833f21e63 | 117 | |
eqon | 0:0ce833f21e63 | 118 | /// |
eqon | 0:0ce833f21e63 | 119 | |
eqon | 0:0ce833f21e63 | 120 | #define MEM_POSITION __attribute((section("AHBSRAM0"))) |
eqon | 0:0ce833f21e63 | 121 | |
eqon | 0:0ce833f21e63 | 122 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
eqon | 0:0ce833f21e63 | 123 | sends a lot of data out of ROM (or other static memory), this |
eqon | 0:0ce833f21e63 | 124 | should be set high. */ |
eqon | 0:0ce833f21e63 | 125 | #define MEMP_NUM_PBUF 16 |
eqon | 0:0ce833f21e63 | 126 | /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One |
eqon | 0:0ce833f21e63 | 127 | per active RAW "connection". */ |
eqon | 0:0ce833f21e63 | 128 | //#define MEMP_NUM_RAW_PCB 3 |
eqon | 0:0ce833f21e63 | 129 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
eqon | 0:0ce833f21e63 | 130 | per active UDP "connection". */ |
eqon | 0:0ce833f21e63 | 131 | #define MEMP_NUM_UDP_PCB 2 |
eqon | 0:0ce833f21e63 | 132 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
eqon | 0:0ce833f21e63 | 133 | connections. */ |
eqon | 0:0ce833f21e63 | 134 | #define MEMP_NUM_TCP_PCB 2 |
eqon | 0:0ce833f21e63 | 135 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
eqon | 0:0ce833f21e63 | 136 | connections. */ |
eqon | 0:0ce833f21e63 | 137 | #define MEMP_NUM_TCP_PCB_LISTEN 2//4 |
eqon | 0:0ce833f21e63 | 138 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
eqon | 0:0ce833f21e63 | 139 | segments. */ |
eqon | 0:0ce833f21e63 | 140 | #define MEMP_NUM_TCP_SEG 16 |
eqon | 0:0ce833f21e63 | 141 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
eqon | 0:0ce833f21e63 | 142 | timeouts. */ |
eqon | 0:0ce833f21e63 | 143 | #define MEMP_NUM_SYS_TIMEOUT 12 |
eqon | 0:0ce833f21e63 | 144 | |
eqon | 0:0ce833f21e63 | 145 | /* The following four are used only with the sequential API and can be |
eqon | 0:0ce833f21e63 | 146 | set to 0 if the application only will use the raw API. */ |
eqon | 0:0ce833f21e63 | 147 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
eqon | 0:0ce833f21e63 | 148 | #define MEMP_NUM_NETBUF 0 |
eqon | 0:0ce833f21e63 | 149 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
eqon | 0:0ce833f21e63 | 150 | #define MEMP_NUM_NETCONN 0 |
eqon | 0:0ce833f21e63 | 151 | /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used |
eqon | 0:0ce833f21e63 | 152 | for sequential API communication and incoming packets. Used in |
eqon | 0:0ce833f21e63 | 153 | src/api/tcpip.c. */ |
eqon | 0:0ce833f21e63 | 154 | #define MEMP_NUM_TCPIP_MSG_API 0 |
eqon | 0:0ce833f21e63 | 155 | #define MEMP_NUM_TCPIP_MSG_INPKT 0 |
eqon | 0:0ce833f21e63 | 156 | |
eqon | 0:0ce833f21e63 | 157 | /* ---------- Pbuf options ---------- */ |
eqon | 0:0ce833f21e63 | 158 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
eqon | 0:0ce833f21e63 | 159 | #define PBUF_POOL_SIZE 8//100 |
eqon | 0:0ce833f21e63 | 160 | |
eqon | 0:0ce833f21e63 | 161 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
eqon | 0:0ce833f21e63 | 162 | #define PBUF_POOL_BUFSIZE 128 |
eqon | 0:0ce833f21e63 | 163 | |
eqon | 0:0ce833f21e63 | 164 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
eqon | 0:0ce833f21e63 | 165 | link level header. */ |
eqon | 0:0ce833f21e63 | 166 | //#define PBUF_LINK_HLEN 16 |
eqon | 0:0ce833f21e63 | 167 | |
eqon | 0:0ce833f21e63 | 168 | /** SYS_LIGHTWEIGHT_PROT |
eqon | 0:0ce833f21e63 | 169 | * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection |
eqon | 0:0ce833f21e63 | 170 | * for certain critical regions during buffer allocation, deallocation and memory |
eqon | 0:0ce833f21e63 | 171 | * allocation and deallocation. |
eqon | 0:0ce833f21e63 | 172 | */ |
eqon | 0:0ce833f21e63 | 173 | #define SYS_LIGHTWEIGHT_PROT 0 //No sys here |
eqon | 0:0ce833f21e63 | 174 | |
eqon | 0:0ce833f21e63 | 175 | /* ---------- TCP options ---------- */ |
eqon | 0:0ce833f21e63 | 176 | #define LWIP_TCP 1 |
eqon | 0:0ce833f21e63 | 177 | #define TCP_TTL 255 |
eqon | 0:0ce833f21e63 | 178 | |
eqon | 0:0ce833f21e63 | 179 | /* Controls if TCP should queue segments that arrive out of |
eqon | 0:0ce833f21e63 | 180 | order. Define to 0 if your device is low on memory. */ |
eqon | 0:0ce833f21e63 | 181 | #define TCP_QUEUE_OOSEQ 0 |
eqon | 0:0ce833f21e63 | 182 | |
eqon | 0:0ce833f21e63 | 183 | /* TCP Maximum segment size. */ |
eqon | 0:0ce833f21e63 | 184 | //#define TCP_MSS 1024 |
eqon | 0:0ce833f21e63 | 185 | #define TCP_MSS 0x276//536//0x276 |
eqon | 0:0ce833f21e63 | 186 | |
eqon | 0:0ce833f21e63 | 187 | /* TCP sender buffer space (bytes). */ |
eqon | 0:0ce833f21e63 | 188 | #define TCP_SND_BUF 2048 |
eqon | 0:0ce833f21e63 | 189 | |
eqon | 0:0ce833f21e63 | 190 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
eqon | 0:0ce833f21e63 | 191 | TCP_SND_BUF/TCP_MSS for things to work. */ |
eqon | 0:0ce833f21e63 | 192 | #define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS) |
eqon | 0:0ce833f21e63 | 193 | |
eqon | 0:0ce833f21e63 | 194 | /* TCP writable space (bytes). This must be less than or equal |
eqon | 0:0ce833f21e63 | 195 | to TCP_SND_BUF. It is the amount of space which must be |
eqon | 0:0ce833f21e63 | 196 | available in the tcp snd_buf for select to return writable */ |
eqon | 0:0ce833f21e63 | 197 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) |
eqon | 0:0ce833f21e63 | 198 | |
eqon | 0:0ce833f21e63 | 199 | /* TCP receive window. */ |
eqon | 0:0ce833f21e63 | 200 | #define TCP_WND 2048 //8096 |
eqon | 0:0ce833f21e63 | 201 | |
eqon | 0:0ce833f21e63 | 202 | /* Maximum number of retransmissions of data segments. */ |
eqon | 0:0ce833f21e63 | 203 | //#define TCP_MAXRTX 12 |
eqon | 0:0ce833f21e63 | 204 | |
eqon | 0:0ce833f21e63 | 205 | /* Maximum number of retransmissions of SYN segments. */ |
eqon | 0:0ce833f21e63 | 206 | //#define TCP_SYNMAXRTX 4 |
eqon | 0:0ce833f21e63 | 207 | |
eqon | 0:0ce833f21e63 | 208 | #elif TARGET_LPC2368 |
eqon | 0:0ce833f21e63 | 209 | |
eqon | 0:0ce833f21e63 | 210 | #define MEM_POSITION __attribute((section("AHBSRAM1"))) |
eqon | 0:0ce833f21e63 | 211 | |
eqon | 0:0ce833f21e63 | 212 | /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application |
eqon | 0:0ce833f21e63 | 213 | sends a lot of data out of ROM (or other static memory), this |
eqon | 0:0ce833f21e63 | 214 | should be set high. */ |
eqon | 0:0ce833f21e63 | 215 | #define MEMP_NUM_PBUF 8 |
eqon | 0:0ce833f21e63 | 216 | /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One |
eqon | 0:0ce833f21e63 | 217 | per active RAW "connection". */ |
eqon | 0:0ce833f21e63 | 218 | //#define MEMP_NUM_RAW_PCB 3 |
eqon | 0:0ce833f21e63 | 219 | /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
eqon | 0:0ce833f21e63 | 220 | per active UDP "connection". */ |
eqon | 0:0ce833f21e63 | 221 | #define MEMP_NUM_UDP_PCB 2 |
eqon | 0:0ce833f21e63 | 222 | /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP |
eqon | 0:0ce833f21e63 | 223 | connections. */ |
eqon | 0:0ce833f21e63 | 224 | #define MEMP_NUM_TCP_PCB 2 |
eqon | 0:0ce833f21e63 | 225 | /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP |
eqon | 0:0ce833f21e63 | 226 | connections. */ |
eqon | 0:0ce833f21e63 | 227 | #define MEMP_NUM_TCP_PCB_LISTEN 2//4 |
eqon | 0:0ce833f21e63 | 228 | /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP |
eqon | 0:0ce833f21e63 | 229 | segments. */ |
eqon | 0:0ce833f21e63 | 230 | #define MEMP_NUM_TCP_SEG 8 |
eqon | 0:0ce833f21e63 | 231 | /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active |
eqon | 0:0ce833f21e63 | 232 | timeouts. */ |
eqon | 0:0ce833f21e63 | 233 | #define MEMP_NUM_SYS_TIMEOUT 12 |
eqon | 0:0ce833f21e63 | 234 | |
eqon | 0:0ce833f21e63 | 235 | /* The following four are used only with the sequential API and can be |
eqon | 0:0ce833f21e63 | 236 | set to 0 if the application only will use the raw API. */ |
eqon | 0:0ce833f21e63 | 237 | /* MEMP_NUM_NETBUF: the number of struct netbufs. */ |
eqon | 0:0ce833f21e63 | 238 | #define MEMP_NUM_NETBUF 0 |
eqon | 0:0ce833f21e63 | 239 | /* MEMP_NUM_NETCONN: the number of struct netconns. */ |
eqon | 0:0ce833f21e63 | 240 | #define MEMP_NUM_NETCONN 0 |
eqon | 0:0ce833f21e63 | 241 | /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used |
eqon | 0:0ce833f21e63 | 242 | for sequential API communication and incoming packets. Used in |
eqon | 0:0ce833f21e63 | 243 | src/api/tcpip.c. */ |
eqon | 0:0ce833f21e63 | 244 | #define MEMP_NUM_TCPIP_MSG_API 0 |
eqon | 0:0ce833f21e63 | 245 | #define MEMP_NUM_TCPIP_MSG_INPKT 0 |
eqon | 0:0ce833f21e63 | 246 | |
eqon | 0:0ce833f21e63 | 247 | /* ---------- Pbuf options ---------- */ |
eqon | 0:0ce833f21e63 | 248 | /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ |
eqon | 0:0ce833f21e63 | 249 | #define PBUF_POOL_SIZE 8//16//100 |
eqon | 0:0ce833f21e63 | 250 | |
eqon | 0:0ce833f21e63 | 251 | /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ |
eqon | 0:0ce833f21e63 | 252 | //#define PBUF_POOL_BUFSIZE 128 |
eqon | 0:0ce833f21e63 | 253 | |
eqon | 0:0ce833f21e63 | 254 | /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
eqon | 0:0ce833f21e63 | 255 | link level header. */ |
eqon | 0:0ce833f21e63 | 256 | //#define PBUF_LINK_HLEN 16 |
eqon | 0:0ce833f21e63 | 257 | |
eqon | 0:0ce833f21e63 | 258 | /** SYS_LIGHTWEIGHT_PROT |
eqon | 0:0ce833f21e63 | 259 | * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection |
eqon | 0:0ce833f21e63 | 260 | * for certain critical regions during buffer allocation, deallocation and memory |
eqon | 0:0ce833f21e63 | 261 | * allocation and deallocation. |
eqon | 0:0ce833f21e63 | 262 | */ |
eqon | 0:0ce833f21e63 | 263 | #define SYS_LIGHTWEIGHT_PROT 0 //No sys here |
eqon | 0:0ce833f21e63 | 264 | |
eqon | 0:0ce833f21e63 | 265 | /* ---------- TCP options ---------- */ |
eqon | 0:0ce833f21e63 | 266 | #define LWIP_TCP 1 |
eqon | 0:0ce833f21e63 | 267 | #define TCP_TTL 255 |
eqon | 0:0ce833f21e63 | 268 | |
eqon | 0:0ce833f21e63 | 269 | /* Controls if TCP should queue segments that arrive out of |
eqon | 0:0ce833f21e63 | 270 | order. Define to 0 if your device is low on memory. */ |
eqon | 0:0ce833f21e63 | 271 | #define TCP_QUEUE_OOSEQ 0 |
eqon | 0:0ce833f21e63 | 272 | |
eqon | 0:0ce833f21e63 | 273 | /* TCP Maximum segment size. */ |
eqon | 0:0ce833f21e63 | 274 | //#define TCP_MSS 1024 |
eqon | 0:0ce833f21e63 | 275 | #define TCP_MSS 512//0x276//536//0x276 |
eqon | 0:0ce833f21e63 | 276 | |
eqon | 0:0ce833f21e63 | 277 | /* TCP sender buffer space (bytes). */ |
eqon | 0:0ce833f21e63 | 278 | #define TCP_SND_BUF 1024//2048 |
eqon | 0:0ce833f21e63 | 279 | |
eqon | 0:0ce833f21e63 | 280 | /* TCP sender buffer space (pbufs). This must be at least = 2 * |
eqon | 0:0ce833f21e63 | 281 | TCP_SND_BUF/TCP_MSS for things to work. */ |
eqon | 0:0ce833f21e63 | 282 | #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)//(4 * TCP_SND_BUF/TCP_MSS) |
eqon | 0:0ce833f21e63 | 283 | |
eqon | 0:0ce833f21e63 | 284 | /* TCP writable space (bytes). This must be less than or equal |
eqon | 0:0ce833f21e63 | 285 | to TCP_SND_BUF. It is the amount of space which must be |
eqon | 0:0ce833f21e63 | 286 | available in the tcp snd_buf for select to return writable */ |
eqon | 0:0ce833f21e63 | 287 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) |
eqon | 0:0ce833f21e63 | 288 | |
eqon | 0:0ce833f21e63 | 289 | /* TCP receive window. */ |
eqon | 0:0ce833f21e63 | 290 | #define TCP_WND 512 //8096 |
eqon | 0:0ce833f21e63 | 291 | |
eqon | 0:0ce833f21e63 | 292 | /* Maximum number of retransmissions of data segments. */ |
eqon | 0:0ce833f21e63 | 293 | //#define TCP_MAXRTX 12 |
eqon | 0:0ce833f21e63 | 294 | |
eqon | 0:0ce833f21e63 | 295 | /* Maximum number of retransmissions of SYN segments. */ |
eqon | 0:0ce833f21e63 | 296 | //#define TCP_SYNMAXRTX 4 |
eqon | 0:0ce833f21e63 | 297 | |
eqon | 0:0ce833f21e63 | 298 | #endif |
eqon | 0:0ce833f21e63 | 299 | |
eqon | 0:0ce833f21e63 | 300 | /* ---------- ARP options ---------- */ |
eqon | 0:0ce833f21e63 | 301 | #define LWIP_ARP (NET_ETH | NET_ZG2100) |
eqon | 0:0ce833f21e63 | 302 | #define ARP_TABLE_SIZE 2//4//10 |
eqon | 0:0ce833f21e63 | 303 | #define ARP_QUEUEING 0//1 |
eqon | 0:0ce833f21e63 | 304 | #define ETHARP_TRUST_IP_MAC 1 |
eqon | 0:0ce833f21e63 | 305 | |
eqon | 0:0ce833f21e63 | 306 | /* ---------- IP options ---------- */ |
eqon | 0:0ce833f21e63 | 307 | /* Define IP_FORWARD to 1 if you wish to have the ability to forward |
eqon | 0:0ce833f21e63 | 308 | IP packets across network interfaces. If you are going to run lwIP |
eqon | 0:0ce833f21e63 | 309 | on a device with only one network interface, define this to 0. */ |
eqon | 0:0ce833f21e63 | 310 | #define IP_FORWARD 0 |
eqon | 0:0ce833f21e63 | 311 | |
eqon | 0:0ce833f21e63 | 312 | |
eqon | 0:0ce833f21e63 | 313 | /* IP reassembly and segmentation.These are orthogonal even |
eqon | 0:0ce833f21e63 | 314 | * if they both deal with IP fragments */ |
eqon | 0:0ce833f21e63 | 315 | /* |
eqon | 0:0ce833f21e63 | 316 | #define IP_REASSEMBLY 1 |
eqon | 0:0ce833f21e63 | 317 | #define IP_REASS_MAX_PBUFS 10 |
eqon | 0:0ce833f21e63 | 318 | #define MEMP_NUM_REASSDATA 10 |
eqon | 0:0ce833f21e63 | 319 | #define IP_FRAG 1 |
eqon | 0:0ce833f21e63 | 320 | */ |
eqon | 0:0ce833f21e63 | 321 | /* ---------- ICMP options ---------- */ |
eqon | 0:0ce833f21e63 | 322 | #define ICMP_TTL 255 |
eqon | 0:0ce833f21e63 | 323 | |
eqon | 0:0ce833f21e63 | 324 | /* ---------- DHCP options ---------- */ |
eqon | 0:0ce833f21e63 | 325 | /* Define LWIP_DHCP to 1 if you want DHCP configuration of |
eqon | 0:0ce833f21e63 | 326 | interfaces. */ |
eqon | 0:0ce833f21e63 | 327 | #define LWIP_DHCP (NET_ETH | NET_ZG2100) |
eqon | 0:0ce833f21e63 | 328 | |
eqon | 0:0ce833f21e63 | 329 | /* 1 if you want to do an ARP check on the offered address |
eqon | 0:0ce833f21e63 | 330 | (recommended if using DHCP). */ |
eqon | 0:0ce833f21e63 | 331 | #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) |
eqon | 0:0ce833f21e63 | 332 | |
eqon | 0:0ce833f21e63 | 333 | /* ---------- AUTOIP options ------- */ |
eqon | 0:0ce833f21e63 | 334 | #define LWIP_AUTOIP 0 |
eqon | 0:0ce833f21e63 | 335 | |
eqon | 0:0ce833f21e63 | 336 | /* ---------- SNMP options ---------- */ |
eqon | 0:0ce833f21e63 | 337 | /** @todo SNMP is experimental for now |
eqon | 0:0ce833f21e63 | 338 | @note UDP must be available for SNMP transport */ |
eqon | 0:0ce833f21e63 | 339 | #ifndef LWIP_SNMP |
eqon | 0:0ce833f21e63 | 340 | #define LWIP_SNMP 0 |
eqon | 0:0ce833f21e63 | 341 | #endif |
eqon | 0:0ce833f21e63 | 342 | |
eqon | 0:0ce833f21e63 | 343 | |
eqon | 0:0ce833f21e63 | 344 | #ifndef SNMP_PRIVATE_MIB |
eqon | 0:0ce833f21e63 | 345 | #define SNMP_PRIVATE_MIB 0 |
eqon | 0:0ce833f21e63 | 346 | #endif |
eqon | 0:0ce833f21e63 | 347 | |
eqon | 0:0ce833f21e63 | 348 | |
eqon | 0:0ce833f21e63 | 349 | /* ---------- UDP options ---------- */ |
eqon | 0:0ce833f21e63 | 350 | #define LWIP_UDP 1 |
eqon | 0:0ce833f21e63 | 351 | #define UDP_TTL 255 |
eqon | 0:0ce833f21e63 | 352 | |
eqon | 0:0ce833f21e63 | 353 | /* ---------- DNS options ---------- */ |
eqon | 0:0ce833f21e63 | 354 | #define LWIP_DNS 1 |
eqon | 0:0ce833f21e63 | 355 | |
eqon | 0:0ce833f21e63 | 356 | /* ---------- RAW options ---------- */ |
eqon | 0:0ce833f21e63 | 357 | #define LWIP_RAW 0 |
eqon | 0:0ce833f21e63 | 358 | #define RAW_TTL 255 |
eqon | 0:0ce833f21e63 | 359 | |
eqon | 0:0ce833f21e63 | 360 | /* ---------- Statistics options ---------- */ |
eqon | 0:0ce833f21e63 | 361 | /* individual STATS options can be turned off by defining them to 0 |
eqon | 0:0ce833f21e63 | 362 | * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS |
eqon | 0:0ce833f21e63 | 363 | * is 0 |
eqon | 0:0ce833f21e63 | 364 | * */ |
eqon | 0:0ce833f21e63 | 365 | |
eqon | 0:0ce833f21e63 | 366 | #define LWIP_STATS 0 |
eqon | 0:0ce833f21e63 | 367 | |
eqon | 0:0ce833f21e63 | 368 | /* ---------- PPP options ---------- */ |
eqon | 0:0ce833f21e63 | 369 | |
eqon | 0:0ce833f21e63 | 370 | #define PPP_SUPPORT NET_PPP /* Set > 0 for PPP */ |
eqon | 0:0ce833f21e63 | 371 | |
eqon | 0:0ce833f21e63 | 372 | #if PPP_SUPPORT > 0 |
eqon | 0:0ce833f21e63 | 373 | |
eqon | 0:0ce833f21e63 | 374 | #define NUM_PPP 1 /* Max PPP sessions. */ |
eqon | 0:0ce833f21e63 | 375 | |
eqon | 0:0ce833f21e63 | 376 | |
eqon | 0:0ce833f21e63 | 377 | /* Select modules to enable. Ideally these would be set in the makefile but |
eqon | 0:0ce833f21e63 | 378 | * we're limited by the command line length so you need to modify the settings |
eqon | 0:0ce833f21e63 | 379 | * in this file. |
eqon | 0:0ce833f21e63 | 380 | */ |
eqon | 0:0ce833f21e63 | 381 | #define PAP_SUPPORT 1 /* Set > 0 for PAP. */ |
eqon | 0:0ce833f21e63 | 382 | #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ |
eqon | 0:0ce833f21e63 | 383 | #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */ |
eqon | 0:0ce833f21e63 | 384 | #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ |
eqon | 0:0ce833f21e63 | 385 | #define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */ |
eqon | 0:0ce833f21e63 | 386 | #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ |
eqon | 0:0ce833f21e63 | 387 | #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ |
eqon | 0:0ce833f21e63 | 388 | |
eqon | 0:0ce833f21e63 | 389 | |
eqon | 0:0ce833f21e63 | 390 | /* |
eqon | 0:0ce833f21e63 | 391 | * Timeouts. |
eqon | 0:0ce833f21e63 | 392 | */ |
eqon | 0:0ce833f21e63 | 393 | #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ |
eqon | 0:0ce833f21e63 | 394 | #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ |
eqon | 0:0ce833f21e63 | 395 | #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ |
eqon | 0:0ce833f21e63 | 396 | #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ |
eqon | 0:0ce833f21e63 | 397 | |
eqon | 0:0ce833f21e63 | 398 | #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ |
eqon | 0:0ce833f21e63 | 399 | #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ |
eqon | 0:0ce833f21e63 | 400 | |
eqon | 0:0ce833f21e63 | 401 | #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ |
eqon | 0:0ce833f21e63 | 402 | #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ |
eqon | 0:0ce833f21e63 | 403 | |
eqon | 0:0ce833f21e63 | 404 | |
eqon | 0:0ce833f21e63 | 405 | /* Interval in seconds between keepalive echo requests, 0 to disable. */ |
eqon | 0:0ce833f21e63 | 406 | #if 1 |
eqon | 0:0ce833f21e63 | 407 | #define LCP_ECHOINTERVAL 0 |
eqon | 0:0ce833f21e63 | 408 | #else |
eqon | 0:0ce833f21e63 | 409 | |
eqon | 0:0ce833f21e63 | 410 | #define LCP_ECHOINTERVAL 10 |
eqon | 0:0ce833f21e63 | 411 | #endif |
eqon | 0:0ce833f21e63 | 412 | |
eqon | 0:0ce833f21e63 | 413 | |
eqon | 0:0ce833f21e63 | 414 | /* Number of unanswered echo requests before failure. */ |
eqon | 0:0ce833f21e63 | 415 | #define LCP_MAXECHOFAILS 3 |
eqon | 0:0ce833f21e63 | 416 | |
eqon | 0:0ce833f21e63 | 417 | /* Max Xmit idle time (in jiffies) before resend flag char. */ |
eqon | 0:0ce833f21e63 | 418 | #define PPP_MAXIDLEFLAG 0//Send it every time//100 |
eqon | 0:0ce833f21e63 | 419 | |
eqon | 0:0ce833f21e63 | 420 | /* |
eqon | 0:0ce833f21e63 | 421 | * Packet sizes |
eqon | 0:0ce833f21e63 | 422 | * |
eqon | 0:0ce833f21e63 | 423 | * Note - lcp shouldn't be allowed to negotiate stuff outside these |
eqon | 0:0ce833f21e63 | 424 | * limits. See lcp.h in the pppd directory. |
eqon | 0:0ce833f21e63 | 425 | * (XXX - these constants should simply be shared by lcp.c instead |
eqon | 0:0ce833f21e63 | 426 | * of living in lcp.h) |
eqon | 0:0ce833f21e63 | 427 | */ |
eqon | 0:0ce833f21e63 | 428 | #define PPP_MTU 1500 /* Default MTU (size of Info field) */ |
eqon | 0:0ce833f21e63 | 429 | #if 0 |
eqon | 0:0ce833f21e63 | 430 | #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) |
eqon | 0:0ce833f21e63 | 431 | #else |
eqon | 0:0ce833f21e63 | 432 | |
eqon | 0:0ce833f21e63 | 433 | #define PPP_MAXMTU 1500 /* Largest MTU we allow */ |
eqon | 0:0ce833f21e63 | 434 | #endif |
eqon | 0:0ce833f21e63 | 435 | |
eqon | 0:0ce833f21e63 | 436 | #define PPP_MINMTU 64 |
eqon | 0:0ce833f21e63 | 437 | #define PPP_MRU 1500 /* default MRU = max length of info field */ |
eqon | 0:0ce833f21e63 | 438 | #define PPP_MAXMRU 1500 /* Largest MRU we allow */ |
eqon | 0:0ce833f21e63 | 439 | #define PPP_DEFMRU 296 /* Try for this */ |
eqon | 0:0ce833f21e63 | 440 | #define PPP_MINMRU 128 /* No MRUs below this */ |
eqon | 0:0ce833f21e63 | 441 | |
eqon | 0:0ce833f21e63 | 442 | |
eqon | 0:0ce833f21e63 | 443 | #define MAXNAMELEN 64 /* max length of hostname or name for auth */ |
eqon | 0:0ce833f21e63 | 444 | #define MAXSECRETLEN 64 /* max length of password or secret */ |
eqon | 0:0ce833f21e63 | 445 | |
eqon | 0:0ce833f21e63 | 446 | #endif /* PPP_SUPPORT > 0 */ |
eqon | 0:0ce833f21e63 | 447 | |
eqon | 0:0ce833f21e63 | 448 | //C++ Compat |
eqon | 0:0ce833f21e63 | 449 | #define try vTry |
eqon | 0:0ce833f21e63 | 450 | |
eqon | 0:0ce833f21e63 | 451 | #endif |
eqon | 0:0ce833f21e63 | 452 | |
eqon | 0:0ce833f21e63 | 453 | |
eqon | 0:0ce833f21e63 | 454 | #endif /* __LWIPOPTS_H__ */ |