• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @file
3  *
4  * lwIP Options Configuration
5  */
6 
7 /*
8  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without modification,
12  * are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  *    this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  *    this list of conditions and the following disclaimer in the documentation
18  *    and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote products
20  *    derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31  * OF SUCH DAMAGE.
32  *
33  * This file is part of the lwIP TCP/IP stack.
34  *
35  * Author: Adam Dunkels <adam@sics.se>
36  *
37  */
38 
39 /*
40  * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug -
41  * without this, doxygen does not see the actual #define
42  */
43 
44 #if !defined LWIP_HDR_OPT_H
45 #define LWIP_HDR_OPT_H
46 
47 /*
48  * Include user defined options first. Anything not defined in these files
49  * will be set to standard values. Override anything you don't like!
50  */
51 #include "lwipopts.h"
52 #include "lwip/debug.h"
53 
54 /**
55  * @defgroup lwip_opts Options (lwipopts.h)
56  * @ingroup lwip
57  *
58  * @defgroup lwip_opts_debug Debugging
59  * @ingroup lwip_opts
60  *
61  * @defgroup lwip_opts_infrastructure Infrastructure
62  * @ingroup lwip_opts
63  *
64  * @defgroup lwip_opts_callback Callback-style APIs
65  * @ingroup lwip_opts
66  *
67  * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs
68  * @ingroup lwip_opts
69  */
70 
71  /*
72    ------------------------------------
73    -------------- NO SYS --------------
74    ------------------------------------
75 */
76 /**
77  * @defgroup lwip_opts_nosys NO_SYS
78  * @ingroup lwip_opts_infrastructure
79  * @{
80  */
81 /**
82  * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or
83  * mboxes). This means threaded APIs cannot be used (socket, netconn,
84  * i.e. everything in the 'api' folder), only the callback-style raw API is
85  * available (and you have to watch out for yourself that you don't access
86  * lwIP functions/structures from more than one context at a time!)
87  */
88 #if !defined NO_SYS || defined __DOXYGEN__
89 #define NO_SYS                          0
90 #endif
91 /**
92  * @}
93  */
94 
95 /**
96  * @defgroup lwip_opts_timers Timers
97  * @ingroup lwip_opts_infrastructure
98  * @{
99  */
100 /**
101  * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers.
102  * (the array of lwip-internal cyclic timers is still provided)
103  * (check NO_SYS_NO_TIMERS for compatibility to old versions)
104  */
105 #if !defined LWIP_TIMERS || defined __DOXYGEN__
106 #ifdef NO_SYS_NO_TIMERS
107 #define LWIP_TIMERS                     (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
108 #else
109 #define LWIP_TIMERS                     1
110 #endif
111 #endif
112 
113 /**
114  * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation.
115  * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers
116  * are still included, but the implementation is not. The following functions
117  * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(),
118  *                   sys_timeouts_mbox_fetch()
119  */
120 #if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__
121 #define LWIP_TIMERS_CUSTOM              0
122 #endif
123 /**
124  * @}
125  */
126 
127 /**
128  * @defgroup lwip_opts_memcpy memcpy
129  * @ingroup lwip_opts_infrastructure
130  * @{
131  */
132 /**
133  * MEMCPY: override this if you have a faster implementation at hand than the
134  * one included in your C library
135  */
136 #if !defined MEMCPY || defined __DOXYGEN__
137 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
138 #endif
139 
140 /**
141  * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
142  * call to memcpy() if the length is known at compile time and is small.
143  */
144 #if !defined SMEMCPY || defined __DOXYGEN__
145 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
146 #endif
147 
148 /**
149  * MEMMOVE: override this if you have a faster implementation at hand than the
150  * one included in your C library.  lwIP currently uses MEMMOVE only when IPv6
151  * fragmentation support is enabled.
152  */
153 #if !defined MEMMOVE || defined __DOXYGEN__
154 #define MEMMOVE(dst,src,len)            memmove(dst,src,len)
155 #endif
156 /**
157  * @}
158  */
159 
160 /*
161    ------------------------------------
162    ----------- Core locking -----------
163    ------------------------------------
164 */
165 /**
166  * @defgroup lwip_opts_lock Core locking and MPU
167  * @ingroup lwip_opts_infrastructure
168  * @{
169  */
170 /**
171  * LWIP_MPU_COMPATIBLE: enables special memory management mechanism
172  * which makes lwip able to work on MPU (Memory Protection Unit) system
173  * by not passing stack-pointers to other threads
174  * (this decreases performance as memory is allocated from pools instead
175  * of keeping it on the stack)
176  */
177 #if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__
178 #define LWIP_MPU_COMPATIBLE             0
179 #endif
180 
181 /**
182  * LWIP_TCPIP_CORE_LOCKING
183  * Creates a global mutex that is held during TCPIP thread operations.
184  * Can be locked by client code to perform lwIP operations without changing
185  * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and
186  * UNLOCK_TCPIP_CORE().
187  * Your system should provide mutexes supporting priority inversion to use this.
188  */
189 #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__
190 #define LWIP_TCPIP_CORE_LOCKING         1
191 #endif
192 
193 /**
194  * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled,
195  * this lets tcpip_input() grab the mutex for input packets as well,
196  * instead of allocating a message and passing it to tcpip_thread.
197  *
198  * ATTENTION: this does not work when tcpip_input() is called from
199  * interrupt context!
200  */
201 #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__
202 #define LWIP_TCPIP_CORE_LOCKING_INPUT   0
203 #endif
204 
205 /**
206  * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt
207  * protection) for certain critical regions during buffer allocation, deallocation
208  * and memory allocation and deallocation.
209  * ATTENTION: This is required when using lwIP from more than one context! If
210  * you disable this, you must be sure what you are doing!
211  */
212 #if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__
213 #define SYS_LIGHTWEIGHT_PROT            1
214 #endif
215 
216 /**
217  * Macro/function to check whether lwIP's threading/locking
218  * requirements are satisfied during current function call.
219  * This macro usually calls a function that is implemented in the OS-dependent
220  * sys layer and performs the following checks:
221  * - Not in ISR (this should be checked for NO_SYS==1, too!)
222  * - If @ref LWIP_TCPIP_CORE_LOCKING = 1: TCPIP core lock is held
223  * - If @ref LWIP_TCPIP_CORE_LOCKING = 0: function is called from TCPIP thread
224  * @see @ref multithreading
225  */
226 #if !defined LWIP_ASSERT_CORE_LOCKED || defined __DOXYGEN__
227 #define LWIP_ASSERT_CORE_LOCKED()
228 #endif
229 
230 /**
231  * Called as first thing in the lwIP TCPIP thread. Can be used in conjunction
232  * with @ref LWIP_ASSERT_CORE_LOCKED to check core locking.
233  * @see @ref multithreading
234  */
235 #if !defined LWIP_MARK_TCPIP_THREAD || defined __DOXYGEN__
236 #define LWIP_MARK_TCPIP_THREAD()
237 #endif
238 /**
239  * @}
240  */
241 
242 /*
243    ------------------------------------
244    ---------- Memory options ----------
245    ------------------------------------
246 */
247 /**
248  * @defgroup lwip_opts_mem Heap and memory pools
249  * @ingroup lwip_opts_infrastructure
250  * @{
251  */
252 /**
253  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
254  * instead of the lwip internal allocator. Can save code size if you
255  * already use it.
256  */
257 #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__
258 #define MEM_LIBC_MALLOC                 0
259 #endif
260 
261 /**
262  * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
263  * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
264  * speed (heap alloc can be much slower than pool alloc) and usage from interrupts
265  * (especially if your netif driver allocates PBUF_POOL pbufs for received frames
266  * from interrupt)!
267  * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools,
268  * not only for internal pools defined in memp_std.h)!
269  */
270 #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__
271 #define MEMP_MEM_MALLOC                 0
272 #endif
273 
274 /**
275  * MEMP_MEM_INIT==1: Force use of memset to initialize pool memory.
276  * Useful if pool are moved in uninitialized section of memory. This will ensure
277  * default values in pcbs struct are well initialized in all conditions.
278  */
279 #if !defined MEMP_MEM_INIT || defined __DOXYGEN__
280 #define MEMP_MEM_INIT                   0
281 #endif
282 
283 /**
284  * MEM_ALIGNMENT: should be set to the alignment of the CPU
285  *    4 byte alignment -> \#define MEM_ALIGNMENT 4
286  *    2 byte alignment -> \#define MEM_ALIGNMENT 2
287  */
288 #if !defined MEM_ALIGNMENT || defined __DOXYGEN__
289 #define MEM_ALIGNMENT                   1
290 #endif
291 
292 /**
293  * MEM_SIZE: the size of the heap memory. If the application will send
294  * a lot of data that needs to be copied, this should be set high.
295  */
296 #if !defined MEM_SIZE || defined __DOXYGEN__
297 #define MEM_SIZE                        1600
298 #endif
299 
300 /**
301  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
302  * amount of bytes before and after each memp element in every pool and fills
303  * it with a prominent default value.
304  *    MEMP_OVERFLOW_CHECK == 0 no checking
305  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
306  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
307  *      memp_malloc() or memp_free() is called (useful but slow!)
308  */
309 #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__
310 #define MEMP_OVERFLOW_CHECK             0
311 #endif
312 
313 /**
314  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
315  * sure that there are no cycles in the linked lists.
316  */
317 #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__
318 #define MEMP_SANITY_CHECK               0
319 #endif
320 
321 /**
322  * MEM_OVERFLOW_CHECK: mem overflow protection reserves a configurable
323  * amount of bytes before and after each heap allocation chunk and fills
324  * it with a prominent default value.
325  *    MEM_OVERFLOW_CHECK == 0 no checking
326  *    MEM_OVERFLOW_CHECK == 1 checks each element when it is freed
327  *    MEM_OVERFLOW_CHECK >= 2 checks all heap elements every time
328  *      mem_malloc() or mem_free() is called (useful but slow!)
329  */
330 #if !defined MEM_OVERFLOW_CHECK || defined __DOXYGEN__
331 #define MEM_OVERFLOW_CHECK              0
332 #endif
333 
334 /**
335  * MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make
336  * sure that the linked list of heap elements is not corrupted.
337  */
338 #if !defined MEM_SANITY_CHECK || defined __DOXYGEN__
339 #define MEM_SANITY_CHECK                0
340 #endif
341 
342 /**
343  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
344  * of memory pools of various sizes. When mem_malloc is called, an element of
345  * the smallest pool that can provide the length needed is returned.
346  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
347  */
348 #if !defined MEM_USE_POOLS || defined __DOXYGEN__
349 #define MEM_USE_POOLS                   0
350 #endif
351 
352 /**
353  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
354  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
355  * reliable. */
356 #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__
357 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
358 #endif
359 
360 /**
361  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
362  * that defines additional pools beyond the "standard" ones required
363  * by lwIP. If you set this to 1, you must have lwippools.h in your
364  * include path somewhere.
365  */
366 #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__
367 #define MEMP_USE_CUSTOM_POOLS           0
368 #endif
369 
370 /**
371  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
372  * interrupt context (or another context that doesn't allow waiting for a
373  * semaphore).
374  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
375  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
376  * with each loop so that mem_free can run.
377  *
378  * ATTENTION: As you can see from the above description, this leads to dis-/
379  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
380  * can need longer.
381  *
382  * If you don't want that, at least for NO_SYS=0, you can still use the following
383  * functions to enqueue a deallocation call which then runs in the tcpip_thread
384  * context:
385  * - pbuf_free_callback(p);
386  * - mem_free_callback(m);
387  */
388 #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__
389 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
390 #endif
391 /**
392  * @}
393  */
394 
395 /*
396    ------------------------------------------------
397    ---------- Internal Memory Pool Sizes ----------
398    ------------------------------------------------
399 */
400 /**
401  * @defgroup lwip_opts_memp Internal memory pools
402  * @ingroup lwip_opts_infrastructure
403  * @{
404  */
405 /**
406  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
407  * If the application sends a lot of data out of ROM (or other static memory),
408  * this should be set high.
409  */
410 #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__
411 #define MEMP_NUM_PBUF                   16
412 #endif
413 
414 /**
415  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
416  * (requires the LWIP_RAW option)
417  */
418 #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__
419 #define MEMP_NUM_RAW_PCB                4
420 #endif
421 
422 /**
423  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
424  * per active UDP "connection".
425  * (requires the LWIP_UDP option)
426  */
427 #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__
428 #define MEMP_NUM_UDP_PCB                4
429 #endif
430 
431 /**
432  * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections.
433  * (requires the LWIP_TCP option)
434  */
435 #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__
436 #define MEMP_NUM_TCP_PCB                5
437 #endif
438 
439 /**
440  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
441  * (requires the LWIP_TCP option)
442  */
443 #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__
444 #define MEMP_NUM_TCP_PCB_LISTEN         8
445 #endif
446 
447 /**
448  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
449  * (requires the LWIP_TCP option)
450  */
451 #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__
452 #define MEMP_NUM_TCP_SEG                16
453 #endif
454 
455 /**
456  * MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs.
457  * (requires the LWIP_ALTCP option)
458  * Connections with multiple layers require more than one altcp_pcb (e.g. TLS
459  * over TCP requires 2 altcp_pcbs, one for TLS and one for TCP).
460  */
461 #if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__
462 #define MEMP_NUM_ALTCP_PCB              MEMP_NUM_TCP_PCB
463 #endif
464 
465 /**
466  * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
467  * reassembly (whole packets, not fragments!)
468  */
469 #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__
470 #define MEMP_NUM_REASSDATA              5
471 #endif
472 
473 /**
474  * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
475  * (fragments, not whole packets!).
476  * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1
477  * with DMA-enabled MACs where the packet is not yet sent when netif->output
478  * returns.
479  */
480 #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__
481 #define MEMP_NUM_FRAG_PBUF              15
482 #endif
483 
484 /**
485  * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing
486  * packets (pbufs) that are waiting for an ARP request (to resolve
487  * their destination address) to finish.
488  * (requires the ARP_QUEUEING option)
489  */
490 #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__
491 #define MEMP_NUM_ARP_QUEUE              30
492 #endif
493 
494 /**
495  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
496  * can be members at the same time (one per netif - allsystems group -, plus one
497  * per netif membership).
498  * (requires the LWIP_IGMP option)
499  */
500 #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__
501 #define MEMP_NUM_IGMP_GROUP             8
502 #endif
503 
504 /**
505  * The number of sys timeouts used by the core stack (not apps)
506  * The default number of timeouts is calculated here for all enabled modules.
507  */
508 #if ESP_LWIP
509 #define LWIP_NUM_SYS_TIMEOUT_INTERNAL   (LWIP_TCP + IP_REASSEMBLY + (LWIP_ARP + (ESP_GRATUITOUS_ARP ? 1 : 0)) + (2*LWIP_DHCP + (ESP_DHCPS_TIMER ? 1 : 0)) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))
510 #else
511 #define LWIP_NUM_SYS_TIMEOUT_INTERNAL   (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))
512 #endif
513 /**
514  * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts.
515  * The default number of timeouts is calculated here for all enabled modules.
516  * The formula expects settings to be either '0' or '1'.
517  */
518 #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__
519 #define MEMP_NUM_SYS_TIMEOUT            LWIP_NUM_SYS_TIMEOUT_INTERNAL
520 #endif
521 
522 /**
523  * MEMP_NUM_NETBUF: the number of struct netbufs.
524  * (only needed if you use the sequential API, like api_lib.c)
525  */
526 #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__
527 #define MEMP_NUM_NETBUF                 2
528 #endif
529 
530 /**
531  * MEMP_NUM_NETCONN: the number of struct netconns.
532  * (only needed if you use the sequential API, like api_lib.c)
533  */
534 #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__
535 #define MEMP_NUM_NETCONN                4
536 #endif
537 
538 /**
539  * MEMP_NUM_SELECT_CB: the number of struct lwip_select_cb.
540  * (Only needed if you have LWIP_MPU_COMPATIBLE==1 and use the socket API.
541  * In that case, you need one per thread calling lwip_select.)
542  */
543 #if !defined MEMP_NUM_SELECT_CB || defined __DOXYGEN__
544 #define MEMP_NUM_SELECT_CB              4
545 #endif
546 
547 /**
548  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
549  * for callback/timeout API communication.
550  * (only needed if you use tcpip.c)
551  */
552 #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__
553 #define MEMP_NUM_TCPIP_MSG_API          8
554 #endif
555 
556 /**
557  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
558  * for incoming packets.
559  * (only needed if you use tcpip.c)
560  */
561 #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__
562 #define MEMP_NUM_TCPIP_MSG_INPKT        8
563 #endif
564 
565 /**
566  * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
567  * (before freeing the corresponding memory using lwip_freeaddrinfo()).
568  */
569 #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__
570 #define MEMP_NUM_NETDB                  1
571 #endif
572 
573 /**
574  * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
575  * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
576  */
577 #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__
578 #define MEMP_NUM_LOCALHOSTLIST          1
579 #endif
580 
581 /**
582  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
583  */
584 #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__
585 #define PBUF_POOL_SIZE                  16
586 #endif
587 
588 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various
589  * socket, netconn, and tcpip functions
590  */
591 #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__
592 #define MEMP_NUM_API_MSG                MEMP_NUM_TCPIP_MSG_API
593 #endif
594 
595 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname
596  */
597 #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__
598 #define MEMP_NUM_DNS_API_MSG            MEMP_NUM_TCPIP_MSG_API
599 #endif
600 
601 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls
602  * to getsockopt/setsockopt
603  */
604 #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__
605 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API
606 #endif
607 
608 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the
609  * netifapi functions
610  */
611 #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__
612 #define MEMP_NUM_NETIFAPI_MSG           MEMP_NUM_TCPIP_MSG_API
613 #endif
614 /**
615  * @}
616  */
617 
618 /*
619    ---------------------------------
620    ---------- ARP options ----------
621    ---------------------------------
622 */
623 /**
624  * @defgroup lwip_opts_arp ARP
625  * @ingroup lwip_opts_ipv4
626  * @{
627  */
628 /**
629  * LWIP_ARP==1: Enable ARP functionality.
630  */
631 #if !defined LWIP_ARP || defined __DOXYGEN__
632 #define LWIP_ARP                        1
633 #endif
634 
635 /**
636  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
637  */
638 #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__
639 #define ARP_TABLE_SIZE                  10
640 #endif
641 
642 /** the time an ARP entry stays valid after its last update,
643  *  for ARP_TMR_INTERVAL = 1000, this is
644  *  (60 * 5) seconds = 5 minutes.
645  */
646 #if !defined ARP_MAXAGE || defined __DOXYGEN__
647 #define ARP_MAXAGE                      300
648 #endif
649 
650 /**
651  * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
652  * resolution. By default, only the most recent packet is queued per IP address.
653  * This is sufficient for most protocols and mainly reduces TCP connection
654  * startup time. Set this to 1 if you know your application sends more than one
655  * packet in a row to an IP address that is not in the ARP cache.
656  */
657 #if !defined ARP_QUEUEING || defined __DOXYGEN__
658 #define ARP_QUEUEING                    0
659 #endif
660 
661 /** The maximum number of packets which may be queued for each
662  *  unresolved address by other network layers. Defaults to 3, 0 means disabled.
663  *  Old packets are dropped, new packets are queued.
664  */
665 #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__
666 #define ARP_QUEUE_LEN                   3
667 #endif
668 
669 /**
670  * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with
671  * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and
672  * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers.
673  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
674  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
675  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
676  * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan)
677  * that returns 1 to accept a packet or 0 to drop a packet.
678  */
679 #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__
680 #define ETHARP_SUPPORT_VLAN             0
681 #endif
682 
683 /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled
684  */
685 #if !defined LWIP_ETHERNET || defined __DOXYGEN__
686 #define LWIP_ETHERNET                   LWIP_ARP
687 #endif
688 
689 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
690  * alignment of payload after that header. Since the header is 14 bytes long,
691  * without this padding e.g. addresses in the IP header will not be aligned
692  * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
693  */
694 #if !defined ETH_PAD_SIZE || defined __DOXYGEN__
695 #define ETH_PAD_SIZE                    0
696 #endif
697 
698 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
699  * entries (using etharp_add_static_entry/etharp_remove_static_entry).
700  */
701 #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__
702 #define ETHARP_SUPPORT_STATIC_ENTRIES   0
703 #endif
704 
705 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries.
706  * If disabled, duplicate IP address on multiple netifs are not supported
707  * (but this should only occur for AutoIP).
708  */
709 #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__
710 #define ETHARP_TABLE_MATCH_NETIF        !LWIP_SINGLE_NETIF
711 #endif
712 /**
713  * @}
714  */
715 
716 /*
717    --------------------------------
718    ---------- IP options ----------
719    --------------------------------
720 */
721 /**
722  * @defgroup lwip_opts_ipv4 IPv4
723  * @ingroup lwip_opts
724  * @{
725  */
726 /**
727  * LWIP_IPV4==1: Enable IPv4
728  */
729 #if !defined LWIP_IPV4 || defined __DOXYGEN__
730 #define LWIP_IPV4                       1
731 #endif
732 
733 /**
734  * IP_FORWARD==1: Enables the ability to forward IP packets across network
735  * interfaces. If you are going to run lwIP on a device with only one network
736  * interface, define this to 0.
737  */
738 #if !defined IP_FORWARD || defined __DOXYGEN__
739 #define IP_FORWARD                      0
740 #endif
741 
742 /**
743  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
744  * this option does not affect outgoing packet sizes, which can be controlled
745  * via IP_FRAG.
746  */
747 #if !defined IP_REASSEMBLY || defined __DOXYGEN__
748 #define IP_REASSEMBLY                   1
749 #endif
750 
751 /**
752  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
753  * that this option does not affect incoming packet sizes, which can be
754  * controlled via IP_REASSEMBLY.
755  */
756 #if !defined IP_FRAG || defined __DOXYGEN__
757 #define IP_FRAG                         1
758 #endif
759 
760 #if !LWIP_IPV4
761 /* disable IPv4 extensions when IPv4 is disabled */
762 #undef IP_FORWARD
763 #define IP_FORWARD                      0
764 #undef IP_REASSEMBLY
765 #define IP_REASSEMBLY                   0
766 #undef IP_FRAG
767 #define IP_FRAG                         0
768 #endif /* !LWIP_IPV4 */
769 
770 /**
771  * IP_NAPT==1: Enables IPv4 Network Address and Port Translation
772  * Note that IP_FORWARD needs to be enabled for NAPT to work
773  */
774 #if !defined IP_NAPT || defined __DOXYGEN__
775 #define IP_NAPT                      0
776 #endif
777 
778 /**
779  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
780  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
781  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
782  */
783 #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__
784 #define IP_OPTIONS_ALLOWED              1
785 #endif
786 
787 /**
788  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
789  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
790  * in this time, the whole packet is discarded.
791  */
792 #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__
793 #define IP_REASS_MAXAGE                 15
794 #endif
795 
796 /**
797  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
798  * Since the received pbufs are enqueued, be sure to configure
799  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
800  * packets even if the maximum amount of fragments is enqueued for reassembly!
801  * When IPv4 *and* IPv6 are enabled, this even changes to
802  * (PBUF_POOL_SIZE > 2 * IP_REASS_MAX_PBUFS)!
803  */
804 #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__
805 #define IP_REASS_MAX_PBUFS              10
806 #endif
807 
808 /**
809  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
810  */
811 #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__
812 #define IP_DEFAULT_TTL                  255
813 #endif
814 
815 /**
816  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
817  * filter per pcb on udp and raw send operations. To enable broadcast filter
818  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
819  */
820 #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__
821 #define IP_SOF_BROADCAST                0
822 #endif
823 
824 /**
825  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
826  * filter on recv operations.
827  */
828 #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__
829 #define IP_SOF_BROADCAST_RECV           0
830 #endif
831 
832 /**
833  * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back
834  * out on the netif where it was received. This should only be used for
835  * wireless networks.
836  * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming
837  * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags!
838  */
839 #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__
840 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0
841 #endif
842 /**
843  * @}
844  */
845 
846 /*
847    ----------------------------------
848    ---------- ICMP options ----------
849    ----------------------------------
850 */
851 /**
852  * @defgroup lwip_opts_icmp ICMP
853  * @ingroup lwip_opts_ipv4
854  * @{
855  */
856 /**
857  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
858  * Be careful, disable that make your product non-compliant to RFC1122
859  */
860 #if !defined LWIP_ICMP || defined __DOXYGEN__
861 #define LWIP_ICMP                       1
862 #endif
863 
864 /**
865  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
866  */
867 #if !defined ICMP_TTL || defined __DOXYGEN__
868 #define ICMP_TTL                        IP_DEFAULT_TTL
869 #endif
870 
871 /**
872  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
873  */
874 #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__
875 #define LWIP_BROADCAST_PING             0
876 #endif
877 
878 /**
879  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
880  */
881 #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__
882 #define LWIP_MULTICAST_PING             0
883 #endif
884 /**
885  * @}
886  */
887 
888 /*
889    ---------------------------------
890    ---------- RAW options ----------
891    ---------------------------------
892 */
893 /**
894  * @defgroup lwip_opts_raw RAW
895  * @ingroup lwip_opts_callback
896  * @{
897  */
898 /**
899  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
900  */
901 #if !defined LWIP_RAW || defined __DOXYGEN__
902 #define LWIP_RAW                        0
903 #endif
904 
905 /**
906  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
907  */
908 #if !defined RAW_TTL || defined __DOXYGEN__
909 #define RAW_TTL                         IP_DEFAULT_TTL
910 #endif
911 /**
912  * @}
913  */
914 
915 /*
916    ----------------------------------
917    ---------- DHCP options ----------
918    ----------------------------------
919 */
920 /**
921  * @defgroup lwip_opts_dhcp DHCP
922  * @ingroup lwip_opts_ipv4
923  * @{
924  */
925 /**
926  * LWIP_DHCP==1: Enable DHCP module.
927  */
928 #if !defined LWIP_DHCP || defined __DOXYGEN__
929 #define LWIP_DHCP                       0
930 #endif
931 #if !LWIP_IPV4
932 /* disable DHCP when IPv4 is disabled */
933 #undef LWIP_DHCP
934 #define LWIP_DHCP                       0
935 #endif /* !LWIP_IPV4 */
936 
937 /**
938  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
939  */
940 #if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__
941 #define DHCP_DOES_ARP_CHECK             (LWIP_DHCP && LWIP_ARP)
942 #endif
943 
944 /**
945  * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
946  */
947 #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__
948 #define LWIP_DHCP_BOOTP_FILE            0
949 #endif
950 
951 /**
952  * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each
953  * response packet, an callback is called, which has to be provided by the port:
954  * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
955 */
956 #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__
957 #define LWIP_DHCP_GET_NTP_SRV           0
958 #endif
959 
960 /**
961  * The maximum of NTP servers requested
962  */
963 #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__
964 #define LWIP_DHCP_MAX_NTP_SERVERS       1
965 #endif
966 
967 /**
968  * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select.
969  * DNS servers received in the response are passed to DNS via @ref dns_setserver()
970  * (up to the maximum limit defined here).
971  */
972 #if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__
973 #define LWIP_DHCP_MAX_DNS_SERVERS       DNS_MAX_SERVERS
974 #endif
975 /**
976  * @}
977  */
978 
979 #ifndef LWIP_DHCP_IP_ADDR_RESTORE
980 #define LWIP_DHCP_IP_ADDR_RESTORE()       0
981 #endif
982 
983 #ifndef LWIP_DHCP_IP_ADDR_STORE
984 #define LWIP_DHCP_IP_ADDR_STORE()
985 #endif
986 
987 #ifndef LWIP_DHCP_IP_ADDR_ERASE
988 #define LWIP_DHCP_IP_ADDR_ERASE(esp_netif)
989 #endif
990 
991 /*
992    ------------------------------------
993    ---------- AUTOIP options ----------
994    ------------------------------------
995 */
996 /**
997  * @defgroup lwip_opts_autoip AUTOIP
998  * @ingroup lwip_opts_ipv4
999  * @{
1000  */
1001 /**
1002  * LWIP_AUTOIP==1: Enable AUTOIP module.
1003  */
1004 #if !defined LWIP_AUTOIP || defined __DOXYGEN__
1005 #define LWIP_AUTOIP                     0
1006 #endif
1007 #if !LWIP_IPV4
1008 /* disable AUTOIP when IPv4 is disabled */
1009 #undef LWIP_AUTOIP
1010 #define LWIP_AUTOIP                     0
1011 #endif /* !LWIP_IPV4 */
1012 
1013 /**
1014  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
1015  * the same interface at the same time.
1016  */
1017 #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__
1018 #define LWIP_DHCP_AUTOIP_COOP           0
1019 #endif
1020 
1021 /**
1022  * ESP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
1023  */
1024 #if !defined ESP_IPV6_AUTOCONFIG
1025 #define ESP_IPV6_AUTOCONFIG 0
1026 #endif
1027 
1028 /**
1029  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
1030  * that should be sent before falling back on AUTOIP (the DHCP client keeps
1031  * running in this case). This can be set as low as 1 to get an AutoIP address
1032  * very  quickly, but you should be prepared to handle a changing IP address
1033  * when DHCP overrides AutoIP.
1034  */
1035 #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__
1036 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
1037 #endif
1038 /**
1039  * @}
1040  */
1041 
1042 /*
1043    ----------------------------------
1044    ----- SNMP MIB2 support      -----
1045    ----------------------------------
1046 */
1047 /**
1048  * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks
1049  * @ingroup lwip_opts_infrastructure
1050  * @{
1051  */
1052 /**
1053  * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks.
1054  * Turn this on to get callbacks needed to implement MIB2.
1055  * Usually MIB2_STATS should be enabled, too.
1056  */
1057 #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__
1058 #define LWIP_MIB2_CALLBACKS             0
1059 #endif
1060 /**
1061  * @}
1062  */
1063 
1064 /*
1065    ----------------------------------
1066    -------- Multicast options -------
1067    ----------------------------------
1068 */
1069 /**
1070  * @defgroup lwip_opts_multicast Multicast
1071  * @ingroup lwip_opts_infrastructure
1072  * @{
1073  */
1074 /**
1075  * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options
1076  * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only)
1077  * core support for the corresponding IPv6 options.
1078  */
1079 #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__
1080 #define LWIP_MULTICAST_TX_OPTIONS       ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW))
1081 #endif
1082 /**
1083  * @}
1084  */
1085 
1086 /*
1087    ----------------------------------
1088    ---------- IGMP options ----------
1089    ----------------------------------
1090 */
1091 /**
1092  * @defgroup lwip_opts_igmp IGMP
1093  * @ingroup lwip_opts_ipv4
1094  * @{
1095  */
1096 /**
1097  * LWIP_IGMP==1: Turn on IGMP module.
1098  */
1099 #if !defined LWIP_IGMP || defined __DOXYGEN__
1100 #define LWIP_IGMP                       0
1101 #endif
1102 #if !LWIP_IPV4
1103 #undef LWIP_IGMP
1104 #define LWIP_IGMP                       0
1105 #endif
1106 /**
1107  * @}
1108  */
1109 
1110 /*
1111    ----------------------------------
1112    ---------- DNS options -----------
1113    ----------------------------------
1114 */
1115 /**
1116  * @defgroup lwip_opts_dns DNS
1117  * @ingroup lwip_opts_callback
1118  * @{
1119  */
1120 /**
1121  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
1122  * transport.
1123  */
1124 #if !defined LWIP_DNS || defined __DOXYGEN__
1125 #define LWIP_DNS                        0
1126 #endif
1127 
1128 /** DNS maximum number of entries to maintain locally. */
1129 #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__
1130 #define DNS_TABLE_SIZE                  4
1131 #endif
1132 
1133 /** DNS maximum host name length supported in the name table. */
1134 #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__
1135 #define DNS_MAX_NAME_LENGTH             256
1136 #endif
1137 
1138 /** The maximum of DNS servers
1139  * The first server can be initialized automatically by defining
1140  * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*'
1141  */
1142 #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__
1143 #define DNS_MAX_SERVERS                 2
1144 #endif
1145 
1146 /** DNS maximum number of retries when asking for a name, before "timeout". */
1147 #if !defined DNS_MAX_RETRIES || defined __DOXYGEN__
1148 #define DNS_MAX_RETRIES                 4
1149 #endif
1150 
1151 /** DNS do a name checking between the query and the response. */
1152 #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__
1153 #define DNS_DOES_NAME_CHECK             1
1154 #endif
1155 
1156 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation
1157  * Use all DNS security features by default.
1158  * This is overridable but should only be needed by very small targets
1159  * or when using against non standard DNS servers. */
1160 #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__
1161 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)
1162 #endif
1163 
1164 /* A list of DNS security features follows */
1165 #define LWIP_DNS_SECURE_RAND_XID                1
1166 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2
1167 #define LWIP_DNS_SECURE_RAND_SRC_PORT           4
1168 
1169 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer:
1170  *  \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \
1171  *                                    DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)}
1172  *
1173  *  Instead, you can also use an external function:
1174  *  \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype)
1175  *  that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype).
1176  */
1177 #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__
1178 #define DNS_LOCAL_HOSTLIST              0
1179 #endif /* DNS_LOCAL_HOSTLIST */
1180 
1181 /** If this is turned on, the local host-list can be dynamically changed
1182  *  at runtime. */
1183 #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__
1184 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
1185 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
1186 
1187 /** Set this to 1 to enable querying ".local" names via mDNS
1188  *  using a One-Shot Multicast DNS Query */
1189 #if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__
1190 #define LWIP_DNS_SUPPORT_MDNS_QUERIES   0
1191 #endif
1192 /**
1193  * @}
1194  */
1195 
1196 /*
1197    ---------------------------------
1198    ---------- UDP options ----------
1199    ---------------------------------
1200 */
1201 /**
1202  * @defgroup lwip_opts_udp UDP
1203  * @ingroup lwip_opts_callback
1204  * @{
1205  */
1206 /**
1207  * LWIP_UDP==1: Turn on UDP.
1208  */
1209 #if !defined LWIP_UDP || defined __DOXYGEN__
1210 #define LWIP_UDP                        1
1211 #endif
1212 
1213 /**
1214  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
1215  */
1216 #if !defined LWIP_UDPLITE || defined __DOXYGEN__
1217 #define LWIP_UDPLITE                    0
1218 #endif
1219 
1220 /**
1221  * UDP_TTL: Default Time-To-Live value.
1222  */
1223 #if !defined UDP_TTL || defined __DOXYGEN__
1224 #define UDP_TTL                         IP_DEFAULT_TTL
1225 #endif
1226 
1227 /**
1228  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
1229  */
1230 #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__
1231 #define LWIP_NETBUF_RECVINFO            0
1232 #endif
1233 /**
1234  * @}
1235  */
1236 
1237 /*
1238    ---------------------------------
1239    ---------- TCP options ----------
1240    ---------------------------------
1241 */
1242 /**
1243  * @defgroup lwip_opts_tcp TCP
1244  * @ingroup lwip_opts_callback
1245  * @{
1246  */
1247 /**
1248  * LWIP_TCP==1: Turn on TCP.
1249  */
1250 #if !defined LWIP_TCP || defined __DOXYGEN__
1251 #define LWIP_TCP                        1
1252 #endif
1253 
1254 /**
1255  * TCP_TTL: Default Time-To-Live value.
1256  */
1257 #if !defined TCP_TTL || defined __DOXYGEN__
1258 #define TCP_TTL                         IP_DEFAULT_TTL
1259 #endif
1260 
1261 /**
1262  * TCP_WND: The size of a TCP window.  This must be at least
1263  * (2 * TCP_MSS) for things to work well.
1264  * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size
1265  * with scaling applied. Maximum window value in the TCP header
1266  * will be TCP_WND >> TCP_RCV_SCALE
1267  */
1268 #if !defined TCP_WND || defined __DOXYGEN__
1269 #define TCP_WND                         (4 * TCP_MSS)
1270 #endif
1271 
1272 /**
1273  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
1274  */
1275 #if !defined TCP_MAXRTX || defined __DOXYGEN__
1276 #define TCP_MAXRTX                      12
1277 #endif
1278 
1279 /**
1280  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
1281  */
1282 #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__
1283 #define TCP_SYNMAXRTX                   6
1284 #endif
1285 
1286 /**
1287  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
1288  * Define to 0 if your device is low on memory.
1289  */
1290 #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__
1291 #define TCP_QUEUE_OOSEQ                 LWIP_TCP
1292 #endif
1293 
1294 /**
1295  * LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs).
1296  */
1297 #if !defined LWIP_TCP_SACK_OUT || defined __DOXYGEN__
1298 #define LWIP_TCP_SACK_OUT               0
1299 #endif
1300 
1301 /**
1302  * LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments.
1303  * Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled.
1304  * NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment
1305  * (depending on other options), setting this option to values greater than 4 is not pointless.
1306  * This is basically the max number of SACK ranges we want to keep track of.
1307  * As new data is delivered, some of the SACK ranges may be removed or merged.
1308  * In that case some of those older SACK ranges may be used again.
1309  * The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB.
1310  */
1311 #if !defined LWIP_TCP_MAX_SACK_NUM || defined __DOXYGEN__
1312 #define LWIP_TCP_MAX_SACK_NUM           4
1313 #endif
1314 
1315 /**
1316  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
1317  * you might want to increase this.)
1318  * For the receive side, this MSS is advertised to the remote side
1319  * when opening a connection. For the transmit size, this MSS sets
1320  * an upper limit on the MSS advertised by the remote host.
1321  */
1322 #if !defined TCP_MSS || defined __DOXYGEN__
1323 #define TCP_MSS                         536
1324 #endif
1325 
1326 /**
1327  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
1328  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
1329  * reflects the available reassembly buffer size at the remote host) and the
1330  * largest size permitted by the IP layer" (RFC 1122)
1331  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
1332  * netif used for a connection and limits the MSS if it would be too big otherwise.
1333  */
1334 #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__
1335 #define TCP_CALCULATE_EFF_SEND_MSS      1
1336 #endif
1337 
1338 
1339 /**
1340  * TCP_SND_BUF: TCP sender buffer space (bytes).
1341  * To achieve good performance, this should be at least 2 * TCP_MSS.
1342  */
1343 #if !defined TCP_SND_BUF || defined __DOXYGEN__
1344 #define TCP_SND_BUF                     (2 * TCP_MSS)
1345 #endif
1346 
1347 /**
1348  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
1349  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
1350  */
1351 #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__
1352 #define TCP_SND_QUEUELEN                ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
1353 #endif
1354 
1355 /**
1356  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
1357  * TCP_SND_BUF. It is the amount of space which must be available in the
1358  * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
1359  */
1360 #if !defined TCP_SNDLOWAT || defined __DOXYGEN__
1361 #define TCP_SNDLOWAT                    LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
1362 #endif
1363 
1364 /**
1365  * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less
1366  * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
1367  * this number, select returns writable (combined with TCP_SNDLOWAT).
1368  */
1369 #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__
1370 #define TCP_SNDQUEUELOWAT               LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
1371 #endif
1372 
1373 /**
1374  * TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per
1375  * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit).
1376  * Only valid for TCP_QUEUE_OOSEQ==1.
1377  */
1378 #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__
1379 #define TCP_OOSEQ_MAX_BYTES             0
1380 #endif
1381 
1382 /**
1383  * TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued
1384  * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 &&
1385  * TCP_OOSEQ_MAX_BYTES==1.
1386  * Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb.
1387  */
1388 #if !defined TCP_OOSEQ_BYTES_LIMIT
1389 #if TCP_OOSEQ_MAX_BYTES
1390 #define TCP_OOSEQ_BYTES_LIMIT(pcb)      TCP_OOSEQ_MAX_BYTES
1391 #elif defined __DOXYGEN__
1392 #define TCP_OOSEQ_BYTES_LIMIT(pcb)
1393 #endif
1394 #endif
1395 
1396 /**
1397  * TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per
1398  * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit).
1399  * Only valid for TCP_QUEUE_OOSEQ==1.
1400  */
1401 #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__
1402 #define TCP_OOSEQ_MAX_PBUFS             0
1403 #endif
1404 
1405 /**
1406  * TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued
1407  * on ooseq per pcb, given the pcb.  Only valid for TCP_QUEUE_OOSEQ==1 &&
1408  * TCP_OOSEQ_MAX_PBUFS==1.
1409  * Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb.
1410  */
1411 #if !defined TCP_OOSEQ_PBUFS_LIMIT
1412 #if TCP_OOSEQ_MAX_PBUFS
1413 #define TCP_OOSEQ_PBUFS_LIMIT(pcb)      TCP_OOSEQ_MAX_PBUFS
1414 #elif defined __DOXYGEN__
1415 #define TCP_OOSEQ_PBUFS_LIMIT(pcb)
1416 #endif
1417 #endif
1418 
1419 /**
1420  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
1421  */
1422 #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__
1423 #define TCP_LISTEN_BACKLOG              0
1424 #endif
1425 
1426 /**
1427  * The maximum allowed backlog for TCP listen netconns.
1428  * This backlog is used unless another is explicitly specified.
1429  * 0xff is the maximum (u8_t).
1430  */
1431 #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__
1432 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
1433 #endif
1434 
1435 /**
1436  * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
1437  * allocate ahead of time in an attempt to create shorter pbuf chains
1438  * for transmission. The meaningful range is 0 to TCP_MSS. Some
1439  * suggested values are:
1440  *
1441  * 0:         Disable oversized allocation. Each tcp_write() allocates a new
1442               pbuf (old behaviour).
1443  * 1:         Allocate size-aligned pbufs with minimal excess. Use this if your
1444  *            scatter-gather DMA requires aligned fragments.
1445  * 128:       Limit the pbuf/memory overhead to 20%.
1446  * TCP_MSS:   Try to create unfragmented TCP packets.
1447  * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
1448  */
1449 #if !defined TCP_OVERSIZE || defined __DOXYGEN__
1450 #define TCP_OVERSIZE                    TCP_MSS
1451 #endif
1452 
1453 /**
1454  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
1455  * The timestamp option is currently only used to help remote hosts, it is not
1456  * really used locally. Therefore, it is only enabled when a TS option is
1457  * received in the initial SYN packet from a remote host.
1458  */
1459 #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__
1460 #define LWIP_TCP_TIMESTAMPS             0
1461 #endif
1462 
1463 /**
1464  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
1465  * explicit window update
1466  */
1467 #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__
1468 #define TCP_WND_UPDATE_THRESHOLD        LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))
1469 #endif
1470 
1471 /**
1472  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
1473  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
1474  *         events (accept, sent, etc) that happen in the system.
1475  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
1476  *         for the event. This is the default.
1477  */
1478 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__
1479 #define LWIP_EVENT_API                  0
1480 #define LWIP_CALLBACK_API               1
1481 #else
1482 #ifndef LWIP_EVENT_API
1483 #define LWIP_EVENT_API                  0
1484 #endif
1485 #ifndef LWIP_CALLBACK_API
1486 #define LWIP_CALLBACK_API               0
1487 #endif
1488 #endif
1489 
1490 /**
1491  * LWIP_WND_SCALE and TCP_RCV_SCALE:
1492  * Set LWIP_WND_SCALE to 1 to enable window scaling.
1493  * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the
1494  * range of [0..14]).
1495  * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large
1496  * send window while having a small receive window only.
1497  */
1498 #if !defined LWIP_WND_SCALE || defined __DOXYGEN__
1499 #define LWIP_WND_SCALE                  0
1500 #define TCP_RCV_SCALE                   0
1501 #endif
1502 
1503 /**
1504  * LWIP_TCP_PCB_NUM_EXT_ARGS:
1505  * When this is > 0, every tcp pcb (including listen pcb) includes a number of
1506  * additional argument entries in an array (see tcp_ext_arg_alloc_id)
1507  */
1508 #if !defined LWIP_TCP_PCB_NUM_EXT_ARGS || defined __DOXYGEN__
1509 #define LWIP_TCP_PCB_NUM_EXT_ARGS       0
1510 #endif
1511 
1512 /** LWIP_ALTCP==1: enable the altcp API.
1513  * altcp is an abstraction layer that prevents applications linking against the
1514  * tcp.h functions but provides the same functionality. It is used to e.g. add
1515  * SSL/TLS or proxy-connect support to an application written for the tcp callback
1516  * API without that application knowing the protocol details.
1517  *
1518  * With LWIP_ALTCP==0, applications written against the altcp API can still be
1519  * compiled but are directly linked against the tcp.h callback API and then
1520  * cannot use layered protocols.
1521  *
1522  * See @ref altcp_api
1523  */
1524 #if !defined LWIP_ALTCP || defined __DOXYGEN__
1525 #define LWIP_ALTCP                      0
1526 #endif
1527 
1528 /** LWIP_ALTCP_TLS==1: enable TLS support for altcp API.
1529  * This needs a port of the functions in altcp_tls.h to a TLS library.
1530  * A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory
1531  * and LWIP_ALTCP_TLS_MBEDTLS option.
1532  */
1533 #if !defined LWIP_ALTCP_TLS || defined __DOXYGEN__
1534 #define LWIP_ALTCP_TLS                  0
1535 #endif
1536 
1537 #if ESP_LWIP
1538 #if !defined LWIP_TCP_RTO_TIME || defined __DOXYGEN__
1539 #define LWIP_TCP_RTO_TIME             3000
1540 #endif
1541 #endif
1542 /**
1543  * @}
1544  */
1545 
1546 /*
1547    ----------------------------------
1548    ---------- Pbuf options ----------
1549    ----------------------------------
1550 */
1551 /**
1552  * @defgroup lwip_opts_pbuf PBUF
1553  * @ingroup lwip_opts
1554  * @{
1555  */
1556 /**
1557  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
1558  * link level header. The default is 14, the standard value for
1559  * Ethernet.
1560  */
1561 #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__
1562 #if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__
1563 #define PBUF_LINK_HLEN                  (18 + ETH_PAD_SIZE)
1564 #else /* LWIP_HOOK_VLAN_SET */
1565 #define PBUF_LINK_HLEN                  (14 + ETH_PAD_SIZE)
1566 #endif /* LWIP_HOOK_VLAN_SET */
1567 #endif
1568 
1569 /**
1570  * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated
1571  * for an additional encapsulation header before ethernet headers (e.g. 802.11)
1572  */
1573 #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__
1574 #define PBUF_LINK_ENCAPSULATION_HLEN    0
1575 #endif
1576 
1577 /**
1578  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
1579  * designed to accommodate single full size TCP frame in one pbuf, including
1580  * TCP_MSS, IP header, and link header.
1581  */
1582 #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__
1583 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
1584 #endif
1585 
1586 /**
1587  * LWIP_PBUF_REF_T: Refcount type in pbuf.
1588  * Default width of u8_t can be increased if 255 refs are not enough for you.
1589  */
1590 #if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__
1591 #define LWIP_PBUF_REF_T                 u8_t
1592 #endif
1593 
1594 /**
1595  * LWIP_PBUF_CUSTOM_DATA: Store private data on pbufs (e.g. timestamps)
1596  * This extends struct pbuf so user can store custom data on every pbuf.
1597  */
1598 #if !defined LWIP_PBUF_CUSTOM_DATA || defined __DOXYGEN__
1599 #define LWIP_PBUF_CUSTOM_DATA
1600 #endif
1601 /**
1602  * @}
1603  */
1604 
1605 /*
1606    ------------------------------------------------
1607    ---------- Network Interfaces options ----------
1608    ------------------------------------------------
1609 */
1610 /**
1611  * @defgroup lwip_opts_netif NETIF
1612  * @ingroup lwip_opts
1613  * @{
1614  */
1615 /**
1616  * LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for
1617  * small real-life targets. Some code like routing etc. can be left out.
1618  */
1619 #if !defined LWIP_SINGLE_NETIF || defined __DOXYGEN__
1620 #define LWIP_SINGLE_NETIF               0
1621 #endif
1622 
1623 /**
1624  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
1625  * field.
1626  */
1627 #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__
1628 #define LWIP_NETIF_HOSTNAME             0
1629 #endif
1630 
1631 /**
1632  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
1633  */
1634 #if !defined LWIP_NETIF_API || defined __DOXYGEN__
1635 #define LWIP_NETIF_API                  0
1636 #endif
1637 
1638 /**
1639  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
1640  * changes its up/down status (i.e., due to DHCP IP acquisition)
1641  */
1642 #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__
1643 #define LWIP_NETIF_STATUS_CALLBACK      0
1644 #endif
1645 
1646 /**
1647  * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function
1648  * for several netif related event that supports multiple subscribers.
1649  * @see netif_ext_status_callback
1650  */
1651 #if !defined LWIP_NETIF_EXT_STATUS_CALLBACK || defined __DOXYGEN__
1652 #define LWIP_NETIF_EXT_STATUS_CALLBACK  0
1653 #endif
1654 
1655 /**
1656  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
1657  * whenever the link changes (i.e., link down)
1658  */
1659 #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__
1660 #define LWIP_NETIF_LINK_CALLBACK        0
1661 #endif
1662 
1663 /**
1664  * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called
1665  * when a netif has been removed
1666  */
1667 #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__
1668 #define LWIP_NETIF_REMOVE_CALLBACK      0
1669 #endif
1670 
1671 /**
1672  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
1673  * indices) in struct netif. TCP and UDP can make use of this to prevent
1674  * scanning the ARP table for every sent packet. While this is faster for big
1675  * ARP tables or many concurrent connections, it might be counterproductive
1676  * if you have a tiny ARP table or if there never are concurrent connections.
1677  */
1678 #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__
1679 #define LWIP_NETIF_HWADDRHINT           0
1680 #endif
1681 
1682 /**
1683  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data
1684  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
1685  * MACs that do not support scatter-gather.
1686  * Beware that this might involve CPU-memcpy before transmitting that would not
1687  * be needed without this flag! Use this only if you need to!
1688  *
1689  * ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX
1690  * pbufs for being in one piece. If not, @ref pbuf_clone can be used to get
1691  * a single pbuf:
1692  *   if (p->next != NULL) {
1693  *     struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p);
1694  *     if (q == NULL) {
1695  *       return ERR_MEM;
1696  *     }
1697  *     p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller!
1698  *   }
1699  */
1700 #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__
1701 #define LWIP_NETIF_TX_SINGLE_PBUF       0
1702 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
1703 
1704 /**
1705  * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store
1706  * data in client_data member array of struct netif (max. 256).
1707  */
1708 #if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__
1709 #define LWIP_NUM_NETIF_CLIENT_DATA      0
1710 #endif
1711 /**
1712  * @}
1713  */
1714 
1715 /*
1716    ------------------------------------
1717    ---------- LOOPIF options ----------
1718    ------------------------------------
1719 */
1720 /**
1721  * @defgroup lwip_opts_loop Loopback interface
1722  * @ingroup lwip_opts_netif
1723  * @{
1724  */
1725 /**
1726  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1).
1727  * This is only needed when no real netifs are available. If at least one other
1728  * netif is available, loopback traffic uses this netif.
1729  */
1730 #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__
1731 #define LWIP_HAVE_LOOPIF                (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF)
1732 #endif
1733 
1734 /**
1735  * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1).
1736  */
1737 #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__
1738 #define LWIP_LOOPIF_MULTICAST           0
1739 #endif
1740 
1741 /**
1742  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
1743  * address equal to the netif IP address, looping them back up the stack.
1744  */
1745 #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__
1746 #define LWIP_NETIF_LOOPBACK             0
1747 #endif
1748 
1749 /**
1750  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
1751  * sending for each netif (0 = disabled)
1752  */
1753 #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__
1754 #define LWIP_LOOPBACK_MAX_PBUFS         0
1755 #endif
1756 
1757 /**
1758  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
1759  * the system, as netifs must change how they behave depending on this setting
1760  * for the LWIP_NETIF_LOOPBACK option to work.
1761  * Setting this is needed to avoid reentering non-reentrant functions like
1762  * tcp_input().
1763  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
1764  *       multithreaded environment like tcpip.c. In this case, netif->input()
1765  *       is called directly.
1766  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
1767  *       The packets are put on a list and netif_poll() must be called in
1768  *       the main application loop.
1769  */
1770 #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__
1771 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
1772 #endif
1773 /**
1774  * @}
1775  */
1776 
1777 /*
1778    ------------------------------------
1779    ---------- Thread options ----------
1780    ------------------------------------
1781 */
1782 /**
1783  * @defgroup lwip_opts_thread Threading
1784  * @ingroup lwip_opts_infrastructure
1785  * @{
1786  */
1787 /**
1788  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1789  */
1790 #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__
1791 #define TCPIP_THREAD_NAME               "tcpip_thread"
1792 #endif
1793 
1794 /**
1795  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1796  * The stack size value itself is platform-dependent, but is passed to
1797  * sys_thread_new() when the thread is created.
1798  */
1799 #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__
1800 #define TCPIP_THREAD_STACKSIZE          0
1801 #endif
1802 
1803 /**
1804  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1805  * The priority value itself is platform-dependent, but is passed to
1806  * sys_thread_new() when the thread is created.
1807  */
1808 #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__
1809 #define TCPIP_THREAD_PRIO               1
1810 #endif
1811 
1812 /**
1813  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1814  * The queue size value itself is platform-dependent, but is passed to
1815  * sys_mbox_new() when tcpip_init is called.
1816  */
1817 #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__
1818 #define TCPIP_MBOX_SIZE                 0
1819 #endif
1820 
1821 /**
1822  * Define this to something that triggers a watchdog. This is called from
1823  * tcpip_thread after processing a message.
1824  */
1825 #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__
1826 #define LWIP_TCPIP_THREAD_ALIVE()
1827 #endif
1828 
1829 /**
1830  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1831  */
1832 #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__
1833 #define SLIPIF_THREAD_NAME              "slipif_loop"
1834 #endif
1835 
1836 /**
1837  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1838  * The stack size value itself is platform-dependent, but is passed to
1839  * sys_thread_new() when the thread is created.
1840  */
1841 #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__
1842 #define SLIPIF_THREAD_STACKSIZE         0
1843 #endif
1844 
1845 /**
1846  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1847  * The priority value itself is platform-dependent, but is passed to
1848  * sys_thread_new() when the thread is created.
1849  */
1850 #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__
1851 #define SLIPIF_THREAD_PRIO              1
1852 #endif
1853 
1854 /**
1855  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1856  */
1857 #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__
1858 #define DEFAULT_THREAD_NAME             "lwIP"
1859 #endif
1860 
1861 /**
1862  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1863  * The stack size value itself is platform-dependent, but is passed to
1864  * sys_thread_new() when the thread is created.
1865  */
1866 #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__
1867 #define DEFAULT_THREAD_STACKSIZE        0
1868 #endif
1869 
1870 /**
1871  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1872  * The priority value itself is platform-dependent, but is passed to
1873  * sys_thread_new() when the thread is created.
1874  */
1875 #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__
1876 #define DEFAULT_THREAD_PRIO             1
1877 #endif
1878 
1879 /**
1880  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1881  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1882  * to sys_mbox_new() when the recvmbox is created.
1883  */
1884 #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__
1885 #define DEFAULT_RAW_RECVMBOX_SIZE       0
1886 #endif
1887 
1888 /**
1889  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1890  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1891  * to sys_mbox_new() when the recvmbox is created.
1892  */
1893 #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__
1894 #define DEFAULT_UDP_RECVMBOX_SIZE       0
1895 #endif
1896 
1897 /**
1898  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1899  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1900  * to sys_mbox_new() when the recvmbox is created.
1901  */
1902 #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__
1903 #define DEFAULT_TCP_RECVMBOX_SIZE       0
1904 #endif
1905 
1906 /**
1907  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1908  * The queue size value itself is platform-dependent, but is passed to
1909  * sys_mbox_new() when the acceptmbox is created.
1910  */
1911 #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__
1912 #define DEFAULT_ACCEPTMBOX_SIZE         0
1913 #endif
1914 /**
1915  * @}
1916  */
1917 
1918 /*
1919    ----------------------------------------------
1920    ---------- Sequential layer options ----------
1921    ----------------------------------------------
1922 */
1923 /**
1924  * @defgroup lwip_opts_netconn Netconn
1925  * @ingroup lwip_opts_threadsafe_apis
1926  * @{
1927  */
1928 /**
1929  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
1930  */
1931 #if !defined LWIP_NETCONN || defined __DOXYGEN__
1932 #define LWIP_NETCONN                    1
1933 #endif
1934 
1935 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create
1936  * timers running in tcpip_thread from another thread.
1937  */
1938 #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__
1939 #define LWIP_TCPIP_TIMEOUT              0
1940 #endif
1941 
1942 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per
1943  * thread calling socket/netconn functions instead of allocating one
1944  * semaphore per netconn (and per select etc.)
1945  * ATTENTION: a thread-local semaphore for API calls is needed:
1946  * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t*
1947  * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore
1948  * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore
1949  * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup().
1950  * Ports may call these for threads created with sys_thread_new().
1951  */
1952 #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__
1953 #define LWIP_NETCONN_SEM_PER_THREAD     0
1954 #endif
1955 
1956 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread,
1957  * writing from a 2nd thread and closing from a 3rd thread at the same time.
1958  * ATTENTION: This is currently really alpha! Some requirements:
1959  * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from
1960  *   multiple threads at once
1961  * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox
1962  *   and prevent a task pending on this during/after deletion
1963  */
1964 #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__
1965 #define LWIP_NETCONN_FULLDUPLEX         0
1966 #endif
1967 /**
1968  * @}
1969  */
1970 
1971 /*
1972    ------------------------------------
1973    ---------- Socket options ----------
1974    ------------------------------------
1975 */
1976 /**
1977  * @defgroup lwip_opts_socket Sockets
1978  * @ingroup lwip_opts_threadsafe_apis
1979  * @{
1980  */
1981 /**
1982  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1983  */
1984 #if !defined LWIP_SOCKET || defined __DOXYGEN__
1985 #define LWIP_SOCKET                     1
1986 #endif
1987 
1988 /**
1989  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines.
1990  * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created.
1991  * While this helps code completion, it might conflict with existing libraries.
1992  * (only used if you use sockets.c)
1993  */
1994 #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__
1995 #define LWIP_COMPAT_SOCKETS             1
1996 #endif
1997 
1998 /**
1999  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
2000  * Disable this option if you use a POSIX operating system that uses the same
2001  * names (read, write & close). (only used if you use sockets.c)
2002  */
2003 #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__
2004 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
2005 #endif
2006 
2007 /**
2008  * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.
2009  * This can be useful when there are multiple APIs which create file descriptors.
2010  * When they all start with a different offset and you won't make them overlap you can
2011  * re implement read/write/close/ioctl/fnctl to send the requested action to the right
2012  * library (sharing select will need more work though).
2013  */
2014 #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__
2015 #define LWIP_SOCKET_OFFSET              0
2016 #endif
2017 
2018 /**
2019  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
2020  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
2021  * in seconds. (does not require sockets.c, and will affect tcp.c)
2022  */
2023 #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__
2024 #define LWIP_TCP_KEEPALIVE              0
2025 #endif
2026 
2027 /**
2028  * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
2029  * SO_SNDTIMEO processing.
2030  */
2031 #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__
2032 #define LWIP_SO_SNDTIMEO                0
2033 #endif
2034 
2035 /**
2036  * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
2037  * SO_RCVTIMEO processing.
2038  */
2039 #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__
2040 #define LWIP_SO_RCVTIMEO                0
2041 #endif
2042 
2043 /**
2044  * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int
2045  * (milliseconds, much like winsock does) instead of a struct timeval (default).
2046  */
2047 #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__
2048 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0
2049 #endif
2050 
2051 /**
2052  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
2053  */
2054 #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__
2055 #define LWIP_SO_RCVBUF                  0
2056 #endif
2057 
2058 /**
2059  * LWIP_SO_LINGER==1: Enable SO_LINGER processing.
2060  */
2061 #if !defined LWIP_SO_LINGER || defined __DOXYGEN__
2062 #define LWIP_SO_LINGER                  0
2063 #endif
2064 
2065 /**
2066  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
2067  */
2068 #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__
2069 #define RECV_BUFSIZE_DEFAULT            INT_MAX
2070 #endif
2071 
2072 /**
2073  * By default, TCP socket/netconn close waits 20 seconds max to send the FIN
2074  */
2075 #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__
2076 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000
2077 #endif
2078 
2079 /**
2080  * SO_REUSE==1: Enable SO_REUSEADDR option.
2081  */
2082 #if !defined SO_REUSE || defined __DOXYGEN__
2083 #define SO_REUSE                        0
2084 #endif
2085 
2086 /**
2087  * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
2088  * to all local matches if SO_REUSEADDR is turned on.
2089  * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
2090  */
2091 #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__
2092 #define SO_REUSE_RXTOALL                0
2093 #endif
2094 
2095 /**
2096  * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of
2097  * pending data in the network buffer. This is the way windows does it. It's
2098  * the default for lwIP since it is smaller.
2099  * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next
2100  * pending datagram in bytes. This is the way linux does it. This code is only
2101  * here for compatibility.
2102  */
2103 #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__
2104 #define LWIP_FIONREAD_LINUXMODE         0
2105 #endif
2106 
2107 /**
2108  * LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn
2109  * callback to keep track of events).
2110  * This saves RAM (counters per socket) and code (netconn event callback), which
2111  * should improve performance a bit).
2112  */
2113 #if !defined LWIP_SOCKET_SELECT || defined __DOXYGEN__
2114 #define LWIP_SOCKET_SELECT              1
2115 #endif
2116 
2117 /**
2118  * LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including
2119  * struct pollfd, nfds_t, and constants)
2120  */
2121 #if !defined LWIP_SOCKET_POLL || defined __DOXYGEN__
2122 #define LWIP_SOCKET_POLL                1
2123 #endif
2124 /**
2125  * @}
2126  */
2127 
2128 /*
2129    ----------------------------------------
2130    ---------- Statistics options ----------
2131    ----------------------------------------
2132 */
2133 /**
2134  * @defgroup lwip_opts_stats Statistics
2135  * @ingroup lwip_opts_debug
2136  * @{
2137  */
2138 /**
2139  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
2140  */
2141 #if !defined LWIP_STATS || defined __DOXYGEN__
2142 #define LWIP_STATS                      1
2143 #endif
2144 
2145 #if LWIP_STATS
2146 
2147 /**
2148  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
2149  */
2150 #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__
2151 #define LWIP_STATS_DISPLAY              0
2152 #endif
2153 
2154 /**
2155  * LINK_STATS==1: Enable link stats.
2156  */
2157 #if !defined LINK_STATS || defined __DOXYGEN__
2158 #define LINK_STATS                      1
2159 #endif
2160 
2161 /**
2162  * ETHARP_STATS==1: Enable etharp stats.
2163  */
2164 #if !defined ETHARP_STATS || defined __DOXYGEN__
2165 #define ETHARP_STATS                    (LWIP_ARP)
2166 #endif
2167 
2168 /**
2169  * IP_STATS==1: Enable IP stats.
2170  */
2171 #if !defined IP_STATS || defined __DOXYGEN__
2172 #define IP_STATS                        1
2173 #endif
2174 
2175 /**
2176  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
2177  * on if using either frag or reass.
2178  */
2179 #if !defined IPFRAG_STATS || defined __DOXYGEN__
2180 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
2181 #endif
2182 
2183 /**
2184  * ICMP_STATS==1: Enable ICMP stats.
2185  */
2186 #if !defined ICMP_STATS || defined __DOXYGEN__
2187 #define ICMP_STATS                      1
2188 #endif
2189 
2190 /**
2191  * IGMP_STATS==1: Enable IGMP stats.
2192  */
2193 #if !defined IGMP_STATS || defined __DOXYGEN__
2194 #define IGMP_STATS                      (LWIP_IGMP)
2195 #endif
2196 
2197 /**
2198  * UDP_STATS==1: Enable UDP stats. Default is on if
2199  * UDP enabled, otherwise off.
2200  */
2201 #if !defined UDP_STATS || defined __DOXYGEN__
2202 #define UDP_STATS                       (LWIP_UDP)
2203 #endif
2204 
2205 /**
2206  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
2207  * enabled, otherwise off.
2208  */
2209 #if !defined TCP_STATS || defined __DOXYGEN__
2210 #define TCP_STATS                       (LWIP_TCP)
2211 #endif
2212 
2213 /**
2214  * MEM_STATS==1: Enable mem.c stats.
2215  */
2216 #if !defined MEM_STATS || defined __DOXYGEN__
2217 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
2218 #endif
2219 
2220 /**
2221  * MEMP_STATS==1: Enable memp.c pool stats.
2222  */
2223 #if !defined MEMP_STATS || defined __DOXYGEN__
2224 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
2225 #endif
2226 
2227 /**
2228  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
2229  */
2230 #if !defined SYS_STATS || defined __DOXYGEN__
2231 #define SYS_STATS                       (NO_SYS == 0)
2232 #endif
2233 
2234 /**
2235  * IP6_STATS==1: Enable IPv6 stats.
2236  */
2237 #if !defined IP6_STATS || defined __DOXYGEN__
2238 #define IP6_STATS                       (LWIP_IPV6)
2239 #endif
2240 
2241 /**
2242  * ICMP6_STATS==1: Enable ICMP for IPv6 stats.
2243  */
2244 #if !defined ICMP6_STATS || defined __DOXYGEN__
2245 #define ICMP6_STATS                     (LWIP_IPV6 && LWIP_ICMP6)
2246 #endif
2247 
2248 /**
2249  * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats.
2250  */
2251 #if !defined IP6_FRAG_STATS || defined __DOXYGEN__
2252 #define IP6_FRAG_STATS                  (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS))
2253 #endif
2254 
2255 /**
2256  * MLD6_STATS==1: Enable MLD for IPv6 stats.
2257  */
2258 #if !defined MLD6_STATS || defined __DOXYGEN__
2259 #define MLD6_STATS                      (LWIP_IPV6 && LWIP_IPV6_MLD)
2260 #endif
2261 
2262 /**
2263  * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats.
2264  */
2265 #if !defined ND6_STATS || defined __DOXYGEN__
2266 #define ND6_STATS                       (LWIP_IPV6)
2267 #endif
2268 
2269 /**
2270  * MIB2_STATS==1: Stats for SNMP MIB2.
2271  */
2272 #if !defined MIB2_STATS || defined __DOXYGEN__
2273 #define MIB2_STATS                      0
2274 #endif
2275 
2276 #else
2277 
2278 #define LINK_STATS                      0
2279 #define ETHARP_STATS                    0
2280 #define IP_STATS                        0
2281 #define IPFRAG_STATS                    0
2282 #define ICMP_STATS                      0
2283 #define IGMP_STATS                      0
2284 #define UDP_STATS                       0
2285 #define TCP_STATS                       0
2286 #define MEM_STATS                       0
2287 #define MEMP_STATS                      0
2288 #define SYS_STATS                       0
2289 #define LWIP_STATS_DISPLAY              0
2290 #define IP6_STATS                       0
2291 #define ICMP6_STATS                     0
2292 #define IP6_FRAG_STATS                  0
2293 #define MLD6_STATS                      0
2294 #define ND6_STATS                       0
2295 #define MIB2_STATS                      0
2296 
2297 #endif /* LWIP_STATS */
2298 /**
2299  * @}
2300  */
2301 
2302 /*
2303    --------------------------------------
2304    ---------- Checksum options ----------
2305    --------------------------------------
2306 */
2307 /**
2308  * @defgroup lwip_opts_checksum Checksum
2309  * @ingroup lwip_opts_infrastructure
2310  * @{
2311  */
2312 /**
2313  * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled
2314  * per netif.
2315  * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled!
2316  */
2317 #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__
2318 #define LWIP_CHECKSUM_CTRL_PER_NETIF    0
2319 #endif
2320 
2321 /**
2322  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
2323  */
2324 #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__
2325 #define CHECKSUM_GEN_IP                 1
2326 #endif
2327 
2328 /**
2329  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
2330  */
2331 #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__
2332 #define CHECKSUM_GEN_UDP                1
2333 #endif
2334 
2335 /**
2336  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
2337  */
2338 #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__
2339 #define CHECKSUM_GEN_TCP                1
2340 #endif
2341 
2342 /**
2343  * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.
2344  */
2345 #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__
2346 #define CHECKSUM_GEN_ICMP               1
2347 #endif
2348 
2349 /**
2350  * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
2351  */
2352 #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__
2353 #define CHECKSUM_GEN_ICMP6              1
2354 #endif
2355 
2356 /**
2357  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
2358  */
2359 #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__
2360 #define CHECKSUM_CHECK_IP               1
2361 #endif
2362 
2363 /**
2364  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
2365  */
2366 #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__
2367 #define CHECKSUM_CHECK_UDP              1
2368 #endif
2369 
2370 /**
2371  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
2372  */
2373 #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__
2374 #define CHECKSUM_CHECK_TCP              1
2375 #endif
2376 
2377 /**
2378  * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
2379  */
2380 #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__
2381 #define CHECKSUM_CHECK_ICMP             1
2382 #endif
2383 
2384 /**
2385  * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
2386  */
2387 #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__
2388 #define CHECKSUM_CHECK_ICMP6            1
2389 #endif
2390 
2391 /**
2392  * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
2393  * application buffers to pbufs.
2394  */
2395 #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__
2396 #define LWIP_CHECKSUM_ON_COPY           0
2397 #endif
2398 /**
2399  * @}
2400  */
2401 
2402 /*
2403    ---------------------------------------
2404    ---------- IPv6 options ---------------
2405    ---------------------------------------
2406 */
2407 /**
2408  * @defgroup lwip_opts_ipv6 IPv6
2409  * @ingroup lwip_opts
2410  * @{
2411  */
2412 /**
2413  * LWIP_IPV6==1: Enable IPv6
2414  */
2415 #if !defined LWIP_IPV6 || defined __DOXYGEN__
2416 #define LWIP_IPV6                       0
2417 #endif
2418 
2419 /**
2420  * IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally)
2421  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
2422  * in this time, the whole packet is discarded.
2423  */
2424 #if !defined IPV6_REASS_MAXAGE || defined __DOXYGEN__
2425 #define IPV6_REASS_MAXAGE               60
2426 #endif
2427 
2428 /**
2429  * LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that
2430  * e.g. link-local addresses are really treated as link-local. Disable this
2431  * setting only for single-interface configurations.
2432  * All addresses that have a scope according to the default policy (link-local
2433  * unicast addresses, interface-local and link-local multicast addresses) should
2434  * now have a zone set on them before being passed to the core API, although
2435  * lwIP will currently attempt to select a zone on the caller's behalf when
2436  * necessary. Applications that directly assign IPv6 addresses to interfaces
2437  * (which is NOT recommended) must now ensure that link-local addresses carry
2438  * the netif's zone. See the new ip6_zone.h header file for more information and
2439  * relevant macros. For now it is still possible to turn off scopes support
2440  * through the new LWIP_IPV6_SCOPES option. When upgrading an implementation that
2441  * uses the core API directly, it is highly recommended to enable
2442  * LWIP_IPV6_SCOPES_DEBUG at least for a while, to ensure e.g. proper address
2443  * initialization.
2444  */
2445 #if !defined LWIP_IPV6_SCOPES || defined __DOXYGEN__
2446 #define LWIP_IPV6_SCOPES                (LWIP_IPV6 && !LWIP_SINGLE_NETIF)
2447 #endif
2448 
2449 /**
2450  * LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses
2451  * are properly zoned (see ip6_zone.h on what that means) where it matters.
2452  * Enabling this setting is highly recommended when upgrading from an existing
2453  * installation that is not yet scope-aware; otherwise it may be too expensive.
2454  */
2455 #if !defined LWIP_IPV6_SCOPES_DEBUG || defined __DOXYGEN__
2456 #define LWIP_IPV6_SCOPES_DEBUG          0
2457 #endif
2458 
2459 /**
2460  * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
2461  */
2462 #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__
2463 #define LWIP_IPV6_NUM_ADDRESSES         3
2464 #endif
2465 
2466 /**
2467  * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
2468  */
2469 #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__
2470 #define LWIP_IPV6_FORWARD               0
2471 #endif
2472 
2473 /**
2474  * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
2475  */
2476 #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__
2477 #define LWIP_IPV6_FRAG                  1
2478 #endif
2479 
2480 /**
2481  * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
2482  */
2483 #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__
2484 #define LWIP_IPV6_REASS                 LWIP_IPV6
2485 #endif
2486 
2487 /**
2488  * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during
2489  * network startup.
2490  */
2491 #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__
2492 #define LWIP_IPV6_SEND_ROUTER_SOLICIT   1
2493 #endif
2494 
2495 /**
2496  * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
2497  */
2498 #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__
2499 #define LWIP_IPV6_AUTOCONFIG            LWIP_IPV6
2500 #endif
2501 
2502 /**
2503  * LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each
2504  * IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled
2505  * otherwise, in which case the application may assign address lifetimes with
2506  * the appropriate macros. Addresses with no lifetime are assumed to be static.
2507  * If this option is disabled, all addresses are assumed to be static.
2508  */
2509 #if !defined LWIP_IPV6_ADDRESS_LIFETIMES || defined __DOXYGEN__
2510 #define LWIP_IPV6_ADDRESS_LIFETIMES     LWIP_IPV6_AUTOCONFIG
2511 #endif
2512 
2513 /**
2514  * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts.
2515  */
2516 #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__
2517 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS   1
2518 #endif
2519 /**
2520  * @}
2521  */
2522 
2523 /**
2524  * @defgroup lwip_opts_icmp6 ICMP6
2525  * @ingroup lwip_opts_ipv6
2526  * @{
2527  */
2528 /**
2529  * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
2530  */
2531 #if !defined LWIP_ICMP6 || defined __DOXYGEN__
2532 #define LWIP_ICMP6                      LWIP_IPV6
2533 #endif
2534 
2535 /**
2536  * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in
2537  * ICMPv6 error messages.
2538  */
2539 #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__
2540 #define LWIP_ICMP6_DATASIZE             8
2541 #endif
2542 
2543 /**
2544  * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
2545  */
2546 #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__
2547 #define LWIP_ICMP6_HL                   255
2548 #endif
2549 /**
2550  * @}
2551  */
2552 
2553 /**
2554  * @defgroup lwip_opts_mld6 Multicast listener discovery
2555  * @ingroup lwip_opts_ipv6
2556  * @{
2557  */
2558 /**
2559  * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol.
2560  * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must
2561  * indiscriminately pass all inbound IPv6 multicast traffic to lwIP.
2562  */
2563 #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__
2564 #define LWIP_IPV6_MLD                   LWIP_IPV6
2565 #endif
2566 
2567 /**
2568  * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined.
2569  * There must be enough groups so that each netif can join the solicited-node
2570  * multicast group for each of its local addresses, plus one for MDNS if
2571  * applicable, plus any number of groups to be joined on UDP sockets.
2572  */
2573 #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__
2574 #define MEMP_NUM_MLD6_GROUP             4
2575 #endif
2576 /**
2577  * @}
2578  */
2579 
2580 /**
2581  * @defgroup lwip_opts_nd6 Neighbor discovery
2582  * @ingroup lwip_opts_ipv6
2583  * @{
2584  */
2585 /**
2586  * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address
2587  * is being resolved.
2588  */
2589 #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__
2590 #define LWIP_ND6_QUEUEING               LWIP_IPV6
2591 #endif
2592 
2593 /**
2594  * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
2595  */
2596 #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__
2597 #define MEMP_NUM_ND6_QUEUE              20
2598 #endif
2599 
2600 /**
2601  * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
2602  */
2603 #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__
2604 #define LWIP_ND6_NUM_NEIGHBORS          10
2605 #endif
2606 
2607 /**
2608  * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
2609  */
2610 #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__
2611 #define LWIP_ND6_NUM_DESTINATIONS       10
2612 #endif
2613 
2614 /**
2615  * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
2616  */
2617 #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__
2618 #define LWIP_ND6_NUM_PREFIXES           5
2619 #endif
2620 
2621 /**
2622  * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
2623  */
2624 #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__
2625 #define LWIP_ND6_NUM_ROUTERS            3
2626 #endif
2627 
2628 /**
2629  * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send
2630  * (neighbor solicit and router solicit)
2631  */
2632 #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__
2633 #define LWIP_ND6_MAX_MULTICAST_SOLICIT  3
2634 #endif
2635 
2636 /**
2637  * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages
2638  * to send during neighbor reachability detection.
2639  */
2640 #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__
2641 #define LWIP_ND6_MAX_UNICAST_SOLICIT    3
2642 #endif
2643 
2644 /**
2645  * Unused: See ND RFC (time in milliseconds).
2646  */
2647 #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__
2648 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000
2649 #endif
2650 
2651 /**
2652  * Unused: See ND RFC
2653  */
2654 #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__
2655 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT  3
2656 #endif
2657 
2658 /**
2659  * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds).
2660  * May be updated by router advertisement messages.
2661  */
2662 #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__
2663 #define LWIP_ND6_REACHABLE_TIME         30000
2664 #endif
2665 
2666 /**
2667  * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
2668  */
2669 #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__
2670 #define LWIP_ND6_RETRANS_TIMER          1000
2671 #endif
2672 
2673 /**
2674  * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation
2675  * message is sent, during neighbor reachability detection.
2676  */
2677 #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__
2678 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000
2679 #endif
2680 
2681 /**
2682  * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update
2683  * Reachable time and retransmission timers, and netif MTU.
2684  */
2685 #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__
2686 #define LWIP_ND6_ALLOW_RA_UPDATES       1
2687 #endif
2688 
2689 /**
2690  * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery
2691  * with reachability hints for connected destinations. This helps avoid sending
2692  * unicast neighbor solicitation messages.
2693  */
2694 #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__
2695 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1
2696 #endif
2697 
2698 /**
2699  * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive
2700  * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS
2701  * servers to the DNS module.
2702  */
2703 #if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__
2704 #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS  0
2705 #endif
2706 /**
2707  * @}
2708  */
2709 
2710 /**
2711  * @defgroup lwip_opts_dhcpv6 DHCPv6
2712  * @ingroup lwip_opts_ipv6
2713  * @{
2714  */
2715 /**
2716  * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration.
2717  */
2718 #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__
2719 #define LWIP_IPV6_DHCP6                 0
2720 #endif
2721 
2722 /**
2723  * LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration.
2724  * (not supported, yet!)
2725  */
2726 #if !defined LWIP_IPV6_DHCP6_STATEFUL || defined __DOXYGEN__
2727 #define LWIP_IPV6_DHCP6_STATEFUL        0
2728 #endif
2729 
2730 /**
2731  * LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration.
2732  */
2733 #if !defined LWIP_IPV6_DHCP6_STATELESS || defined __DOXYGEN__
2734 #define LWIP_IPV6_DHCP6_STATELESS       LWIP_IPV6_DHCP6
2735 #endif
2736 
2737 /**
2738  * LWIP_DHCP6_GETS_NTP==1: Request NTP servers via DHCPv6. For each
2739  * response packet, a callback is called, which has to be provided by the port:
2740  * void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
2741 */
2742 #if !defined LWIP_DHCP6_GET_NTP_SRV || defined __DOXYGEN__
2743 #define LWIP_DHCP6_GET_NTP_SRV          0
2744 #endif
2745 
2746 /**
2747  * The maximum of NTP servers requested
2748  */
2749 #if !defined LWIP_DHCP6_MAX_NTP_SERVERS || defined __DOXYGEN__
2750 #define LWIP_DHCP6_MAX_NTP_SERVERS      1
2751 #endif
2752 
2753 /**
2754  * LWIP_DHCP6_MAX_DNS_SERVERS > 0: Request DNS servers via DHCPv6.
2755  * DNS servers received in the response are passed to DNS via @ref dns_setserver()
2756  * (up to the maximum limit defined here).
2757  */
2758 #if !defined LWIP_DHCP6_MAX_DNS_SERVERS || defined __DOXYGEN__
2759 #define LWIP_DHCP6_MAX_DNS_SERVERS      DNS_MAX_SERVERS
2760 #endif
2761 /**
2762  * @}
2763  */
2764 
2765 /*
2766    ---------------------------------------
2767    ---------- Hook options ---------------
2768    ---------------------------------------
2769 */
2770 
2771 /**
2772  * @defgroup lwip_opts_hooks Hooks
2773  * @ingroup lwip_opts_infrastructure
2774  * Hooks are undefined by default, define them to a function if you need them.
2775  * @{
2776  */
2777 
2778 /**
2779  * LWIP_HOOK_FILENAME: Custom filename to \#include in files that provide hooks.
2780  * Declare your hook function prototypes in there, you may also \#include all headers
2781  * providing data types that are need in this file.
2782  */
2783 #ifdef __DOXYGEN__
2784 #define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h"
2785 #endif
2786 
2787 /**
2788  * LWIP_HOOK_TCP_ISN:
2789  * Hook for generation of the Initial Sequence Number (ISN) for a new TCP
2790  * connection. The default lwIP ISN generation algorithm is very basic and may
2791  * allow for TCP spoofing attacks. This hook provides the means to implement
2792  * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn),
2793  * or any other desired algorithm as a replacement.
2794  * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for
2795  * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n
2796  * Signature:\code{.c}
2797  * u32_t my_hook_tcp_isn(const ip_addr_t* local_ip, u16_t local_port, const ip_addr_t* remote_ip, u16_t remote_port);
2798  * \endcode
2799  * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n
2800  * Arguments:
2801  * - local_ip: pointer to the local IP address of the connection
2802  * - local_port: local port number of the connection (host-byte order)
2803  * - remote_ip: pointer to the remote IP address of the connection
2804  * - remote_port: remote port number of the connection (host-byte order)\n
2805  * Return value:
2806  * - the 32-bit Initial Sequence Number to use for the new TCP connection.
2807  */
2808 #ifdef __DOXYGEN__
2809 #define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port)
2810 #endif
2811 
2812 /**
2813  * LWIP_HOOK_TCP_INPACKET_PCB:
2814  * Hook for intercepting incoming packets before they are passed to a pcb. This
2815  * allows updating some state or even dropping a packet.
2816  * Signature:\code{.c}
2817  * err_t my_hook_tcp_inpkt(struct tcp_pcb *pcb, struct tcp_hdr *hdr, u16_t optlen, u16_t opt1len, u8_t *opt2, struct pbuf *p);
2818  * \endcode
2819  * Arguments:
2820  * - pcb: tcp_pcb selected for input of this packet (ATTENTION: this may be
2821  *        struct tcp_pcb_listen if pcb->state == LISTEN)
2822  * - hdr: pointer to tcp header (ATTENTION: tcp options may not be in one piece!)
2823  * - optlen: tcp option length
2824  * - opt1len: tcp option length 1st part
2825  * - opt2: if this is != NULL, tcp options are split among 2 pbufs. In that case,
2826  *         options start at right after the tcp header ('(u8_t*)(hdr + 1)') for
2827  *         the first 'opt1len' bytes and the rest starts at 'opt2'. opt2len can
2828  *         be simply calculated: 'opt2len = optlen - opt1len;'
2829  * - p: input packet, p->payload points to application data (that's why tcp hdr
2830  *      and options are passed in seperately)
2831  * Return value:
2832  * - ERR_OK: continue input of this packet as normal
2833  * - != ERR_OK: drop this packet for input (don't continue input processing)
2834  *
2835  * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
2836  * state or any pcb lists) from this callback!
2837  */
2838 #ifdef __DOXYGEN__
2839 #define LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p)
2840 #endif
2841 
2842 /**
2843  * LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH:
2844  * Hook for increasing the size of the options allocated with a tcp header.
2845  * Together with LWIP_HOOK_TCP_OUT_ADD_TCPOPTS, this can be used to add custom
2846  * options to outgoing tcp segments.
2847  * Signature:\code{.c}
2848  * u8_t my_hook_tcp_out_tcpopt_length(const struct tcp_pcb *pcb, u8_t internal_option_length);
2849  * \endcode
2850  * Arguments:
2851  * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or
2852  *        struct tcp_pcb_listen if pcb->state == LISTEN)
2853  * - internal_option_length: tcp option length used by the stack internally
2854  * Return value:
2855  * - a number of bytes to allocate for tcp options (internal_option_length <= ret <= 40)
2856  *
2857  * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
2858  * state or any pcb lists) from this callback!
2859  */
2860 #ifdef __DOXYGEN__
2861 #define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len)
2862 #endif
2863 
2864 /**
2865  * LWIP_HOOK_TCP_OUT_ADD_TCPOPTS:
2866  * Hook for adding custom options to outgoing tcp segments.
2867  * Space for these custom options has to be reserved via LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH.
2868  * Signature:\code{.c}
2869  * u32_t *my_hook_tcp_out_add_tcpopts(struct pbuf *p, struct tcp_hdr *hdr, const struct tcp_pcb *pcb, u32_t *opts);
2870  * \endcode
2871  * Arguments:
2872  * - p: output packet, p->payload pointing to tcp header, data follows
2873  * - hdr: tcp header
2874  * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or
2875  *        struct tcp_pcb_listen if pcb->state == LISTEN)
2876  * - opts: pointer where to add the custom options (there may already be options
2877  *         between the header and these)
2878  * Return value:
2879  * - pointer pointing directly after the inserted options
2880  *
2881  * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
2882  * state or any pcb lists) from this callback!
2883  */
2884 #ifdef __DOXYGEN__
2885 #define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts)
2886 #endif
2887 
2888 /**
2889  * LWIP_HOOK_IP4_INPUT(pbuf, input_netif):
2890  * Called from ip_input() (IPv4)
2891  * Signature:\code{.c}
2892  *   int my_hook(struct pbuf *pbuf, struct netif *input_netif);
2893  * \endcode
2894  * Arguments:
2895  * - pbuf: received struct pbuf passed to ip_input()
2896  * - input_netif: struct netif on which the packet has been received
2897  * Return values:
2898  * - 0: Hook has not consumed the packet, packet is processed as normal
2899  * - != 0: Hook has consumed the packet.
2900  * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
2901  * (i.e. free it when done).
2902  */
2903 #ifdef __DOXYGEN__
2904 #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif)
2905 #endif
2906 
2907 /**
2908  * LWIP_HOOK_IP4_ROUTE(dest):
2909  * Called from ip_route() (IPv4)
2910  * Signature:\code{.c}
2911  *   struct netif *my_hook(const ip4_addr_t *dest);
2912  * \endcode
2913  * Arguments:
2914  * - dest: destination IPv4 address
2915  * Returns values:
2916  * - the destination netif
2917  * - NULL if no destination netif is found. In that case, ip_route() continues as normal.
2918  */
2919 #ifdef __DOXYGEN__
2920 #define LWIP_HOOK_IP4_ROUTE()
2921 #endif
2922 
2923 /**
2924  * LWIP_HOOK_IP4_ROUTE_SRC(src, dest):
2925  * Source-based routing for IPv4 - called from ip_route() (IPv4)
2926  * Signature:\code{.c}
2927  *   struct netif *my_hook(const ip4_addr_t *src, const ip4_addr_t *dest);
2928  * \endcode
2929  * Arguments:
2930  * - src: local/source IPv4 address
2931  * - dest: destination IPv4 address
2932  * Returns values:
2933  * - the destination netif
2934  * - NULL if no destination netif is found. In that case, ip_route() continues as normal.
2935  */
2936 #ifdef __DOXYGEN__
2937 #define LWIP_HOOK_IP4_ROUTE_SRC(src, dest)
2938 #endif
2939 
2940 /**
2941  * LWIP_HOOK_IP4_CANFORWARD(src, dest):
2942  * Check if an IPv4 can be forwarded - called from:
2943  * ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4)
2944  * - source address is available via ip4_current_src_addr()
2945  * - calling an output function in this context (e.g. multicast router) is allowed
2946  * Signature:\code{.c}
2947  *   int my_hook(struct pbuf *p, u32_t dest_addr_hostorder);
2948  * \endcode
2949  * Arguments:
2950  * - p: packet to forward
2951  * - dest: destination IPv4 address
2952  * Returns values:
2953  * - 1: forward
2954  * - 0: don't forward
2955  * - -1: no decision. In that case, ip4_canforward() continues as normal.
2956  */
2957 #ifdef __DOXYGEN__
2958 #define LWIP_HOOK_IP4_CANFORWARD(src, dest)
2959 #endif
2960 
2961 /**
2962  * LWIP_HOOK_ETHARP_GET_GW(netif, dest):
2963  * Called from etharp_output() (IPv4)
2964  * Signature:\code{.c}
2965  *   const ip4_addr_t *my_hook(struct netif *netif, const ip4_addr_t *dest);
2966  * \endcode
2967  * Arguments:
2968  * - netif: the netif used for sending
2969  * - dest: the destination IPv4 address
2970  * Return values:
2971  * - the IPv4 address of the gateway to handle the specified destination IPv4 address
2972  * - NULL, in which case the netif's default gateway is used
2973  *
2974  * The returned address MUST be directly reachable on the specified netif!
2975  * This function is meant to implement advanced IPv4 routing together with
2976  * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is
2977  * not part of lwIP but can e.g. be hidden in the netif's state argument.
2978 */
2979 #ifdef __DOXYGEN__
2980 #define LWIP_HOOK_ETHARP_GET_GW(netif, dest)
2981 #endif
2982 
2983 /**
2984  * LWIP_HOOK_IP6_INPUT(pbuf, input_netif):
2985  * Called from ip6_input() (IPv6)
2986  * Signature:\code{.c}
2987  *   int my_hook(struct pbuf *pbuf, struct netif *input_netif);
2988  * \endcode
2989  * Arguments:
2990  * - pbuf: received struct pbuf passed to ip6_input()
2991  * - input_netif: struct netif on which the packet has been received
2992  * Return values:
2993  * - 0: Hook has not consumed the packet, packet is processed as normal
2994  * - != 0: Hook has consumed the packet.
2995  * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
2996  * (i.e. free it when done).
2997  */
2998 #ifdef __DOXYGEN__
2999 #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif)
3000 #endif
3001 
3002 /**
3003  * LWIP_HOOK_IP6_ROUTE(src, dest):
3004  * Called from ip_route() (IPv6)
3005  * Signature:\code{.c}
3006  *   struct netif *my_hook(const ip6_addr_t *dest, const ip6_addr_t *src);
3007  * \endcode
3008  * Arguments:
3009  * - src: source IPv6 address
3010  * - dest: destination IPv6 address
3011  * Return values:
3012  * - the destination netif
3013  * - NULL if no destination netif is found. In that case, ip6_route() continues as normal.
3014  */
3015 #ifdef __DOXYGEN__
3016 #define LWIP_HOOK_IP6_ROUTE(src, dest)
3017 #endif
3018 
3019 /**
3020  * LWIP_HOOK_ND6_GET_GW(netif, dest):
3021  * Called from nd6_get_next_hop_entry() (IPv6)
3022  * Signature:\code{.c}
3023  *   const ip6_addr_t *my_hook(struct netif *netif, const ip6_addr_t *dest);
3024  * \endcode
3025  * Arguments:
3026  * - netif: the netif used for sending
3027  * - dest: the destination IPv6 address
3028  * Return values:
3029  * - the IPv6 address of the next hop to handle the specified destination IPv6 address
3030  * - NULL, in which case a NDP-discovered router is used instead
3031  *
3032  * The returned address MUST be directly reachable on the specified netif!
3033  * This function is meant to implement advanced IPv6 routing together with
3034  * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is
3035  * not part of lwIP but can e.g. be hidden in the netif's state argument.
3036 */
3037 #ifdef __DOXYGEN__
3038 #define LWIP_HOOK_ND6_GET_GW(netif, dest)
3039 #endif
3040 
3041 /**
3042  * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr):
3043  * Called from ethernet_input() if VLAN support is enabled
3044  * Signature:\code{.c}
3045  *   int my_hook(struct netif *netif, struct eth_hdr *eth_hdr, struct eth_vlan_hdr *vlan_hdr);
3046  * \endcode
3047  * Arguments:
3048  * - netif: struct netif on which the packet has been received
3049  * - eth_hdr: struct eth_hdr of the packet
3050  * - vlan_hdr: struct eth_vlan_hdr of the packet
3051  * Return values:
3052  * - 0: Packet must be dropped.
3053  * - != 0: Packet must be accepted.
3054  */
3055 #ifdef __DOXYGEN__
3056 #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr)
3057 #endif
3058 
3059 /**
3060  * LWIP_HOOK_VLAN_SET:
3061  * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data
3062  * on per-netif basis to implement this callback, see @ref netif_cd.
3063  * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n
3064  * Signature:\code{.c}
3065  *   s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n
3066  * \endcode
3067  * Arguments:
3068  * - netif: struct netif that the packet will be sent through
3069  * - p: struct pbuf packet to be sent
3070  * - src: source eth address
3071  * - dst: destination eth address
3072  * - eth_type: ethernet type to packet to be sent\n
3073  *
3074  *
3075  * Return values:
3076  * - &lt;0: Packet shall not contain VLAN header.
3077  * - 0 &lt;= return value &lt;= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order.
3078  */
3079 #ifdef __DOXYGEN__
3080 #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type)
3081 #endif
3082 
3083 /**
3084  * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type):
3085  * Called from memp_free() when a memp pool was empty and an item is now available
3086  * Signature:\code{.c}
3087  *   void my_hook(memp_t type);
3088  * \endcode
3089  */
3090 #ifdef __DOXYGEN__
3091 #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
3092 #endif
3093 
3094 /**
3095  * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif):
3096  * Called from ethernet_input() when an unknown eth type is encountered.
3097  * Signature:\code{.c}
3098  *   err_t my_hook(struct pbuf* pbuf, struct netif* netif);
3099  * \endcode
3100  * Arguments:
3101  * - p: rx packet with unknown eth type
3102  * - netif: netif on which the packet has been received
3103  * Return values:
3104  * - ERR_OK if packet is accepted (hook function now owns the pbuf)
3105  * - any error code otherwise (pbuf is freed)
3106  *
3107  * Payload points to ethernet header!
3108  */
3109 #ifdef __DOXYGEN__
3110 #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif)
3111 #endif
3112 
3113 /**
3114  * LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr):
3115  * Called from various dhcp functions when sending a DHCP message.
3116  * This hook is called just before the DHCP message trailer is added, so the
3117  * options are at the end of a DHCP message.
3118  * Signature:\code{.c}
3119  *   void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg,
3120  *                u8_t msg_type, u16_t *options_len_ptr);
3121  * \endcode
3122  * Arguments:
3123  * - netif: struct netif that the packet will be sent through
3124  * - dhcp: struct dhcp on that netif
3125  * - state: current dhcp state (dhcp_state_enum_t as an u8_t)
3126  * - msg: struct dhcp_msg that will be sent
3127  * - msg_type: dhcp message type to be sent (u8_t)
3128  * - options_len_ptr: pointer to the current length of options in the dhcp_msg "msg"
3129  *                    (must be increased when options are added!)
3130  *
3131  * Options need to appended like this:
3132  *   LWIP_ASSERT("dhcp option overflow", *options_len_ptr + option_len + 2 <= DHCP_OPTIONS_LEN);
3133  *   msg->options[(*options_len_ptr)++] = &lt;option_number&gt;;
3134  *   msg->options[(*options_len_ptr)++] = &lt;option_len&gt;;
3135  *   msg->options[(*options_len_ptr)++] = &lt;option_bytes&gt;;
3136  *   [...]
3137  */
3138 #ifdef __DOXYGEN__
3139 #define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr)
3140 #endif
3141 
3142 /**
3143  * LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset):
3144  * Called from dhcp_parse_reply when receiving a DHCP message.
3145  * This hook is called for every option in the received message that is not handled internally.
3146  * Signature:\code{.c}
3147  *   void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg,
3148  *                u8_t msg_type, u8_t option, u8_t option_len, struct pbuf *pbuf, u16_t option_value_offset);
3149  * \endcode
3150  * Arguments:
3151  * - netif: struct netif that the packet will be sent through
3152  * - dhcp: struct dhcp on that netif
3153  * - state: current dhcp state (dhcp_state_enum_t as an u8_t)
3154  * - msg: struct dhcp_msg that was received
3155  * - msg_type: dhcp message type received (u8_t, ATTENTION: only valid after
3156  *             the message type option has been parsed!)
3157  * - option: option value (u8_t)
3158  * - len: option data length (u8_t)
3159  * - pbuf: pbuf where option data is contained
3160  * - option_value_offset: offset in pbuf where option data begins
3161  *
3162  * A nice way to get the option contents is pbuf_get_contiguous():
3163  *  u8_t buf[32];
3164  *  u8_t *ptr = (u8_t*)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset);
3165  */
3166 #ifdef __DOXYGEN__
3167 #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset)
3168 #endif
3169 
3170 /**
3171  * LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len):
3172  * Called from various dhcp6 functions when sending a DHCP6 message.
3173  * This hook is called just before the DHCP6 message is sent, so the
3174  * options are at the end of a DHCP6 message.
3175  * Signature:\code{.c}
3176  *   void my_hook(struct netif *netif, struct dhcp6 *dhcp, u8_t state, struct dhcp6_msg *msg,
3177  *                u8_t msg_type, u16_t *options_len_ptr);
3178  * \endcode
3179  * Arguments:
3180  * - netif: struct netif that the packet will be sent through
3181  * - dhcp6: struct dhcp6 on that netif
3182  * - state: current dhcp6 state (dhcp6_state_enum_t as an u8_t)
3183  * - msg: struct dhcp6_msg that will be sent
3184  * - msg_type: dhcp6 message type to be sent (u8_t)
3185  * - options_len_ptr: pointer to the current length of options in the dhcp6_msg "msg"
3186  *                    (must be increased when options are added!)
3187  *
3188  * Options need to appended like this:
3189  *   u8_t *options = (u8_t *)(msg + 1);
3190  *   LWIP_ASSERT("dhcp option overflow", sizeof(struct dhcp6_msg) + *options_len_ptr + newoptlen <= max_len);
3191  *   options[(*options_len_ptr)++] = &lt;option_data&gt;;
3192  *   [...]
3193  */
3194 #ifdef __DOXYGEN__
3195 #define LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len)
3196 #endif
3197 
3198 /**
3199  * LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err)
3200  * Called from socket API to implement setsockopt() for options not provided by lwIP.
3201  * Core lock is held when this hook is called.
3202  * Signature:\code{.c}
3203  *   int my_hook(int s, struct lwip_sock *sock, int level, int optname, const void *optval, socklen_t optlen, int *err)
3204  * \endcode
3205  * Arguments:
3206  * - s: socket file descriptor
3207  * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h)
3208  * - level: protocol level at which the option resides
3209  * - optname: option to set
3210  * - optval: value to set
3211  * - optlen: size of optval
3212  * - err: output error
3213  * Return values:
3214  * - 0: Hook has not consumed the option, code continues as normal (to internal options)
3215  * - != 0: Hook has consumed the option, 'err' is returned
3216  */
3217 #ifdef __DOXYGEN__
3218 #define LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err)
3219 #endif
3220 
3221 /**
3222  * LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err)
3223  * Called from socket API to implement getsockopt() for options not provided by lwIP.
3224  * Core lock is held when this hook is called.
3225  * Signature:\code{.c}
3226  *   int my_hook(int s, struct lwip_sock *sock, int level, int optname, void *optval, socklen_t *optlen, int *err)
3227  * \endcode
3228  * Arguments:
3229  * - s: socket file descriptor
3230  * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h)
3231  * - level: protocol level at which the option resides
3232  * - optname: option to get
3233  * - optval: value to get
3234  * - optlen: size of optval
3235  * - err: output error
3236  * Return values:
3237  * - 0: Hook has not consumed the option, code continues as normal (to internal options)
3238  * - != 0: Hook has consumed the option, 'err' is returned
3239  */
3240 #ifdef __DOXYGEN__
3241 #define LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err)
3242 #endif
3243 
3244 /**
3245  * LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
3246  * Called from netconn APIs (not usable with callback apps) allowing an
3247  * external DNS resolver (which uses sequential API) to handle the query.
3248  * Signature:\code{.c}
3249  *   int my_hook(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err)
3250  * \endcode
3251  * Arguments:
3252  * - name: hostname to resolve
3253  * - addr: output host address
3254  * - addrtype: type of address to query
3255  * - err: output error
3256  * Return values:
3257  * - 0: Hook has not consumed hostname query, query continues into DNS module
3258  * - != 0: Hook has consumed the query
3259  *
3260  * err must also be checked to determine if the hook consumed the query, but
3261  * the query failed
3262  */
3263 #ifdef __DOXYGEN__
3264 #define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
3265 #endif
3266 /**
3267  * @}
3268  */
3269 
3270 /*
3271    ---------------------------------------
3272    ---------- Debugging options ----------
3273    ---------------------------------------
3274 */
3275 /**
3276  * @defgroup lwip_opts_debugmsg Debug messages
3277  * @ingroup lwip_opts_debug
3278  * @{
3279  */
3280 /**
3281  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
3282  * compared against this value. If it is smaller, then debugging
3283  * messages are written.
3284  * @see debugging_levels
3285  */
3286 #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__
3287 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
3288 #endif
3289 
3290 /**
3291  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
3292  * debug messages of certain types.
3293  * @see debugging_levels
3294  */
3295 #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
3296 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
3297 #endif
3298 
3299 /**
3300  * ETHARP_DEBUG: Enable debugging in etharp.c.
3301  */
3302 #if !defined ETHARP_DEBUG || defined __DOXYGEN__
3303 #define ETHARP_DEBUG                    LWIP_DBG_OFF
3304 #endif
3305 
3306 /**
3307  * NETIF_DEBUG: Enable debugging in netif.c.
3308  */
3309 #if !defined NETIF_DEBUG || defined __DOXYGEN__
3310 #define NETIF_DEBUG                     LWIP_DBG_OFF
3311 #endif
3312 
3313 /**
3314  * PBUF_DEBUG: Enable debugging in pbuf.c.
3315  */
3316 #if !defined PBUF_DEBUG || defined __DOXYGEN__
3317 #define PBUF_DEBUG                      LWIP_DBG_OFF
3318 #endif
3319 
3320 /**
3321  * API_LIB_DEBUG: Enable debugging in api_lib.c.
3322  */
3323 #if !defined API_LIB_DEBUG || defined __DOXYGEN__
3324 #define API_LIB_DEBUG                   LWIP_DBG_OFF
3325 #endif
3326 
3327 /**
3328  * API_MSG_DEBUG: Enable debugging in api_msg.c.
3329  */
3330 #if !defined API_MSG_DEBUG || defined __DOXYGEN__
3331 #define API_MSG_DEBUG                   LWIP_DBG_OFF
3332 #endif
3333 
3334 /**
3335  * SOCKETS_DEBUG: Enable debugging in sockets.c.
3336  */
3337 #if !defined SOCKETS_DEBUG || defined __DOXYGEN__
3338 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
3339 #endif
3340 
3341 /**
3342  * ICMP_DEBUG: Enable debugging in icmp.c.
3343  */
3344 #if !defined ICMP_DEBUG || defined __DOXYGEN__
3345 #define ICMP_DEBUG                      LWIP_DBG_OFF
3346 #endif
3347 
3348 /**
3349  * IGMP_DEBUG: Enable debugging in igmp.c.
3350  */
3351 #if !defined IGMP_DEBUG || defined __DOXYGEN__
3352 #define IGMP_DEBUG                      LWIP_DBG_OFF
3353 #endif
3354 
3355 /**
3356  * INET_DEBUG: Enable debugging in inet.c.
3357  */
3358 #if !defined INET_DEBUG || defined __DOXYGEN__
3359 #define INET_DEBUG                      LWIP_DBG_OFF
3360 #endif
3361 
3362 /**
3363  * IP_DEBUG: Enable debugging for IP.
3364  */
3365 #if !defined IP_DEBUG || defined __DOXYGEN__
3366 #define IP_DEBUG                        LWIP_DBG_OFF
3367 #endif
3368 
3369 /**
3370  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
3371  */
3372 #if !defined IP_REASS_DEBUG || defined __DOXYGEN__
3373 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
3374 #endif
3375 
3376 /**
3377  * RAW_DEBUG: Enable debugging in raw.c.
3378  */
3379 #if !defined RAW_DEBUG || defined __DOXYGEN__
3380 #define RAW_DEBUG                       LWIP_DBG_OFF
3381 #endif
3382 
3383 /**
3384  * MEM_DEBUG: Enable debugging in mem.c.
3385  */
3386 #if !defined MEM_DEBUG || defined __DOXYGEN__
3387 #define MEM_DEBUG                       LWIP_DBG_OFF
3388 #endif
3389 
3390 /**
3391  * MEMP_DEBUG: Enable debugging in memp.c.
3392  */
3393 #if !defined MEMP_DEBUG || defined __DOXYGEN__
3394 #define MEMP_DEBUG                      LWIP_DBG_OFF
3395 #endif
3396 
3397 /**
3398  * SYS_DEBUG: Enable debugging in sys.c.
3399  */
3400 #if !defined SYS_DEBUG || defined __DOXYGEN__
3401 #define SYS_DEBUG                       LWIP_DBG_OFF
3402 #endif
3403 
3404 /**
3405  * TIMERS_DEBUG: Enable debugging in timers.c.
3406  */
3407 #if !defined TIMERS_DEBUG || defined __DOXYGEN__
3408 #define TIMERS_DEBUG                    LWIP_DBG_OFF
3409 #endif
3410 
3411 /**
3412  * TCP_DEBUG: Enable debugging for TCP.
3413  */
3414 #if !defined TCP_DEBUG || defined __DOXYGEN__
3415 #define TCP_DEBUG                       LWIP_DBG_OFF
3416 #endif
3417 
3418 /**
3419  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
3420  */
3421 #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__
3422 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
3423 #endif
3424 
3425 /**
3426  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
3427  */
3428 #if !defined TCP_FR_DEBUG || defined __DOXYGEN__
3429 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
3430 #endif
3431 
3432 /**
3433  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
3434  * timeout.
3435  */
3436 #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__
3437 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
3438 #endif
3439 
3440 /**
3441  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
3442  */
3443 #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__
3444 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
3445 #endif
3446 
3447 /**
3448  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
3449  */
3450 #if !defined TCP_WND_DEBUG || defined __DOXYGEN__
3451 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
3452 #endif
3453 
3454 /**
3455  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
3456  */
3457 #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__
3458 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
3459 #endif
3460 
3461 /**
3462  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
3463  */
3464 #if !defined TCP_RST_DEBUG || defined __DOXYGEN__
3465 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
3466 #endif
3467 
3468 /**
3469  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
3470  */
3471 #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__
3472 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
3473 #endif
3474 
3475 /**
3476  * UDP_DEBUG: Enable debugging in UDP.
3477  */
3478 #if !defined UDP_DEBUG || defined __DOXYGEN__
3479 #define UDP_DEBUG                       LWIP_DBG_OFF
3480 #endif
3481 
3482 /**
3483  * TCPIP_DEBUG: Enable debugging in tcpip.c.
3484  */
3485 #if !defined TCPIP_DEBUG || defined __DOXYGEN__
3486 #define TCPIP_DEBUG                     LWIP_DBG_OFF
3487 #endif
3488 
3489 /**
3490  * SLIP_DEBUG: Enable debugging in slipif.c.
3491  */
3492 #if !defined SLIP_DEBUG || defined __DOXYGEN__
3493 #define SLIP_DEBUG                      LWIP_DBG_OFF
3494 #endif
3495 
3496 /**
3497  * DHCP_DEBUG: Enable debugging in dhcp.c.
3498  */
3499 #if !defined DHCP_DEBUG || defined __DOXYGEN__
3500 #define DHCP_DEBUG                      LWIP_DBG_OFF
3501 #endif
3502 
3503 /**
3504  * AUTOIP_DEBUG: Enable debugging in autoip.c.
3505  */
3506 #if !defined AUTOIP_DEBUG || defined __DOXYGEN__
3507 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
3508 #endif
3509 
3510 /**
3511  * DNS_DEBUG: Enable debugging for DNS.
3512  */
3513 #if !defined DNS_DEBUG || defined __DOXYGEN__
3514 #define DNS_DEBUG                       LWIP_DBG_OFF
3515 #endif
3516 
3517 /**
3518  * IP6_DEBUG: Enable debugging for IPv6.
3519  */
3520 #if !defined IP6_DEBUG || defined __DOXYGEN__
3521 #define IP6_DEBUG                       LWIP_DBG_OFF
3522 #endif
3523 
3524 /**
3525  * DHCP6_DEBUG: Enable debugging in dhcp6.c.
3526  */
3527 #if !defined DHCP6_DEBUG || defined __DOXYGEN__
3528 #define DHCP6_DEBUG                     LWIP_DBG_OFF
3529 #endif
3530 /**
3531  * @}
3532  */
3533 
3534 /**
3535  * LWIP_TESTMODE: Changes to make unit test possible
3536  */
3537 #if !defined LWIP_TESTMODE
3538 #define LWIP_TESTMODE                   0
3539 #endif
3540 
3541 /**
3542  * NAPT_DEBUG: Enable debugging for NAPT.
3543  */
3544 #ifndef NAPT_DEBUG
3545 #define NAPT_DEBUG                       LWIP_DBG_OFF
3546 #endif
3547 
3548 /*
3549    --------------------------------------------------
3550    ---------- Performance tracking options ----------
3551    --------------------------------------------------
3552 */
3553 /**
3554  * @defgroup lwip_opts_perf Performance
3555  * @ingroup lwip_opts_debug
3556  * @{
3557  */
3558 /**
3559  * LWIP_PERF: Enable performance testing for lwIP
3560  * (if enabled, arch/perf.h is included)
3561  */
3562 #if !defined LWIP_PERF || defined __DOXYGEN__
3563 #define LWIP_PERF                       0
3564 #endif
3565 /**
3566  * @}
3567  */
3568 
3569 #endif /* LWIP_HDR_OPT_H */
3570