Dependencies:   mbed

Dependents:   TCP

Committer:
slowness
Date:
Tue Sep 06 18:05:46 2011 +0000
Revision:
0:58c3d014a4e7

        

Who changed what in which revision?

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