HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

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