Leest de waarde van een sensor binnen een maakt deze beschikbaar via internet

Dependencies:   NTPClient_NetServices mbed

Committer:
hendrikvincent
Date:
Mon Dec 02 09:01:23 2013 +0000
Revision:
0:05ccbd4f84f1
eerste programma;

Who changed what in which revision?

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