Xbee test 2

Dependencies:   XBee mbed

Committer:
takashiyamanoue
Date:
Sat Jul 21 04:08:27 2012 +0000
Revision:
0:ffac63d6a7f0
xbee test 2

Who changed what in which revision?

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