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