hattori&ide

Dependencies:   mbed

Committer:
hattori_atsushi
Date:
Sun Dec 18 08:16:01 2022 +0000
Revision:
0:f77369cabd75
hattori

Who changed what in which revision?

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