japanese tweeting sample with newer version libraries

Dependencies:   TextLCD mbed

Committer:
nxpfan
Date:
Fri Aug 31 08:29:07 2012 +0000
Revision:
1:57304b082776
Parent:
0:66c7c9c4f765
mbed-lib has been updated also

Who changed what in which revision?

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