SNMP agent attached to SPI slave

Dependencies:   mbed

Committer:
lorcansmith
Date:
Thu Sep 06 12:52:48 2012 +0000
Revision:
2:25e12a7fe0aa
Parent:
0:2a53a4c3238c
Open source version 1.a

Who changed what in which revision?

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