Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop
lwipopts.h
00001 /* 00002 * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright notice, 00011 * this list of conditions and the following disclaimer in the documentation 00012 * and/or other materials provided with the distribution. 00013 * 3. The name of the author may not be used to endorse or promote products 00014 * derived from this software without specific prior written permission. 00015 * 00016 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00017 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00018 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00019 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00020 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00021 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00022 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00023 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00024 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00025 * OF SUCH DAMAGE. 00026 * 00027 * This file is part of the lwIP TCP/IP stack. 00028 * 00029 * Author: Adam Dunkels <adam@sics.se> 00030 * 00031 */ 00032 #ifndef LWIP_LWIPOPTS_H 00033 #define LWIP_LWIPOPTS_H 00034 00035 #ifdef LWIP_OPTTEST_FILE 00036 #include "lwipopts_test.h" 00037 #else /* LWIP_OPTTEST_FILE */ 00038 00039 #define LWIP_IPV4 1 00040 #define LWIP_IPV6 0 00041 00042 #define NO_SYS 0 00043 #define LWIP_SOCKET (NO_SYS==0) 00044 #define LWIP_NETCONN (NO_SYS==0) 00045 #define LWIP_NETIF_API (NO_SYS==0) 00046 00047 #define LWIP_IGMP LWIP_IPV4 00048 #define LWIP_ICMP LWIP_IPV4 00049 00050 #define LWIP_SNMP LWIP_UDP 00051 #define MIB2_STATS LWIP_SNMP 00052 #ifdef LWIP_HAVE_MBEDTLS 00053 #define LWIP_SNMP_V3 (LWIP_SNMP) 00054 #endif 00055 00056 #define LWIP_DNS LWIP_UDP 00057 #define LWIP_MDNS_RESPONDER LWIP_UDP 00058 00059 #define LWIP_NUM_NETIF_CLIENT_DATA (LWIP_MDNS_RESPONDER) 00060 00061 #define LWIP_HAVE_LOOPIF 1 00062 #define LWIP_NETIF_LOOPBACK 1 00063 #define LWIP_LOOPBACK_MAX_PBUFS 10 00064 00065 #define TCP_LISTEN_BACKLOG 1 00066 00067 #define LWIP_COMPAT_SOCKETS 1 00068 #define LWIP_SO_RCVTIMEO 1 00069 #define LWIP_SO_RCVBUF 1 00070 00071 #define LWIP_TCPIP_CORE_LOCKING 1 00072 00073 #define LWIP_NETIF_LINK_CALLBACK 1 00074 #define LWIP_NETIF_STATUS_CALLBACK 1 00075 #define LWIP_NETIF_EXT_STATUS_CALLBACK 1 00076 00077 //#define LWIP_DEBUG 00078 #ifdef LWIP_DEBUG 00079 00080 #define LWIP_DBG_MIN_LEVEL 0 00081 #define PPP_DEBUG LWIP_DBG_OFF 00082 #define MEM_DEBUG LWIP_DBG_OFF 00083 #define MEMP_DEBUG LWIP_DBG_OFF 00084 #define PBUF_DEBUG LWIP_DBG_OFF 00085 #define API_LIB_DEBUG LWIP_DBG_OFF 00086 #define API_MSG_DEBUG LWIP_DBG_OFF 00087 #define TCPIP_DEBUG LWIP_DBG_OFF 00088 #define NETIF_DEBUG LWIP_DBG_OFF 00089 #define SOCKETS_DEBUG LWIP_DBG_OFF 00090 #define DNS_DEBUG LWIP_DBG_OFF 00091 #define AUTOIP_DEBUG LWIP_DBG_OFF 00092 #define DHCP_DEBUG LWIP_DBG_OFF 00093 #define IP_DEBUG LWIP_DBG_OFF 00094 #define IP_REASS_DEBUG LWIP_DBG_OFF 00095 #define ICMP_DEBUG LWIP_DBG_OFF 00096 #define IGMP_DEBUG LWIP_DBG_OFF 00097 #define UDP_DEBUG LWIP_DBG_OFF 00098 #define TCP_DEBUG LWIP_DBG_OFF 00099 #define TCP_INPUT_DEBUG LWIP_DBG_OFF 00100 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF 00101 #define TCP_RTO_DEBUG LWIP_DBG_OFF 00102 #define TCP_CWND_DEBUG LWIP_DBG_OFF 00103 #define TCP_WND_DEBUG LWIP_DBG_OFF 00104 #define TCP_FR_DEBUG LWIP_DBG_OFF 00105 #define TCP_QLEN_DEBUG LWIP_DBG_OFF 00106 #define TCP_RST_DEBUG LWIP_DBG_OFF 00107 #endif 00108 00109 #define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) 00110 00111 00112 /* ---------- Memory options ---------- */ 00113 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which 00114 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 00115 byte alignment -> define MEM_ALIGNMENT to 2. */ 00116 /* MSVC port: intel processors don't need 4-byte alignment, 00117 but are faster that way! */ 00118 #define MEM_ALIGNMENT 4U 00119 00120 /* MEM_SIZE: the size of the heap memory. If the application will send 00121 a lot of data that needs to be copied, this should be set high. */ 00122 #define MEM_SIZE 10240 00123 00124 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application 00125 sends a lot of data out of ROM (or other static memory), this 00126 should be set high. */ 00127 #define MEMP_NUM_PBUF 16 00128 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One 00129 per active RAW "connection". */ 00130 #define MEMP_NUM_RAW_PCB 3 00131 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One 00132 per active UDP "connection". */ 00133 #define MEMP_NUM_UDP_PCB 40 00134 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP 00135 connections. */ 00136 #define MEMP_NUM_TCP_PCB 5 00137 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP 00138 connections. */ 00139 #define MEMP_NUM_TCP_PCB_LISTEN 8 00140 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP 00141 segments. */ 00142 #define MEMP_NUM_TCP_SEG 16 00143 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active 00144 timeouts. */ 00145 #define MEMP_NUM_SYS_TIMEOUT 17 00146 00147 /* The following four are used only with the sequential API and can be 00148 set to 0 if the application only will use the raw API. */ 00149 /* MEMP_NUM_NETBUF: the number of struct netbufs. */ 00150 #define MEMP_NUM_NETBUF 2 00151 /* MEMP_NUM_NETCONN: the number of struct netconns. */ 00152 #define MEMP_NUM_NETCONN 10 00153 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used 00154 for sequential API communication and incoming packets. Used in 00155 src/api/tcpip.c. */ 00156 #define MEMP_NUM_TCPIP_MSG_API 16 00157 #define MEMP_NUM_TCPIP_MSG_INPKT 16 00158 00159 00160 /* ---------- Pbuf options ---------- */ 00161 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ 00162 #define PBUF_POOL_SIZE 120 00163 00164 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ 00165 #define PBUF_POOL_BUFSIZE 512 00166 00167 /** SYS_LIGHTWEIGHT_PROT 00168 * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection 00169 * for certain critical regions during buffer allocation, deallocation and memory 00170 * allocation and deallocation. 00171 */ 00172 #define SYS_LIGHTWEIGHT_PROT (NO_SYS==0) 00173 00174 00175 /* ---------- TCP options ---------- */ 00176 #define LWIP_TCP 0 00177 #define TCP_TTL 255 00178 00179 #define LWIP_ALTCP (LWIP_TCP) 00180 #ifdef LWIP_HAVE_MBEDTLS 00181 #define LWIP_ALTCP_TLS (LWIP_TCP) 00182 #define LWIP_ALTCP_TLS_MBEDTLS (LWIP_TCP) 00183 #endif 00184 00185 00186 /* Controls if TCP should queue segments that arrive out of 00187 order. Define to 0 if your device is low on memory. */ 00188 #define TCP_QUEUE_OOSEQ 1 00189 00190 /* TCP Maximum segment size. */ 00191 #define TCP_MSS 1024 00192 00193 /* TCP sender buffer space (bytes). */ 00194 #define TCP_SND_BUF 2048 00195 00196 /* TCP sender buffer space (pbufs). This must be at least = 2 * 00197 TCP_SND_BUF/TCP_MSS for things to work. */ 00198 #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS) 00199 00200 /* TCP writable space (bytes). This must be less than or equal 00201 to TCP_SND_BUF. It is the amount of space which must be 00202 available in the tcp snd_buf for select to return writable */ 00203 #define TCP_SNDLOWAT (TCP_SND_BUF/2) 00204 00205 /* TCP receive window. */ 00206 #define TCP_WND (20 * 1024) 00207 00208 /* Maximum number of retransmissions of data segments. */ 00209 #define TCP_MAXRTX 12 00210 00211 /* Maximum number of retransmissions of SYN segments. */ 00212 #define TCP_SYNMAXRTX 4 00213 00214 00215 /* ---------- ARP options ---------- */ 00216 #define LWIP_ARP 1 00217 #define ARP_TABLE_SIZE 10 00218 #define ARP_QUEUEING 1 00219 00220 00221 /* ---------- IP options ---------- */ 00222 /* Define IP_FORWARD to 1 if you wish to have the ability to forward 00223 IP packets across network interfaces. If you are going to run lwIP 00224 on a device with only one network interface, define this to 0. */ 00225 #define IP_FORWARD 1 00226 00227 /* IP reassembly and segmentation.These are orthogonal even 00228 * if they both deal with IP fragments */ 00229 #define IP_REASSEMBLY 1 00230 #define IP_REASS_MAX_PBUFS (10 * ((1500 + PBUF_POOL_BUFSIZE - 1) / PBUF_POOL_BUFSIZE)) 00231 #define MEMP_NUM_REASSDATA IP_REASS_MAX_PBUFS 00232 #define IP_FRAG 1 00233 #define IPV6_FRAG_COPYHEADER 1 00234 00235 /* ---------- ICMP options ---------- */ 00236 #define ICMP_TTL 255 00237 00238 00239 /* ---------- DHCP options ---------- */ 00240 /* Define LWIP_DHCP to 1 if you want DHCP configuration of 00241 interfaces. */ 00242 #define LWIP_DHCP 0 /*LWIP_UDP*/ 00243 00244 /* 1 if you want to do an ARP check on the offered address 00245 (recommended). */ 00246 #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) 00247 00248 00249 /* ---------- AUTOIP options ------- */ 00250 #define LWIP_AUTOIP (LWIP_DHCP) 00251 #define LWIP_DHCP_AUTOIP_COOP (LWIP_DHCP && LWIP_AUTOIP) 00252 00253 00254 /* ---------- UDP options ---------- */ 00255 #define LWIP_UDP 1 00256 #define LWIP_UDPLITE LWIP_UDP 00257 #define UDP_TTL 255 00258 00259 00260 /* ---------- RAW options ---------- */ 00261 #define LWIP_RAW 1 00262 00263 00264 /* ---------- Statistics options ---------- */ 00265 00266 #define LWIP_STATS 1 00267 #define LWIP_STATS_DISPLAY 1 00268 00269 #if LWIP_STATS 00270 #define LINK_STATS 1 00271 #define IP_STATS 1 00272 #define ICMP_STATS 1 00273 #define IGMP_STATS 1 00274 #define IPFRAG_STATS 1 00275 #define UDP_STATS 1 00276 #define TCP_STATS 1 00277 #define MEM_STATS 1 00278 #define MEMP_STATS 1 00279 #define PBUF_STATS 1 00280 #define SYS_STATS 1 00281 #endif /* LWIP_STATS */ 00282 00283 /* ---------- NETBIOS options ---------- */ 00284 #define LWIP_NETBIOS_RESPOND_NAME_QUERY 1 00285 00286 /* ---------- PPP options ---------- */ 00287 00288 #define PPP_SUPPORT 0 /* Set > 0 for PPP */ 00289 00290 #if PPP_SUPPORT 00291 00292 #define NUM_PPP 1 /* Max PPP sessions. */ 00293 00294 00295 /* Select modules to enable. Ideally these would be set in the makefile but 00296 * we're limited by the command line length so you need to modify the settings 00297 * in this file. 00298 */ 00299 #define PPPOE_SUPPORT 1 00300 #define PPPOS_SUPPORT 1 00301 00302 #define PAP_SUPPORT 1 /* Set > 0 for PAP. */ 00303 #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ 00304 #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP */ 00305 #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ 00306 #define CCP_SUPPORT 0 /* Set > 0 for CCP */ 00307 #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ 00308 #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ 00309 00310 #endif /* PPP_SUPPORT */ 00311 00312 #endif /* LWIP_OPTTEST_FILE */ 00313 00314 /* The following defines must be done even in OPTTEST mode: */ 00315 #ifdef __cplusplus 00316 extern "C"{ 00317 #endif 00318 00319 #if !defined(NO_SYS) || !NO_SYS /* default is 0 */ 00320 void sys_check_core_locking(void); 00321 #define LWIP_ASSERT_CORE_LOCKED() sys_check_core_locking() 00322 void sys_mark_tcpip_thread(void); 00323 #define LWIP_MARK_TCPIP_THREAD() sys_mark_tcpip_thread() 00324 00325 #if !defined(LWIP_TCPIP_CORE_LOCKING) || LWIP_TCPIP_CORE_LOCKING /* default is 1 */ 00326 void sys_lock_tcpip_core(void); 00327 #define LOCK_TCPIP_CORE() sys_lock_tcpip_core() 00328 void sys_unlock_tcpip_core(void); 00329 #define UNLOCK_TCPIP_CORE() sys_unlock_tcpip_core() 00330 #endif 00331 #endif 00332 00333 #ifdef __cplusplus 00334 } 00335 #endif 00336 00337 #endif /* LWIP_LWIPOPTS_H */
Generated on Sun Jul 31 2022 04:49:47 by
1.7.2