Modified version of NetServices. Fixes an issue where connections failed should the HTTP response status line be received in a packet on its own prior to any further headers. Changes are made to the HTTPClient.cpp file's readHeaders method.

Committer:
andrewbonney
Date:
Fri Apr 08 14:39:41 2011 +0000
Revision:
0:ec559500a63f

        

Who changed what in which revision?

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