12Oct2012MbedLab

Dependents:   Lab3_VoiceMeter

Fork of EthernetNetIf by Donatien Garnier

Committer:
psawant9
Date:
Fri Oct 12 16:02:00 2012 +0000
Revision:
6:22ce63eddd2b
Parent:
5:bc7df6da7589
Done

Who changed what in which revision?

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