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