/* * SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science * * SPDX-License-Identifier: BSD-3-Clause * * SPDX-FileContributor: 2015-2024 Espressif Systems (Shanghai) CO LTD *//* ... */#ifndefLWIP_HDR_ESP_LWIPOPTS_H#defineLWIP_HDR_ESP_LWIPOPTS_H#include"sdkconfig.h"#include<string.h>// For memcpy#include<stdlib.h>// For malloc/free#include<unistd.h>#include<sys/fcntl.h>#include<sys/ioctl.h>#include<sys/types.h>#include<sys/select.h>#include<sys/poll.h>#include"esp_task.h"#include"esp_random.h"#include"sdkconfig.h"#include"sntp/sntp_get_set_time.h"#include"sockets_ext.h"#include"arch/sys_arch.h"15 includes#ifdef__cplusplusextern"C"{#endif/* ----------------------------------------------- ---------- Platform specific locking ---------- -----------------------------------------------*//* ... *//** * LWIP_TCPIP_CORE_LOCKING * Creates a global mutex that is held during TCPIP thread operations. * Can be locked by client code to perform lwIP operations without changing * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and * UNLOCK_TCPIP_CORE(). * Your system should provide mutexes supporting priority inversion to use this. *//* ... */#ifdefCONFIG_LWIP_TCPIP_CORE_LOCKING#defineLWIP_TCPIP_CORE_LOCKING1#ifdefCONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT#defineLWIP_TCPIP_CORE_LOCKING_INPUT1#else#defineLWIP_TCPIP_CORE_LOCKING_INPUT0#endif#defineLOCK_TCPIP_CORE()do{sys_mutex_lock(&lock_tcpip_core);sys_thread_tcpip(LWIP_CORE_LOCK_MARK_HOLDER);}while(0)#defineUNLOCK_TCPIP_CORE()do{sys_thread_tcpip(LWIP_CORE_LOCK_UNMARK_HOLDER);sys_mutex_unlock(&lock_tcpip_core);}while(0)#ifdefCONFIG_LWIP_CHECK_THREAD_SAFETY#defineLWIP_ASSERT_CORE_LOCKED()do{LWIP_ASSERT("Required to lock TCPIP core functionality!",sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER));}while(0)#endif/* CONFIG_LWIP_CHECK_THREAD_SAFETY *//* ... */#else#defineLWIP_TCPIP_CORE_LOCKING0#defineLWIP_TCPIP_CORE_LOCKING_INPUT0#ifdefCONFIG_LWIP_CHECK_THREAD_SAFETY#defineLWIP_ASSERT_CORE_LOCKED()do{LWIP_ASSERT("Required to run in TCPIP context!",sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER));}while(0)#endif/* CONFIG_LWIP_CHECK_THREAD_SAFETY *//* ... */#endif/* CONFIG_LWIP_TCPIP_CORE_LOCKING */#defineLWIP_MARK_TCPIP_THREAD()sys_thread_tcpip(LWIP_CORE_MARK_TCPIP_TASK)/** * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain * critical regions during buffer allocation, deallocation and memory * allocation and deallocation. *//* ... */#defineSYS_LIGHTWEIGHT_PROT1/** * MEMCPY: override this if you have a faster implementation at hand than the * one included in your C library *//* ... */#defineMEMCPY(dst,src,len)memcpy(dst,src,len)/** * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a * call to memcpy() if the length is known at compile time and is small. *//* ... */#defineSMEMCPY(dst,src,len)memcpy(dst,src,len)#defineLWIP_RANDesp_random/* ------------------------------------ ---------- Memory options ---------- ------------------------------------*//* ... *//** * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library * instead of the lwip internal allocator. Can save code size if you * already use it. *//* ... */#defineMEM_LIBC_MALLOC1/*** MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution* speed and usage from interrupts!*//* ... */#defineMEMP_MEM_MALLOC1/** * MEM_ALIGNMENT: should be set to the alignment of the CPU * 4 byte alignment -> #define MEM_ALIGNMENT 4 * 2 byte alignment -> #define MEM_ALIGNMENT 2 *//* ... */#defineMEM_ALIGNMENT4/* ------------------------------------------------ ---------- Internal Memory Pool Sizes ---------- ------------------------------------------------*//* ... *//** * MEMP_NUM_NETCONN: the number of struct netconns. * (only needed if you use the sequential API, like api_lib.c) *//* ... */#defineMEMP_NUM_NETCONNCONFIG_LWIP_MAX_SOCKETS/** * MEMP_NUM_RAW_PCB: Number of raw connection PCBs * (requires the LWIP_RAW option) *//* ... */#defineMEMP_NUM_RAW_PCBCONFIG_LWIP_MAX_RAW_PCBS/** * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. * (requires the LWIP_TCP option) *//* ... */#defineMEMP_NUM_TCP_PCBCONFIG_LWIP_MAX_ACTIVE_TCP/** * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. * (requires the LWIP_TCP option) *//* ... */#defineMEMP_NUM_TCP_PCB_LISTENCONFIG_LWIP_MAX_LISTENING_TCP/** * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One * per active UDP "connection". * (requires the LWIP_UDP option) *//* ... */#defineMEMP_NUM_UDP_PCBCONFIG_LWIP_MAX_UDP_PCBS/* -------------------------------- ---------- ARP options ------- --------------------------------*//* ... *//** * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address * resolution. By default, only the most recent packet is queued per IP address. * This is sufficient for most protocols and mainly reduces TCP connection * startup time. Set this to 1 if you know your application sends more than one * packet in a row to an IP address that is not in the ARP cache. *//* ... */#defineARP_QUEUEING114 defines#ifdefCONFIG_LWIP_DHCPS_STATIC_ENTRIES#defineETHARP_SUPPORT_STATIC_ENTRIES1#else#defineETHARP_SUPPORT_STATIC_ENTRIES0#endif/* -------------------------------- ---------- IP options ---------- --------------------------------*//* ... *//** * LWIP_IPV4==1: Enable IPv4 *//* ... */#ifdefCONFIG_LWIP_IPV4#defineLWIP_IPV41#else#defineLWIP_IPV40#endif/** * IP_REASSEMBLY==1: Reassemble incoming fragmented IP4 packets. Note that * this option does not affect outgoing packet sizes, which can be controlled * via IP_FRAG. *//* ... */#ifdefCONFIG_LWIP_IP4_REASSEMBLY#defineIP_REASSEMBLY1#else#defineIP_REASSEMBLY0#endif/** * IP_FRAG==1: Fragment outgoing IP4 packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP_REASSEMBLY. *//* ... */#ifdefCONFIG_LWIP_IP4_FRAG#defineIP_FRAG1#else#defineIP_FRAG0#endif/** * IP_FORWARD==1: Enables the ability to forward IP packets across network * interfaces. If you are going to run lwIP on a device with only one network * interface, define this to 0. *//* ... */#ifdefCONFIG_LWIP_IP_FORWARD#defineIP_FORWARD1#else#defineIP_FORWARD0#endif/** * IP_NAPT==1: Enables IPv4 Network Address and Port Translation. * Note that CONFIG_LWIP_IP_FORWARD option need to be enabled in * system configuration for the NAPT to work on ESP platform *//* ... */#ifdefCONFIG_LWIP_IPV4_NAPT#defineIP_NAPT1#ifdefCONFIG_LWIP_IPV4_NAPT_PORTMAP#defineIP_NAPT_PORTMAP1#else#defineIP_NAPT_PORTMAP0#endif/* ... */#else#defineIP_NAPT0#endif/** * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived * in this time, the whole packet is discarded. *//* ... */#defineIP_REASS_MAXAGE3/** * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. * Since the received pbufs are enqueued, be sure to configure * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive * packets even if the maximum amount of fragments is enqueued for reassembly! *//* ... */#defineIP_REASS_MAX_PBUFSCONFIG_LWIP_IP_REASS_MAX_PBUFS/** * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. *//* ... */#defineIP_DEFAULT_TTLCONFIG_LWIP_IP_DEFAULT_TTL/* ---------------------------------- ---------- ICMP options ---------- ----------------------------------*//* ... *//** * LWIP_ICMP==1: Enable ICMP module inside the IP stack. * Be careful, disable that make your product non-compliant to RFC1122 *//* ... */#ifdefCONFIG_LWIP_ICMP#defineLWIP_ICMP1#else#defineLWIP_ICMP0#endif/** * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) *//* ... */#ifdefCONFIG_LWIP_BROADCAST_PING#defineLWIP_BROADCAST_PING1#else#defineLWIP_BROADCAST_PING0#endif/** * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) *//* ... */#ifdefCONFIG_LWIP_MULTICAST_PING#defineLWIP_MULTICAST_PING1#else#defineLWIP_MULTICAST_PING0#endif/* --------------------------------- ---------- RAW options ---------- ---------------------------------*//* ... *//** * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. *//* ... */#defineLWIP_RAW1/* ---------------------------------- ---------- DHCP options ---------- ----------------------------------*//* ... */#ifCONFIG_LWIP_IPV4/** * LWIP_DHCP==1: Enable DHCP module. *//* ... */#defineLWIP_DHCP1/** * LWIP_DHCP_CHECKS_OFFERED_ADDRESS: * - Using Address Conflict Detection (ACD) module assures that the offered IP address * is properly probed and announced before binding in DHCP. This conforms to RFC5227, * but takes several seconds. * - Using ARP check, we only send two ARP requests to check for replies. This process * lasts 1 - 2 seconds. * - No conflict detection: We directly bind the offered address. *//* ... */#ifdefCONFIG_LWIP_DHCP_DOES_ARP_CHECK#defineDHCP_DOES_ARP_CHECK1#defineLWIP_DHCP_DOES_ACD_CHECK1/* ... */#elifCONFIG_LWIP_DHCP_DOES_ACD_CHECK#defineDHCP_DOES_ARP_CHECK0#defineLWIP_DHCP_DOES_ACD_CHECK1/* ... */#else#defineDHCP_DOES_ARP_CHECK0#defineLWIP_DHCP_DOES_ACD_CHECK0/* ... */#endif/** * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each * response packet, an callback is called, which has to be provided by the port: * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);*//* ... */#ifdefCONFIG_LWIP_DHCP_GET_NTP_SRV#defineLWIP_DHCP_GET_NTP_SRV1#else#defineLWIP_DHCP_GET_NTP_SRV0#endif/** * ESP specific option only applicable if ESP_DHCP=1 * LWIP_DHCP_DISABLE_CLIENT_ID==1: Do not add option 61 (client-id) to DHCP packets * *//* ... */#ifdefCONFIG_LWIP_DHCP_DISABLE_CLIENT_ID#defineESP_DHCP_DISABLE_CLIENT_ID1#else#defineESP_DHCP_DISABLE_CLIENT_ID0#endif/** * ESP specific option only applicable if ESP_DHCP=1 * CONFIG_LWIP_DHCP_RESTORE_LAST_IP==1: Last valid IP address obtained from DHCP server * is restored after reset/power-up. *//* ... */#ifdefCONFIG_LWIP_DHCP_RESTORE_LAST_IP/* * Make the post-init hook check if we could restore the previously bound address * - if yes reset the state to bound and mark result as ERR_OK (which skips discovery state) * - if no, return false to continue normally to the discovery state *//* ... */#defineLWIP_HOOK_DHCP_POST_INIT(netif,result)\(dhcp_ip_addr_restore(netif)?(dhcp_set_state(dhcp,DHCP_STATE_BOUND),\dhcp_network_changed_link_up(netif),\(result)=ERR_OK,\true):\false).../* ... */#else#defineLWIP_HOOK_DHCP_PRE_DISCOVERY(netif,result)(false)#endif/* CONFIG_LWIP_DHCP_RESTORE_LAST_IP *//** * The maximum of NTP servers requested *//* ... */#defineLWIP_DHCP_MAX_NTP_SERVERSCONFIG_LWIP_DHCP_MAX_NTP_SERVERS/** * CONFIG_LWIP_DHCP_OPTIONS_LEN: The total length of outgoing DHCP option msg. If you have many options * and options value is too long, you can configure the length according to your requirements *//* ... */#defineDHCP_OPTIONS_LENCONFIG_LWIP_DHCP_OPTIONS_LEN/** * LWIP_DHCP_DISABLE_VENDOR_CLASS_ID==1: Do not add option 60 (Vendor Class Identifier) to DHCP packets *//* ... */#defineESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIERCONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID#defineDHCP_DEFINE_CUSTOM_TIMEOUTS1#defineDHCP_COARSE_TIMER_SECSCONFIG_LWIP_DHCP_COARSE_TIMER_SECS#defineDHCP_NEXT_TIMEOUT_THRESHOLD(3)/* Since for embedded devices it's not that hard to miss a discover packet, so lower * the discover and request retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,4,4,4)s. *//* ... */#defineDHCP_REQUEST_BACKOFF_SEQUENCE(state,tries)((uint16_t)(((tries)<5?1<<(tries):16)*250))/* Use custom DHCP timeout type to support longer lease times (with IDF coarse timer granularity) *//* ... */#defineDHCP_TIMEOUT_SIZE_Tu32_t8 definesstaticinlineuint32_ttimeout_from_offered(uint32_tlease,uint32_tmin){uint32_ttimeout=lease;if(timeout==0){timeout=min;}{...}timeout=(timeout+DHCP_COARSE_TIMER_SECS-1)/DHCP_COARSE_TIMER_SECS;returntimeout;}{ ... }#defineDHCP_SET_TIMEOUT_FROM_OFFERED_T0_LEASE(tout,dhcp)do{\(tout)=timeout_from_offered((dhcp)->offered_t0_lease,120);}{...}while(0)...#defineDHCP_SET_TIMEOUT_FROM_OFFERED_T1_RENEW(tout,dhcp)do{\(tout)=timeout_from_offered((dhcp)->offered_t1_renew,(dhcp)->t0_timeout>>1/* 50% */);}{...}while(0)...#defineDHCP_SET_TIMEOUT_FROM_OFFERED_T2_REBIND(tout,dhcp)do{\(tout)=timeout_from_offered((dhcp)->offered_t2_rebind,((dhcp)->t0_timeout/8)*7/* 87.5% */);}{...}while(0)...#defineLWIP_HOOK_DHCP_PARSE_OPTION(netif,dhcp,state,msg,msg_type,option,len,pbuf,offset)\do{LWIP_UNUSED_ARG(msg);\dhcp_parse_extra_opts(dhcp,state,option,len,pbuf,offset);\}{...}while(0)...#defineLWIP_HOOK_DHCP_APPEND_OPTIONS(netif,dhcp,state,msg,msg_type,options_len_ptr)\dhcp_append_extra_opts(netif,state,msg,options_len_ptr);...5 defines/* ... */#endif/* CONFIG_LWIP_IPV4 *//* ------------------------------------ ---------- AUTOIP options ---------- ------------------------------------*//* ... *//** * LWIP_AUTOIP==1: Enable AUTOIP module. *//* ... */#ifdefCONFIG_LWIP_AUTOIP#defineLWIP_AUTOIP1/*** LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on* the same interface at the same time.*//* ... */#defineLWIP_DHCP_AUTOIP_COOP1/*** LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes* that should be sent before falling back on AUTOIP. This can be set* as low as 1 to get an AutoIP address very quickly, but you should* be prepared to handle a changing IP address when DHCP overrides* AutoIP.*//* ... */#defineLWIP_DHCP_AUTOIP_COOP_TRIESCONFIG_LWIP_AUTOIP_TRIES/** * ESP specific option only applicable if ESP_DHCP=1 * LWIP_AUTOIP_MAX_CONFLICTS: Defines max conflicts before rate limiting *//* ... */#defineLWIP_AUTOIP_MAX_CONFLICTSCONFIG_LWIP_AUTOIP_MAX_CONFLICTS/** * ESP specific option only applicable if ESP_DHCP=1 * LWIP_AUTOIP_RATE_LIMIT_INTERVAL: Delay in seconds between successive attempts *//* ... */#defineLWIP_AUTOIP_RATE_LIMIT_INTERVALCONFIG_LWIP_AUTOIP_RATE_LIMIT_INTERVAL5 defines/* ... */#endif/* CONFIG_LWIP_AUTOIP *//* ---------------------------------- ---------- IGMP options ---------- ----------------------------------*//* ... *//** * LWIP_IGMP==1: Turn on IGMP module. *//* ... */#defineLWIP_IGMP1/* ---------------------------------- ---------- DNS options ----------- ----------------------------------*//* ... *//** * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS * transport. *//* ... */#defineLWIP_DNS1/** The maximum number of IP addresses per host *//* ... */#defineDNS_MAX_HOST_IPCONFIG_LWIP_DNS_MAX_HOST_IP/** The maximum of DNS servers *//* ... */#defineDNS_MAX_SERVERSCONFIG_LWIP_DNS_MAX_SERVERS/** ESP specific option only applicable if ESP_DNS=1 * * The last server can be initialized automatically by defining * FALLBACK_DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' *//* ... */#defineDNS_FALLBACK_SERVER_INDEX(DNS_MAX_SERVERS-1)5 defines#ifdefCONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT#defineFALLBACK_DNS_SERVER_ADDRESS(address)\do{ip_addr_t*server_dns=address;\charserver_ip[]=CONFIG_LWIP_FALLBACK_DNS_SERVER_ADDRESS;\ipaddr_aton(server_ip,server_dns);\}{...}while(0).../* ... */#endif/* CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT *//** * LWIP_DNS_SUPPORT_MDNS_QUERIES==1: Enable mDNS queries in hostname resolution. * This option is set via menuconfig. *//* ... */#ifdefCONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES#defineLWIP_DNS_SUPPORT_MDNS_QUERIES1#else#defineLWIP_DNS_SUPPORT_MDNS_QUERIES0#endif/** * LWIP_DNS_SETSERVER_WITH_NETIF: If this is turned on, the dns_setserver_with_netif() is enabled and called * from all internal modules (instead of dns_setserver()) allowing to setup a user callback to collect DNS server * information acquired by the related network interface. *//* ... */#ifdefCONFIG_LWIP_DNS_SETSERVER_WITH_NETIF#defineLWIP_DNS_SETSERVER_WITH_NETIF1#else#defineLWIP_DNS_SETSERVER_WITH_NETIF0#endif/* --------------------------------- ---------- UDP options ---------- ---------------------------------*//* ... *//** * LWIP_UDP==1: Turn on UDP. *//* ... */#defineLWIP_UDP1/** * LWIP_NETBUF_RECVINFO==1: Enable IP_PKTINFO option. * This option is set via menuconfig. *//* ... */#ifdefCONFIG_LWIP_NETBUF_RECVINFO#defineLWIP_NETBUF_RECVINFO1#else#defineLWIP_NETBUF_RECVINFO0#endif/* --------------------------------- ---------- TCP options ---------- ---------------------------------*//* ... *//** * LWIP_TCP==1: Turn on TCP. *//* ... */#defineLWIP_TCP1/** * TCP_WND: The size of a TCP window. This must be at least * (2 * TCP_MSS) for things to work well. * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size * with scaling applied. Maximum window value in the TCP header * will be TCP_WND >> TCP_RCV_SCALE *//* ... */#defineTCP_WNDCONFIG_LWIP_TCP_WND_DEFAULT/** * TCP_MAXRTX: Maximum number of retransmissions of data segments. *//* ... */#defineTCP_MAXRTXCONFIG_LWIP_TCP_MAXRTX/** * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. *//* ... */#defineTCP_SYNMAXRTXCONFIG_LWIP_TCP_SYNMAXRTX/** * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. * Define to 0 if your device is low on memory. *//* ... */#ifdefCONFIG_LWIP_TCP_QUEUE_OOSEQ#defineTCP_QUEUE_OOSEQ1#else#defineTCP_QUEUE_OOSEQ0#endif/** * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs * queued on ooseq per pcb *//* ... */#ifTCP_QUEUE_OOSEQ#defineTCP_OOSEQ_MAX_PBUFSCONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS#endif/** * TCP_OOSEQ_TIMEOUT: Timeout for each pbuf queued in TCP OOSEQ, in RTOs. *//* ... */#ifTCP_QUEUE_OOSEQ#defineTCP_OOSEQ_TIMEOUTCONFIG_LWIP_TCP_OOSEQ_TIMEOUT#endif/** * LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs). *//* ... */#ifdefCONFIG_LWIP_TCP_SACK_OUT#defineLWIP_TCP_SACK_OUT1#else#defineLWIP_TCP_SACK_OUT0#endif/** * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, * you might want to increase this.) * For the receive side, this MSS is advertised to the remote side * when opening a connection. For the transmit size, this MSS sets * an upper limit on the MSS advertised by the remote host. *//* ... */#defineTCP_MSSCONFIG_LWIP_TCP_MSS/** * TCP_SND_BUF: TCP sender buffer space (bytes). * To achieve good performance, this should be at least 2 * TCP_MSS. *//* ... */#defineTCP_SND_BUFCONFIG_LWIP_TCP_SND_BUF_DEFAULT/** * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. *//* ... */#defineTCP_LISTEN_BACKLOG1/** * TCP_OVERSIZE: The maximum number of bytes that tcp_write may * allocate ahead of time *//* ... */#ifdefCONFIG_LWIP_TCP_OVERSIZE_MSS#defineTCP_OVERSIZETCP_MSS#endif#ifdefCONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS#defineTCP_OVERSIZE(TCP_MSS/4)#endif#ifdefCONFIG_LWIP_TCP_OVERSIZE_DISABLE#defineTCP_OVERSIZE0#endif#ifndefTCP_OVERSIZE#error"One of CONFIG_TCP_OVERSIZE_xxx options should be set by sdkconfig"#endif/** * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all * events (accept, sent, etc) that happen in the system. * LWIP_CALLBACK_API==1: The PCB callback function is called directly * for the event. This is the default. *//* ... */#defineLWIP_EVENT_API0#defineLWIP_CALLBACK_API1/** * TCP_TMR_INTERVAL: TCP timer interval *//* ... */#defineTCP_TMR_INTERVALCONFIG_LWIP_TCP_TMR_INTERVAL/** * TCP_MSL: The maximum segment lifetime in milliseconds *//* ... */#defineTCP_MSLCONFIG_LWIP_TCP_MSL/** * TCP_FIN_WAIT_TIMEOUT: The maximum FIN segment lifetime in milliseconds *//* ... */#defineTCP_FIN_WAIT_TIMEOUTCONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT5 defines/** * LWIP_WND_SCALE and TCP_RCV_SCALE: * Set LWIP_WND_SCALE to 1 to enable window scaling. * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the * range of [0..14]). * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large * send window while having a small receive window only. *//* ... */#ifdefCONFIG_LWIP_WND_SCALE#defineLWIP_WND_SCALE1#defineTCP_RCV_SCALECONFIG_LWIP_TCP_RCV_SCALE/* ... */#else#defineLWIP_WND_SCALE0#defineTCP_RCV_SCALE0/* ... */#endif/* CONFIG_LWIP_WND_SCALE *//** * ESP specific option only applicable if ESP_LWIP=1 * LWIP_TCP_RTO_TIME: TCP rto time. * Default is 3 second. *//* ... */#defineLWIP_TCP_RTO_TIMECONFIG_LWIP_TCP_RTO_TIME/* ------------------------------------------------ ---------- Network Interfaces options ---------- ------------------------------------------------*//* ... *//** * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname * field. * LWIP_DHCP_DISCOVER_ADD_HOSTNAME==1: include hostname opt in discover packets. * If the hostname is not set in the DISCOVER packet, then some servers might issue * an OFFER with hostname configured and consequently reject the REQUEST with any other hostname. *//* ... */#defineLWIP_NETIF_HOSTNAME1#defineLWIP_DHCP_DISCOVER_ADD_HOSTNAME1/** * LWIP_NETIF_API==1: Support netif api (in netifapi.c) *//* ... */#ifdefCONFIG_LWIP_NETIF_API#defineLWIP_NETIF_API1#else#defineLWIP_NETIF_API0#endif/** * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface * changes its up/down status (i.e., due to DHCP IP acquisition) *//* ... */#ifdefCONFIG_LWIP_NETIF_STATUS_CALLBACK#defineLWIP_NETIF_STATUS_CALLBACK1#else#defineLWIP_NETIF_STATUS_CALLBACK0#endif/** * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function * for several netif related event that supports multiple subscribers. * * This ext-callback is used by ESP-NETIF with lwip-orig (upstream version) * to provide netif related events on IP4/IP6 address/status changes *//* ... */#defineLWIP_NETIF_EXT_STATUS_CALLBACK1/** * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data * to be sent into one single pbuf. This is for compatibility with DMA-enabled * MACs that do not support scatter-gather. * Beware that this might involve CPU-memcpy before transmitting that would not * be needed without this flag! Use this only if you need to! * * ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX * pbufs for being in one piece. If not, @ref pbuf_clone can be used to get * a single pbuf: * if (p->next != NULL) { * struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p); * if (q == NULL) { * return ERR_MEM; * } * p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller! * } *//* ... */#defineLWIP_NETIF_TX_SINGLE_PBUF1/** * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store * data in client_data member array of struct netif (max. 256). *//* ... */#ifndefCONFIG_LWIP_NUM_NETIF_CLIENT_DATA#defineCONFIG_LWIP_NUM_NETIF_CLIENT_DATA0#endif#ifdefined(CONFIG_ESP_NETIF_BRIDGE_EN)||defined(CONFIG_LWIP_PPP_SUPPORT)/* * If special lwip interfaces (like bridge, ppp) enabled * `netif->state` is used internally and we must store esp-netif ptr * in `netif->client_data` *//* ... */#defineLWIP_ESP_NETIF_DATA(1)/* ... */#else#defineLWIP_ESP_NETIF_DATA(0)#endif#defineLWIP_NUM_NETIF_CLIENT_DATA(LWIP_ESP_NETIF_DATA+CONFIG_LWIP_NUM_NETIF_CLIENT_DATA)/** * BRIDGEIF_MAX_PORTS: this is used to create a typedef used for forwarding * bit-fields: the number of bits required is this + 1 (for the internal/cpu port) *//* ... */#ifdefCONFIG_LWIP_BRIDGEIF_MAX_PORTS#defineBRIDGEIF_MAX_PORTSCONFIG_LWIP_BRIDGEIF_MAX_PORTS#endif/* ------------------------------------ ---------- LOOPIF options ---------- ------------------------------------*//* ... *//** * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). * This is only needed when no real netifs are available. If at least one other*//* ... */#ifdefCONFIG_LWIP_NETIF_LOOPBACK#defineLWIP_HAVE_LOOPIF1/** * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP * address equal to the netif IP address, looping them back up the stack. *//* ... */#defineLWIP_NETIF_LOOPBACK1/** * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback * sending for each netif (0 = disabled) *//* ... */#defineLWIP_LOOPBACK_MAX_PBUFSCONFIG_LWIP_LOOPBACK_MAX_PBUFS/* ... */#else#defineLWIP_HAVE_LOOPIF0#endif/* ------------------------------------ ---------- SLIPIF options ---------- ------------------------------------*//* ... */#ifdefCONFIG_LWIP_SLIP_SUPPORT/** * Enable SLIP receive from ISR functions and disable Rx thread * * This is the only supported mode of lwIP SLIP interface, so that * - incoming packets are queued into pbufs * - no thread is created from lwIP * meaning it is the application responsibility to read data * from IO driver and feed them to the slip interface *//* ... */#defineSLIP_RX_FROM_ISR1#defineSLIP_USE_RX_THREAD0/** * SLIP_DEBUG: Enable debugging for SLIP. *//* ... */#ifdefCONFIG_LWIP_SLIP_DEBUG_ON#defineSLIP_DEBUGLWIP_DBG_ON#else#defineSLIP_DEBUGLWIP_DBG_OFF#endif/* ... */#endif/* CONFIG_LWIP_SLIP_SUPPORT *//* ------------------------------------ ---------- Thread options ---------- ------------------------------------*//* ... *//** * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. *//* ... */#defineTCPIP_THREAD_NAME"tiT"/** * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. * The stack size value itself is platform-dependent, but is passed to * sys_thread_new() when the thread is created. *//* ... */#defineTCPIP_THREAD_STACKSIZEESP_TASK_TCPIP_STACK/** * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when the thread is created. *//* ... */#defineTCPIP_THREAD_PRIOESP_TASK_TCPIP_PRIO/** * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages * The queue size value itself is platform-dependent, but is passed to * sys_mbox_new() when tcpip_init is called. *//* ... */#defineTCPIP_MBOX_SIZECONFIG_LWIP_TCPIP_RECVMBOX_SIZE/** * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. *//* ... */#defineDEFAULT_UDP_RECVMBOX_SIZECONFIG_LWIP_UDP_RECVMBOX_SIZE/** * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. *//* ... */#defineDEFAULT_TCP_RECVMBOX_SIZECONFIG_LWIP_TCP_RECVMBOX_SIZE/** * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. * The queue size value itself is platform-dependent, but is passed to * sys_mbox_new() when the acceptmbox is created. *//* ... */#defineDEFAULT_ACCEPTMBOX_SIZECONFIG_LWIP_TCP_ACCEPTMBOX_SIZE/** * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. * The stack size value itself is platform-dependent, but is passed to * sys_thread_new() when the thread is created. *//* ... */#defineDEFAULT_THREAD_STACKSIZETCPIP_THREAD_STACKSIZE/** * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. * The priority value itself is platform-dependent, but is passed to * sys_thread_new() when the thread is created. *//* ... */#defineDEFAULT_THREAD_PRIOTCPIP_THREAD_PRIO/** * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. *//* ... */#defineDEFAULT_RAW_RECVMBOX_SIZE6/* ---------------------------------------------- ---------- Sequential layer options ---------- ----------------------------------------------*//* ... *//** * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) *//* ... */#defineLWIP_NETCONN1/** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per * thread calling socket/netconn functions instead of allocating one * semaphore per netconn (and per select etc.) * ATTENTION: a thread-local semaphore for API calls is needed: * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). * Ports may call these for threads created with sys_thread_new(). *//* ... */#defineLWIP_NETCONN_SEM_PER_THREAD1/** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, * writing from a 2nd thread and closing from a 3rd thread at the same time. * ATTENTION: This is currently really alpha! Some requirements: * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from * multiple threads at once * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox * and prevent a task pending on this during/after deletion *//* ... */#defineLWIP_NETCONN_FULLDUPLEX1/* ------------------------------------ ---------- Socket options ---------- ------------------------------------*//* ... *//** * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) *//* ... */#defineLWIP_SOCKET1/** * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. * While this helps code completion, it might conflict with existing libraries. * (only used if you use sockets.c) *//* ... */#defineLWIP_COMPAT_SOCKETS0/** * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. * Disable this option if you use a POSIX operating system that uses the same * names (read, write & close). (only used if you use sockets.c) * * POSIX I/O functions are mapped to LWIP via the VFS layer * (see port/vfs_lwip.c) *//* ... *//** *//* ... */#defineLWIP_POSIX_SOCKETS_IO_NAMES0/** * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. * * FD_SETSIZE from sys/types.h is the maximum number of supported file * descriptors and CONFIG_LWIP_MAX_SOCKETS defines the number of sockets; * LWIP_SOCKET_OFFSET is configured to use the largest numbers of file * descriptors for sockets. File descriptors from 0 to LWIP_SOCKET_OFFSET-1 * are non-socket descriptors and from LWIP_SOCKET_OFFSET to FD_SETSIZE are * socket descriptors. *//* ... */#defineLWIP_SOCKET_OFFSET(FD_SETSIZE-CONFIG_LWIP_MAX_SOCKETS)/** * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and * SO_SNDTIMEO processing. *//* ... */#defineLWIP_SO_SNDTIMEO1/** * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and * SO_RCVTIMEO processing. *//* ... */#defineLWIP_SO_RCVTIMEO1/** * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set * in seconds. (does not require sockets.c, and will affect tcp.c) *//* ... */#defineLWIP_TCP_KEEPALIVE120 defines/** * LWIP_SO_LINGER==1: Enable SO_LINGER processing. * This option is set via menuconfig. *//* ... */#ifdefCONFIG_LWIP_SO_LINGER#defineLWIP_SO_LINGER1#else#defineLWIP_SO_LINGER0#endif/** * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. * This option is set via menuconfig. *//* ... */#ifdefCONFIG_LWIP_SO_RCVBUF#defineLWIP_SO_RCVBUF1#else#defineLWIP_SO_RCVBUF0#endif/** * SO_REUSE==1: Enable SO_REUSEADDR option. * This option is set via menuconfig. *//* ... */#ifdefCONFIG_LWIP_SO_REUSE#defineSO_REUSE1#else#defineSO_REUSE0#endif/** * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets * to all local matches if SO_REUSEADDR is turned on. * WARNING: Adds a memcpy for every packet if passing to more than one pcb! *//* ... */#ifdefCONFIG_LWIP_SO_REUSE_RXTOALL#defineSO_REUSE_RXTOALL1#else#defineSO_REUSE_RXTOALL0#endif/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided * by your system, set this to 0 and include <sys/time.h> in cc.h *//* ... */#defineLWIP_TIMEVAL_PRIVATE0/* ---------------------------------------- ---------- Statistics options ---------- ----------------------------------------*//* ... *//** * LWIP_STATS==1: Enable statistics collection in lwip_stats. *//* ... */#ifdefCONFIG_LWIP_STATS#defineLWIP_STATS1#defineESP_STATS_MEM1/** * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. *//* ... */#defineLWIP_STATS_DISPLAY1/* ... */#else#defineLWIP_STATS0#defineESP_STATS_MEM0/* ... */#endif/* CONFIG_LWIP_STATS *//* --------------------------------- ---------- PPP options ---------- ---------------------------------*//* ... *//** * PPP_SUPPORT==1: Enable PPP. *//* ... */#ifdefCONFIG_LWIP_PPP_SUPPORT#definePPP_SUPPORT1/** * PPP_IPV6_SUPPORT == 1: Enable IPV6 support for local link * between modem and lwIP stack. * Some modems do not support IPV6 addressing in local link and * the only option available is to disable IPV6 address negotiation. *//* ... */#definePPP_IPV6_SUPPORTCONFIG_LWIP_PPP_ENABLE_IPV6/** * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support *//* ... */#definePPP_IPV4_SUPPORTCONFIG_LWIP_PPP_ENABLE_IPV4/** * PPP_NOTIFY_PHASE==1: Support PPP notify phase. *//* ... */#definePPP_NOTIFY_PHASECONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT/** * PAP_SUPPORT==1: Support PAP. *//* ... */#definePAP_SUPPORTCONFIG_LWIP_PPP_PAP_SUPPORT/** * CHAP_SUPPORT==1: Support CHAP. *//* ... */#defineCHAP_SUPPORTCONFIG_LWIP_PPP_CHAP_SUPPORT/** * MSCHAP_SUPPORT==1: Support MSCHAP. *//* ... */#defineMSCHAP_SUPPORTCONFIG_LWIP_PPP_MSCHAP_SUPPORT/** * CCP_SUPPORT==1: Support CCP. *//* ... */#defineMPPE_SUPPORTCONFIG_LWIP_PPP_MPPE_SUPPORT/** * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). *//* ... */#definePPP_SERVERCONFIG_LWIP_PPP_SERVER_SUPPORT/** * VJ_SUPPORT==1: Support VJ header compression. *//* ... */#defineVJ_SUPPORTCONFIG_LWIP_PPP_VJ_HEADER_COMPRESSION/** * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. * TODO: If PPP_MAXIDLEFLAG > 0 and next package is send during PPP_MAXIDLEFLAG time, * then 0x7E is not added at the beginning of PPP package but 0x7E termination * is always at the end. This behaviour brokes PPP dial with GSM (PPPoS). * The PPP package should always start and end with 0x7E. *//* ... */#definePPP_MAXIDLEFLAG011 defines#ifdefCONFIG_LWIP_ENABLE_LCP_ECHO/** * LCP_ECHOINTERVAL: Interval in seconds between keepalive LCP echo requests, 0 to disable. *//* ... */#defineLCP_ECHOINTERVALCONFIG_LWIP_LCP_ECHOINTERVAL/** * LCP_MAXECHOFAILS: Number of consecutive unanswered echo requests before failure is indicated. *//* ... */#defineLCP_MAXECHOFAILSCONFIG_LWIP_LCP_MAXECHOFAILS/* ... */#endif/* CONFIG_LWIP_ENABLE_LCP_ECHO *//** * PPP_DEBUG: Enable debugging for PPP. *//* ... */#ifdefCONFIG_LWIP_PPP_DEBUG_ON#definePPP_DEBUGLWIP_DBG_ON#definePRINTPKT_SUPPORT1#definePPP_PROTOCOLNAME1/* ... */#else#definePPP_DEBUGLWIP_DBG_OFF#endif/* CONFIG_LWIP_PPP_DEBUG_ON *//* ... */#else#definePPP_SUPPORT0#endif/* CONFIG_LWIP_PPP_SUPPORT *//** * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library for crypto implementation used in PPP AUTH *//* ... */#ifdefCONFIG_LWIP_USE_EXTERNAL_MBEDTLS#defineLWIP_USE_EXTERNAL_MBEDTLS1#else#defineLWIP_USE_EXTERNAL_MBEDTLS0#endif/* -------------------------------------- ---------- Checksum options ---------- --------------------------------------*//* ... *//** * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. *//* ... */#ifdefCONFIG_LWIP_CHECKSUM_CHECK_IP#defineCHECKSUM_CHECK_IP1#else#defineCHECKSUM_CHECK_IP0#endif/** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. *//* ... */#ifdefCONFIG_LWIP_CHECKSUM_CHECK_UDP#defineCHECKSUM_CHECK_UDP1#else#defineCHECKSUM_CHECK_UDP0#endif/** * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. *//* ... */#ifdefCONFIG_LWIP_CHECKSUM_CHECK_ICMP#defineCHECKSUM_CHECK_ICMP1#else#defineCHECKSUM_CHECK_ICMP0#endif/* --------------------------------------- ---------- IPv6 options --------------- ---------------------------------------*//* ... *//** * LWIP_IPV6==1: Enable IPv6 *//* ... */#ifdefCONFIG_LWIP_IPV6#defineLWIP_IPV61#else#defineLWIP_IPV60#endif/** * LWIP_ND6==1: Enable ND6 protocol in IPv6 *//* ... */#ifdefCONFIG_LWIP_ND6#defineLWIP_ND61#else#defineLWIP_ND60#endif/** * LWIP_FORCE_ROUTER_FORWARDING==1: the router flag in NA packet will always set to 1, * otherwise, never set router flag for NA packets. *//* ... */#ifdefCONFIG_LWIP_FORCE_ROUTER_FORWARDING#defineLWIP_FORCE_ROUTER_FORWARDING1#else#defineLWIP_FORCE_ROUTER_FORWARDING0#endif/** * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. *//* ... */#defineLWIP_IPV6_NUM_ADDRESSESCONFIG_LWIP_IPV6_NUM_ADDRESSES/** * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs *//* ... */#ifdefCONFIG_LWIP_IPV6_FORWARD#defineLWIP_IPV6_FORWARD1#else#defineLWIP_IPV6_FORWARD0#endif/** * LWIP_IPV6_FRAG==1: Fragment outgoing IP6 packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP6_REASSEMBLY. *//* ... */#ifdefCONFIG_LWIP_IP6_FRAG#defineLWIP_IPV6_FRAG1#else#defineLWIP_IPV6_FRAG0#endif/** * LWIP_IPV6_REASS==1: reassemble incoming IP6 packets that fragmented. Note that * this option does not affect outgoing packet sizes, which can be controlled * via LWIP_IP6_FRAG. *//* ... */#ifdefCONFIG_LWIP_IP6_REASSEMBLY#defineLWIP_IPV6_REASS1#else#defineLWIP_IPV6_REASS0#endif/** * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. *//* ... */#ifdefCONFIG_LWIP_IPV6_AUTOCONFIG#defineESP_IPV6_AUTOCONFIG1#else#defineESP_IPV6_AUTOCONFIG0#endif/** * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS * servers to the DNS module. *//* ... */#defineLWIP_ND6_RDNSS_MAX_DNS_SERVERSCONFIG_LWIP_IPV6_RDNSS_MAX_DNS_SERVERS/** * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration. *//* ... */#ifdefCONFIG_LWIP_IPV6_DHCP6#defineLWIP_IPV6_DHCP61#else#defineLWIP_IPV6_DHCP60#endif/** * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. *//* ... */#defineMEMP_NUM_ND6_QUEUECONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE/** * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache *//* ... */#defineLWIP_ND6_NUM_NEIGHBORSCONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS/** * LWIP_ND6_NUM_PREFIXES: Maximum number of entries in IPv6 on-link prefixes cache *//* ... */#defineLWIP_ND6_NUM_PREFIXESCONFIG_LWIP_IPV6_ND6_NUM_PREFIXES/** * LWIP_ND6_NUM_ROUTERS: Maximum number of entries in IPv6 default routers cache *//* ... */#defineLWIP_ND6_NUM_ROUTERSCONFIG_LWIP_IPV6_ND6_NUM_ROUTERS/** * LWIP_ND6_NUM_DESTINATIONS: Maximum number of entries in IPv6 destinations cache *//* ... */#defineLWIP_ND6_NUM_DESTINATIONSCONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS5 defines/* --------------------------------------- ---------- Hook options --------------- ---------------------------------------*//* ... */#ifdefLWIP_HOOK_FILENAME#warningLWIP_HOOK_FILENAMEisusedforIDFdefaulthooks.PleaseuseESP_IDF_LWIP_HOOK_FILENAMEtoinsertadditionalhook#endif#defineLWIP_HOOK_FILENAME"lwip_default_hooks.h"#defineLWIP_HOOK_IP4_ROUTE_SRCip4_route_src_hook#ifLWIP_NETCONN_FULLDUPLEX#defineLWIP_DONE_SOCK(sock)done_socket(sock)#else#defineLWIP_DONE_SOCK(sock)((void)1)#endif/* LWIP_NETCONN_FULLDUPLEX */#defineLWIP_HOOK_SOCKETS_GETSOCKOPT(s,sock,level,optname,optval,optlen,err)\lwip_getsockopt_impl_ext(sock,level,optname,optval,optlen,err)?(LWIP_DONE_SOCK(sock),true):false...#defineLWIP_HOOK_SOCKETS_SETSOCKOPT(s,sock,level,optname,optval,optlen,err)\lwip_setsockopt_impl_ext(sock,level,optname,optval,optlen,err)?(LWIP_DONE_SOCK(sock),true):false.../* --------------------------------------- ---------- Debugging options ---------- ---------------------------------------*//* ... *//** * LWIP_DEBUG: Enable lwip debugging in other modules. *//* ... */#ifdefCONFIG_LWIP_DEBUG#defineLWIP_DEBUGLWIP_DBG_ON#else#undefLWIP_DEBUG#endif/** * ETHARP_DEBUG: Enable debugging in etharp.c. *//* ... */#ifdefCONFIG_LWIP_ETHARP_DEBUG#defineETHARP_DEBUGLWIP_DBG_ON#else#defineETHARP_DEBUGLWIP_DBG_OFF#endif/** * NETIF_DEBUG: Enable debugging in netif.c. *//* ... */#ifdefCONFIG_LWIP_NETIF_DEBUG#defineNETIF_DEBUGLWIP_DBG_ON#else#defineNETIF_DEBUGLWIP_DBG_OFF#endif/** * PBUF_DEBUG: Enable debugging in pbuf.c. *//* ... */#ifdefCONFIG_LWIP_PBUF_DEBUG#definePBUF_DEBUGLWIP_DBG_ON#else#definePBUF_DEBUGLWIP_DBG_OFF#endif/** * API_LIB_DEBUG: Enable debugging in api_lib.c. *//* ... */#ifdefCONFIG_LWIP_API_LIB_DEBUG#defineAPI_LIB_DEBUGLWIP_DBG_ON#else#defineAPI_LIB_DEBUGLWIP_DBG_OFF#endif/** * SOCKETS_DEBUG: Enable debugging in sockets.c. *//* ... */#ifdefCONFIG_LWIP_SOCKETS_DEBUG#defineSOCKETS_DEBUGLWIP_DBG_ON#else#defineSOCKETS_DEBUGLWIP_DBG_OFF#endif/** * ICMP_DEBUG: Enable debugging in icmp.c. *//* ... */#ifdefCONFIG_LWIP_ICMP_DEBUG#defineICMP_DEBUGLWIP_DBG_ON#else#defineICMP_DEBUGLWIP_DBG_OFF#endif#ifdefCONFIG_LWIP_ICMP6_DEBUG#defineICMP6_DEBUGLWIP_DBG_ON#else#defineICMP6_DEBUGLWIP_DBG_OFF#endif/** * DHCP_DEBUG: Enable debugging in dhcp.c. *//* ... */#ifdefCONFIG_LWIP_DHCP_DEBUG#defineDHCP_DEBUGLWIP_DBG_ON#else#defineDHCP_DEBUGLWIP_DBG_OFF#endif#ifdefCONFIG_LWIP_DHCP_STATE_DEBUG#defineESP_DHCP_DEBUGLWIP_DBG_ON#else#defineESP_DHCP_DEBUGLWIP_DBG_OFF#endif/** * IP_DEBUG: Enable debugging for IP. *//* ... */#ifdefCONFIG_LWIP_IP_DEBUG#defineIP_DEBUGLWIP_DBG_ON#else#defineIP_DEBUGLWIP_DBG_OFF#endif/** * IP6_DEBUG: Enable debugging for IP6. *//* ... */#ifdefCONFIG_LWIP_IP6_DEBUG#defineIP6_DEBUGLWIP_DBG_ON#else#defineIP6_DEBUGLWIP_DBG_OFF#endif/** * TCP_DEBUG: Enable debugging for TCP. *//* ... */#ifdefCONFIG_LWIP_TCP_DEBUG#defineTCP_DEBUGLWIP_DBG_ON#else#defineTCP_DEBUGLWIP_DBG_OFF#endif/** * UDP_DEBUG: Enable debugging for UDP. *//* ... */#ifdefCONFIG_LWIP_UDP_DEBUG#defineUDP_DEBUGLWIP_DBG_ON#else#defineUDP_DEBUGLWIP_DBG_OFF#endif/** * SNTP_DEBUG: Enable debugging for SNTP. *//* ... */#ifdefCONFIG_LWIP_SNTP_DEBUG#defineSNTP_DEBUGLWIP_DBG_ON#else#defineSNTP_DEBUGLWIP_DBG_OFF#endif/** * DNS_DEBUG: Enable debugging for DNS. *//* ... */#ifdefCONFIG_LWIP_DNS_DEBUG#defineDNS_DEBUGLWIP_DBG_ON#else#defineDNS_DEBUGLWIP_DBG_OFF#endif/** * NAPT_DEBUG: Enable debugging for NAPT. *//* ... */#ifdefCONFIG_LWIP_NAPT_DEBUG#defineNAPT_DEBUGLWIP_DBG_ON#else#defineNAPT_DEBUGLWIP_DBG_OFF#endif/** * MEMP_DEBUG: Enable debugging in memp.c. *//* ... */#defineMEMP_DEBUGLWIP_DBG_OFF/** * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. *//* ... */#defineTCP_INPUT_DEBUGLWIP_DBG_OFF/** * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. *//* ... */#defineTCP_OUTPUT_DEBUGLWIP_DBG_OFF/** * TCPIP_DEBUG: Enable debugging in tcpip.c. *//* ... */#defineTCPIP_DEBUGLWIP_DBG_OFF/** * TCP_OOSEQ_DEBUG: Enable debugging in tcpin.c for OOSEQ. *//* ... */#defineTCP_OOSEQ_DEBUGLWIP_DBG_OFF5 defines/** * BRIDGEIF_DEBUG: Enable generic debugging for bridge. *//* ... */#ifdefCONFIG_LWIP_BRIDGEIF_DEBUG#defineBRIDGEIF_DEBUGLWIP_DBG_ON#endif/** * BRIDGEIF_FDB_DEBUG: Enable debugging for bridge FDB. *//* ... */#ifdefCONFIG_LWIP_BRIDGEIF_FDB_DEBUG#defineBRIDGEIF_FDB_DEBUGLWIP_DBG_ON#endif/** * BRIDGEIF_FW_DEBUG: Enable debugging for bridge forwarding. *//* ... */#ifdefCONFIG_LWIP_BRIDGEIF_FW_DEBUG#defineBRIDGEIF_FW_DEBUGLWIP_DBG_ON#endif/* -------------------------------------- ------------ SNTP options ------------ --------------------------------------*//* ... *//** * Max number of SNTP servers handled (default equal to LWIP_DHCP_MAX_NTP_SERVERS) *//* ... */#ifdefCONFIG_LWIP_SNTP_MAX_SERVERS#defineSNTP_MAX_SERVERSCONFIG_LWIP_SNTP_MAX_SERVERS#endif/* CONFIG_LWIP_SNTP_MAX_SERVERS *//** Set this to 1 to support DNS names (or IP address strings) to set sntp servers * One server address/name can be defined as default if SNTP_SERVER_DNS == 1: * \#define SNTP_SERVER_ADDRESS "pool.ntp.org" *//* ... */#defineSNTP_SERVER_DNS1/** * It disables a check of SNTP_UPDATE_DELAY it is done in sntp_set_sync_interval *//* ... */#defineSNTP_SUPPRESS_DELAY_CHECK#defineSNTP_UPDATE_DELAY(sntp_get_sync_interval())#defineSNTP_SET_SYSTEM_TIME_US(sec,us)(sntp_set_system_time(sec,us))#defineSNTP_GET_SYSTEM_TIME(sec,us)(sntp_get_system_time(&(sec),&(us)))5 defines/** * Configuring SNTP startup delay *//* ... */#ifdefCONFIG_LWIP_SNTP_STARTUP_DELAY#defineSNTP_STARTUP_DELAY1#ifdefCONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY#defineSNTP_STARTUP_DELAY_FUNC(LWIP_RAND()%CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY)#endif/* CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY *//* ... */#else#defineSNTP_STARTUP_DELAY0#endif/* SNTP_STARTUP_DELAY *//* --------------------------------------- --------- ESP specific options -------- ---------------------------------------*//* ... *//** * ESP_LWIP_IGMP_TIMERS_ONDEMAND==1: Start IGMP timers only if used * ESP_LWIP_MLD6_TIMERS_ONDEMAND==1: Start MLD6 timers only if used * Timers will only be activated when joining groups/receiving queries *//* ... */#ifdefCONFIG_LWIP_TIMERS_ONDEMAND#defineESP_LWIP_IGMP_TIMERS_ONDEMAND1#defineESP_LWIP_MLD6_TIMERS_ONDEMAND1#defineESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND1#defineESP_LWIP_DNS_TIMERS_ONDEMAND1#ifIP_REASSEMBLY#defineESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND1#endif/* IP_REASSEMBLY */#ifLWIP_IPV6_REASS#defineESP_LWIP_IP6_REASSEMBLY_TIMERS_ONDEMAND1#endif/* LWIP_IPV6_REASS *//* ... */#else#defineESP_LWIP_IGMP_TIMERS_ONDEMAND0#defineESP_LWIP_MLD6_TIMERS_ONDEMAND0#defineESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND0#defineESP_LWIP_DNS_TIMERS_ONDEMAND0#ifIP_REASSEMBLY#defineESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND0#endif/* IP_REASSEMBLY */#ifLWIP_IPV6_REASS#defineESP_LWIP_IP6_REASSEMBLY_TIMERS_ONDEMAND0#endif/* LWIP_IPV6_REASS *//* ... */#endif/** * ESP_GRATUITOUS_ARP==1: This option allows to send gratuitous ARP periodically. *//* ... */#ifdefCONFIG_LWIP_ESP_GRATUITOUS_ARP#defineESP_GRATUITOUS_ARP1#defineESP_GRATUITOUS_ARP_INTERVAL(CONFIG_LWIP_GARP_TMR_INTERVAL*1000UL)/* ... */#else#defineESP_GRATUITOUS_ARP0#endif/** * ESP_MLDV6_REPORT==1: This option allows to send mldv6 report periodically. *//* ... */#ifdefCONFIG_LWIP_ESP_MLDV6_REPORT#defineESP_MLDV6_REPORT1#else#defineESP_MLDV6_REPORT0#endif#defineESP_LWIP1#defineESP_LWIP_ARP1#defineESP_PER_SOC_TCP_WND0#defineESP_THREAD_SAFE1/* Not used (to be removed in v6.x) */#defineESP_THREAD_SAFE_DEBUGLWIP_DBG_OFF#defineESP_DHCP1#defineESP_DNS1#defineESP_STATS_TCP0#defineESP_LWIP_LOGI(...)ESP_LOGI("lwip",__VA_ARGS__)#defineESP_PING1#defineESP_HAS_SELECT1#defineESP_IP4_ROUTE1#defineESP_AUTO_IP1#defineESP_PBUF1#defineESP_PPP1#defineESP_IPV6LWIP_IPV6#defineESP_SOCKET1#defineESP_LWIP_SELECT1#defineESP_LWIP_LOCK1#defineESP_THREAD_PROTECTION1#defineLWIP_SUPPORT_CUSTOM_PBUF1#defineESP_LWIP_FALLBACK_DNS_PREFER_IPV4022 defines/* ----------------------------------------- ---------- DHCP Server options ---------- -----------------------------------------*//* ... *//** * ESP_DHCPS==1: Enable the DHCP server *//* ... */#ifdefCONFIG_LWIP_DHCPS#defineESP_DHCPS1#defineESP_DHCPS_TIMER0/* ... */#else#defineESP_DHCPS0#defineESP_DHCPS_TIMER0/* ... */#endif/* CONFIG_LWIP_DHCPS */#ifLWIP_NETCONN_SEM_PER_THREAD#defineLWIP_NETCONN_THREAD_SEM_GET()sys_thread_sem_get()#defineLWIP_NETCONN_THREAD_SEM_ALLOC()sys_thread_sem_init()#defineLWIP_NETCONN_THREAD_SEM_FREE()sys_thread_sem_deinit()/* ... */#endif/** * If CONFIG_ALLOC_MEMORY_IN_SPIRAM_FIRST is enabled, Try to * allocate memory for lwip in SPIRAM firstly. If failed, try to allocate * internal memory then. *//* ... */#ifCONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP#definemem_clib_malloc(size)heap_caps_malloc_prefer(size,2,MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM,MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)#definemem_clib_calloc(n,size)heap_caps_calloc_prefer(n,size,2,MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM,MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)/* ... */#else/* !CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP */#definemem_clib_mallocmalloc#definemem_clib_calloccalloc/* ... */#endif/* CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP *//* * Check if the lwIP configuration is sane *//* ... */#if!LWIP_IPV4&&!LWIP_IPV6#error"Please enable at least one IP stack (either IPv4 or IPv6 or both)"#endif#ifdef__cplusplus}{...}#endif/* ... */#endif/* LWIP_HDR_ESP_LWIPOPTS_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.