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