Library for Bert van Dam's book "ARM MICROCONTROLLERS" For all chapters with internet.

Dependencies:   mbed

Committer:
ICTFBI
Date:
Fri Oct 16 14:28:26 2015 +0000
Revision:
0:4edb816d21e1
Pre-update 16-10-15

Who changed what in which revision?

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