Experimental HTTPClient with proxy support

Committer:
igorsk
Date:
Wed Jun 29 16:01:58 2011 +0000
Revision:
0:b56b6a05cad4

        

Who changed what in which revision?

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