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