TwitterExample with newer library (2012Aug)

Dependencies:   EthernetNetIf HTTPClient mbed

Committer:
nxpfan
Date:
Wed Aug 29 03:50:19 2012 +0000
Revision:
0:075157567b0c
simple twitter example with newer library

Who changed what in which revision?

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