65 #error "BYTE_ORDER is not defined, you have to define it in your cc.h" 67 #if (!IP_SOF_BROADCAST && IP_SOF_BROADCAST_RECV) 68 #error "If you want to use broadcast filter per pcb on recv operations, you have to define IP_SOF_BROADCAST=1 in your lwipopts.h" 70 #if (!LWIP_ARP && ARP_QUEUEING) 71 #error "If you want to use ARP Queueing, you have to define LWIP_ARP=1 in your lwipopts.h" 73 #if (!LWIP_UDP && LWIP_UDPLITE) 74 #error "If you want to use UDP Lite, you have to define LWIP_UDP=1 in your lwipopts.h" 76 #if (!LWIP_UDP && LWIP_SNMP) 77 #error "If you want to use SNMP, you have to define LWIP_UDP=1 in your lwipopts.h" 79 #if (!LWIP_UDP && LWIP_DHCP) 80 #error "If you want to use DHCP, you have to define LWIP_UDP=1 in your lwipopts.h" 82 #if (!LWIP_UDP && LWIP_IGMP) 83 #error "If you want to use IGMP, you have to define LWIP_UDP=1 in your lwipopts.h" 85 #if (!LWIP_UDP && LWIP_SNMP) 86 #error "If you want to use SNMP, you have to define LWIP_UDP=1 in your lwipopts.h" 88 #if (!LWIP_UDP && LWIP_DNS) 89 #error "If you want to use DNS, you have to define LWIP_UDP=1 in your lwipopts.h" 91 #if (LWIP_ARP && ARP_QUEUEING && (MEMP_NUM_ARP_QUEUE<=0)) 92 #error "If you want to use ARP Queueing, you have to define MEMP_NUM_ARP_QUEUE>=1 in your lwipopts.h" 94 #if (LWIP_RAW && (MEMP_NUM_RAW_PCB<=0)) 95 #error "If you want to use RAW, you have to define MEMP_NUM_RAW_PCB>=1 in your lwipopts.h" 97 #if (LWIP_UDP && (MEMP_NUM_UDP_PCB<=0)) 98 #error "If you want to use UDP, you have to define MEMP_NUM_UDP_PCB>=1 in your lwipopts.h" 106 #if (LWIP_TCP && (TCP_SND_QUEUELEN > 0xffff)) 107 #error "If you want to use TCP, TCP_SND_QUEUELEN must fit in an u16_t, so, you have to reduce it in your lwipopts.h" 109 #if (LWIP_TCP && (TCP_SND_QUEUELEN < 2)) 110 #error "TCP_SND_QUEUELEN must be at least 2 for no-copy TCP writes to work" 115 #if (LWIP_TCP && TCP_LISTEN_BACKLOG && (TCP_DEFAULT_LISTEN_BACKLOG < 0) || (TCP_DEFAULT_LISTEN_BACKLOG > 0xff)) 116 #error "If you want to use TCP backlog, TCP_DEFAULT_LISTEN_BACKLOG must fit into an u8_t" 118 #if (LWIP_IGMP && (MEMP_NUM_IGMP_GROUP<=1)) 119 #error "If you want to use IGMP, you have to define MEMP_NUM_IGMP_GROUP>1 in your lwipopts.h" 121 #if (LWIP_NETIF_API && (NO_SYS==1)) 122 #error "If you want to use NETIF API, you have to define NO_SYS=0 in your lwipopts.h" 124 #if ((LWIP_SOCKET || LWIP_NETCONN) && (NO_SYS==1)) 125 #error "If you want to use Sequential API, you have to define NO_SYS=0 in your lwipopts.h" 127 #if ((LWIP_NETCONN || LWIP_SOCKET) && (MEMP_NUM_TCPIP_MSG_API<=0)) 128 #error "If you want to use Sequential API, you have to define MEMP_NUM_TCPIP_MSG_API>=1 in your lwipopts.h" 130 #if (!LWIP_NETCONN && LWIP_SOCKET) 131 #error "If you want to use Socket API, you have to define LWIP_NETCONN=1 in your lwipopts.h" 133 #if (((!LWIP_DHCP) || (!LWIP_AUTOIP)) && LWIP_DHCP_AUTOIP_COOP) 134 #error "If you want to use DHCP/AUTOIP cooperation mode, you have to define LWIP_DHCP=1 and LWIP_AUTOIP=1 in your lwipopts.h" 136 #if (((!LWIP_DHCP) || (!LWIP_ARP)) && DHCP_DOES_ARP_CHECK) 137 #error "If you want to use DHCP ARP checking, you have to define LWIP_DHCP=1 and LWIP_ARP=1 in your lwipopts.h" 139 #if (!LWIP_ARP && LWIP_AUTOIP) 140 #error "If you want to use AUTOIP, you have to define LWIP_ARP=1 in your lwipopts.h" 142 #if (LWIP_SNMP && (SNMP_CONCURRENT_REQUESTS<=0)) 143 #error "If you want to use SNMP, you have to define SNMP_CONCURRENT_REQUESTS>=1 in your lwipopts.h" 145 #if (LWIP_SNMP && (SNMP_TRAP_DESTINATIONS<=0)) 146 #error "If you want to use SNMP, you have to define SNMP_TRAP_DESTINATIONS>=1 in your lwipopts.h" 148 #if (LWIP_TCP && ((LWIP_EVENT_API && LWIP_CALLBACK_API) || (!LWIP_EVENT_API && !LWIP_CALLBACK_API))) 149 #error "One and exactly one of LWIP_EVENT_API and LWIP_CALLBACK_API has to be enabled in your lwipopts.h" 152 #if LWIP_TIMERS && (MEMP_NUM_SYS_TIMEOUT < (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT)) 153 #error "MEMP_NUM_SYS_TIMEOUT is too low to accomodate all required timeouts" 155 #if (IP_REASSEMBLY && (MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS)) 156 #error "MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS doesn't make sense since each struct ip_reassdata must hold 2 pbufs at least!" 158 #if (MEM_LIBC_MALLOC && MEM_USE_POOLS) 159 #error "MEM_LIBC_MALLOC and MEM_USE_POOLS may not both be simultaneously enabled in your lwipopts.h" 161 #if (MEM_USE_POOLS && !MEMP_USE_CUSTOM_POOLS) 162 #error "MEM_USE_POOLS requires custom pools (MEMP_USE_CUSTOM_POOLS) to be enabled in your lwipopts.h" 164 #if (PBUF_POOL_BUFSIZE <= MEM_ALIGNMENT) 165 #error "PBUF_POOL_BUFSIZE must be greater than MEM_ALIGNMENT or the offset may take the full first pbuf" 167 #if (TCP_QUEUE_OOSEQ && !LWIP_TCP) 168 #error "TCP_QUEUE_OOSEQ requires LWIP_TCP" 170 #if (DNS_LOCAL_HOSTLIST && !DNS_LOCAL_HOSTLIST_IS_DYNAMIC && !(defined(DNS_LOCAL_HOSTLIST_INIT))) 171 #error "you have to define define DNS_LOCAL_HOSTLIST_INIT {{'host1', 0x123}, {'host2', 0x234}} to initialize DNS_LOCAL_HOSTLIST" 173 #if PPP_SUPPORT && !PPPOS_SUPPORT & !PPPOE_SUPPORT 174 #error "PPP_SUPPORT needs either PPPOS_SUPPORT or PPPOE_SUPPORT turned on" 176 #if !LWIP_ETHERNET && (LWIP_ARP || PPPOE_SUPPORT) 177 #error "LWIP_ETHERNET needs to be turned on for LWIP_ARP or PPPOE_SUPPORT" 179 #if LWIP_IGMP && !defined(LWIP_RAND) 180 #error "When using IGMP, LWIP_RAND() needs to be defined to a random-function returning an u32_t random value" 182 #if LWIP_TCPIP_CORE_LOCKING_INPUT && !LWIP_TCPIP_CORE_LOCKING 183 #error "When using LWIP_TCPIP_CORE_LOCKING_INPUT, LWIP_TCPIP_CORE_LOCKING must be enabled, too" 185 #if LWIP_TCP && LWIP_NETIF_TX_SINGLE_PBUF && !TCP_OVERSIZE 186 #error "LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE enabled to create single-pbuf TCP packets" 188 #if IP_FRAG && IP_FRAG_USES_STATIC_BUF && LWIP_NETIF_TX_SINGLE_PBUF 189 #error "LWIP_NETIF_TX_SINGLE_PBUF does not work with IP_FRAG_USES_STATIC_BUF==1 as that creates pbuf queues" 195 #ifdef MEMP_NUM_TCPIP_MSG 196 #error "MEMP_NUM_TCPIP_MSG option is deprecated. Remove it from your lwipopts.h." 198 #ifdef MEMP_NUM_API_MSG 199 #error "MEMP_NUM_API_MSG option is deprecated. Remove it from your lwipopts.h." 201 #ifdef TCP_REXMIT_DEBUG 202 #error "TCP_REXMIT_DEBUG option is deprecated. Remove it from your lwipopts.h." 205 #error "RAW_STATS option is deprecated. Remove it from your lwipopts.h." 207 #ifdef ETHARP_QUEUE_FIRST 208 #error "ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h." 210 #ifdef ETHARP_ALWAYS_INSERT 211 #error "ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h." 221 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: MEMP_NUM_NETCONN should be less than the sum of MEMP_NUM_{TCP,RAW,UDP}_PCB+MEMP_NUM_TCP_PCB_LISTEN\n"));
225 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: MEMP_NUM_TCP_SEG should be at least as big as TCP_SND_QUEUELEN\n"));
227 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: TCP_SND_BUF must be at least as much as (2 * TCP_MSS) for things to work smoothly\n"));
229 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: TCP_SND_QUEUELEN must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work\n"));
231 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF.\n"));
233 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: TCP_SNDQUEUELOWAT must be less than TCP_SND_QUEUELEN.\n"));
235 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: TCP_WND is larger than space provided by PBUF_POOL_SIZE*PBUF_POOL_BUFSIZE\n"));
242 LWIP_PLATFORM_DIAG((
"lwip_sanity_check: WARNING: SO_ACCEPTCONN != SOF_ACCEPTCONN\n"));
254 #define lwip_sanity_check() 327 #if IP_NAPT && !IP_NAPT_DYNAMIC 328 ip_napt_init(IP_NAPT_MAX, IP_PORTMAP_MAX);
void memp_init(void) ICACHE_FLASH_ATTR
#define ICACHE_FLASH_ATTR
void mem_init(void) ICACHE_FLASH_ATTR
#define MEMP_NUM_TCP_PCB_LISTEN
void sys_init(void) ICACHE_FLASH_ATTR
#define lwip_sanity_check()
#define PBUF_POOL_BUFSIZE
void sys_timeouts_init(void) ICACHE_FLASH_ATTR
#define TCP_SNDQUEUELOWAT
#define LWIP_PLATFORM_DIAG(x)
void netif_init(void) ICACHE_FLASH_ATTR