Committer:
Simon Cooksey
Date:
Thu Nov 17 16:43:53 2016 +0000
Revision:
0:fb7af294d5d9
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Simon Cooksey 0:fb7af294d5d9 1 /* Copyright (C) 2012 mbed.org, MIT License
Simon Cooksey 0:fb7af294d5d9 2 *
Simon Cooksey 0:fb7af294d5d9 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
Simon Cooksey 0:fb7af294d5d9 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
Simon Cooksey 0:fb7af294d5d9 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
Simon Cooksey 0:fb7af294d5d9 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
Simon Cooksey 0:fb7af294d5d9 7 * furnished to do so, subject to the following conditions:
Simon Cooksey 0:fb7af294d5d9 8 *
Simon Cooksey 0:fb7af294d5d9 9 * The above copyright notice and this permission notice shall be included in all copies or
Simon Cooksey 0:fb7af294d5d9 10 * substantial portions of the Software.
Simon Cooksey 0:fb7af294d5d9 11 *
Simon Cooksey 0:fb7af294d5d9 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
Simon Cooksey 0:fb7af294d5d9 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Simon Cooksey 0:fb7af294d5d9 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Simon Cooksey 0:fb7af294d5d9 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Simon Cooksey 0:fb7af294d5d9 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Simon Cooksey 0:fb7af294d5d9 17 */
Simon Cooksey 0:fb7af294d5d9 18
Simon Cooksey 0:fb7af294d5d9 19 #ifndef LWIPOPTS_H
Simon Cooksey 0:fb7af294d5d9 20 #define LWIPOPTS_H
Simon Cooksey 0:fb7af294d5d9 21
Simon Cooksey 0:fb7af294d5d9 22 #include "lwipopts_conf.h"
Simon Cooksey 0:fb7af294d5d9 23
Simon Cooksey 0:fb7af294d5d9 24 // Workaround for Linux timeval
Simon Cooksey 0:fb7af294d5d9 25 #if defined (TOOLCHAIN_GCC)
Simon Cooksey 0:fb7af294d5d9 26 #define LWIP_TIMEVAL_PRIVATE 0
Simon Cooksey 0:fb7af294d5d9 27 #include <sys/time.h>
Simon Cooksey 0:fb7af294d5d9 28 #endif
Simon Cooksey 0:fb7af294d5d9 29
Simon Cooksey 0:fb7af294d5d9 30 // Operating System
Simon Cooksey 0:fb7af294d5d9 31 #define NO_SYS 0
Simon Cooksey 0:fb7af294d5d9 32
Simon Cooksey 0:fb7af294d5d9 33 #if MBED_CONF_LWIP_IPV4_ENABLED
Simon Cooksey 0:fb7af294d5d9 34 #define LWIP_IPV4 1
Simon Cooksey 0:fb7af294d5d9 35 #else
Simon Cooksey 0:fb7af294d5d9 36 #define LWIP_IPV4 0
Simon Cooksey 0:fb7af294d5d9 37 #endif
Simon Cooksey 0:fb7af294d5d9 38 #if MBED_CONF_LWIP_IPV6_ENABLED
Simon Cooksey 0:fb7af294d5d9 39 #define LWIP_IPV6 1
Simon Cooksey 0:fb7af294d5d9 40 #else
Simon Cooksey 0:fb7af294d5d9 41 #define LWIP_IPV6 0
Simon Cooksey 0:fb7af294d5d9 42 #endif
Simon Cooksey 0:fb7af294d5d9 43 #if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
Simon Cooksey 0:fb7af294d5d9 44 #error "Either IPv4 or IPv6 must be enabled."
Simon Cooksey 0:fb7af294d5d9 45 #endif
Simon Cooksey 0:fb7af294d5d9 46
Simon Cooksey 0:fb7af294d5d9 47 // On dual stack configuration how long wait for preferred stack
Simon Cooksey 0:fb7af294d5d9 48 // before selecting either IPv6 or IPv4
Simon Cooksey 0:fb7af294d5d9 49 #if LWIP_IPV4 && LWIP_IPV6
Simon Cooksey 0:fb7af294d5d9 50 #define ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
Simon Cooksey 0:fb7af294d5d9 51 #else
Simon Cooksey 0:fb7af294d5d9 52 #define ADDR_TIMEOUT 0
Simon Cooksey 0:fb7af294d5d9 53 #endif
Simon Cooksey 0:fb7af294d5d9 54
Simon Cooksey 0:fb7af294d5d9 55 #define PREF_IPV4 1
Simon Cooksey 0:fb7af294d5d9 56 #define PREF_IPV6 2
Simon Cooksey 0:fb7af294d5d9 57
Simon Cooksey 0:fb7af294d5d9 58 #if MBED_CONF_LWIP_IP_VER_PREF == 4
Simon Cooksey 0:fb7af294d5d9 59 #define IP_VERSION_PREF PREF_IPV4
Simon Cooksey 0:fb7af294d5d9 60 #endif
Simon Cooksey 0:fb7af294d5d9 61 #if MBED_CONF_LWIP_IP_VER_PREF == 6
Simon Cooksey 0:fb7af294d5d9 62 #define IP_VERSION_PREF PREF_IPV6
Simon Cooksey 0:fb7af294d5d9 63 #endif
Simon Cooksey 0:fb7af294d5d9 64 #ifndef IP_VERSION_PREF
Simon Cooksey 0:fb7af294d5d9 65 #error "Either IPv4 or IPv6 must be preferred."
Simon Cooksey 0:fb7af294d5d9 66 #endif
Simon Cooksey 0:fb7af294d5d9 67
Simon Cooksey 0:fb7af294d5d9 68 //#define LWIP_DEBUG
Simon Cooksey 0:fb7af294d5d9 69
Simon Cooksey 0:fb7af294d5d9 70 #if NO_SYS == 0
Simon Cooksey 0:fb7af294d5d9 71 #include "cmsis_os.h"
Simon Cooksey 0:fb7af294d5d9 72
Simon Cooksey 0:fb7af294d5d9 73 #define SYS_LIGHTWEIGHT_PROT 1
Simon Cooksey 0:fb7af294d5d9 74
Simon Cooksey 0:fb7af294d5d9 75 #define LWIP_RAW 0
Simon Cooksey 0:fb7af294d5d9 76
Simon Cooksey 0:fb7af294d5d9 77 #define TCPIP_MBOX_SIZE 8
Simon Cooksey 0:fb7af294d5d9 78 #define DEFAULT_TCP_RECVMBOX_SIZE 8
Simon Cooksey 0:fb7af294d5d9 79 #define DEFAULT_UDP_RECVMBOX_SIZE 8
Simon Cooksey 0:fb7af294d5d9 80 #define DEFAULT_RAW_RECVMBOX_SIZE 8
Simon Cooksey 0:fb7af294d5d9 81 #define DEFAULT_ACCEPTMBOX_SIZE 8
Simon Cooksey 0:fb7af294d5d9 82
Simon Cooksey 0:fb7af294d5d9 83 #ifdef LWIP_DEBUG
Simon Cooksey 0:fb7af294d5d9 84 #define TCPIP_THREAD_STACKSIZE 1200*2
Simon Cooksey 0:fb7af294d5d9 85 #else
Simon Cooksey 0:fb7af294d5d9 86 #define TCPIP_THREAD_STACKSIZE 1200
Simon Cooksey 0:fb7af294d5d9 87 #endif
Simon Cooksey 0:fb7af294d5d9 88
Simon Cooksey 0:fb7af294d5d9 89 #define TCPIP_THREAD_PRIO (osPriorityNormal)
Simon Cooksey 0:fb7af294d5d9 90
Simon Cooksey 0:fb7af294d5d9 91 #ifdef LWIP_DEBUG
Simon Cooksey 0:fb7af294d5d9 92 #define DEFAULT_THREAD_STACKSIZE 512*2
Simon Cooksey 0:fb7af294d5d9 93 #else
Simon Cooksey 0:fb7af294d5d9 94 #define DEFAULT_THREAD_STACKSIZE 512
Simon Cooksey 0:fb7af294d5d9 95 #endif
Simon Cooksey 0:fb7af294d5d9 96
Simon Cooksey 0:fb7af294d5d9 97 #define MEMP_NUM_SYS_TIMEOUT 16
Simon Cooksey 0:fb7af294d5d9 98
Simon Cooksey 0:fb7af294d5d9 99 #define sys_msleep(ms) sys_msleep(ms)
Simon Cooksey 0:fb7af294d5d9 100
Simon Cooksey 0:fb7af294d5d9 101 #endif
Simon Cooksey 0:fb7af294d5d9 102
Simon Cooksey 0:fb7af294d5d9 103 // 32-bit alignment
Simon Cooksey 0:fb7af294d5d9 104 #define MEM_ALIGNMENT 4
Simon Cooksey 0:fb7af294d5d9 105
Simon Cooksey 0:fb7af294d5d9 106 #define LWIP_RAM_HEAP_POINTER lwip_ram_heap
Simon Cooksey 0:fb7af294d5d9 107
Simon Cooksey 0:fb7af294d5d9 108 #define PBUF_POOL_SIZE 5
Simon Cooksey 0:fb7af294d5d9 109 #define MEMP_NUM_TCP_PCB_LISTEN 4
Simon Cooksey 0:fb7af294d5d9 110 #define MEMP_NUM_TCP_PCB 4
Simon Cooksey 0:fb7af294d5d9 111 #define MEMP_NUM_UDP_PCB 4
Simon Cooksey 0:fb7af294d5d9 112 #define MEMP_NUM_PBUF 8
Simon Cooksey 0:fb7af294d5d9 113 #define MEMP_NUM_NETBUF 8
Simon Cooksey 0:fb7af294d5d9 114
Simon Cooksey 0:fb7af294d5d9 115 #define TCP_QUEUE_OOSEQ 0
Simon Cooksey 0:fb7af294d5d9 116 #define TCP_OVERSIZE 0
Simon Cooksey 0:fb7af294d5d9 117
Simon Cooksey 0:fb7af294d5d9 118 #define LWIP_DHCP LWIP_IPV4
Simon Cooksey 0:fb7af294d5d9 119 #define LWIP_DNS 1
Simon Cooksey 0:fb7af294d5d9 120 #define LWIP_SOCKET 0
Simon Cooksey 0:fb7af294d5d9 121
Simon Cooksey 0:fb7af294d5d9 122 #define SO_REUSE 1
Simon Cooksey 0:fb7af294d5d9 123
Simon Cooksey 0:fb7af294d5d9 124 // Support Multicast
Simon Cooksey 0:fb7af294d5d9 125 #include "stdlib.h"
Simon Cooksey 0:fb7af294d5d9 126 #define LWIP_IGMP LWIP_IPV4
Simon Cooksey 0:fb7af294d5d9 127 #define LWIP_RAND() rand()
Simon Cooksey 0:fb7af294d5d9 128
Simon Cooksey 0:fb7af294d5d9 129 #define LWIP_COMPAT_SOCKETS 0
Simon Cooksey 0:fb7af294d5d9 130 #define LWIP_POSIX_SOCKETS_IO_NAMES 0
Simon Cooksey 0:fb7af294d5d9 131 #define LWIP_SO_RCVTIMEO 1
Simon Cooksey 0:fb7af294d5d9 132 #define LWIP_TCP_KEEPALIVE 1
Simon Cooksey 0:fb7af294d5d9 133
Simon Cooksey 0:fb7af294d5d9 134 // Fragmentation on, as per IPv4 default
Simon Cooksey 0:fb7af294d5d9 135 #define LWIP_IPV6_FRAG LWIP_IPV6
Simon Cooksey 0:fb7af294d5d9 136
Simon Cooksey 0:fb7af294d5d9 137 // Queuing "disabled", as per IPv4 default (so actually queues 1)
Simon Cooksey 0:fb7af294d5d9 138 #define LWIP_ND6_QUEUEING 0
Simon Cooksey 0:fb7af294d5d9 139
Simon Cooksey 0:fb7af294d5d9 140 // Debug Options
Simon Cooksey 0:fb7af294d5d9 141 #define NETIF_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 142 #define PBUF_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 143 #define API_LIB_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 144 #define API_MSG_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 145 #define SOCKETS_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 146 #define ICMP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 147 #define IGMP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 148 #define INET_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 149 #define IP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 150 #define IP_REASS_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 151 #define RAW_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 152 #define MEM_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 153 #define MEMP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 154 #define SYS_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 155 #define TIMERS_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 156 #define TCP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 157 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 158 #define TCP_FR_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 159 #define TCP_RTO_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 160 #define TCP_CWND_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 161 #define TCP_WND_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 162 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 163 #define TCP_RST_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 164 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 165 #define UDP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 166 #define TCPIP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 167 #define SLIP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 168 #define DHCP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 169 #define AUTOIP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 170 #define DNS_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 171 #define IP6_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 172
Simon Cooksey 0:fb7af294d5d9 173 #define PPP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 174 #define ETHARP_DEBUG LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 175 #define UDP_LPC_EMAC LWIP_DBG_OFF
Simon Cooksey 0:fb7af294d5d9 176
Simon Cooksey 0:fb7af294d5d9 177 #ifdef LWIP_DEBUG
Simon Cooksey 0:fb7af294d5d9 178 #define MEMP_OVERFLOW_CHECK 1
Simon Cooksey 0:fb7af294d5d9 179 #define MEMP_SANITY_CHECK 1
Simon Cooksey 0:fb7af294d5d9 180 #else
Simon Cooksey 0:fb7af294d5d9 181 #define LWIP_NOASSERT 1
Simon Cooksey 0:fb7af294d5d9 182 #define LWIP_STATS 0
Simon Cooksey 0:fb7af294d5d9 183 #endif
Simon Cooksey 0:fb7af294d5d9 184
Simon Cooksey 0:fb7af294d5d9 185 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
Simon Cooksey 0:fb7af294d5d9 186 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
Simon Cooksey 0:fb7af294d5d9 187
Simon Cooksey 0:fb7af294d5d9 188 #define LWIP_PLATFORM_BYTESWAP 1
Simon Cooksey 0:fb7af294d5d9 189
Simon Cooksey 0:fb7af294d5d9 190 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
Simon Cooksey 0:fb7af294d5d9 191
Simon Cooksey 0:fb7af294d5d9 192 #if LWIP_TRANSPORT_ETHERNET
Simon Cooksey 0:fb7af294d5d9 193
Simon Cooksey 0:fb7af294d5d9 194 // Broadcast
Simon Cooksey 0:fb7af294d5d9 195 #define IP_SOF_BROADCAST 1
Simon Cooksey 0:fb7af294d5d9 196 #define IP_SOF_BROADCAST_RECV 1
Simon Cooksey 0:fb7af294d5d9 197
Simon Cooksey 0:fb7af294d5d9 198 #define LWIP_BROADCAST_PING 1
Simon Cooksey 0:fb7af294d5d9 199
Simon Cooksey 0:fb7af294d5d9 200 #define LWIP_CHECKSUM_ON_COPY 1
Simon Cooksey 0:fb7af294d5d9 201
Simon Cooksey 0:fb7af294d5d9 202 #define LWIP_NETIF_HOSTNAME 1
Simon Cooksey 0:fb7af294d5d9 203 #define LWIP_NETIF_STATUS_CALLBACK 1
Simon Cooksey 0:fb7af294d5d9 204 #define LWIP_NETIF_LINK_CALLBACK 1
Simon Cooksey 0:fb7af294d5d9 205
Simon Cooksey 0:fb7af294d5d9 206 #elif LWIP_TRANSPORT_PPP
Simon Cooksey 0:fb7af294d5d9 207
Simon Cooksey 0:fb7af294d5d9 208 #define TCP_SND_BUF (3 * 536)
Simon Cooksey 0:fb7af294d5d9 209 #define TCP_WND (2 * 536)
Simon Cooksey 0:fb7af294d5d9 210
Simon Cooksey 0:fb7af294d5d9 211 #define LWIP_ARP 0
Simon Cooksey 0:fb7af294d5d9 212
Simon Cooksey 0:fb7af294d5d9 213 #define PPP_SUPPORT 1
Simon Cooksey 0:fb7af294d5d9 214 #define CHAP_SUPPORT 1
Simon Cooksey 0:fb7af294d5d9 215 #define PAP_SUPPORT 1
Simon Cooksey 0:fb7af294d5d9 216 #define PPP_THREAD_STACKSIZE 4*192
Simon Cooksey 0:fb7af294d5d9 217 #define PPP_THREAD_PRIO 0
Simon Cooksey 0:fb7af294d5d9 218
Simon Cooksey 0:fb7af294d5d9 219 #define MAXNAMELEN 64 /* max length of hostname or name for auth */
Simon Cooksey 0:fb7af294d5d9 220 #define MAXSECRETLEN 64
Simon Cooksey 0:fb7af294d5d9 221
Simon Cooksey 0:fb7af294d5d9 222 #else
Simon Cooksey 0:fb7af294d5d9 223 #error A transport mechanism (Ethernet or PPP) must be defined
Simon Cooksey 0:fb7af294d5d9 224 #endif
Simon Cooksey 0:fb7af294d5d9 225
Simon Cooksey 0:fb7af294d5d9 226 #endif /* LWIPOPTS_H_ */