Marco Zecchini
/
Example_RTOS
Rtos API example
mbed-os/features/FEATURE_LWIP/lwip-interface/lwipopts.h@0:9fca2b23d0ba, 2019-02-23 (annotated)
- Committer:
- marcozecchini
- Date:
- Sat Feb 23 12:13:36 2019 +0000
- Revision:
- 0:9fca2b23d0ba
final commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcozecchini | 0:9fca2b23d0ba | 1 | /* Copyright (C) 2012 mbed.org, MIT License |
marcozecchini | 0:9fca2b23d0ba | 2 | * |
marcozecchini | 0:9fca2b23d0ba | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
marcozecchini | 0:9fca2b23d0ba | 4 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
marcozecchini | 0:9fca2b23d0ba | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
marcozecchini | 0:9fca2b23d0ba | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
marcozecchini | 0:9fca2b23d0ba | 7 | * furnished to do so, subject to the following conditions: |
marcozecchini | 0:9fca2b23d0ba | 8 | * |
marcozecchini | 0:9fca2b23d0ba | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
marcozecchini | 0:9fca2b23d0ba | 10 | * substantial portions of the Software. |
marcozecchini | 0:9fca2b23d0ba | 11 | * |
marcozecchini | 0:9fca2b23d0ba | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
marcozecchini | 0:9fca2b23d0ba | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
marcozecchini | 0:9fca2b23d0ba | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
marcozecchini | 0:9fca2b23d0ba | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
marcozecchini | 0:9fca2b23d0ba | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
marcozecchini | 0:9fca2b23d0ba | 17 | */ |
marcozecchini | 0:9fca2b23d0ba | 18 | |
marcozecchini | 0:9fca2b23d0ba | 19 | #ifndef LWIPOPTS_H |
marcozecchini | 0:9fca2b23d0ba | 20 | #define LWIPOPTS_H |
marcozecchini | 0:9fca2b23d0ba | 21 | |
marcozecchini | 0:9fca2b23d0ba | 22 | #if MBED_CONF_LWIP_ETHERNET_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 23 | #include "lwipopts_conf.h" |
marcozecchini | 0:9fca2b23d0ba | 24 | #endif |
marcozecchini | 0:9fca2b23d0ba | 25 | |
marcozecchini | 0:9fca2b23d0ba | 26 | // Workaround for Linux timeval |
marcozecchini | 0:9fca2b23d0ba | 27 | #if defined (TOOLCHAIN_GCC) |
marcozecchini | 0:9fca2b23d0ba | 28 | #define LWIP_TIMEVAL_PRIVATE 0 |
marcozecchini | 0:9fca2b23d0ba | 29 | #include <sys/time.h> |
marcozecchini | 0:9fca2b23d0ba | 30 | #endif |
marcozecchini | 0:9fca2b23d0ba | 31 | |
marcozecchini | 0:9fca2b23d0ba | 32 | // Operating System |
marcozecchini | 0:9fca2b23d0ba | 33 | #define NO_SYS 0 |
marcozecchini | 0:9fca2b23d0ba | 34 | |
marcozecchini | 0:9fca2b23d0ba | 35 | #if MBED_CONF_LWIP_IPV4_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 36 | #define LWIP_IPV4 1 |
marcozecchini | 0:9fca2b23d0ba | 37 | #else |
marcozecchini | 0:9fca2b23d0ba | 38 | #define LWIP_IPV4 0 |
marcozecchini | 0:9fca2b23d0ba | 39 | #endif |
marcozecchini | 0:9fca2b23d0ba | 40 | #if MBED_CONF_LWIP_IPV6_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 41 | #define LWIP_IPV6 1 |
marcozecchini | 0:9fca2b23d0ba | 42 | #else |
marcozecchini | 0:9fca2b23d0ba | 43 | #define LWIP_IPV6 0 |
marcozecchini | 0:9fca2b23d0ba | 44 | #endif |
marcozecchini | 0:9fca2b23d0ba | 45 | #if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 46 | #error "Either IPv4 or IPv6 must be enabled." |
marcozecchini | 0:9fca2b23d0ba | 47 | #endif |
marcozecchini | 0:9fca2b23d0ba | 48 | |
marcozecchini | 0:9fca2b23d0ba | 49 | // On dual stack configuration how long to wait for both or preferred stack |
marcozecchini | 0:9fca2b23d0ba | 50 | // addresses before completing bring up. |
marcozecchini | 0:9fca2b23d0ba | 51 | #if LWIP_IPV4 && LWIP_IPV6 |
marcozecchini | 0:9fca2b23d0ba | 52 | #if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE |
marcozecchini | 0:9fca2b23d0ba | 53 | #define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT |
marcozecchini | 0:9fca2b23d0ba | 54 | #define PREF_ADDR_TIMEOUT 0 |
marcozecchini | 0:9fca2b23d0ba | 55 | #else |
marcozecchini | 0:9fca2b23d0ba | 56 | #define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT |
marcozecchini | 0:9fca2b23d0ba | 57 | #define BOTH_ADDR_TIMEOUT 0 |
marcozecchini | 0:9fca2b23d0ba | 58 | #endif |
marcozecchini | 0:9fca2b23d0ba | 59 | #else |
marcozecchini | 0:9fca2b23d0ba | 60 | #define PREF_ADDR_TIMEOUT 0 |
marcozecchini | 0:9fca2b23d0ba | 61 | #define BOTH_ADDR_TIMEOUT 0 |
marcozecchini | 0:9fca2b23d0ba | 62 | #endif |
marcozecchini | 0:9fca2b23d0ba | 63 | |
marcozecchini | 0:9fca2b23d0ba | 64 | #define DHCP_TIMEOUT 60 |
marcozecchini | 0:9fca2b23d0ba | 65 | |
marcozecchini | 0:9fca2b23d0ba | 66 | #define PREF_IPV4 1 |
marcozecchini | 0:9fca2b23d0ba | 67 | #define PREF_IPV6 2 |
marcozecchini | 0:9fca2b23d0ba | 68 | |
marcozecchini | 0:9fca2b23d0ba | 69 | #if MBED_CONF_LWIP_IP_VER_PREF == 4 |
marcozecchini | 0:9fca2b23d0ba | 70 | #define IP_VERSION_PREF PREF_IPV4 |
marcozecchini | 0:9fca2b23d0ba | 71 | #endif |
marcozecchini | 0:9fca2b23d0ba | 72 | #if MBED_CONF_LWIP_IP_VER_PREF == 6 |
marcozecchini | 0:9fca2b23d0ba | 73 | #define IP_VERSION_PREF PREF_IPV6 |
marcozecchini | 0:9fca2b23d0ba | 74 | #endif |
marcozecchini | 0:9fca2b23d0ba | 75 | #ifndef IP_VERSION_PREF |
marcozecchini | 0:9fca2b23d0ba | 76 | #error "Either IPv4 or IPv6 must be preferred." |
marcozecchini | 0:9fca2b23d0ba | 77 | #endif |
marcozecchini | 0:9fca2b23d0ba | 78 | |
marcozecchini | 0:9fca2b23d0ba | 79 | #undef LWIP_DEBUG |
marcozecchini | 0:9fca2b23d0ba | 80 | #if MBED_CONF_LWIP_DEBUG_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 81 | #define LWIP_DEBUG 1 |
marcozecchini | 0:9fca2b23d0ba | 82 | #endif |
marcozecchini | 0:9fca2b23d0ba | 83 | |
marcozecchini | 0:9fca2b23d0ba | 84 | #if NO_SYS == 0 |
marcozecchini | 0:9fca2b23d0ba | 85 | #include "cmsis_os2.h" |
marcozecchini | 0:9fca2b23d0ba | 86 | |
marcozecchini | 0:9fca2b23d0ba | 87 | #define SYS_LIGHTWEIGHT_PROT 1 |
marcozecchini | 0:9fca2b23d0ba | 88 | |
marcozecchini | 0:9fca2b23d0ba | 89 | #define LWIP_RAW 0 |
marcozecchini | 0:9fca2b23d0ba | 90 | |
marcozecchini | 0:9fca2b23d0ba | 91 | #define TCPIP_MBOX_SIZE 8 |
marcozecchini | 0:9fca2b23d0ba | 92 | #define DEFAULT_TCP_RECVMBOX_SIZE 8 |
marcozecchini | 0:9fca2b23d0ba | 93 | #define DEFAULT_UDP_RECVMBOX_SIZE 8 |
marcozecchini | 0:9fca2b23d0ba | 94 | #define DEFAULT_RAW_RECVMBOX_SIZE 8 |
marcozecchini | 0:9fca2b23d0ba | 95 | #define DEFAULT_ACCEPTMBOX_SIZE 8 |
marcozecchini | 0:9fca2b23d0ba | 96 | |
marcozecchini | 0:9fca2b23d0ba | 97 | // Thread stack size for lwip tcpip thread |
marcozecchini | 0:9fca2b23d0ba | 98 | #ifndef MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 99 | #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 |
marcozecchini | 0:9fca2b23d0ba | 100 | #endif |
marcozecchini | 0:9fca2b23d0ba | 101 | |
marcozecchini | 0:9fca2b23d0ba | 102 | #ifdef LWIP_DEBUG |
marcozecchini | 0:9fca2b23d0ba | 103 | #define TCPIP_THREAD_STACKSIZE MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2 |
marcozecchini | 0:9fca2b23d0ba | 104 | #else |
marcozecchini | 0:9fca2b23d0ba | 105 | #define TCPIP_THREAD_STACKSIZE MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 106 | #endif |
marcozecchini | 0:9fca2b23d0ba | 107 | |
marcozecchini | 0:9fca2b23d0ba | 108 | #define TCPIP_THREAD_PRIO (osPriorityNormal) |
marcozecchini | 0:9fca2b23d0ba | 109 | |
marcozecchini | 0:9fca2b23d0ba | 110 | // Thread stack size for lwip system threads |
marcozecchini | 0:9fca2b23d0ba | 111 | #ifndef MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 112 | #define MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE 512 |
marcozecchini | 0:9fca2b23d0ba | 113 | #endif |
marcozecchini | 0:9fca2b23d0ba | 114 | |
marcozecchini | 0:9fca2b23d0ba | 115 | // Thread stack size for private PPP thread |
marcozecchini | 0:9fca2b23d0ba | 116 | #ifndef MBED_CONF_LWIP_PPP_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 117 | #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 |
marcozecchini | 0:9fca2b23d0ba | 118 | #endif |
marcozecchini | 0:9fca2b23d0ba | 119 | |
marcozecchini | 0:9fca2b23d0ba | 120 | #ifdef LWIP_DEBUG |
marcozecchini | 0:9fca2b23d0ba | 121 | #define DEFAULT_THREAD_STACKSIZE MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2 |
marcozecchini | 0:9fca2b23d0ba | 122 | #define PPP_THREAD_STACK_SIZE MBED_CONF_LWIP_PPP_THREAD_STACKSIZE*2 |
marcozecchini | 0:9fca2b23d0ba | 123 | #else |
marcozecchini | 0:9fca2b23d0ba | 124 | #define DEFAULT_THREAD_STACKSIZE MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 125 | #define PPP_THREAD_STACK_SIZE MBED_CONF_LWIP_PPP_THREAD_STACKSIZE |
marcozecchini | 0:9fca2b23d0ba | 126 | #endif |
marcozecchini | 0:9fca2b23d0ba | 127 | |
marcozecchini | 0:9fca2b23d0ba | 128 | #define MEMP_NUM_SYS_TIMEOUT 16 |
marcozecchini | 0:9fca2b23d0ba | 129 | |
marcozecchini | 0:9fca2b23d0ba | 130 | #define sys_msleep(ms) sys_msleep(ms) |
marcozecchini | 0:9fca2b23d0ba | 131 | |
marcozecchini | 0:9fca2b23d0ba | 132 | #endif |
marcozecchini | 0:9fca2b23d0ba | 133 | |
marcozecchini | 0:9fca2b23d0ba | 134 | // 32-bit alignment |
marcozecchini | 0:9fca2b23d0ba | 135 | #define MEM_ALIGNMENT 4 |
marcozecchini | 0:9fca2b23d0ba | 136 | |
marcozecchini | 0:9fca2b23d0ba | 137 | #define LWIP_RAM_HEAP_POINTER lwip_ram_heap |
marcozecchini | 0:9fca2b23d0ba | 138 | |
marcozecchini | 0:9fca2b23d0ba | 139 | // Number of pool pbufs. |
marcozecchini | 0:9fca2b23d0ba | 140 | // Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS) |
marcozecchini | 0:9fca2b23d0ba | 141 | #ifdef MBED_CONF_LWIP_PBUF_POOL_SIZE |
marcozecchini | 0:9fca2b23d0ba | 142 | #undef PBUF_POOL_SIZE |
marcozecchini | 0:9fca2b23d0ba | 143 | #define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE |
marcozecchini | 0:9fca2b23d0ba | 144 | #else |
marcozecchini | 0:9fca2b23d0ba | 145 | #ifndef PBUF_POOL_SIZE |
marcozecchini | 0:9fca2b23d0ba | 146 | #define PBUF_POOL_SIZE 5 |
marcozecchini | 0:9fca2b23d0ba | 147 | #endif |
marcozecchini | 0:9fca2b23d0ba | 148 | #endif |
marcozecchini | 0:9fca2b23d0ba | 149 | |
marcozecchini | 0:9fca2b23d0ba | 150 | #ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE |
marcozecchini | 0:9fca2b23d0ba | 151 | #undef PBUF_POOL_BUFSIZE |
marcozecchini | 0:9fca2b23d0ba | 152 | #define PBUF_POOL_BUFSIZE MBED_CONF_LWIP_PBUF_POOL_BUFSIZE |
marcozecchini | 0:9fca2b23d0ba | 153 | #endif |
marcozecchini | 0:9fca2b23d0ba | 154 | |
marcozecchini | 0:9fca2b23d0ba | 155 | #ifdef MBED_CONF_LWIP_MEM_SIZE |
marcozecchini | 0:9fca2b23d0ba | 156 | #undef MEM_SIZE |
marcozecchini | 0:9fca2b23d0ba | 157 | #define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE |
marcozecchini | 0:9fca2b23d0ba | 158 | #endif |
marcozecchini | 0:9fca2b23d0ba | 159 | |
marcozecchini | 0:9fca2b23d0ba | 160 | // One tcp_pcb_listen is needed for each TCPServer. |
marcozecchini | 0:9fca2b23d0ba | 161 | // Each requires 72 bytes of RAM. |
marcozecchini | 0:9fca2b23d0ba | 162 | #ifdef MBED_CONF_LWIP_TCP_SERVER_MAX |
marcozecchini | 0:9fca2b23d0ba | 163 | #define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX |
marcozecchini | 0:9fca2b23d0ba | 164 | #else |
marcozecchini | 0:9fca2b23d0ba | 165 | #define MEMP_NUM_TCP_PCB_LISTEN 4 |
marcozecchini | 0:9fca2b23d0ba | 166 | #endif |
marcozecchini | 0:9fca2b23d0ba | 167 | |
marcozecchini | 0:9fca2b23d0ba | 168 | // One is tcp_pcb needed for each TCPSocket. |
marcozecchini | 0:9fca2b23d0ba | 169 | // Each requires 196 bytes of RAM. |
marcozecchini | 0:9fca2b23d0ba | 170 | #ifdef MBED_CONF_LWIP_TCP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 171 | #define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 172 | #else |
marcozecchini | 0:9fca2b23d0ba | 173 | #define MEMP_NUM_TCP_PCB 4 |
marcozecchini | 0:9fca2b23d0ba | 174 | #endif |
marcozecchini | 0:9fca2b23d0ba | 175 | |
marcozecchini | 0:9fca2b23d0ba | 176 | // One udp_pcb is needed for each UDPSocket. |
marcozecchini | 0:9fca2b23d0ba | 177 | // Each requires 84 bytes of RAM (total rounded to multiple of 512). |
marcozecchini | 0:9fca2b23d0ba | 178 | #ifdef MBED_CONF_LWIP_UDP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 179 | #define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 180 | #else |
marcozecchini | 0:9fca2b23d0ba | 181 | #define MEMP_NUM_UDP_PCB 4 |
marcozecchini | 0:9fca2b23d0ba | 182 | #endif |
marcozecchini | 0:9fca2b23d0ba | 183 | |
marcozecchini | 0:9fca2b23d0ba | 184 | // Number of non-pool pbufs. |
marcozecchini | 0:9fca2b23d0ba | 185 | // Each requires 92 bytes of RAM. |
marcozecchini | 0:9fca2b23d0ba | 186 | #ifndef MEMP_NUM_PBUF |
marcozecchini | 0:9fca2b23d0ba | 187 | #define MEMP_NUM_PBUF 8 |
marcozecchini | 0:9fca2b23d0ba | 188 | #endif |
marcozecchini | 0:9fca2b23d0ba | 189 | |
marcozecchini | 0:9fca2b23d0ba | 190 | // Each netbuf requires 64 bytes of RAM. |
marcozecchini | 0:9fca2b23d0ba | 191 | #ifndef MEMP_NUM_NETBUF |
marcozecchini | 0:9fca2b23d0ba | 192 | #define MEMP_NUM_NETBUF 8 |
marcozecchini | 0:9fca2b23d0ba | 193 | #endif |
marcozecchini | 0:9fca2b23d0ba | 194 | |
marcozecchini | 0:9fca2b23d0ba | 195 | // One netconn is needed for each UDPSocket, TCPSocket or TCPServer. |
marcozecchini | 0:9fca2b23d0ba | 196 | // Each requires 236 bytes of RAM (total rounded to multiple of 512). |
marcozecchini | 0:9fca2b23d0ba | 197 | #ifdef MBED_CONF_LWIP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 198 | #define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX |
marcozecchini | 0:9fca2b23d0ba | 199 | #else |
marcozecchini | 0:9fca2b23d0ba | 200 | #define MEMP_NUM_NETCONN 4 |
marcozecchini | 0:9fca2b23d0ba | 201 | #endif |
marcozecchini | 0:9fca2b23d0ba | 202 | |
marcozecchini | 0:9fca2b23d0ba | 203 | #if MBED_CONF_LWIP_TCP_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 204 | #define LWIP_TCP 1 |
marcozecchini | 0:9fca2b23d0ba | 205 | #define TCP_QUEUE_OOSEQ 0 |
marcozecchini | 0:9fca2b23d0ba | 206 | #define TCP_OVERSIZE 0 |
marcozecchini | 0:9fca2b23d0ba | 207 | #define LWIP_TCP_KEEPALIVE 1 |
marcozecchini | 0:9fca2b23d0ba | 208 | #else |
marcozecchini | 0:9fca2b23d0ba | 209 | #define LWIP_TCP 0 |
marcozecchini | 0:9fca2b23d0ba | 210 | #endif |
marcozecchini | 0:9fca2b23d0ba | 211 | |
marcozecchini | 0:9fca2b23d0ba | 212 | #define LWIP_DNS 1 |
marcozecchini | 0:9fca2b23d0ba | 213 | #define LWIP_SOCKET 0 |
marcozecchini | 0:9fca2b23d0ba | 214 | |
marcozecchini | 0:9fca2b23d0ba | 215 | #define SO_REUSE 1 |
marcozecchini | 0:9fca2b23d0ba | 216 | |
marcozecchini | 0:9fca2b23d0ba | 217 | // Support Multicast |
marcozecchini | 0:9fca2b23d0ba | 218 | #include "stdlib.h" |
marcozecchini | 0:9fca2b23d0ba | 219 | #define LWIP_IGMP LWIP_IPV4 |
marcozecchini | 0:9fca2b23d0ba | 220 | #define LWIP_RAND() lwip_get_random() |
marcozecchini | 0:9fca2b23d0ba | 221 | |
marcozecchini | 0:9fca2b23d0ba | 222 | #define LWIP_COMPAT_SOCKETS 0 |
marcozecchini | 0:9fca2b23d0ba | 223 | #define LWIP_POSIX_SOCKETS_IO_NAMES 0 |
marcozecchini | 0:9fca2b23d0ba | 224 | #define LWIP_SO_RCVTIMEO 1 |
marcozecchini | 0:9fca2b23d0ba | 225 | |
marcozecchini | 0:9fca2b23d0ba | 226 | #define LWIP_BROADCAST_PING 1 |
marcozecchini | 0:9fca2b23d0ba | 227 | |
marcozecchini | 0:9fca2b23d0ba | 228 | // Fragmentation on, as per IPv4 default |
marcozecchini | 0:9fca2b23d0ba | 229 | #define LWIP_IPV6_FRAG LWIP_IPV6 |
marcozecchini | 0:9fca2b23d0ba | 230 | |
marcozecchini | 0:9fca2b23d0ba | 231 | // Queuing "disabled", as per IPv4 default (so actually queues 1) |
marcozecchini | 0:9fca2b23d0ba | 232 | #define LWIP_ND6_QUEUEING 0 |
marcozecchini | 0:9fca2b23d0ba | 233 | |
marcozecchini | 0:9fca2b23d0ba | 234 | // Debug Options |
marcozecchini | 0:9fca2b23d0ba | 235 | #define NETIF_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 236 | #define PBUF_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 237 | #define API_LIB_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 238 | #define API_MSG_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 239 | #define SOCKETS_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 240 | #define ICMP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 241 | #define IGMP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 242 | #define INET_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 243 | #define IP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 244 | #define IP_REASS_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 245 | #define RAW_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 246 | #define MEM_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 247 | #define MEMP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 248 | #define SYS_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 249 | #define TIMERS_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 250 | #define TCP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 251 | #define TCP_INPUT_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 252 | #define TCP_FR_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 253 | #define TCP_RTO_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 254 | #define TCP_CWND_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 255 | #define TCP_WND_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 256 | #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 257 | #define TCP_RST_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 258 | #define TCP_QLEN_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 259 | #define UDP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 260 | #define TCPIP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 261 | #define SLIP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 262 | #define DHCP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 263 | #define AUTOIP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 264 | #define DNS_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 265 | #define IP6_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 266 | |
marcozecchini | 0:9fca2b23d0ba | 267 | #if MBED_CONF_LWIP_ENABLE_PPP_TRACE |
marcozecchini | 0:9fca2b23d0ba | 268 | #define PPP_DEBUG LWIP_DBG_ON |
marcozecchini | 0:9fca2b23d0ba | 269 | #else |
marcozecchini | 0:9fca2b23d0ba | 270 | #define PPP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 271 | #endif //MBED_CONF_LWIP_ENABLE_PPP_TRACE |
marcozecchini | 0:9fca2b23d0ba | 272 | #define ETHARP_DEBUG LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 273 | #define UDP_LPC_EMAC LWIP_DBG_OFF |
marcozecchini | 0:9fca2b23d0ba | 274 | |
marcozecchini | 0:9fca2b23d0ba | 275 | #ifdef LWIP_DEBUG |
marcozecchini | 0:9fca2b23d0ba | 276 | #define MEMP_OVERFLOW_CHECK 1 |
marcozecchini | 0:9fca2b23d0ba | 277 | #define MEMP_SANITY_CHECK 1 |
marcozecchini | 0:9fca2b23d0ba | 278 | #define LWIP_DBG_TYPES_ON LWIP_DBG_ON |
marcozecchini | 0:9fca2b23d0ba | 279 | #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL |
marcozecchini | 0:9fca2b23d0ba | 280 | #else |
marcozecchini | 0:9fca2b23d0ba | 281 | #define LWIP_NOASSERT 1 |
marcozecchini | 0:9fca2b23d0ba | 282 | #define LWIP_STATS 0 |
marcozecchini | 0:9fca2b23d0ba | 283 | #endif |
marcozecchini | 0:9fca2b23d0ba | 284 | |
marcozecchini | 0:9fca2b23d0ba | 285 | #define TRACE_TO_ASCII_HEX_DUMP 0 |
marcozecchini | 0:9fca2b23d0ba | 286 | |
marcozecchini | 0:9fca2b23d0ba | 287 | #define LWIP_PLATFORM_BYTESWAP 1 |
marcozecchini | 0:9fca2b23d0ba | 288 | |
marcozecchini | 0:9fca2b23d0ba | 289 | #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1 |
marcozecchini | 0:9fca2b23d0ba | 290 | |
marcozecchini | 0:9fca2b23d0ba | 291 | // Interface type configuration |
marcozecchini | 0:9fca2b23d0ba | 292 | |
marcozecchini | 0:9fca2b23d0ba | 293 | #if MBED_CONF_LWIP_ETHERNET_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 294 | #define LWIP_ARP 1 |
marcozecchini | 0:9fca2b23d0ba | 295 | #define LWIP_ETHERNET 1 |
marcozecchini | 0:9fca2b23d0ba | 296 | #define LWIP_DHCP LWIP_IPV4 |
marcozecchini | 0:9fca2b23d0ba | 297 | #else |
marcozecchini | 0:9fca2b23d0ba | 298 | #define LWIP_ARP 0 |
marcozecchini | 0:9fca2b23d0ba | 299 | #define LWIP_ETHERNET 0 |
marcozecchini | 0:9fca2b23d0ba | 300 | #endif // MBED_CONF_LWIP_ETHERNET_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 301 | |
marcozecchini | 0:9fca2b23d0ba | 302 | // Note generic macro name used rather than MBED_CONF_LWIP_PPP_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 303 | // to allow users like PPPCellularInterface to detect that nsapi_ppp.h is available. |
marcozecchini | 0:9fca2b23d0ba | 304 | #if NSAPI_PPP_AVAILABLE |
marcozecchini | 0:9fca2b23d0ba | 305 | #define PPP_SUPPORT 1 |
marcozecchini | 0:9fca2b23d0ba | 306 | #if MBED_CONF_LWIP_IPV6_ENABLED |
marcozecchini | 0:9fca2b23d0ba | 307 | #define PPP_IPV6_SUPPORT 1 |
marcozecchini | 0:9fca2b23d0ba | 308 | // Disable DAD for PPP |
marcozecchini | 0:9fca2b23d0ba | 309 | #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0 |
marcozecchini | 0:9fca2b23d0ba | 310 | #endif |
marcozecchini | 0:9fca2b23d0ba | 311 | #define CHAP_SUPPORT 1 |
marcozecchini | 0:9fca2b23d0ba | 312 | #define PPP_INPROC_IRQ_SAFE 1 |
marcozecchini | 0:9fca2b23d0ba | 313 | // Save RAM |
marcozecchini | 0:9fca2b23d0ba | 314 | #define PAP_SUPPORT 0 |
marcozecchini | 0:9fca2b23d0ba | 315 | #define VJ_SUPPORT 0 |
marcozecchini | 0:9fca2b23d0ba | 316 | #define PRINTPKT_SUPPORT 0 |
marcozecchini | 0:9fca2b23d0ba | 317 | |
marcozecchini | 0:9fca2b23d0ba | 318 | // Broadcast |
marcozecchini | 0:9fca2b23d0ba | 319 | #define IP_SOF_BROADCAST 0 |
marcozecchini | 0:9fca2b23d0ba | 320 | #define IP_SOF_BROADCAST_RECV 0 |
marcozecchini | 0:9fca2b23d0ba | 321 | |
marcozecchini | 0:9fca2b23d0ba | 322 | #define MAXNAMELEN 64 /* max length of hostname or name for auth */ |
marcozecchini | 0:9fca2b23d0ba | 323 | #define MAXSECRETLEN 64 |
marcozecchini | 0:9fca2b23d0ba | 324 | #endif // NSAPI_PPP_AVAILABLE |
marcozecchini | 0:9fca2b23d0ba | 325 | |
marcozecchini | 0:9fca2b23d0ba | 326 | // Make sure we default these to off, so |
marcozecchini | 0:9fca2b23d0ba | 327 | // LWIP doesn't default to on |
marcozecchini | 0:9fca2b23d0ba | 328 | #ifndef LWIP_ARP |
marcozecchini | 0:9fca2b23d0ba | 329 | #define LWIP_ARP 0 |
marcozecchini | 0:9fca2b23d0ba | 330 | #endif |
marcozecchini | 0:9fca2b23d0ba | 331 | // Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914 |
marcozecchini | 0:9fca2b23d0ba | 332 | #define LWIP_CHECKSUM_ON_COPY 0 |
marcozecchini | 0:9fca2b23d0ba | 333 | |
marcozecchini | 0:9fca2b23d0ba | 334 | #define LWIP_NETIF_HOSTNAME 1 |
marcozecchini | 0:9fca2b23d0ba | 335 | #define LWIP_NETIF_STATUS_CALLBACK 1 |
marcozecchini | 0:9fca2b23d0ba | 336 | #define LWIP_NETIF_LINK_CALLBACK 1 |
marcozecchini | 0:9fca2b23d0ba | 337 | |
marcozecchini | 0:9fca2b23d0ba | 338 | #define DNS_TABLE_SIZE 2 |
marcozecchini | 0:9fca2b23d0ba | 339 | #define DNS_MAX_NAME_LENGTH 128 |
marcozecchini | 0:9fca2b23d0ba | 340 | |
marcozecchini | 0:9fca2b23d0ba | 341 | #include "lwip_random.h" |
marcozecchini | 0:9fca2b23d0ba | 342 | #include "lwip_tcp_isn.h" |
marcozecchini | 0:9fca2b23d0ba | 343 | #define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn |
marcozecchini | 0:9fca2b23d0ba | 344 | #ifdef MBEDTLS_MD5_C |
marcozecchini | 0:9fca2b23d0ba | 345 | #include "mbedtls/inc/mbedtls/md5.h" |
marcozecchini | 0:9fca2b23d0ba | 346 | #define LWIP_USE_EXTERNAL_MBEDTLS 1 |
marcozecchini | 0:9fca2b23d0ba | 347 | #endif |
marcozecchini | 0:9fca2b23d0ba | 348 | |
marcozecchini | 0:9fca2b23d0ba | 349 | #endif /* LWIPOPTS_H_ */ |