A modified version of http://mbed.org/users/segundo/libraries/NetServices/ljhqix to add HTTP proxy feature (based on http://mbed.org/users/igorsk/programs/NetServicesSource/ltjpag)

Dependents:   SenseClient

Committer:
mimil
Date:
Tue Sep 06 13:26:45 2011 +0000
Revision:
0:308f83189a3f

        

Who changed what in which revision?

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