I have a problem getting this to work. Server only recieves half of the data being sent. Whats wrong

Dependencies:   mbed

Committer:
tax
Date:
Tue Mar 29 13:20:15 2011 +0000
Revision:
0:66300c77c6e9

        

Who changed what in which revision?

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