WebSocketServer test

Dependencies:   mbed

Committer:
gtk2k
Date:
Sun Apr 29 03:58:08 2012 +0000
Revision:
0:74be48b504a5
WebSocketServer

Who changed what in which revision?

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