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