]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/lwip/lib/contrib/src/include/lwip/opt.h
Update
[l4.git] / l4 / pkg / lwip / lib / contrib / src / include / lwip / opt.h
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 #ifndef LWIP_HDR_OPT_H
39 #define LWIP_HDR_OPT_H
40
41 /*
42  * Include user defined options first. Anything not defined in these files
43  * will be set to standard values. Override anything you don't like!
44  */
45 #include "lwipopts.h"
46 #include "lwip/debug.h"
47
48 /*
49    -----------------------------------------------
50    ---------- Platform specific locking ----------
51    -----------------------------------------------
52 */
53
54 /**
55  * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
56  * critical regions during buffer allocation, deallocation and memory
57  * allocation and deallocation.
58  */
59 #ifndef SYS_LIGHTWEIGHT_PROT
60 #define SYS_LIGHTWEIGHT_PROT            0
61 #endif
62
63 /**
64  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
65  * use lwIP facilities.
66  */
67 #ifndef NO_SYS
68 #define NO_SYS                          0
69 #endif
70
71 /**
72  * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1
73  * Mainly for compatibility to old versions.
74  */
75 #ifndef NO_SYS_NO_TIMERS
76 #define NO_SYS_NO_TIMERS                0
77 #endif
78
79 /**
80  * MEMCPY: override this if you have a faster implementation at hand than the
81  * one included in your C library
82  */
83 #ifndef MEMCPY
84 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
85 #endif
86
87 /**
88  * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
89  * call to memcpy() if the length is known at compile time and is small.
90  */
91 #ifndef SMEMCPY
92 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
93 #endif
94
95 /**
96  * LWIP_MPU_COMPATIBLE: enables special memory management mechanism
97  * which makes lwip able to work on MPU (Memory Protection Unit) system
98  * by not passing stack-pointers to other threads
99  * (this decreases performance)
100  */
101 #ifndef LWIP_MPU_COMPATIBLE
102 #define LWIP_MPU_COMPATIBLE             0
103 #endif
104
105 /*
106    ------------------------------------
107    ---------- Memory options ----------
108    ------------------------------------
109 */
110 /**
111  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
112  * instead of the lwip internal allocator. Can save code size if you
113  * already use it.
114  */
115 #ifndef MEM_LIBC_MALLOC
116 #define MEM_LIBC_MALLOC                 0
117 #endif
118
119 /**
120 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
121 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
122 * speed and usage from interrupts!
123 */
124 #ifndef MEMP_MEM_MALLOC
125 #define MEMP_MEM_MALLOC                 0
126 #endif
127
128 /**
129  * MEM_ALIGNMENT: should be set to the alignment of the CPU
130  *    4 byte alignment -> #define MEM_ALIGNMENT 4
131  *    2 byte alignment -> #define MEM_ALIGNMENT 2
132  */
133 #ifndef MEM_ALIGNMENT
134 #define MEM_ALIGNMENT                   1
135 #endif
136
137 /**
138  * MEM_SIZE: the size of the heap memory. If the application will send
139  * a lot of data that needs to be copied, this should be set high.
140  */
141 #ifndef MEM_SIZE
142 #define MEM_SIZE                        1600
143 #endif
144
145 /**
146  * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array.
147  * This can be used to individually change the location of each pool.
148  * Default is one big array for all pools
149  */
150 #ifndef MEMP_SEPARATE_POOLS
151 #define MEMP_SEPARATE_POOLS             0
152 #endif
153
154 /**
155  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
156  * amount of bytes before and after each memp element in every pool and fills
157  * it with a prominent default value.
158  *    MEMP_OVERFLOW_CHECK == 0 no checking
159  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
160  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
161  *      memp_malloc() or memp_free() is called (useful but slow!)
162  */
163 #ifndef MEMP_OVERFLOW_CHECK
164 #define MEMP_OVERFLOW_CHECK             0
165 #endif
166
167 /**
168  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
169  * sure that there are no cycles in the linked lists.
170  */
171 #ifndef MEMP_SANITY_CHECK
172 #define MEMP_SANITY_CHECK               0
173 #endif
174
175 /**
176  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
177  * of memory pools of various sizes. When mem_malloc is called, an element of
178  * the smallest pool that can provide the length needed is returned.
179  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
180  */
181 #ifndef MEM_USE_POOLS
182 #define MEM_USE_POOLS                   0
183 #endif
184
185 /**
186  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
187  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
188  * reliable. */
189 #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
190 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
191 #endif
192
193 /**
194  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
195  * that defines additional pools beyond the "standard" ones required
196  * by lwIP. If you set this to 1, you must have lwippools.h in your
197  * include path somewhere.
198  */
199 #ifndef MEMP_USE_CUSTOM_POOLS
200 #define MEMP_USE_CUSTOM_POOLS           0
201 #endif
202
203 /**
204  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
205  * interrupt context (or another context that doesn't allow waiting for a
206  * semaphore).
207  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
208  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
209  * with each loop so that mem_free can run.
210  *
211  * ATTENTION: As you can see from the above description, this leads to dis-/
212  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
213  * can need longer.
214  *
215  * If you don't want that, at least for NO_SYS=0, you can still use the following
216  * functions to enqueue a deallocation call which then runs in the tcpip_thread
217  * context:
218  * - pbuf_free_callback(p);
219  * - mem_free_callback(m);
220  */
221 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
222 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
223 #endif
224
225 /*
226    ------------------------------------------------
227    ---------- Internal Memory Pool Sizes ----------
228    ------------------------------------------------
229 */
230 /**
231  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
232  * If the application sends a lot of data out of ROM (or other static memory),
233  * this should be set high.
234  */
235 #ifndef MEMP_NUM_PBUF
236 #define MEMP_NUM_PBUF                   16
237 #endif
238
239 /**
240  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
241  * (requires the LWIP_RAW option)
242  */
243 #ifndef MEMP_NUM_RAW_PCB
244 #define MEMP_NUM_RAW_PCB                4
245 #endif
246
247 /**
248  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
249  * per active UDP "connection".
250  * (requires the LWIP_UDP option)
251  */
252 #ifndef MEMP_NUM_UDP_PCB
253 #define MEMP_NUM_UDP_PCB                4
254 #endif
255
256 /**
257  * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections.
258  * (requires the LWIP_TCP option)
259  */
260 #ifndef MEMP_NUM_TCP_PCB
261 #define MEMP_NUM_TCP_PCB                5
262 #endif
263
264 /**
265  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
266  * (requires the LWIP_TCP option)
267  */
268 #ifndef MEMP_NUM_TCP_PCB_LISTEN
269 #define MEMP_NUM_TCP_PCB_LISTEN         8
270 #endif
271
272 /**
273  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
274  * (requires the LWIP_TCP option)
275  */
276 #ifndef MEMP_NUM_TCP_SEG
277 #define MEMP_NUM_TCP_SEG                16
278 #endif
279
280 /**
281  * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
282  * reassembly (whole packets, not fragments!)
283  */
284 #ifndef MEMP_NUM_REASSDATA
285 #define MEMP_NUM_REASSDATA              5
286 #endif
287
288 /**
289  * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
290  * (fragments, not whole packets!).
291  * This is only used with IP_FRAG_USES_STATIC_BUF==0 and
292  * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs
293  * where the packet is not yet sent when netif->output returns.
294  */
295 #ifndef MEMP_NUM_FRAG_PBUF
296 #define MEMP_NUM_FRAG_PBUF              15
297 #endif
298
299 /**
300  * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing
301  * packets (pbufs) that are waiting for an ARP request (to resolve
302  * their destination address) to finish.
303  * (requires the ARP_QUEUEING option)
304  */
305 #ifndef MEMP_NUM_ARP_QUEUE
306 #define MEMP_NUM_ARP_QUEUE              30
307 #endif
308
309 /**
310  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
311  * can be members at the same time (one per netif - allsystems group -, plus one
312  * per netif membership).
313  * (requires the LWIP_IGMP option)
314  */
315 #ifndef MEMP_NUM_IGMP_GROUP
316 #define MEMP_NUM_IGMP_GROUP             8
317 #endif
318
319 /**
320  * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts.
321  * The default number of timeouts is calculated here for all enabled modules.
322  * The formula expects settings to be either '0' or '1'.
323  */
324 #ifndef MEMP_NUM_SYS_TIMEOUT
325 #define MEMP_NUM_SYS_TIMEOUT            (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0))
326 #endif
327
328 /**
329  * MEMP_NUM_NETBUF: the number of struct netbufs.
330  * (only needed if you use the sequential API, like api_lib.c)
331  */
332 #ifndef MEMP_NUM_NETBUF
333 #define MEMP_NUM_NETBUF                 2
334 #endif
335
336 /**
337  * MEMP_NUM_NETCONN: the number of struct netconns.
338  * (only needed if you use the sequential API, like api_lib.c)
339  */
340 #ifndef MEMP_NUM_NETCONN
341 #define MEMP_NUM_NETCONN                4
342 #endif
343
344 /**
345  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
346  * for callback/timeout API communication.
347  * (only needed if you use tcpip.c)
348  */
349 #ifndef MEMP_NUM_TCPIP_MSG_API
350 #define MEMP_NUM_TCPIP_MSG_API          8
351 #endif
352
353 /**
354  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
355  * for incoming packets.
356  * (only needed if you use tcpip.c)
357  */
358 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
359 #define MEMP_NUM_TCPIP_MSG_INPKT        8
360 #endif
361
362 /**
363  * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree.
364  */
365 #ifndef MEMP_NUM_SNMP_NODE
366 #define MEMP_NUM_SNMP_NODE              50
367 #endif
368
369 /**
370  * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree.
371  * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least!
372  */
373 #ifndef MEMP_NUM_SNMP_ROOTNODE
374 #define MEMP_NUM_SNMP_ROOTNODE          30
375 #endif
376
377 /**
378  * MEMP_NUM_SNMP_VARBIND: influences the number of concurrent requests:
379  * 2 of these are used per request (1 for input, 1 for output), so this needs
380  * to be increased only if you want to support concurrent requests or multiple
381  * variables per request/response.
382  */
383 #ifndef MEMP_NUM_SNMP_VARBIND
384 #define MEMP_NUM_SNMP_VARBIND           2
385 #endif
386
387 /**
388  * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used
389  * (does not have to be changed normally) - >=3 of these are used per request
390  * (1 for the value read and 2 for OIDs - input and output on getnext, or more
391  * if you want to support multiple varibles per request/response)
392  */
393 #ifndef MEMP_NUM_SNMP_VALUE
394 #define MEMP_NUM_SNMP_VALUE             3
395 #endif
396
397 /**
398  * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
399  * (before freeing the corresponding memory using lwip_freeaddrinfo()).
400  */
401 #ifndef MEMP_NUM_NETDB
402 #define MEMP_NUM_NETDB                  1
403 #endif
404
405 /**
406  * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
407  * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
408  */
409 #ifndef MEMP_NUM_LOCALHOSTLIST
410 #define MEMP_NUM_LOCALHOSTLIST          1
411 #endif
412
413 /**
414  * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP
415  * connections (requires the PPP_SUPPORT option)
416  */
417 #ifndef MEMP_NUM_PPP_PCB
418 #define MEMP_NUM_PPP_PCB       1
419 #endif
420
421 /**
422  * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS
423  * interfaces (only used with PPPOS_SUPPORT==1)
424  */
425 #ifndef MEMP_NUM_PPPOS_INTERFACES
426 #define MEMP_NUM_PPPOS_INTERFACES       MEMP_NUM_PPP_PCB
427 #endif
428
429 /**
430  * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
431  * interfaces (only used with PPPOE_SUPPORT==1)
432  */
433 #ifndef MEMP_NUM_PPPOE_INTERFACES
434 #define MEMP_NUM_PPPOE_INTERFACES       1
435 #endif
436
437 /**
438  * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP
439  * interfaces (only used with PPPOL2TP_SUPPORT==1)
440  */
441 #ifndef MEMP_NUM_PPPOL2TP_INTERFACES
442 #define MEMP_NUM_PPPOL2TP_INTERFACES       1
443 #endif
444
445 /**
446  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
447  */
448 #ifndef PBUF_POOL_SIZE
449 #define PBUF_POOL_SIZE                  16
450 #endif
451
452 /** MEMP_NUM_API_MSG: the number of concurrently active calls to various
453  * socket, netconn, and tcpip functions
454  */
455 #ifndef MEMP_NUM_API_MSG
456 #define MEMP_NUM_API_MSG                MEMP_NUM_TCPIP_MSG_API
457 #endif
458
459 /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname
460  */
461 #ifndef MEMP_NUM_DNS_API_MSG
462 #define MEMP_NUM_DNS_API_MSG            MEMP_NUM_TCPIP_MSG_API
463 #endif
464
465 /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls
466  * to getsockopt/setsockopt
467  */
468 #ifndef MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA
469 #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API
470 #endif
471
472 /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the
473  * netifapi functions
474  */
475 #ifndef MEMP_NUM_NETIFAPI_MSG
476 #define MEMP_NUM_NETIFAPI_MSG           MEMP_NUM_TCPIP_MSG_API
477 #endif
478
479 /*
480    ---------------------------------
481    ---------- ARP options ----------
482    ---------------------------------
483 */
484 /**
485  * LWIP_ARP==1: Enable ARP functionality.
486  */
487 #ifndef LWIP_ARP
488 #define LWIP_ARP                        1
489 #endif
490
491 /**
492  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
493  */
494 #ifndef ARP_TABLE_SIZE
495 #define ARP_TABLE_SIZE                  10
496 #endif
497
498 /**
499  * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
500  * resolution. By default, only the most recent packet is queued per IP address.
501  * This is sufficient for most protocols and mainly reduces TCP connection
502  * startup time. Set this to 1 if you know your application sends more than one
503  * packet in a row to an IP address that is not in the ARP cache.
504  */
505 #ifndef ARP_QUEUEING
506 #define ARP_QUEUEING                    0
507 #endif
508
509 /** The maximum number of packets which may be queued for each
510  *  unresolved address by other network layers. Defaults to 3, 0 means disabled.
511  *  Old packets are dropped, new packets are queued.
512  */
513 #ifndef ARP_QUEUE_LEN
514 #define ARP_QUEUE_LEN                   3
515 #endif
516
517 /**
518  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
519  * updated with the source MAC and IP addresses supplied in the packet.
520  * You may want to disable this if you do not trust LAN peers to have the
521  * correct addresses, or as a limited approach to attempt to handle
522  * spoofing. If disabled, lwIP will need to make a new ARP request if
523  * the peer is not already in the ARP table, adding a little latency.
524  * The peer *is* in the ARP table if it requested our address before.
525  * Also notice that this slows down input processing of every IP packet!
526  */
527 #ifndef ETHARP_TRUST_IP_MAC
528 #define ETHARP_TRUST_IP_MAC             0
529 #endif
530
531 /**
532  * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with
533  * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and
534  * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers.
535  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
536  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
537  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
538  * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan)
539  * that returns 1 to accept a packet or 0 to drop a packet.
540  */
541 #ifndef ETHARP_SUPPORT_VLAN
542 #define ETHARP_SUPPORT_VLAN             0
543 #endif
544
545 /** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP
546  * might be disabled
547  */
548 #ifndef LWIP_ETHERNET
549 #define LWIP_ETHERNET                   (LWIP_ARP || PPPOE_SUPPORT)
550 #endif
551
552 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
553  * alignment of payload after that header. Since the header is 14 bytes long,
554  * without this padding e.g. addresses in the IP header will not be aligned
555  * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
556  */
557 #ifndef ETH_PAD_SIZE
558 #define ETH_PAD_SIZE                    0
559 #endif
560
561 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
562  * entries (using etharp_add_static_entry/etharp_remove_static_entry).
563  */
564 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
565 #define ETHARP_SUPPORT_STATIC_ENTRIES   0
566 #endif
567
568 /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries.
569  * If disabled, duplicate IP address on multiple netifs are not supported
570  * (but this should only occur for AutoIP).
571  */
572 #ifndef ETHARP_TABLE_MATCH_NETIF
573 #define ETHARP_TABLE_MATCH_NETIF        0
574 #endif
575
576 /*
577    --------------------------------
578    ---------- IP options ----------
579    --------------------------------
580 */
581 /**
582  * LWIP_IPV4==1: Enable IPv4
583  */
584 #ifndef LWIP_IPV4
585 #define LWIP_IPV4                       1
586 #endif
587
588 /**
589  * IP_FORWARD==1: Enables the ability to forward IP packets across network
590  * interfaces. If you are going to run lwIP on a device with only one network
591  * interface, define this to 0.
592  */
593 #ifndef IP_FORWARD
594 #define IP_FORWARD                      0
595 #endif
596
597 /**
598  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
599  * this option does not affect outgoing packet sizes, which can be controlled
600  * via IP_FRAG.
601  */
602 #ifndef IP_REASSEMBLY
603 #define IP_REASSEMBLY                   1
604 #endif
605
606 /**
607  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
608  * that this option does not affect incoming packet sizes, which can be
609  * controlled via IP_REASSEMBLY.
610  */
611 #ifndef IP_FRAG
612 #define IP_FRAG                         1
613 #endif
614
615 #if !LWIP_IPV4
616 /* disable IPv4 extensions when IPv4 is disabled */
617 #undef IP_FORWARD
618 #define IP_FORWARD                      0
619 #undef IP_REASSEMBLY
620 #define IP_REASSEMBLY                   0
621 #undef IP_FRAG
622 #define IP_FRAG                         0
623 #endif /* !LWIP_IPV4 */
624
625 /**
626  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
627  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
628  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
629  */
630 #ifndef IP_OPTIONS_ALLOWED
631 #define IP_OPTIONS_ALLOWED              1
632 #endif
633
634 /**
635  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
636  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
637  * in this time, the whole packet is discarded.
638  */
639 #ifndef IP_REASS_MAXAGE
640 #define IP_REASS_MAXAGE                 3
641 #endif
642
643 /**
644  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
645  * Since the received pbufs are enqueued, be sure to configure
646  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
647  * packets even if the maximum amount of fragments is enqueued for reassembly!
648  */
649 #ifndef IP_REASS_MAX_PBUFS
650 #define IP_REASS_MAX_PBUFS              10
651 #endif
652
653 /**
654  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
655  * fragmentation. Otherwise pbufs are allocated and reference the original
656  * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
657  * new PBUF_RAM pbufs are used for fragments).
658  * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs!
659  */
660 #ifndef IP_FRAG_USES_STATIC_BUF
661 #define IP_FRAG_USES_STATIC_BUF         0
662 #endif
663
664 /**
665  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
666  * (requires IP_FRAG_USES_STATIC_BUF==1)
667  */
668 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
669 #define IP_FRAG_MAX_MTU                 1500
670 #endif
671
672 /**
673  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
674  */
675 #ifndef IP_DEFAULT_TTL
676 #define IP_DEFAULT_TTL                  255
677 #endif
678
679 /**
680  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
681  * filter per pcb on udp and raw send operations. To enable broadcast filter
682  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
683  */
684 #ifndef IP_SOF_BROADCAST
685 #define IP_SOF_BROADCAST                0
686 #endif
687
688 /**
689  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
690  * filter on recv operations.
691  */
692 #ifndef IP_SOF_BROADCAST_RECV
693 #define IP_SOF_BROADCAST_RECV           0
694 #endif
695
696 /**
697  * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back
698  * out on the netif where it was received. This should only be used for
699  * wireless networks.
700  * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming
701  * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags!
702  */
703 #ifndef IP_FORWARD_ALLOW_TX_ON_RX_NETIF
704 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0
705 #endif
706
707 /**
708  * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first
709  * local TCP/UDP pcb (default==0). This can prevent creating predictable port
710  * numbers after booting a device.
711  */
712 #ifndef LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS
713 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0
714 #endif
715
716 /*
717    ----------------------------------
718    ---------- ICMP options ----------
719    ----------------------------------
720 */
721 /**
722  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
723  * Be careful, disable that make your product non-compliant to RFC1122
724  */
725 #ifndef LWIP_ICMP
726 #define LWIP_ICMP                       1
727 #endif
728
729 /**
730  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
731  */
732 #ifndef ICMP_TTL
733 #define ICMP_TTL                       (IP_DEFAULT_TTL)
734 #endif
735
736 /**
737  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
738  */
739 #ifndef LWIP_BROADCAST_PING
740 #define LWIP_BROADCAST_PING             0
741 #endif
742
743 /**
744  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
745  */
746 #ifndef LWIP_MULTICAST_PING
747 #define LWIP_MULTICAST_PING             0
748 #endif
749
750 /*
751    ---------------------------------
752    ---------- RAW options ----------
753    ---------------------------------
754 */
755 /**
756  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
757  */
758 #ifndef LWIP_RAW
759 #define LWIP_RAW                        0
760 #endif
761
762 /**
763  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
764  */
765 #ifndef RAW_TTL
766 #define RAW_TTL                        (IP_DEFAULT_TTL)
767 #endif
768
769 /*
770    ----------------------------------
771    ---------- DHCP options ----------
772    ----------------------------------
773 */
774 /**
775  * LWIP_DHCP==1: Enable DHCP module.
776  */
777 #ifndef LWIP_DHCP
778 #define LWIP_DHCP                       0
779 #endif
780 #if !LWIP_IPV4
781 /* disable DHCP when IPv4 is disabled */
782 #undef LWIP_DHCP
783 #define LWIP_DHCP                       0
784 #endif /* !LWIP_IPV4 */
785
786 /**
787  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
788  */
789 #ifndef DHCP_DOES_ARP_CHECK
790 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
791 #endif
792
793 /**
794  * LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has
795  * NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and
796  * netif drivers might not set this flag, the default is off. If enabled,
797  * netif_set_link_up() must be called to continue dhcp starting.
798  */
799 #ifndef LWIP_DHCP_CHECK_LINK_UP
800 #define LWIP_DHCP_CHECK_LINK_UP         0
801 #endif
802
803 /**
804  * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
805  */
806 #ifndef LWIP_DHCP_BOOTP_FILE
807 #define LWIP_DHCP_BOOTP_FILE            0
808 #endif
809
810 /**
811  * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each
812  * response packet, an callback is called, which has to be provided by the port:
813  * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
814 */
815 #ifndef LWIP_DHCP_GET_NTP_SRV
816 #define LWIP_DHCP_GET_NTP_SRV           0
817 #endif
818
819 /**
820  * The maximum of NTP servers requested
821  */
822 #ifndef LWIP_DHCP_MAX_NTP_SERVERS
823 #define LWIP_DHCP_MAX_NTP_SERVERS       1
824 #endif
825
826 /*
827    ------------------------------------
828    ---------- AUTOIP options ----------
829    ------------------------------------
830 */
831 /**
832  * LWIP_AUTOIP==1: Enable AUTOIP module.
833  */
834 #ifndef LWIP_AUTOIP
835 #define LWIP_AUTOIP                     0
836 #endif
837 #if !LWIP_IPV4
838 /* disable AUTOIP when IPv4 is disabled */
839 #undef LWIP_AUTOIP
840 #define LWIP_AUTOIP                     0
841 #endif /* !LWIP_IPV4 */
842
843 /**
844  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
845  * the same interface at the same time.
846  */
847 #ifndef LWIP_DHCP_AUTOIP_COOP
848 #define LWIP_DHCP_AUTOIP_COOP           0
849 #endif
850
851 /**
852  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
853  * that should be sent before falling back on AUTOIP. This can be set
854  * as low as 1 to get an AutoIP address very quickly, but you should
855  * be prepared to handle a changing IP address when DHCP overrides
856  * AutoIP.
857  */
858 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
859 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
860 #endif
861
862 /*
863    ----------------------------------
864    ---------- SNMP options ----------
865    ----------------------------------
866 */
867 /**
868  * LWIP_SNMP==1: This enables the lwIP SNMP agent. UDP must be available
869  * for SNMP transport.
870  * If you want to use your own SNMP agent, leave this disabled.
871  * To integrate MIB2 of an external agent, you need to enable
872  * LWIP_MIB2_CALLBACKS and MIB2_STATS. This will give you the callbacks
873  * and statistics counters you need to get MIB2 working.
874  */
875 #ifndef LWIP_SNMP
876 #define LWIP_SNMP                       0
877 #endif
878
879 /**
880  * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks.
881  * Turn this on to get callbacks needed to implement MIB2.
882  * Usually MIB2_STATS should be enabled, too.
883  */
884 #ifndef LWIP_MIB2_CALLBACKS
885 #define LWIP_MIB2_CALLBACKS             LWIP_SNMP
886 #endif
887
888 /**
889  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
890  * allow. At least one request buffer is required.
891  * Does not have to be changed unless external MIBs answer request asynchronously
892  */
893 #ifndef SNMP_CONCURRENT_REQUESTS
894 #define SNMP_CONCURRENT_REQUESTS        1
895 #endif
896
897 /**
898  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
899  * destination is required
900  */
901 #ifndef SNMP_TRAP_DESTINATIONS
902 #define SNMP_TRAP_DESTINATIONS          1
903 #endif
904
905 /**
906  * SNMP_PRIVATE_MIB:
907  * When using a private MIB, you have to create a file 'private_mib.h' that contains
908  * a 'struct mib_array_node mib_private' which contains your MIB.
909  */
910 #ifndef SNMP_PRIVATE_MIB
911 #define SNMP_PRIVATE_MIB                0
912 #endif
913
914 /**
915  * Only allow SNMP write actions that are 'safe' (e.g. disabling netifs is not
916  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
917  * Unsafe requests are disabled by default!
918  */
919 #ifndef SNMP_SAFE_REQUESTS
920 #define SNMP_SAFE_REQUESTS              1
921 #endif
922
923 /**
924  * The maximum length of strings used. This affects the size of
925  * MEMP_SNMP_VALUE elements.
926  */
927 #ifndef SNMP_MAX_OCTET_STRING_LEN
928 #define SNMP_MAX_OCTET_STRING_LEN       127
929 #endif
930
931 /**
932  * The maximum depth of the SNMP tree.
933  * With private MIBs enabled, this depends on your MIB!
934  * This affects the size of MEMP_SNMP_VALUE elements.
935  */
936 #ifndef SNMP_MAX_TREE_DEPTH
937 #define SNMP_MAX_TREE_DEPTH             15
938 #endif
939
940 /**
941  * The size of the MEMP_SNMP_VALUE elements, normally calculated from
942  * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH.
943  */
944 #ifndef SNMP_MAX_VALUE_SIZE
945 #define SNMP_MAX_VALUE_SIZE             LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH))
946 #endif
947
948 /**
949  * The snmp read-access community. Used for write-access and traps, too
950  * unless SNMP_COMMUNITY_WRITE or SNMP_COMMUNITY_TRAP are enabled, respectively.
951  */
952 #ifndef SNMP_COMMUNITY
953 #define SNMP_COMMUNITY                  "public"
954 #endif
955
956 /**
957  * Set this to 1 to enable support for dedicated write-access and trap communities.
958  */
959 #ifndef SNMP_COMMUNITY_EXT
960 #define SNMP_COMMUNITY_EXT              0
961 #endif
962
963 #if SNMP_COMMUNITY_EXT
964 /**
965  * The snmp write-access community.
966  */
967 #ifndef SNMP_COMMUNITY_WRITE
968 #define SNMP_COMMUNITY_WRITE            "private"
969 #endif
970
971 /**
972  * The snmp community used for sending traps.
973  */
974 #ifndef SNMP_COMMUNITY_TRAP
975 #define SNMP_COMMUNITY_TRAP             "public"
976 #endif
977 #endif /* SNMP_COMMUNITY_EXT */
978
979 /*
980    ----------------------------------
981    ----- Multicast/IGMP options -----
982    ----------------------------------
983 */
984 /**
985  * LWIP_IGMP==1: Turn on IGMP module.
986  */
987 #ifndef LWIP_IGMP
988 #define LWIP_IGMP                       0
989 #endif
990 #if !LWIP_IPV4
991 #undef LWIP_IGMP
992 #define LWIP_IGMP                       0
993 #endif
994
995 /**
996  * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options
997  * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP
998  */
999 #ifndef LWIP_MULTICAST_TX_OPTIONS
1000 #define LWIP_MULTICAST_TX_OPTIONS       LWIP_IGMP
1001 #endif
1002
1003 /*
1004    ----------------------------------
1005    ---------- DNS options -----------
1006    ----------------------------------
1007 */
1008 /**
1009  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
1010  * transport.
1011  */
1012 #ifndef LWIP_DNS
1013 #define LWIP_DNS                        0
1014 #endif
1015
1016 /** DNS maximum number of entries to maintain locally. */
1017 #ifndef DNS_TABLE_SIZE
1018 #define DNS_TABLE_SIZE                  4
1019 #endif
1020
1021 /** DNS maximum host name length supported in the name table. */
1022 #ifndef DNS_MAX_NAME_LENGTH
1023 #define DNS_MAX_NAME_LENGTH             256
1024 #endif
1025
1026 /** The maximum of DNS servers
1027  * The first server can be initialized automatically by defining
1028  * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*'
1029  */
1030 #ifndef DNS_MAX_SERVERS
1031 #define DNS_MAX_SERVERS                 2
1032 #endif
1033
1034 /** DNS do a name checking between the query and the response. */
1035 #ifndef DNS_DOES_NAME_CHECK
1036 #define DNS_DOES_NAME_CHECK             1
1037 #endif
1038
1039 /** LWIP_DNS_SECURE: controls the security level of the DNS implementation
1040  * Use all DNS security features by default.
1041  * This is overridable but should only be needed by very small targets
1042  * or when using against non standard DNS servers. */
1043 #ifndef LWIP_DNS_SECURE
1044 #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)
1045 #endif
1046 /* A list of DNS security features follows */
1047 #define LWIP_DNS_SECURE_RAND_XID                1
1048 #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2
1049 #define LWIP_DNS_SECURE_RAND_SRC_PORT           4
1050
1051 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
1052  *  you have to define
1053  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
1054  *  (an array of structs name/address, where address is an u32_t in network
1055  *  byte order).
1056  *
1057  *  Instead, you can also use an external function:
1058  *  #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
1059  *  that returns the IP address or INADDR_NONE if not found.
1060  */
1061 #ifndef DNS_LOCAL_HOSTLIST
1062 #define DNS_LOCAL_HOSTLIST              0
1063 #endif /* DNS_LOCAL_HOSTLIST */
1064
1065 /** If this is turned on, the local host-list can be dynamically changed
1066  *  at runtime. */
1067 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
1068 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
1069 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
1070
1071 /*
1072    ---------------------------------
1073    ---------- UDP options ----------
1074    ---------------------------------
1075 */
1076 /**
1077  * LWIP_UDP==1: Turn on UDP.
1078  */
1079 #ifndef LWIP_UDP
1080 #define LWIP_UDP                        1
1081 #endif
1082
1083 /**
1084  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
1085  */
1086 #ifndef LWIP_UDPLITE
1087 #define LWIP_UDPLITE                    0
1088 #endif
1089
1090 /**
1091  * UDP_TTL: Default Time-To-Live value.
1092  */
1093 #ifndef UDP_TTL
1094 #define UDP_TTL                         (IP_DEFAULT_TTL)
1095 #endif
1096
1097 /**
1098  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
1099  */
1100 #ifndef LWIP_NETBUF_RECVINFO
1101 #define LWIP_NETBUF_RECVINFO            0
1102 #endif
1103
1104 /*
1105    ---------------------------------
1106    ---------- TCP options ----------
1107    ---------------------------------
1108 */
1109 /**
1110  * LWIP_TCP==1: Turn on TCP.
1111  */
1112 #ifndef LWIP_TCP
1113 #define LWIP_TCP                        1
1114 #endif
1115
1116 /**
1117  * TCP_TTL: Default Time-To-Live value.
1118  */
1119 #ifndef TCP_TTL
1120 #define TCP_TTL                         (IP_DEFAULT_TTL)
1121 #endif
1122
1123 /**
1124  * TCP_WND: The size of a TCP window.  This must be at least
1125  * (2 * TCP_MSS) for things to work well
1126  */
1127 #ifndef TCP_WND
1128 #define TCP_WND                         (4 * TCP_MSS)
1129 #endif
1130
1131 /**
1132  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
1133  */
1134 #ifndef TCP_MAXRTX
1135 #define TCP_MAXRTX                      12
1136 #endif
1137
1138 /**
1139  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
1140  */
1141 #ifndef TCP_SYNMAXRTX
1142 #define TCP_SYNMAXRTX                   6
1143 #endif
1144
1145 /**
1146  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
1147  * Define to 0 if your device is low on memory.
1148  */
1149 #ifndef TCP_QUEUE_OOSEQ
1150 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
1151 #endif
1152
1153 /**
1154  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
1155  * you might want to increase this.)
1156  * For the receive side, this MSS is advertised to the remote side
1157  * when opening a connection. For the transmit size, this MSS sets
1158  * an upper limit on the MSS advertised by the remote host.
1159  */
1160 #ifndef TCP_MSS
1161 #define TCP_MSS                         536
1162 #endif
1163
1164 /**
1165  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
1166  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
1167  * reflects the available reassembly buffer size at the remote host) and the
1168  * largest size permitted by the IP layer" (RFC 1122)
1169  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
1170  * netif used for a connection and limits the MSS if it would be too big otherwise.
1171  */
1172 #ifndef TCP_CALCULATE_EFF_SEND_MSS
1173 #define TCP_CALCULATE_EFF_SEND_MSS      1
1174 #endif
1175
1176
1177 /**
1178  * TCP_SND_BUF: TCP sender buffer space (bytes).
1179  * To achieve good performance, this should be at least 2 * TCP_MSS.
1180  */
1181 #ifndef TCP_SND_BUF
1182 #define TCP_SND_BUF                     (2 * TCP_MSS)
1183 #endif
1184
1185 /**
1186  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
1187  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
1188  */
1189 #ifndef TCP_SND_QUEUELEN
1190 #define TCP_SND_QUEUELEN                ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
1191 #endif
1192
1193 /**
1194  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
1195  * TCP_SND_BUF. It is the amount of space which must be available in the
1196  * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
1197  */
1198 #ifndef TCP_SNDLOWAT
1199 #define TCP_SNDLOWAT                    LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
1200 #endif
1201
1202 /**
1203  * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less
1204  * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
1205  * this number, select returns writable (combined with TCP_SNDLOWAT).
1206  */
1207 #ifndef TCP_SNDQUEUELOWAT
1208 #define TCP_SNDQUEUELOWAT               LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
1209 #endif
1210
1211 /**
1212  * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb.
1213  * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0.
1214  */
1215 #ifndef TCP_OOSEQ_MAX_BYTES
1216 #define TCP_OOSEQ_MAX_BYTES             0
1217 #endif
1218
1219 /**
1220  * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb.
1221  * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0.
1222  */
1223 #ifndef TCP_OOSEQ_MAX_PBUFS
1224 #define TCP_OOSEQ_MAX_PBUFS             0
1225 #endif
1226
1227 /**
1228  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
1229  */
1230 #ifndef TCP_LISTEN_BACKLOG
1231 #define TCP_LISTEN_BACKLOG              0
1232 #endif
1233
1234 /**
1235  * The maximum allowed backlog for TCP listen netconns.
1236  * This backlog is used unless another is explicitly specified.
1237  * 0xff is the maximum (u8_t).
1238  */
1239 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
1240 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
1241 #endif
1242
1243 /**
1244  * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
1245  * allocate ahead of time in an attempt to create shorter pbuf chains
1246  * for transmission. The meaningful range is 0 to TCP_MSS. Some
1247  * suggested values are:
1248  *
1249  * 0:         Disable oversized allocation. Each tcp_write() allocates a new
1250               pbuf (old behaviour).
1251  * 1:         Allocate size-aligned pbufs with minimal excess. Use this if your
1252  *            scatter-gather DMA requires aligned fragments.
1253  * 128:       Limit the pbuf/memory overhead to 20%.
1254  * TCP_MSS:   Try to create unfragmented TCP packets.
1255  * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
1256  */
1257 #ifndef TCP_OVERSIZE
1258 #define TCP_OVERSIZE                    TCP_MSS
1259 #endif
1260
1261 /**
1262  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
1263  * The timestamp option is currently only used to help remote hosts, it is not
1264  * really used locally. Therefore, it is only enabled when a TS option is
1265  * received in the initial SYN packet from a remote host.
1266  */
1267 #ifndef LWIP_TCP_TIMESTAMPS
1268 #define LWIP_TCP_TIMESTAMPS             0
1269 #endif
1270
1271 /**
1272  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
1273  * explicit window update
1274  */
1275 #ifndef TCP_WND_UPDATE_THRESHOLD
1276 #define TCP_WND_UPDATE_THRESHOLD   LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))
1277 #endif
1278
1279 /**
1280  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
1281  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
1282  *         events (accept, sent, etc) that happen in the system.
1283  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
1284  *         for the event. This is the default.
1285  */
1286 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API)
1287 #define LWIP_EVENT_API                  0
1288 #define LWIP_CALLBACK_API               1
1289 #endif
1290
1291 /**
1292  * LWIP_WND_SCALE and TCP_RCV_SCALE:
1293  * Set LWIP_WND_SCALE to 1 to enable window scaling.
1294  * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the
1295  * range of [0..14]).
1296  * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large
1297  * send window while having a small receive window only.
1298  */
1299 #ifndef LWIP_WND_SCALE
1300 #define LWIP_WND_SCALE                  0
1301 #define TCP_RCV_SCALE                   0
1302 #endif
1303
1304
1305 /*
1306    ----------------------------------
1307    ---------- Pbuf options ----------
1308    ----------------------------------
1309 */
1310 /**
1311  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
1312  * link level header. The default is 14, the standard value for
1313  * Ethernet.
1314  */
1315 #ifndef PBUF_LINK_HLEN
1316 #ifdef LWIP_HOOK_VLAN_SET
1317 #define PBUF_LINK_HLEN                  (18 + ETH_PAD_SIZE)
1318 #else /* LWIP_HOOK_VLAN_SET */
1319 #define PBUF_LINK_HLEN                  (14 + ETH_PAD_SIZE)
1320 #endif /* LWIP_HOOK_VLAN_SET */
1321 #endif
1322
1323 /**
1324  * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated
1325  * for an additional encapsulation header before ethernet headers (e.g. 802.11)
1326  */
1327 #ifndef PBUF_LINK_ENCAPSULATION_HLEN
1328 #define PBUF_LINK_ENCAPSULATION_HLEN    0
1329 #endif
1330
1331 /**
1332  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
1333  * designed to accommodate single full size TCP frame in one pbuf, including
1334  * TCP_MSS, IP header, and link header.
1335  */
1336 #ifndef PBUF_POOL_BUFSIZE
1337 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
1338 #endif
1339
1340 /*
1341    ------------------------------------------------
1342    ---------- Network Interfaces options ----------
1343    ------------------------------------------------
1344 */
1345 /**
1346  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
1347  * field.
1348  */
1349 #ifndef LWIP_NETIF_HOSTNAME
1350 #define LWIP_NETIF_HOSTNAME             0
1351 #endif
1352
1353 /**
1354  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
1355  */
1356 #ifndef LWIP_NETIF_API
1357 #define LWIP_NETIF_API                  0
1358 #endif
1359
1360 /**
1361  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
1362  * changes its up/down status (i.e., due to DHCP IP acquisition)
1363  */
1364 #ifndef LWIP_NETIF_STATUS_CALLBACK
1365 #define LWIP_NETIF_STATUS_CALLBACK      0
1366 #endif
1367
1368 /**
1369  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
1370  * whenever the link changes (i.e., link down)
1371  */
1372 #ifndef LWIP_NETIF_LINK_CALLBACK
1373 #define LWIP_NETIF_LINK_CALLBACK        0
1374 #endif
1375
1376 /**
1377  * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called
1378  * when a netif has been removed
1379  */
1380 #ifndef LWIP_NETIF_REMOVE_CALLBACK
1381 #define LWIP_NETIF_REMOVE_CALLBACK      0
1382 #endif
1383
1384 /**
1385  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
1386  * indices) in struct netif. TCP and UDP can make use of this to prevent
1387  * scanning the ARP table for every sent packet. While this is faster for big
1388  * ARP tables or many concurrent connections, it might be counterproductive
1389  * if you have a tiny ARP table or if there never are concurrent connections.
1390  */
1391 #ifndef LWIP_NETIF_HWADDRHINT
1392 #define LWIP_NETIF_HWADDRHINT           0
1393 #endif
1394
1395 /**
1396  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
1397  * address equal to the netif IP address, looping them back up the stack.
1398  */
1399 #ifndef LWIP_NETIF_LOOPBACK
1400 #define LWIP_NETIF_LOOPBACK             0
1401 #endif
1402
1403 /**
1404  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
1405  * sending for each netif (0 = disabled)
1406  */
1407 #ifndef LWIP_LOOPBACK_MAX_PBUFS
1408 #define LWIP_LOOPBACK_MAX_PBUFS         0
1409 #endif
1410
1411 /**
1412  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
1413  * the system, as netifs must change how they behave depending on this setting
1414  * for the LWIP_NETIF_LOOPBACK option to work.
1415  * Setting this is needed to avoid reentering non-reentrant functions like
1416  * tcp_input().
1417  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
1418  *       multithreaded environment like tcpip.c. In this case, netif->input()
1419  *       is called directly.
1420  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
1421  *       The packets are put on a list and netif_poll() must be called in
1422  *       the main application loop.
1423  */
1424 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
1425 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
1426 #endif
1427
1428 /**
1429  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
1430  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
1431  * MACs that do not support scatter-gather.
1432  * Beware that this might involve CPU-memcpy before transmitting that would not
1433  * be needed without this flag! Use this only if you need to!
1434  *
1435  * @todo: TCP and IP-frag do not work with this, yet:
1436  */
1437 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
1438 #define LWIP_NETIF_TX_SINGLE_PBUF             0
1439 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
1440
1441 /*
1442    ------------------------------------
1443    ---------- LOOPIF options ----------
1444    ------------------------------------
1445 */
1446 /**
1447  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1).
1448  * This is only needed when no real netifs are available. If at least one other
1449  * netif is available, loopback traffic uses this netif.
1450  */
1451 #ifndef LWIP_HAVE_LOOPIF
1452 #define LWIP_HAVE_LOOPIF                LWIP_NETIF_LOOPBACK
1453 #endif
1454
1455 /**
1456  * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1).
1457  */
1458 #ifndef LWIP_LOOPIF_MULTICAST
1459 #define LWIP_LOOPIF_MULTICAST               0
1460 #endif
1461
1462 /*
1463    ------------------------------------
1464    ---------- SLIPIF options ----------
1465    ------------------------------------
1466 */
1467 /**
1468  * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
1469  */
1470 #ifndef LWIP_HAVE_SLIPIF
1471 #define LWIP_HAVE_SLIPIF                0
1472 #endif
1473
1474 /*
1475    ------------------------------------
1476    ---------- Thread options ----------
1477    ------------------------------------
1478 */
1479 /**
1480  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1481  */
1482 #ifndef TCPIP_THREAD_NAME
1483 #define TCPIP_THREAD_NAME              "tcpip_thread"
1484 #endif
1485
1486 /**
1487  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1488  * The stack size value itself is platform-dependent, but is passed to
1489  * sys_thread_new() when the thread is created.
1490  */
1491 #ifndef TCPIP_THREAD_STACKSIZE
1492 #define TCPIP_THREAD_STACKSIZE          0
1493 #endif
1494
1495 /**
1496  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1497  * The priority value itself is platform-dependent, but is passed to
1498  * sys_thread_new() when the thread is created.
1499  */
1500 #ifndef TCPIP_THREAD_PRIO
1501 #define TCPIP_THREAD_PRIO               1
1502 #endif
1503
1504 /**
1505  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1506  * The queue size value itself is platform-dependent, but is passed to
1507  * sys_mbox_new() when tcpip_init is called.
1508  */
1509 #ifndef TCPIP_MBOX_SIZE
1510 #define TCPIP_MBOX_SIZE                 0
1511 #endif
1512
1513 /**
1514  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1515  */
1516 #ifndef SLIPIF_THREAD_NAME
1517 #define SLIPIF_THREAD_NAME             "slipif_loop"
1518 #endif
1519
1520 /**
1521  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1522  * The stack size value itself is platform-dependent, but is passed to
1523  * sys_thread_new() when the thread is created.
1524  */
1525 #ifndef SLIPIF_THREAD_STACKSIZE
1526 #define SLIPIF_THREAD_STACKSIZE         0
1527 #endif
1528
1529 /**
1530  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1531  * The priority value itself is platform-dependent, but is passed to
1532  * sys_thread_new() when the thread is created.
1533  */
1534 #ifndef SLIPIF_THREAD_PRIO
1535 #define SLIPIF_THREAD_PRIO              1
1536 #endif
1537
1538 /**
1539  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1540  */
1541 #ifndef DEFAULT_THREAD_NAME
1542 #define DEFAULT_THREAD_NAME            "lwIP"
1543 #endif
1544
1545 /**
1546  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1547  * The stack size value itself is platform-dependent, but is passed to
1548  * sys_thread_new() when the thread is created.
1549  */
1550 #ifndef DEFAULT_THREAD_STACKSIZE
1551 #define DEFAULT_THREAD_STACKSIZE        0
1552 #endif
1553
1554 /**
1555  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1556  * The priority value itself is platform-dependent, but is passed to
1557  * sys_thread_new() when the thread is created.
1558  */
1559 #ifndef DEFAULT_THREAD_PRIO
1560 #define DEFAULT_THREAD_PRIO             1
1561 #endif
1562
1563 /**
1564  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1565  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1566  * to sys_mbox_new() when the recvmbox is created.
1567  */
1568 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1569 #define DEFAULT_RAW_RECVMBOX_SIZE       0
1570 #endif
1571
1572 /**
1573  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1574  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1575  * to sys_mbox_new() when the recvmbox is created.
1576  */
1577 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1578 #define DEFAULT_UDP_RECVMBOX_SIZE       0
1579 #endif
1580
1581 /**
1582  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1583  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1584  * to sys_mbox_new() when the recvmbox is created.
1585  */
1586 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1587 #define DEFAULT_TCP_RECVMBOX_SIZE       0
1588 #endif
1589
1590 /**
1591  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1592  * The queue size value itself is platform-dependent, but is passed to
1593  * sys_mbox_new() when the acceptmbox is created.
1594  */
1595 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1596 #define DEFAULT_ACCEPTMBOX_SIZE         0
1597 #endif
1598
1599 /*
1600    ----------------------------------------------
1601    ---------- Sequential layer options ----------
1602    ----------------------------------------------
1603 */
1604 /**
1605  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
1606  * Don't use it if you're not an active lwIP project member
1607  */
1608 #ifndef LWIP_TCPIP_CORE_LOCKING
1609 #define LWIP_TCPIP_CORE_LOCKING         0
1610 #endif
1611
1612 /**
1613  * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!)
1614  * Don't use it if you're not an active lwIP project member
1615  */
1616 #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
1617 #define LWIP_TCPIP_CORE_LOCKING_INPUT   0
1618 #endif
1619
1620 /**
1621  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
1622  */
1623 #ifndef LWIP_NETCONN
1624 #define LWIP_NETCONN                    1
1625 #endif
1626
1627 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create
1628  * timers running in tcpip_thread from another thread.
1629  */
1630 #ifndef LWIP_TCPIP_TIMEOUT
1631 #define LWIP_TCPIP_TIMEOUT              0
1632 #endif
1633
1634 /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per
1635  * thread calling socket/netconn functions instead of allocating one
1636  * semaphore per netconn (and per select etc.)
1637  * ATTENTION: a thread-local semaphore for API calls is needed:
1638  * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t*
1639  * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore
1640  * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore
1641  * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup().
1642  * Ports may call these for threads created with sys_thread_new().
1643  */
1644 #ifndef LWIP_NETCONN_SEM_PER_THREAD
1645 #define LWIP_NETCONN_SEM_PER_THREAD     0
1646 #endif
1647
1648 /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread,
1649  * writing from a 2nd thread and closing from a 3rd thread at the same time.
1650  * ATTENTION: This is currently really alpha! Some requirements:
1651  * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from
1652  *   multiple threads at once
1653  * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox
1654  *   and prevent a task pending on this during/after deletion
1655  */
1656 #ifndef LWIP_NETCONN_FULLDUPLEX
1657 #define LWIP_NETCONN_FULLDUPLEX         0
1658 #endif
1659
1660 /*
1661    ------------------------------------
1662    ---------- Socket options ----------
1663    ------------------------------------
1664 */
1665 /**
1666  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1667  */
1668 #ifndef LWIP_SOCKET
1669 #define LWIP_SOCKET                     1
1670 #endif
1671
1672 /* LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete
1673  * successfully, as required by POSIX. Default is POSIX-compliant.
1674  */
1675 #ifndef LWIP_SOCKET_SET_ERRNO
1676 #define LWIP_SOCKET_SET_ERRNO           1
1677 #endif
1678
1679 /**
1680  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines.
1681  * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created.
1682  * While this helps code completion, it might conflict with existing libraries.
1683  * (only used if you use sockets.c)
1684  */
1685 #ifndef LWIP_COMPAT_SOCKETS
1686 #define LWIP_COMPAT_SOCKETS             1
1687 #endif
1688
1689 /**
1690  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
1691  * Disable this option if you use a POSIX operating system that uses the same
1692  * names (read, write & close). (only used if you use sockets.c)
1693  */
1694 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1695 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
1696 #endif
1697
1698 /**
1699  * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.
1700  * This can be useful when there are multiple APIs which create file descriptors.
1701  * When they all start with a different offset and you won't make them overlap you can
1702  * re implement read/write/close/ioctl/fnctl to send the requested action to the right
1703  * library (sharing select will need more work though).
1704  */
1705 #ifndef LWIP_SOCKET_OFFSET
1706 #define LWIP_SOCKET_OFFSET              0
1707 #endif
1708
1709 /**
1710  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1711  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1712  * in seconds. (does not require sockets.c, and will affect tcp.c)
1713  */
1714 #ifndef LWIP_TCP_KEEPALIVE
1715 #define LWIP_TCP_KEEPALIVE              0
1716 #endif
1717
1718 /**
1719  * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
1720  * SO_SNDTIMEO processing.
1721  */
1722 #ifndef LWIP_SO_SNDTIMEO
1723 #define LWIP_SO_SNDTIMEO                0
1724 #endif
1725
1726 /**
1727  * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
1728  * SO_RCVTIMEO processing.
1729  */
1730 #ifndef LWIP_SO_RCVTIMEO
1731 #define LWIP_SO_RCVTIMEO                0
1732 #endif
1733
1734 /**
1735  * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int
1736  * (milliseconds, much like winsock does) instead of a struct timeval (default).
1737  */
1738 #ifndef LWIP_SO_SNDRCVTIMEO_NONSTANDARD
1739 #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0
1740 #endif
1741
1742 /**
1743  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1744  */
1745 #ifndef LWIP_SO_RCVBUF
1746 #define LWIP_SO_RCVBUF                  0
1747 #endif
1748
1749 /**
1750  * LWIP_SO_LINGER==1: Enable SO_LINGER processing.
1751  */
1752 #ifndef LWIP_SO_LINGER
1753 #define LWIP_SO_LINGER                  0
1754 #endif
1755
1756 /**
1757  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
1758  */
1759 #ifndef RECV_BUFSIZE_DEFAULT
1760 #define RECV_BUFSIZE_DEFAULT            INT_MAX
1761 #endif
1762
1763 /**
1764  * By default, TCP socket/netconn close waits 20 seconds max to send the FIN
1765  */
1766 #ifndef LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT
1767 #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000
1768 #endif
1769
1770 /**
1771  * SO_REUSE==1: Enable SO_REUSEADDR option.
1772  */
1773 #ifndef SO_REUSE
1774 #define SO_REUSE                        0
1775 #endif
1776
1777 /**
1778  * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
1779  * to all local matches if SO_REUSEADDR is turned on.
1780  * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
1781  */
1782 #ifndef SO_REUSE_RXTOALL
1783 #define SO_REUSE_RXTOALL                0
1784 #endif
1785
1786 /**
1787  * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of
1788  * pending data in the network buffer. This is the way windows does it. It's
1789  * the default for lwIP since it is smaller.
1790  * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next
1791  * pending datagram in bytes. This is the way linux does it. This code is only
1792  * here for compatibility.
1793  */
1794 #ifndef LWIP_FIONREAD_LINUXMODE
1795 #define LWIP_FIONREAD_LINUXMODE         0
1796 #endif
1797
1798 /*
1799    ----------------------------------------
1800    ---------- Statistics options ----------
1801    ----------------------------------------
1802 */
1803 /**
1804  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1805  */
1806 #ifndef LWIP_STATS
1807 #define LWIP_STATS                      1
1808 #endif
1809
1810 #if LWIP_STATS
1811
1812 /**
1813  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1814  */
1815 #ifndef LWIP_STATS_DISPLAY
1816 #define LWIP_STATS_DISPLAY              0
1817 #endif
1818
1819 /**
1820  * LINK_STATS==1: Enable link stats.
1821  */
1822 #ifndef LINK_STATS
1823 #define LINK_STATS                      1
1824 #endif
1825
1826 /**
1827  * ETHARP_STATS==1: Enable etharp stats.
1828  */
1829 #ifndef ETHARP_STATS
1830 #define ETHARP_STATS                    (LWIP_ARP)
1831 #endif
1832
1833 /**
1834  * IP_STATS==1: Enable IP stats.
1835  */
1836 #ifndef IP_STATS
1837 #define IP_STATS                        1
1838 #endif
1839
1840 /**
1841  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1842  * on if using either frag or reass.
1843  */
1844 #ifndef IPFRAG_STATS
1845 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
1846 #endif
1847
1848 /**
1849  * ICMP_STATS==1: Enable ICMP stats.
1850  */
1851 #ifndef ICMP_STATS
1852 #define ICMP_STATS                      1
1853 #endif
1854
1855 /**
1856  * IGMP_STATS==1: Enable IGMP stats.
1857  */
1858 #ifndef IGMP_STATS
1859 #define IGMP_STATS                      (LWIP_IGMP)
1860 #endif
1861
1862 /**
1863  * UDP_STATS==1: Enable UDP stats. Default is on if
1864  * UDP enabled, otherwise off.
1865  */
1866 #ifndef UDP_STATS
1867 #define UDP_STATS                       (LWIP_UDP)
1868 #endif
1869
1870 /**
1871  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1872  * enabled, otherwise off.
1873  */
1874 #ifndef TCP_STATS
1875 #define TCP_STATS                       (LWIP_TCP)
1876 #endif
1877
1878 /**
1879  * MEM_STATS==1: Enable mem.c stats.
1880  */
1881 #ifndef MEM_STATS
1882 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
1883 #endif
1884
1885 /**
1886  * MEMP_STATS==1: Enable memp.c pool stats.
1887  */
1888 #ifndef MEMP_STATS
1889 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
1890 #endif
1891
1892 /**
1893  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1894  */
1895 #ifndef SYS_STATS
1896 #define SYS_STATS                       (NO_SYS == 0)
1897 #endif
1898
1899 /**
1900  * IP6_STATS==1: Enable IPv6 stats.
1901  */
1902 #ifndef IP6_STATS
1903 #define IP6_STATS                       (LWIP_IPV6)
1904 #endif
1905
1906 /**
1907  * ICMP6_STATS==1: Enable ICMP for IPv6 stats.
1908  */
1909 #ifndef ICMP6_STATS
1910 #define ICMP6_STATS                     (LWIP_IPV6 && LWIP_ICMP6)
1911 #endif
1912
1913 /**
1914  * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats.
1915  */
1916 #ifndef IP6_FRAG_STATS
1917 #define IP6_FRAG_STATS                  (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS))
1918 #endif
1919
1920 /**
1921  * MLD6_STATS==1: Enable MLD for IPv6 stats.
1922  */
1923 #ifndef MLD6_STATS
1924 #define MLD6_STATS                      (LWIP_IPV6 && LWIP_IPV6_MLD)
1925 #endif
1926
1927 /**
1928  * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats.
1929  */
1930 #ifndef ND6_STATS
1931 #define ND6_STATS                       (LWIP_IPV6)
1932 #endif
1933
1934 /**
1935  * MIB2_STATS==1: Stats for SNMP MIB2.
1936  */
1937 #ifndef MIB2_STATS
1938 #define MIB2_STATS                      (LWIP_SNMP)
1939 #endif
1940
1941 #else
1942
1943 #define LINK_STATS                      0
1944 #define ETHARP_STATS                    0
1945 #define IP_STATS                        0
1946 #define IPFRAG_STATS                    0
1947 #define ICMP_STATS                      0
1948 #define IGMP_STATS                      0
1949 #define UDP_STATS                       0
1950 #define TCP_STATS                       0
1951 #define MEM_STATS                       0
1952 #define MEMP_STATS                      0
1953 #define SYS_STATS                       0
1954 #define LWIP_STATS_DISPLAY              0
1955 #define IP6_STATS                       0
1956 #define ICMP6_STATS                     0
1957 #define IP6_FRAG_STATS                  0
1958 #define MLD6_STATS                      0
1959 #define ND6_STATS                       0
1960 #define MIB2_STATS                      0
1961
1962 #endif /* LWIP_STATS */
1963
1964 /*
1965    ---------------------------------
1966    ---------- PPP options ----------
1967    ---------------------------------
1968 */
1969
1970 /**
1971  * PPP_SUPPORT==1: Enable PPP.
1972  */
1973 #ifndef PPP_SUPPORT
1974 #define PPP_SUPPORT                     0
1975 #endif
1976
1977 /**
1978  * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
1979  */
1980 #ifndef PPPOE_SUPPORT
1981 #define PPPOE_SUPPORT                   0
1982 #endif
1983
1984 /**
1985  * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP
1986  */
1987 #ifndef PPPOL2TP_SUPPORT
1988 #define PPPOL2TP_SUPPORT                0
1989 #endif
1990
1991 /**
1992  * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support)
1993  */
1994 #ifndef PPPOL2TP_AUTH_SUPPORT
1995 #define PPPOL2TP_AUTH_SUPPORT           PPPOL2TP_SUPPORT
1996 #endif
1997
1998 /**
1999  * PPPOS_SUPPORT==1: Enable PPP Over Serial
2000  */
2001 #ifndef PPPOS_SUPPORT
2002 #define PPPOS_SUPPORT                   PPP_SUPPORT
2003 #endif
2004
2005 /**
2006  * LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
2007  */
2008 #ifndef LWIP_PPP_API
2009 #define LWIP_PPP_API                    (PPP_SUPPORT && (NO_SYS == 0))
2010 #endif
2011
2012 #if PPP_SUPPORT
2013
2014 /**
2015  * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback().
2016  *
2017  * Please read the "PPPoS input path" chapter in the PPP documentation about this option.
2018  */
2019 #ifndef PPP_INPROC_IRQ_SAFE
2020 #define PPP_INPROC_IRQ_SAFE             0
2021 #endif
2022
2023 /**
2024  * PRINTPKT_SUPPORT==1: Enable PPP print packet support
2025  *
2026  * Mandatory for debugging, it displays exchanged packet content in debug trace.
2027  */
2028 #ifndef PRINTPKT_SUPPORT
2029 #define PRINTPKT_SUPPORT                0
2030 #endif
2031
2032 /**
2033  * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support
2034  */
2035 #ifndef PPP_IPV4_SUPPORT
2036 #define PPP_IPV4_SUPPORT                (LWIP_IPV4)
2037 #endif
2038
2039 /**
2040  * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support
2041  */
2042 #ifndef PPP_IPV6_SUPPORT
2043 #define PPP_IPV6_SUPPORT                (LWIP_IPV6)
2044 #endif
2045
2046 /**
2047  * PPP_NOTIFY_PHASE==1: Support PPP notify phase support
2048  *
2049  * PPP notify phase support allows you to set a callback which is
2050  * called on change of the internal PPP state machine.
2051  *
2052  * This can be used for example to set a LED pattern depending on the
2053  * current phase of the PPP session.
2054  */
2055 #ifndef PPP_NOTIFY_PHASE
2056 #define PPP_NOTIFY_PHASE                0
2057 #endif
2058
2059 /**
2060  * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets.
2061  *
2062  * Memory allocated must be single buffered for PPP to works, it requires pbuf
2063  * that are not going to be chained when allocated. This requires setting
2064  * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.
2065  *
2066  * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
2067  * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
2068  */
2069 #ifndef PPP_USE_PBUF_RAM
2070 #define PPP_USE_PBUF_RAM                0
2071 #endif
2072
2073 /**
2074  * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS
2075  */
2076 #ifndef PPP_FCS_TABLE
2077 #define PPP_FCS_TABLE                   1
2078 #endif
2079
2080 /**
2081  * PAP_SUPPORT==1: Support PAP.
2082  */
2083 #ifndef PAP_SUPPORT
2084 #define PAP_SUPPORT                     0
2085 #endif
2086
2087 /**
2088  * CHAP_SUPPORT==1: Support CHAP.
2089  */
2090 #ifndef CHAP_SUPPORT
2091 #define CHAP_SUPPORT                    0
2092 #endif
2093
2094 /**
2095  * MSCHAP_SUPPORT==1: Support MSCHAP.
2096  */
2097 #ifndef MSCHAP_SUPPORT
2098 #define MSCHAP_SUPPORT                  0
2099 #endif
2100 #if MSCHAP_SUPPORT
2101 /* MSCHAP requires CHAP support */
2102 #undef CHAP_SUPPORT
2103 #define CHAP_SUPPORT                    1
2104 #endif /* MSCHAP_SUPPORT */
2105
2106 /**
2107  * EAP_SUPPORT==1: Support EAP.
2108  */
2109 #ifndef EAP_SUPPORT
2110 #define EAP_SUPPORT                     0
2111 #endif
2112
2113 /**
2114  * CCP_SUPPORT==1: Support CCP.
2115  */
2116 #ifndef CCP_SUPPORT
2117 #define CCP_SUPPORT                     0
2118 #endif
2119
2120 /**
2121  * MPPE_SUPPORT==1: Support MPPE.
2122  */
2123 #ifndef MPPE_SUPPORT
2124 #define MPPE_SUPPORT                    0
2125 #endif
2126 #if MPPE_SUPPORT
2127 /* MPPE requires CCP support */
2128 #undef CCP_SUPPORT
2129 #define CCP_SUPPORT                     1
2130 /* MPPE requires MSCHAP support */
2131 #undef MSCHAP_SUPPORT
2132 #define MSCHAP_SUPPORT                  1
2133 /* MSCHAP requires CHAP support */
2134 #undef CHAP_SUPPORT
2135 #define CHAP_SUPPORT                    1
2136 #endif /* MPPE_SUPPORT */
2137
2138 /**
2139  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
2140  */
2141 #ifndef CBCP_SUPPORT
2142 #define CBCP_SUPPORT                    0
2143 #endif
2144
2145 /**
2146  * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET!
2147  */
2148 #ifndef ECP_SUPPORT
2149 #define ECP_SUPPORT                     0
2150 #endif
2151
2152 /**
2153  * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET!
2154  */
2155 #ifndef DEMAND_SUPPORT
2156 #define DEMAND_SUPPORT                  0
2157 #endif
2158
2159 /**
2160  * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets.
2161  */
2162 #ifndef LQR_SUPPORT
2163 #define LQR_SUPPORT                     0
2164 #endif
2165
2166 /**
2167  * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session).
2168  *
2169  * Currently only supported for PPPoS.
2170  */
2171 #ifndef PPP_SERVER
2172 #define PPP_SERVER                      0
2173 #endif
2174
2175 #if PPP_SERVER
2176 /*
2177  * PPP_OUR_NAME: Our name for authentication purposes
2178  */
2179 #ifndef PPP_OUR_NAME
2180 #define PPP_OUR_NAME                    "lwIP"
2181 #endif
2182 #endif /* PPP_SERVER */
2183
2184 /**
2185  * VJ_SUPPORT==1: Support VJ header compression.
2186  */
2187 #ifndef VJ_SUPPORT
2188 #define VJ_SUPPORT                      1
2189 #endif
2190 /* VJ compression is only supported for IPv4 over PPPoS. */
2191 #if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT
2192 #undef VJ_SUPPORT
2193 #define VJ_SUPPORT                      0
2194 #endif /* !PPPOS_SUPPORT */
2195
2196 /**
2197  * PPP_MD5_RANDM==1: Use MD5 for better randomness.
2198  * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled.
2199  */
2200 #ifndef PPP_MD5_RANDM
2201 #define PPP_MD5_RANDM                   (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)
2202 #endif
2203
2204 /**
2205  * PolarSSL library, used if necessary and not previously disabled
2206  *
2207  *
2208  * lwIP contains some files fetched from the latest BSD release of
2209  * the PolarSSL project for ciphers and encryption methods we need for lwIP
2210  * PPP support.
2211  *
2212  * The PolarSSL files were cleaned to contain only the necessary struct
2213  * fields and functions needed for lwIP.
2214  *
2215  * The PolarSSL API was not changed at all, so if you are already using
2216  * PolarSSL you can choose to skip the compilation of the included PolarSSL
2217  * library into lwIP:
2218  *
2219  * The following defines are available for flexibility:
2220  *
2221  * LWIP_INCLUDED_POLARSSL_MD4   ; Use lwIP internal PolarSSL for MD4
2222  * LWIP_INCLUDED_POLARSSL_MD5   ; Use lwIP internal PolarSSL for MD5
2223  * LWIP_INCLUDED_POLARSSL_SHA1  ; Use lwIP internal PolarSSL for SHA1
2224  * LWIP_INCLUDED_POLARSSL_DES   ; Use lwIP internal PolarSSL for DES
2225  *
2226  * If set (=1), the default if required by another enabled PPP feature unless
2227  * explicitly set to 0, using included lwIP PolarSSL.
2228  *
2229  * If clear (=0), not needed or using external PolarSSL.
2230  *
2231  * Beware of the stack requirements which can be a lot larger if you are not
2232  * using our cleaned PolarSSL library.
2233  */
2234
2235 /* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
2236 #if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
2237 #ifndef LWIP_INCLUDED_POLARSSL_MD5
2238 #define LWIP_INCLUDED_POLARSSL_MD5        1
2239 #endif /* LWIP_INCLUDED_POLARSSL_MD5 */
2240 #endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */
2241
2242 #if MSCHAP_SUPPORT
2243 /* MSCHAP require MD4 support */
2244 #ifndef LWIP_INCLUDED_POLARSSL_MD4
2245 #define LWIP_INCLUDED_POLARSSL_MD4      1
2246 #endif /* LWIP_INCLUDED_POLARSSL_MD4 */
2247 /* MSCHAP require SHA1 support */
2248 #ifndef LWIP_INCLUDED_POLARSSL_SHA1
2249 #define LWIP_INCLUDED_POLARSSL_SHA1     1
2250 #endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
2251 /* MSCHAP require DES support */
2252 #ifndef LWIP_INCLUDED_POLARSSL_DES
2253 #define LWIP_INCLUDED_POLARSSL_DES      1
2254 #endif /* LWIP_INCLUDED_POLARSSL_DES */
2255 /* MS-CHAP support is required for MPPE */
2256 #if MPPE_SUPPORT
2257 /* MPPE require ARC4 support */
2258 #ifndef LWIP_INCLUDED_POLARSSL_ARC4
2259 #define LWIP_INCLUDED_POLARSSL_ARC4     1
2260 #endif /* LWIP_INCLUDED_POLARSSL_ARC4*/
2261 #endif /* MPPE_SUPPORT */
2262 #endif /* MSCHAP_SUPPORT */
2263
2264 /* Default value if unset */
2265 #ifndef LWIP_INCLUDED_POLARSSL_MD4
2266 #define LWIP_INCLUDED_POLARSSL_MD4      0
2267 #endif /* LWIP_INCLUDED_POLARSSL_MD4 */
2268 #ifndef LWIP_INCLUDED_POLARSSL_MD5
2269 #define LWIP_INCLUDED_POLARSSL_MD5      0
2270 #endif /* LWIP_INCLUDED_POLARSSL_MD5 */
2271 #ifndef LWIP_INCLUDED_POLARSSL_SHA1
2272 #define LWIP_INCLUDED_POLARSSL_SHA1     0
2273 #endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
2274 #ifndef LWIP_INCLUDED_POLARSSL_DES
2275 #define LWIP_INCLUDED_POLARSSL_DES      0
2276 #endif /* LWIP_INCLUDED_POLARSSL_DES */
2277 #ifndef LWIP_INCLUDED_POLARSSL_ARC4
2278 #define LWIP_INCLUDED_POLARSSL_ARC4     0
2279 #endif /* LWIP_INCLUDED_POLARSSL_ARC4 */
2280
2281 /*
2282  * PPP Timeouts
2283  */
2284
2285 /**
2286  * FSM_DEFTIMEOUT: Timeout time in seconds
2287  */
2288 #ifndef FSM_DEFTIMEOUT
2289 #define FSM_DEFTIMEOUT                  6
2290 #endif
2291
2292 /**
2293  * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions
2294  */
2295 #ifndef FSM_DEFMAXTERMREQS
2296 #define FSM_DEFMAXTERMREQS              2
2297 #endif
2298
2299 /**
2300  * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions
2301  */
2302 #ifndef FSM_DEFMAXCONFREQS
2303 #define FSM_DEFMAXCONFREQS              10
2304 #endif
2305
2306 /**
2307  * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops
2308  */
2309 #ifndef FSM_DEFMAXNAKLOOPS
2310 #define FSM_DEFMAXNAKLOOPS              5
2311 #endif
2312
2313 /**
2314  * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
2315  */
2316 #ifndef UPAP_DEFTIMEOUT
2317 #define UPAP_DEFTIMEOUT                 6
2318 #endif
2319
2320 /**
2321  * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send
2322  */
2323 #ifndef UPAP_DEFTRANSMITS
2324 #define UPAP_DEFTRANSMITS               10
2325 #endif
2326
2327 #if PPP_SERVER
2328 /**
2329  * UPAP_DEFREQTIME: Time to wait for auth-req from peer
2330  */
2331 #ifndef UPAP_DEFREQTIME
2332 #define UPAP_DEFREQTIME                 30
2333 #endif
2334 #endif /* PPP_SERVER */
2335
2336 /**
2337  * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
2338  */
2339 #ifndef CHAP_DEFTIMEOUT
2340 #define CHAP_DEFTIMEOUT                 6
2341 #endif
2342
2343 /**
2344  * CHAP_DEFTRANSMITS: max # times to send challenge
2345  */
2346 #ifndef CHAP_DEFTRANSMITS
2347 #define CHAP_DEFTRANSMITS               10
2348 #endif
2349
2350 #if PPP_SERVER
2351 /**
2352  * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds
2353  */
2354 #ifndef CHAP_DEFRECHALLENGETIME
2355 #define CHAP_DEFRECHALLENGETIME         0
2356 #endif
2357 #endif /* PPP_SERVER */
2358
2359 /**
2360  * EAP_DEFREQTIME: Time to wait for peer request
2361  */
2362 #ifndef EAP_DEFREQTIME
2363 #define EAP_DEFREQTIME                  6
2364 #endif
2365
2366 /**
2367  * EAP_DEFALLOWREQ: max # times to accept requests
2368  */
2369 #ifndef EAP_DEFALLOWREQ
2370 #define EAP_DEFALLOWREQ                 10
2371 #endif
2372
2373 #if PPP_SERVER
2374 /**
2375  * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit
2376  */
2377 #ifndef EAP_DEFTIMEOUT
2378 #define EAP_DEFTIMEOUT                  6
2379 #endif
2380
2381 /**
2382  * EAP_DEFTRANSMITS: max # times to transmit
2383  */
2384 #ifndef EAP_DEFTRANSMITS
2385 #define EAP_DEFTRANSMITS                10
2386 #endif
2387 #endif /* PPP_SERVER */
2388
2389 /**
2390  * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer
2391  * before deciding the link is looped-back.
2392  */
2393 #ifndef LCP_DEFLOOPBACKFAIL
2394 #define LCP_DEFLOOPBACKFAIL             10
2395 #endif
2396
2397 /**
2398  * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable.
2399  */
2400 #ifndef LCP_ECHOINTERVAL
2401 #define LCP_ECHOINTERVAL                0
2402 #endif
2403
2404 /**
2405  * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure.
2406  */
2407 #ifndef LCP_MAXECHOFAILS
2408 #define LCP_MAXECHOFAILS                3
2409 #endif
2410
2411 /**
2412  * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char.
2413  */
2414 #ifndef PPP_MAXIDLEFLAG
2415 #define PPP_MAXIDLEFLAG                 100
2416 #endif
2417
2418 /**
2419  * PPP Packet sizes
2420  */
2421
2422 /**
2423  * PPP_MRU: Default MRU
2424  */
2425 #ifndef PPP_MRU
2426 #define PPP_MRU                         1500
2427 #endif
2428
2429 /**
2430  * PPP_DEFMRU: Default MRU to try
2431  */
2432 #ifndef PPP_DEFMRU
2433 #define PPP_DEFMRU                      1500
2434 #endif
2435
2436 /**
2437  * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384)
2438  */
2439 #ifndef PPP_MAXMRU
2440 #define PPP_MAXMRU                      1500
2441 #endif
2442
2443 /**
2444  * PPP_MINMRU: No MRUs below this
2445  */
2446 #ifndef PPP_MINMRU
2447 #define PPP_MINMRU                      128
2448 #endif
2449
2450 /**
2451  * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP
2452  * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8)
2453  * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2)
2454  */
2455 #if PPPOL2TP_SUPPORT
2456 #ifndef PPPOL2TP_DEFMRU
2457 #define PPPOL2TP_DEFMRU                 1450
2458 #endif
2459 #endif /* PPPOL2TP_SUPPORT */
2460
2461 /**
2462  * MAXNAMELEN: max length of hostname or name for auth
2463  */
2464 #ifndef MAXNAMELEN
2465 #define MAXNAMELEN                      256
2466 #endif
2467
2468 /**
2469  * MAXSECRETLEN: max length of password or secret
2470  */
2471 #ifndef MAXSECRETLEN
2472 #define MAXSECRETLEN                    256
2473 #endif
2474
2475 #endif /* PPP_SUPPORT */
2476
2477 /*
2478    --------------------------------------
2479    ---------- Checksum options ----------
2480    --------------------------------------
2481 */
2482
2483 /**
2484  * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled
2485  * per netif.
2486  * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled!
2487  */
2488 #ifndef LWIP_CHECKSUM_CTRL_PER_NETIF
2489 #define LWIP_CHECKSUM_CTRL_PER_NETIF    0
2490 #endif
2491
2492 /**
2493  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
2494  */
2495 #ifndef CHECKSUM_GEN_IP
2496 #define CHECKSUM_GEN_IP                 1
2497 #endif
2498
2499 /**
2500  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
2501  */
2502 #ifndef CHECKSUM_GEN_UDP
2503 #define CHECKSUM_GEN_UDP                1
2504 #endif
2505
2506 /**
2507  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
2508  */
2509 #ifndef CHECKSUM_GEN_TCP
2510 #define CHECKSUM_GEN_TCP                1
2511 #endif
2512
2513 /**
2514  * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.
2515  */
2516 #ifndef CHECKSUM_GEN_ICMP
2517 #define CHECKSUM_GEN_ICMP               1
2518 #endif
2519
2520 /**
2521  * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
2522  */
2523 #ifndef CHECKSUM_GEN_ICMP6
2524 #define CHECKSUM_GEN_ICMP6              1
2525 #endif
2526
2527 /**
2528  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
2529  */
2530 #ifndef CHECKSUM_CHECK_IP
2531 #define CHECKSUM_CHECK_IP               1
2532 #endif
2533
2534 /**
2535  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
2536  */
2537 #ifndef CHECKSUM_CHECK_UDP
2538 #define CHECKSUM_CHECK_UDP              1
2539 #endif
2540
2541 /**
2542  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
2543  */
2544 #ifndef CHECKSUM_CHECK_TCP
2545 #define CHECKSUM_CHECK_TCP              1
2546 #endif
2547
2548 /**
2549  * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
2550  */
2551 #ifndef CHECKSUM_CHECK_ICMP
2552 #define CHECKSUM_CHECK_ICMP             1
2553 #endif
2554
2555 /**
2556  * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
2557  */
2558 #ifndef CHECKSUM_CHECK_ICMP6
2559 #define CHECKSUM_CHECK_ICMP6            1
2560 #endif
2561
2562 /**
2563  * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
2564  * application buffers to pbufs.
2565  */
2566 #ifndef LWIP_CHECKSUM_ON_COPY
2567 #define LWIP_CHECKSUM_ON_COPY           0
2568 #endif
2569
2570 /*
2571    ---------------------------------------
2572    ---------- IPv6 options ---------------
2573    ---------------------------------------
2574 */
2575 /**
2576  * LWIP_IPV6==1: Enable IPv6
2577  */
2578 #ifndef LWIP_IPV6
2579 #define LWIP_IPV6                       0
2580 #endif
2581
2582 /**
2583  * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
2584  */
2585 #ifndef LWIP_IPV6_NUM_ADDRESSES
2586 #define LWIP_IPV6_NUM_ADDRESSES         3
2587 #endif
2588
2589 /**
2590  * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
2591  */
2592 #ifndef LWIP_IPV6_FORWARD
2593 #define LWIP_IPV6_FORWARD               0
2594 #endif
2595
2596 /**
2597  * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
2598  */
2599 #ifndef LWIP_ICMP6
2600 #define LWIP_ICMP6                      (LWIP_IPV6)
2601 #endif
2602
2603 /**
2604  * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in
2605  * ICMPv6 error messages.
2606  */
2607 #ifndef LWIP_ICMP6_DATASIZE
2608 #define LWIP_ICMP6_DATASIZE             8
2609 #endif
2610
2611 /**
2612  * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
2613  */
2614 #ifndef LWIP_ICMP6_HL
2615 #define LWIP_ICMP6_HL                   255
2616 #endif
2617
2618 /**
2619  * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol.
2620  */
2621 #ifndef LWIP_IPV6_MLD
2622 #define LWIP_IPV6_MLD                   (LWIP_IPV6)
2623 #endif
2624
2625 /**
2626  * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast that can be joined.
2627  */
2628 #ifndef MEMP_NUM_MLD6_GROUP
2629 #define MEMP_NUM_MLD6_GROUP             4
2630 #endif
2631
2632 /**
2633  * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
2634  */
2635 #ifndef LWIP_IPV6_FRAG
2636 #define LWIP_IPV6_FRAG                  0
2637 #endif
2638
2639 /**
2640  * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
2641  */
2642 #ifndef LWIP_IPV6_REASS
2643 #define LWIP_IPV6_REASS                 (LWIP_IPV6)
2644 #endif
2645
2646 /**
2647  * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address
2648  * is being resolved.
2649  */
2650 #ifndef LWIP_ND6_QUEUEING
2651 #define LWIP_ND6_QUEUEING               (LWIP_IPV6)
2652 #endif
2653
2654 /**
2655  * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
2656  */
2657 #ifndef MEMP_NUM_ND6_QUEUE
2658 #define MEMP_NUM_ND6_QUEUE              20
2659 #endif
2660
2661 /**
2662  * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
2663  */
2664 #ifndef LWIP_ND6_NUM_NEIGHBORS
2665 #define LWIP_ND6_NUM_NEIGHBORS          10
2666 #endif
2667
2668 /**
2669  * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
2670  */
2671 #ifndef LWIP_ND6_NUM_DESTINATIONS
2672 #define LWIP_ND6_NUM_DESTINATIONS       10
2673 #endif
2674
2675 /**
2676  * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
2677  */
2678 #ifndef LWIP_ND6_NUM_PREFIXES
2679 #define LWIP_ND6_NUM_PREFIXES           5
2680 #endif
2681
2682 /**
2683  * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
2684  */
2685 #ifndef LWIP_ND6_NUM_ROUTERS
2686 #define LWIP_ND6_NUM_ROUTERS            3
2687 #endif
2688
2689 /**
2690  * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send
2691  * (neighbor solicit and router solicit)
2692  */
2693 #ifndef LWIP_ND6_MAX_MULTICAST_SOLICIT
2694 #define LWIP_ND6_MAX_MULTICAST_SOLICIT  3
2695 #endif
2696
2697 /**
2698  * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages
2699  * to send during neighbor reachability detection.
2700  */
2701 #ifndef LWIP_ND6_MAX_UNICAST_SOLICIT
2702 #define LWIP_ND6_MAX_UNICAST_SOLICIT    3
2703 #endif
2704
2705 /**
2706  * Unused: See ND RFC (time in milliseconds).
2707  */
2708 #ifndef LWIP_ND6_MAX_ANYCAST_DELAY_TIME
2709 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000
2710 #endif
2711
2712 /**
2713  * Unused: See ND RFC
2714  */
2715 #ifndef LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT
2716 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT  3
2717 #endif
2718
2719 /**
2720  * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds).
2721  * May be updated by router advertisement messages.
2722  */
2723 #ifndef LWIP_ND6_REACHABLE_TIME
2724 #define LWIP_ND6_REACHABLE_TIME         30000
2725 #endif
2726
2727 /**
2728  * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
2729  */
2730 #ifndef LWIP_ND6_RETRANS_TIMER
2731 #define LWIP_ND6_RETRANS_TIMER          1000
2732 #endif
2733
2734 /**
2735  * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation
2736  * message is sent, during neighbor reachability detection.
2737  */
2738 #ifndef LWIP_ND6_DELAY_FIRST_PROBE_TIME
2739 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000
2740 #endif
2741
2742 /**
2743  * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update
2744  * Reachable time and retransmission timers, and netif MTU.
2745  */
2746 #ifndef LWIP_ND6_ALLOW_RA_UPDATES
2747 #define LWIP_ND6_ALLOW_RA_UPDATES       1
2748 #endif
2749
2750 /**
2751  * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during
2752  * network startup.
2753  */
2754 #ifndef LWIP_IPV6_SEND_ROUTER_SOLICIT
2755 #define LWIP_IPV6_SEND_ROUTER_SOLICIT   1
2756 #endif
2757
2758 /**
2759  * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery
2760  * with reachability hints for connected destinations. This helps avoid sending
2761  * unicast neighbor solicitation messages.
2762  */
2763 #ifndef LWIP_ND6_TCP_REACHABILITY_HINTS
2764 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1
2765 #endif
2766
2767 /**
2768  * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
2769  */
2770 #ifndef LWIP_IPV6_AUTOCONFIG
2771 #define LWIP_IPV6_AUTOCONFIG            (LWIP_IPV6)
2772 #endif
2773
2774 /**
2775  * LWIP_IPV6_DUP_DETECT_ATTEMPTS: Number of duplicate address detection attempts.
2776  */
2777 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
2778 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS   1
2779 #endif
2780
2781 /**
2782  * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration.
2783  */
2784 #ifndef LWIP_IPV6_DHCP6
2785 #define LWIP_IPV6_DHCP6                 0
2786 #endif
2787
2788 /*
2789    ---------------------------------------
2790    ---------- Hook options ---------------
2791    ---------------------------------------
2792 */
2793
2794 /* Hooks are undefined by default, define them to a function if you need them. */
2795
2796 /**
2797  * LWIP_HOOK_IP4_INPUT(pbuf, input_netif):
2798  * - called from ip_input() (IPv4)
2799  * - pbuf: received struct pbuf passed to ip_input()
2800  * - input_netif: struct netif on which the packet has been received
2801  * Return values:
2802  * - 0: Hook has not consumed the packet, packet is processed as normal
2803  * - != 0: Hook has consumed the packet.
2804  * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
2805  * (i.e. free it when done).
2806  */
2807
2808 /**
2809  * LWIP_HOOK_IP4_ROUTE(dest):
2810  * - called from ip_route() (IPv4)
2811  * - dest: destination IPv4 address
2812  * Returns the destination netif or NULL if no destination netif is found. In
2813  * that case, ip_route() continues as normal.
2814  */
2815
2816 /**
2817  * LWIP_HOOK_IP4_ROUTE_SRC(dest, src):
2818  * - source-based routing for IPv4 (see LWIP_HOOK_IP4_ROUTE(), src may be NULL)
2819  */
2820
2821 /**
2822  * LWIP_HOOK_ETHARP_GET_GW(netif, dest):
2823  * - called from etharp_output() (IPv4)
2824  * - netif: the netif used for sending
2825  * - dest: the destination IPv4 address
2826  * Returns the IPv4 address of the gateway to handle the specified destination
2827  * IPv4 address. If NULL is returned, the netif's default gateway is used.
2828  * The returned address MUST be reachable on the specified netif!
2829  * This function is meant to implement advanced IPv4 routing together with
2830  * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is
2831  * not part of lwIP but can e.g. be hidden in the netif's state argument.
2832 */
2833
2834 /**
2835  * LWIP_HOOK_IP6_INPUT(pbuf, input_netif):
2836  * - called from ip6_input() (IPv6)
2837  * - pbuf: received struct pbuf passed to ip6_input()
2838  * - input_netif: struct netif on which the packet has been received
2839  * Return values:
2840  * - 0: Hook has not consumed the packet, packet is processed as normal
2841  * - != 0: Hook has consumed the packet.
2842  * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
2843  * (i.e. free it when done).
2844  */
2845
2846 /**
2847  * LWIP_HOOK_IP6_ROUTE(src, dest):
2848  * - called from ip6_route() (IPv6)
2849  * - src: sourc IPv6 address
2850  * - dest: destination IPv6 address
2851  * Returns the destination netif or NULL if no destination netif is found. In
2852  * that case, ip6_route() continues as normal.
2853  */
2854
2855 /**
2856  * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr):
2857  * - called from ethernet_input() if VLAN support is enabled
2858  * - netif: struct netif on which the packet has been received
2859  * - eth_hdr: struct eth_hdr of the packet
2860  * - vlan_hdr: struct eth_vlan_hdr of the packet
2861  * Return values:
2862  * - 0: Packet must be dropped.
2863  * - != 0: Packet must be accepted.
2864  */
2865
2866 /**
2867  * LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr):
2868  * - called from etharp_raw() and etharp_send_ip() if VLAN support is enabled
2869  * - netif: struct netif that the packet will be sent through
2870  * - eth_hdr: struct eth_hdr of the packet
2871  * - vlan_hdr: struct eth_vlan_hdr of the packet
2872  * Return values:
2873  * - 0: Packet shall not contain VLAN header.
2874  * - != 0: Packet shall contain VLAN header.
2875  * Hook can be used to set prio_vid field of vlan_hdr.
2876  */
2877
2878 /**
2879  * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type):
2880  * - called from memp_free() when a memp pool was empty and an item is now available
2881  */
2882
2883 /*
2884    ---------------------------------------
2885    ---------- Debugging options ----------
2886    ---------------------------------------
2887 */
2888 /**
2889  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
2890  * compared against this value. If it is smaller, then debugging
2891  * messages are written.
2892  */
2893 #ifndef LWIP_DBG_MIN_LEVEL
2894 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
2895 #endif
2896
2897 /**
2898  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
2899  * debug messages of certain types.
2900  */
2901 #ifndef LWIP_DBG_TYPES_ON
2902 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
2903 #endif
2904
2905 /**
2906  * ETHARP_DEBUG: Enable debugging in etharp.c.
2907  */
2908 #ifndef ETHARP_DEBUG
2909 #define ETHARP_DEBUG                    LWIP_DBG_OFF
2910 #endif
2911
2912 /**
2913  * NETIF_DEBUG: Enable debugging in netif.c.
2914  */
2915 #ifndef NETIF_DEBUG
2916 #define NETIF_DEBUG                     LWIP_DBG_OFF
2917 #endif
2918
2919 /**
2920  * PBUF_DEBUG: Enable debugging in pbuf.c.
2921  */
2922 #ifndef PBUF_DEBUG
2923 #define PBUF_DEBUG                      LWIP_DBG_OFF
2924 #endif
2925
2926 /**
2927  * API_LIB_DEBUG: Enable debugging in api_lib.c.
2928  */
2929 #ifndef API_LIB_DEBUG
2930 #define API_LIB_DEBUG                   LWIP_DBG_OFF
2931 #endif
2932
2933 /**
2934  * API_MSG_DEBUG: Enable debugging in api_msg.c.
2935  */
2936 #ifndef API_MSG_DEBUG
2937 #define API_MSG_DEBUG                   LWIP_DBG_OFF
2938 #endif
2939
2940 /**
2941  * SOCKETS_DEBUG: Enable debugging in sockets.c.
2942  */
2943 #ifndef SOCKETS_DEBUG
2944 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
2945 #endif
2946
2947 /**
2948  * ICMP_DEBUG: Enable debugging in icmp.c.
2949  */
2950 #ifndef ICMP_DEBUG
2951 #define ICMP_DEBUG                      LWIP_DBG_OFF
2952 #endif
2953
2954 /**
2955  * IGMP_DEBUG: Enable debugging in igmp.c.
2956  */
2957 #ifndef IGMP_DEBUG
2958 #define IGMP_DEBUG                      LWIP_DBG_OFF
2959 #endif
2960
2961 /**
2962  * INET_DEBUG: Enable debugging in inet.c.
2963  */
2964 #ifndef INET_DEBUG
2965 #define INET_DEBUG                      LWIP_DBG_OFF
2966 #endif
2967
2968 /**
2969  * IP_DEBUG: Enable debugging for IP.
2970  */
2971 #ifndef IP_DEBUG
2972 #define IP_DEBUG                        LWIP_DBG_OFF
2973 #endif
2974
2975 /**
2976  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
2977  */
2978 #ifndef IP_REASS_DEBUG
2979 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
2980 #endif
2981
2982 /**
2983  * RAW_DEBUG: Enable debugging in raw.c.
2984  */
2985 #ifndef RAW_DEBUG
2986 #define RAW_DEBUG                       LWIP_DBG_OFF
2987 #endif
2988
2989 /**
2990  * MEM_DEBUG: Enable debugging in mem.c.
2991  */
2992 #ifndef MEM_DEBUG
2993 #define MEM_DEBUG                       LWIP_DBG_OFF
2994 #endif
2995
2996 /**
2997  * MEMP_DEBUG: Enable debugging in memp.c.
2998  */
2999 #ifndef MEMP_DEBUG
3000 #define MEMP_DEBUG                      LWIP_DBG_OFF
3001 #endif
3002
3003 /**
3004  * SYS_DEBUG: Enable debugging in sys.c.
3005  */
3006 #ifndef SYS_DEBUG
3007 #define SYS_DEBUG                       LWIP_DBG_OFF
3008 #endif
3009
3010 /**
3011  * TIMERS_DEBUG: Enable debugging in timers.c.
3012  */
3013 #ifndef TIMERS_DEBUG
3014 #define TIMERS_DEBUG                    LWIP_DBG_OFF
3015 #endif
3016
3017 /**
3018  * TCP_DEBUG: Enable debugging for TCP.
3019  */
3020 #ifndef TCP_DEBUG
3021 #define TCP_DEBUG                       LWIP_DBG_OFF
3022 #endif
3023
3024 /**
3025  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
3026  */
3027 #ifndef TCP_INPUT_DEBUG
3028 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
3029 #endif
3030
3031 /**
3032  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
3033  */
3034 #ifndef TCP_FR_DEBUG
3035 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
3036 #endif
3037
3038 /**
3039  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
3040  * timeout.
3041  */
3042 #ifndef TCP_RTO_DEBUG
3043 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
3044 #endif
3045
3046 /**
3047  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
3048  */
3049 #ifndef TCP_CWND_DEBUG
3050 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
3051 #endif
3052
3053 /**
3054  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
3055  */
3056 #ifndef TCP_WND_DEBUG
3057 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
3058 #endif
3059
3060 /**
3061  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
3062  */
3063 #ifndef TCP_OUTPUT_DEBUG
3064 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
3065 #endif
3066
3067 /**
3068  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
3069  */
3070 #ifndef TCP_RST_DEBUG
3071 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
3072 #endif
3073
3074 /**
3075  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
3076  */
3077 #ifndef TCP_QLEN_DEBUG
3078 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
3079 #endif
3080
3081 /**
3082  * UDP_DEBUG: Enable debugging in UDP.
3083  */
3084 #ifndef UDP_DEBUG
3085 #define UDP_DEBUG                       LWIP_DBG_OFF
3086 #endif
3087
3088 /**
3089  * TCPIP_DEBUG: Enable debugging in tcpip.c.
3090  */
3091 #ifndef TCPIP_DEBUG
3092 #define TCPIP_DEBUG                     LWIP_DBG_OFF
3093 #endif
3094
3095 /**
3096  * PPP_DEBUG: Enable debugging for PPP.
3097  */
3098 #ifndef PPP_DEBUG
3099 #define PPP_DEBUG                       LWIP_DBG_OFF
3100 #endif
3101
3102 /**
3103  * SLIP_DEBUG: Enable debugging in slipif.c.
3104  */
3105 #ifndef SLIP_DEBUG
3106 #define SLIP_DEBUG                      LWIP_DBG_OFF
3107 #endif
3108
3109 /**
3110  * DHCP_DEBUG: Enable debugging in dhcp.c.
3111  */
3112 #ifndef DHCP_DEBUG
3113 #define DHCP_DEBUG                      LWIP_DBG_OFF
3114 #endif
3115
3116 /**
3117  * AUTOIP_DEBUG: Enable debugging in autoip.c.
3118  */
3119 #ifndef AUTOIP_DEBUG
3120 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
3121 #endif
3122
3123 /**
3124  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
3125  */
3126 #ifndef SNMP_MSG_DEBUG
3127 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
3128 #endif
3129
3130 /**
3131  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
3132  */
3133 #ifndef SNMP_MIB_DEBUG
3134 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
3135 #endif
3136
3137 /**
3138  * DNS_DEBUG: Enable debugging for DNS.
3139  */
3140 #ifndef DNS_DEBUG
3141 #define DNS_DEBUG                       LWIP_DBG_OFF
3142 #endif
3143
3144 /**
3145  * IP6_DEBUG: Enable debugging for IPv6.
3146  */
3147 #ifndef IP6_DEBUG
3148 #define IP6_DEBUG                       LWIP_DBG_OFF
3149 #endif
3150
3151 /*
3152    --------------------------------------------------
3153    ---------- Performance tracking options ----------
3154    --------------------------------------------------
3155 */
3156 /**
3157  * LWIP_PERF: Enable performance testing for lwIP
3158  * (if enabled, arch/perf.h is included)
3159  */
3160 #ifndef LWIP_PERF
3161 #define LWIP_PERF                       0
3162 #endif
3163
3164 #endif /* LWIP_HDR_OPT_H */