]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/blob - src/include/lwip/opt.h
Implemented limiting data on ooseq queue (task #9989) (define TCP_OOSEQ_MAX_BYTES...
[pes-rpp/rpp-lwip.git] / 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_OPT_H__
39 #define __LWIP_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 dont 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    ------------------------------------
97    ---------- Memory options ----------
98    ------------------------------------
99 */
100 /**
101  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
102  * instead of the lwip internal allocator. Can save code size if you
103  * already use it.
104  */
105 #ifndef MEM_LIBC_MALLOC
106 #define MEM_LIBC_MALLOC                 0
107 #endif
108
109 /**
110 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
111 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
112 * speed and usage from interrupts!
113 */
114 #ifndef MEMP_MEM_MALLOC
115 #define MEMP_MEM_MALLOC                 0
116 #endif
117
118 /**
119  * MEM_ALIGNMENT: should be set to the alignment of the CPU
120  *    4 byte alignment -> #define MEM_ALIGNMENT 4
121  *    2 byte alignment -> #define MEM_ALIGNMENT 2
122  */
123 #ifndef MEM_ALIGNMENT
124 #define MEM_ALIGNMENT                   1
125 #endif
126
127 /**
128  * MEM_SIZE: the size of the heap memory. If the application will send
129  * a lot of data that needs to be copied, this should be set high.
130  */
131 #ifndef MEM_SIZE
132 #define MEM_SIZE                        1600
133 #endif
134
135 /**
136  * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array.
137  * This can be used to individually change the location of each pool.
138  * Default is one big array for all pools
139  */
140 #ifndef MEMP_SEPARATE_POOLS
141 #define MEMP_SEPARATE_POOLS             0
142 #endif
143
144 /**
145  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
146  * amount of bytes before and after each memp element in every pool and fills
147  * it with a prominent default value.
148  *    MEMP_OVERFLOW_CHECK == 0 no checking
149  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
150  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
151  *      memp_malloc() or memp_free() is called (useful but slow!)
152  */
153 #ifndef MEMP_OVERFLOW_CHECK
154 #define MEMP_OVERFLOW_CHECK             0
155 #endif
156
157 /**
158  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
159  * sure that there are no cycles in the linked lists.
160  */
161 #ifndef MEMP_SANITY_CHECK
162 #define MEMP_SANITY_CHECK               0
163 #endif
164
165 /**
166  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
167  * of memory pools of various sizes. When mem_malloc is called, an element of
168  * the smallest pool that can provide the length needed is returned.
169  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
170  */
171 #ifndef MEM_USE_POOLS
172 #define MEM_USE_POOLS                   0
173 #endif
174
175 /**
176  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
177  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
178  * reliable. */
179 #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
180 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
181 #endif
182
183 /**
184  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
185  * that defines additional pools beyond the "standard" ones required
186  * by lwIP. If you set this to 1, you must have lwippools.h in your 
187  * inlude path somewhere. 
188  */
189 #ifndef MEMP_USE_CUSTOM_POOLS
190 #define MEMP_USE_CUSTOM_POOLS           0
191 #endif
192
193 /**
194  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
195  * interrupt context (or another context that doesn't allow waiting for a
196  * semaphore).
197  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
198  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
199  * with each loop so that mem_free can run.
200  *
201  * ATTENTION: As you can see from the above description, this leads to dis-/
202  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
203  * can need longer.
204  *
205  * If you don't want that, at least for NO_SYS=0, you can still use the following
206  * functions to enqueue a deallocation call which then runs in the tcpip_thread
207  * context:
208  * - pbuf_free_callback(p);
209  * - mem_free_callback(m);
210  */
211 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
212 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
213 #endif
214
215 /*
216    ------------------------------------------------
217    ---------- Internal Memory Pool Sizes ----------
218    ------------------------------------------------
219 */
220 /**
221  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
222  * If the application sends a lot of data out of ROM (or other static memory),
223  * this should be set high.
224  */
225 #ifndef MEMP_NUM_PBUF
226 #define MEMP_NUM_PBUF                   16
227 #endif
228
229 /**
230  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
231  * (requires the LWIP_RAW option)
232  */
233 #ifndef MEMP_NUM_RAW_PCB
234 #define MEMP_NUM_RAW_PCB                4
235 #endif
236
237 /**
238  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
239  * per active UDP "connection".
240  * (requires the LWIP_UDP option)
241  */
242 #ifndef MEMP_NUM_UDP_PCB
243 #define MEMP_NUM_UDP_PCB                4
244 #endif
245
246 /**
247  * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
248  * (requires the LWIP_TCP option)
249  */
250 #ifndef MEMP_NUM_TCP_PCB
251 #define MEMP_NUM_TCP_PCB                5
252 #endif
253
254 /**
255  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
256  * (requires the LWIP_TCP option)
257  */
258 #ifndef MEMP_NUM_TCP_PCB_LISTEN
259 #define MEMP_NUM_TCP_PCB_LISTEN         8
260 #endif
261
262 /**
263  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
264  * (requires the LWIP_TCP option)
265  */
266 #ifndef MEMP_NUM_TCP_SEG
267 #define MEMP_NUM_TCP_SEG                16
268 #endif
269
270 /**
271  * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
272  * reassembly (whole packets, not fragments!)
273  */
274 #ifndef MEMP_NUM_REASSDATA
275 #define MEMP_NUM_REASSDATA              5
276 #endif
277
278 /**
279  * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
280  * (fragments, not whole packets!).
281  * This is only used with IP_FRAG_USES_STATIC_BUF==0 and
282  * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs
283  * where the packet is not yet sent when netif->output returns.
284  */
285 #ifndef MEMP_NUM_FRAG_PBUF
286 #define MEMP_NUM_FRAG_PBUF              15
287 #endif
288
289 /**
290  * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
291  * packets (pbufs) that are waiting for an ARP request (to resolve
292  * their destination address) to finish.
293  * (requires the ARP_QUEUEING option)
294  */
295 #ifndef MEMP_NUM_ARP_QUEUE
296 #define MEMP_NUM_ARP_QUEUE              30
297 #endif
298
299 /**
300  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
301  * can be members et the same time (one per netif - allsystems group -, plus one
302  * per netif membership).
303  * (requires the LWIP_IGMP option)
304  */
305 #ifndef MEMP_NUM_IGMP_GROUP
306 #define MEMP_NUM_IGMP_GROUP             8
307 #endif
308
309 /**
310  * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
311  * (requires NO_SYS==0)
312  */
313 #ifndef MEMP_NUM_SYS_TIMEOUT
314 #define MEMP_NUM_SYS_TIMEOUT            3
315 #endif
316
317 /**
318  * MEMP_NUM_NETBUF: the number of struct netbufs.
319  * (only needed if you use the sequential API, like api_lib.c)
320  */
321 #ifndef MEMP_NUM_NETBUF
322 #define MEMP_NUM_NETBUF                 2
323 #endif
324
325 /**
326  * MEMP_NUM_NETCONN: the number of struct netconns.
327  * (only needed if you use the sequential API, like api_lib.c)
328  */
329 #ifndef MEMP_NUM_NETCONN
330 #define MEMP_NUM_NETCONN                4
331 #endif
332
333 /**
334  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
335  * for callback/timeout API communication. 
336  * (only needed if you use tcpip.c)
337  */
338 #ifndef MEMP_NUM_TCPIP_MSG_API
339 #define MEMP_NUM_TCPIP_MSG_API          8
340 #endif
341
342 /**
343  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
344  * for incoming packets. 
345  * (only needed if you use tcpip.c)
346  */
347 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
348 #define MEMP_NUM_TCPIP_MSG_INPKT        8
349 #endif
350
351 /**
352  * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree.
353  */
354 #ifndef MEMP_NUM_SNMP_NODE
355 #define MEMP_NUM_SNMP_NODE              50
356 #endif
357
358 /**
359  * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree.
360  * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least!
361  */
362 #ifndef MEMP_NUM_SNMP_ROOTNODE
363 #define MEMP_NUM_SNMP_ROOTNODE          30
364 #endif
365
366 /**
367  * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to
368  * be changed normally) - 2 of these are used per request (1 for input,
369  * 1 for output)
370  */
371 #ifndef MEMP_NUM_SNMP_VARBIND
372 #define MEMP_NUM_SNMP_VARBIND           2
373 #endif
374
375 /**
376  * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used
377  * (does not have to be changed normally) - 3 of these are used per request
378  * (1 for the value read and 2 for OIDs - input and output)
379  */
380 #ifndef MEMP_NUM_SNMP_VALUE
381 #define MEMP_NUM_SNMP_VALUE             3
382 #endif
383
384 /**
385  * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
386  * (before freeing the corresponding memory using lwip_freeaddrinfo()).
387  */
388 #ifndef MEMP_NUM_NETDB
389 #define MEMP_NUM_NETDB                  1
390 #endif
391
392 /**
393  * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
394  * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
395  */
396 #ifndef MEMP_NUM_LOCALHOSTLIST
397 #define MEMP_NUM_LOCALHOSTLIST          1
398 #endif
399
400 /**
401  * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
402  * interfaces (only used with PPPOE_SUPPORT==1)
403  */
404 #ifndef MEMP_NUM_PPPOE_INTERFACES
405 #define MEMP_NUM_PPPOE_INTERFACES       1
406 #endif
407
408 /**
409  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 
410  */
411 #ifndef PBUF_POOL_SIZE
412 #define PBUF_POOL_SIZE                  16
413 #endif
414
415 /*
416    ---------------------------------
417    ---------- ARP options ----------
418    ---------------------------------
419 */
420 /**
421  * LWIP_ARP==1: Enable ARP functionality.
422  */
423 #ifndef LWIP_ARP
424 #define LWIP_ARP                        1
425 #endif
426
427 /**
428  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
429  */
430 #ifndef ARP_TABLE_SIZE
431 #define ARP_TABLE_SIZE                  10
432 #endif
433
434 /**
435  * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
436  * resolution. By default, only the most recent packet is queued per IP address.
437  * This is sufficient for most protocols and mainly reduces TCP connection
438  * startup time. Set this to 1 if you know your application sends more than one
439  * packet in a row to an IP address that is not in the ARP cache.
440  */
441 #ifndef ARP_QUEUEING
442 #define ARP_QUEUEING                    0
443 #endif
444
445 /**
446  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
447  * updated with the source MAC and IP addresses supplied in the packet.
448  * You may want to disable this if you do not trust LAN peers to have the
449  * correct addresses, or as a limited approach to attempt to handle
450  * spoofing. If disabled, lwIP will need to make a new ARP request if
451  * the peer is not already in the ARP table, adding a little latency.
452  * The peer *is* in the ARP table if it requested our address before.
453  * Also notice that this slows down input processing of every IP packet!
454  */
455 #ifndef ETHARP_TRUST_IP_MAC
456 #define ETHARP_TRUST_IP_MAC             0
457 #endif
458
459 /**
460  * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
461  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
462  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
463  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
464  * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan)
465  * that returns 1 to accept a packet or 0 to drop a packet.
466  */
467 #ifndef ETHARP_SUPPORT_VLAN
468 #define ETHARP_SUPPORT_VLAN             0
469 #endif
470
471 /** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP
472  * might be disabled
473  */
474 #ifndef LWIP_ETHERNET
475 #define LWIP_ETHERNET                   (LWIP_ARP || PPPOE_SUPPORT)
476 #endif
477
478 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
479  * alignment of payload after that header. Since the header is 14 bytes long,
480  * without this padding e.g. addresses in the IP header will not be aligned
481  * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
482  */
483 #ifndef ETH_PAD_SIZE
484 #define ETH_PAD_SIZE                    0
485 #endif
486
487 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
488  * entries (using etharp_add_static_entry/etharp_remove_static_entry).
489  */
490 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
491 #define ETHARP_SUPPORT_STATIC_ENTRIES   0
492 #endif
493
494
495 /*
496    --------------------------------
497    ---------- IP options ----------
498    --------------------------------
499 */
500 /**
501  * IP_FORWARD==1: Enables the ability to forward IP packets across network
502  * interfaces. If you are going to run lwIP on a device with only one network
503  * interface, define this to 0.
504  */
505 #ifndef IP_FORWARD
506 #define IP_FORWARD                      0
507 #endif
508
509 /**
510  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
511  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
512  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
513  */
514 #ifndef IP_OPTIONS_ALLOWED
515 #define IP_OPTIONS_ALLOWED              1
516 #endif
517
518 /**
519  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
520  * this option does not affect outgoing packet sizes, which can be controlled
521  * via IP_FRAG.
522  */
523 #ifndef IP_REASSEMBLY
524 #define IP_REASSEMBLY                   1
525 #endif
526
527 /**
528  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
529  * that this option does not affect incoming packet sizes, which can be
530  * controlled via IP_REASSEMBLY.
531  */
532 #ifndef IP_FRAG
533 #define IP_FRAG                         1
534 #endif
535
536 /**
537  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
538  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
539  * in this time, the whole packet is discarded.
540  */
541 #ifndef IP_REASS_MAXAGE
542 #define IP_REASS_MAXAGE                 3
543 #endif
544
545 /**
546  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
547  * Since the received pbufs are enqueued, be sure to configure
548  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
549  * packets even if the maximum amount of fragments is enqueued for reassembly!
550  */
551 #ifndef IP_REASS_MAX_PBUFS
552 #define IP_REASS_MAX_PBUFS              10
553 #endif
554
555 /**
556  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
557  * fragmentation. Otherwise pbufs are allocated and reference the original
558  * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
559  * new PBUF_RAM pbufs are used for fragments).
560  * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs!
561  */
562 #ifndef IP_FRAG_USES_STATIC_BUF
563 #define IP_FRAG_USES_STATIC_BUF         0
564 #endif
565
566 /**
567  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
568  * (requires IP_FRAG_USES_STATIC_BUF==1)
569  */
570 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
571 #define IP_FRAG_MAX_MTU                 1500
572 #endif
573
574 /**
575  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
576  */
577 #ifndef IP_DEFAULT_TTL
578 #define IP_DEFAULT_TTL                  255
579 #endif
580
581 /**
582  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
583  * filter per pcb on udp and raw send operations. To enable broadcast filter
584  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
585  */
586 #ifndef IP_SOF_BROADCAST
587 #define IP_SOF_BROADCAST                0
588 #endif
589
590 /**
591  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
592  * filter on recv operations.
593  */
594 #ifndef IP_SOF_BROADCAST_RECV
595 #define IP_SOF_BROADCAST_RECV           0
596 #endif
597
598 /**
599  * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back
600  * out on the netif where it was received. This should only be used for
601  * wireless networks.
602  * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming
603  * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags!
604  */
605 #ifndef IP_FORWARD_ALLOW_TX_ON_RX_NETIF
606 #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0
607 #endif
608
609 /**
610  * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first
611  * local TCP/UDP pcb (default==0). This can prevent creating predictable port
612  * numbers after booting a device.
613  */
614 #ifndef LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS
615 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0
616 #endif
617
618 /*
619    ----------------------------------
620    ---------- ICMP options ----------
621    ----------------------------------
622 */
623 /**
624  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
625  * Be careful, disable that make your product non-compliant to RFC1122
626  */
627 #ifndef LWIP_ICMP
628 #define LWIP_ICMP                       1
629 #endif
630
631 /**
632  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
633  */
634 #ifndef ICMP_TTL
635 #define ICMP_TTL                       (IP_DEFAULT_TTL)
636 #endif
637
638 /**
639  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
640  */
641 #ifndef LWIP_BROADCAST_PING
642 #define LWIP_BROADCAST_PING             0
643 #endif
644
645 /**
646  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
647  */
648 #ifndef LWIP_MULTICAST_PING
649 #define LWIP_MULTICAST_PING             0
650 #endif
651
652 /*
653    ---------------------------------
654    ---------- RAW options ----------
655    ---------------------------------
656 */
657 /**
658  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
659  */
660 #ifndef LWIP_RAW
661 #define LWIP_RAW                        1
662 #endif
663
664 /**
665  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
666  */
667 #ifndef RAW_TTL
668 #define RAW_TTL                        (IP_DEFAULT_TTL)
669 #endif
670
671 /*
672    ----------------------------------
673    ---------- DHCP options ----------
674    ----------------------------------
675 */
676 /**
677  * LWIP_DHCP==1: Enable DHCP module.
678  */
679 #ifndef LWIP_DHCP
680 #define LWIP_DHCP                       0
681 #endif
682
683 /**
684  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
685  */
686 #ifndef DHCP_DOES_ARP_CHECK
687 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
688 #endif
689
690 /*
691    ------------------------------------
692    ---------- AUTOIP options ----------
693    ------------------------------------
694 */
695 /**
696  * LWIP_AUTOIP==1: Enable AUTOIP module.
697  */
698 #ifndef LWIP_AUTOIP
699 #define LWIP_AUTOIP                     0
700 #endif
701
702 /**
703  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
704  * the same interface at the same time.
705  */
706 #ifndef LWIP_DHCP_AUTOIP_COOP
707 #define LWIP_DHCP_AUTOIP_COOP           0
708 #endif
709
710 /**
711  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
712  * that should be sent before falling back on AUTOIP. This can be set
713  * as low as 1 to get an AutoIP address very quickly, but you should
714  * be prepared to handle a changing IP address when DHCP overrides
715  * AutoIP.
716  */
717 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
718 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
719 #endif
720
721 /*
722    ----------------------------------
723    ---------- SNMP options ----------
724    ----------------------------------
725 */
726 /**
727  * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
728  * transport.
729  */
730 #ifndef LWIP_SNMP
731 #define LWIP_SNMP                       0
732 #endif
733
734 /**
735  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
736  * allow. At least one request buffer is required.
737  * Does not have to be changed unless external MIBs answer request asynchronously
738  */
739 #ifndef SNMP_CONCURRENT_REQUESTS
740 #define SNMP_CONCURRENT_REQUESTS        1
741 #endif
742
743 /**
744  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
745  * destination is required
746  */
747 #ifndef SNMP_TRAP_DESTINATIONS
748 #define SNMP_TRAP_DESTINATIONS          1
749 #endif
750
751 /**
752  * SNMP_PRIVATE_MIB: 
753  * When using a private MIB, you have to create a file 'private_mib.h' that contains
754  * a 'struct mib_array_node mib_private' which contains your MIB.
755  */
756 #ifndef SNMP_PRIVATE_MIB
757 #define SNMP_PRIVATE_MIB                0
758 #endif
759
760 /**
761  * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
762  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
763  * Unsafe requests are disabled by default!
764  */
765 #ifndef SNMP_SAFE_REQUESTS
766 #define SNMP_SAFE_REQUESTS              1
767 #endif
768
769 /**
770  * The maximum length of strings used. This affects the size of
771  * MEMP_SNMP_VALUE elements.
772  */
773 #ifndef SNMP_MAX_OCTET_STRING_LEN
774 #define SNMP_MAX_OCTET_STRING_LEN       127
775 #endif
776
777 /**
778  * The maximum depth of the SNMP tree.
779  * With private MIBs enabled, this depends on your MIB!
780  * This affects the size of MEMP_SNMP_VALUE elements.
781  */
782 #ifndef SNMP_MAX_TREE_DEPTH
783 #define SNMP_MAX_TREE_DEPTH             15
784 #endif
785
786 /**
787  * The size of the MEMP_SNMP_VALUE elements, normally calculated from
788  * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH.
789  */
790 #ifndef SNMP_MAX_VALUE_SIZE
791 #define SNMP_MAX_VALUE_SIZE             LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH))
792 #endif
793
794 /*
795    ----------------------------------
796    ---------- IGMP options ----------
797    ----------------------------------
798 */
799 /**
800  * LWIP_IGMP==1: Turn on IGMP module. 
801  */
802 #ifndef LWIP_IGMP
803 #define LWIP_IGMP                       0
804 #endif
805
806 /*
807    ----------------------------------
808    ---------- DNS options -----------
809    ----------------------------------
810 */
811 /**
812  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
813  * transport.
814  */
815 #ifndef LWIP_DNS
816 #define LWIP_DNS                        0
817 #endif
818
819 /** DNS maximum number of entries to maintain locally. */
820 #ifndef DNS_TABLE_SIZE
821 #define DNS_TABLE_SIZE                  4
822 #endif
823
824 /** DNS maximum host name length supported in the name table. */
825 #ifndef DNS_MAX_NAME_LENGTH
826 #define DNS_MAX_NAME_LENGTH             256
827 #endif
828
829 /** The maximum of DNS servers */
830 #ifndef DNS_MAX_SERVERS
831 #define DNS_MAX_SERVERS                 2
832 #endif
833
834 /** DNS do a name checking between the query and the response. */
835 #ifndef DNS_DOES_NAME_CHECK
836 #define DNS_DOES_NAME_CHECK             1
837 #endif
838
839 /** DNS message max. size. Default value is RFC compliant. */
840 #ifndef DNS_MSG_SIZE
841 #define DNS_MSG_SIZE                    512
842 #endif
843
844 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
845  *  you have to define
846  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
847  *  (an array of structs name/address, where address is an u32_t in network
848  *  byte order).
849  *
850  *  Instead, you can also use an external function:
851  *  #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
852  *  that returns the IP address or INADDR_NONE if not found.
853  */
854 #ifndef DNS_LOCAL_HOSTLIST
855 #define DNS_LOCAL_HOSTLIST              0
856 #endif /* DNS_LOCAL_HOSTLIST */
857
858 /** If this is turned on, the local host-list can be dynamically changed
859  *  at runtime. */
860 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
861 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
862 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
863
864 /*
865    ---------------------------------
866    ---------- UDP options ----------
867    ---------------------------------
868 */
869 /**
870  * LWIP_UDP==1: Turn on UDP.
871  */
872 #ifndef LWIP_UDP
873 #define LWIP_UDP                        1
874 #endif
875
876 /**
877  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
878  */
879 #ifndef LWIP_UDPLITE
880 #define LWIP_UDPLITE                    0
881 #endif
882
883 /**
884  * UDP_TTL: Default Time-To-Live value.
885  */
886 #ifndef UDP_TTL
887 #define UDP_TTL                         (IP_DEFAULT_TTL)
888 #endif
889
890 /**
891  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
892  */
893 #ifndef LWIP_NETBUF_RECVINFO
894 #define LWIP_NETBUF_RECVINFO            0
895 #endif
896
897 /*
898    ---------------------------------
899    ---------- TCP options ----------
900    ---------------------------------
901 */
902 /**
903  * LWIP_TCP==1: Turn on TCP.
904  */
905 #ifndef LWIP_TCP
906 #define LWIP_TCP                        1
907 #endif
908
909 /**
910  * TCP_TTL: Default Time-To-Live value.
911  */
912 #ifndef TCP_TTL
913 #define TCP_TTL                         (IP_DEFAULT_TTL)
914 #endif
915
916 /**
917  * TCP_WND: The size of a TCP window.  This must be at least 
918  * (2 * TCP_MSS) for things to work well
919  */
920 #ifndef TCP_WND
921 #define TCP_WND                         (4 * TCP_MSS)
922 #endif 
923
924 /**
925  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
926  */
927 #ifndef TCP_MAXRTX
928 #define TCP_MAXRTX                      12
929 #endif
930
931 /**
932  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
933  */
934 #ifndef TCP_SYNMAXRTX
935 #define TCP_SYNMAXRTX                   6
936 #endif
937
938 /**
939  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
940  * Define to 0 if your device is low on memory.
941  */
942 #ifndef TCP_QUEUE_OOSEQ
943 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
944 #endif
945
946 /**
947  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
948  * you might want to increase this.)
949  * For the receive side, this MSS is advertised to the remote side
950  * when opening a connection. For the transmit size, this MSS sets
951  * an upper limit on the MSS advertised by the remote host.
952  */
953 #ifndef TCP_MSS
954 #define TCP_MSS                         536
955 #endif
956
957 /**
958  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
959  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
960  * reflects the available reassembly buffer size at the remote host) and the
961  * largest size permitted by the IP layer" (RFC 1122)
962  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
963  * netif used for a connection and limits the MSS if it would be too big otherwise.
964  */
965 #ifndef TCP_CALCULATE_EFF_SEND_MSS
966 #define TCP_CALCULATE_EFF_SEND_MSS      1
967 #endif
968
969
970 /**
971  * TCP_SND_BUF: TCP sender buffer space (bytes).
972  * To achieve good performance, this should be at least 2 * TCP_MSS.
973  */
974 #ifndef TCP_SND_BUF
975 #define TCP_SND_BUF                     (2 * TCP_MSS)
976 #endif
977
978 /**
979  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
980  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
981  */
982 #ifndef TCP_SND_QUEUELEN
983 #define TCP_SND_QUEUELEN                ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
984 #endif
985
986 /**
987  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
988  * TCP_SND_BUF. It is the amount of space which must be available in the
989  * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
990  */
991 #ifndef TCP_SNDLOWAT
992 #define TCP_SNDLOWAT                    ((TCP_SND_BUF)/2)
993 #endif
994
995 /**
996  * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less
997  * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
998  * this number, select returns writable (combined with TCP_SNDLOWAT).
999  */
1000 #ifndef TCP_SNDQUEUELOWAT
1001 #define TCP_SNDQUEUELOWAT               ((TCP_SND_QUEUELEN)/2)
1002 #endif
1003
1004 /**
1005  * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb.
1006  * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0.
1007  */
1008 #ifndef TCP_OOSEQ_MAX_BYTES
1009 #define TCP_OOSEQ_MAX_BYTES             0
1010 #endif
1011
1012 /**
1013  * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb.
1014  * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==0.
1015  */
1016 #ifndef TCP_OOSEQ_MAX_PBUFS
1017 #define TCP_OOSEQ_MAX_PBUFS             0
1018 #endif
1019
1020 /**
1021  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
1022  */
1023 #ifndef TCP_LISTEN_BACKLOG
1024 #define TCP_LISTEN_BACKLOG              0
1025 #endif
1026
1027 /**
1028  * The maximum allowed backlog for TCP listen netconns.
1029  * This backlog is used unless another is explicitly specified.
1030  * 0xff is the maximum (u8_t).
1031  */
1032 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
1033 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
1034 #endif
1035
1036 /**
1037  * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
1038  * allocate ahead of time in an attempt to create shorter pbuf chains
1039  * for transmission. The meaningful range is 0 to TCP_MSS. Some
1040  * suggested values are:
1041  *
1042  * 0:         Disable oversized allocation. Each tcp_write() allocates a new
1043               pbuf (old behaviour).
1044  * 1:         Allocate size-aligned pbufs with minimal excess. Use this if your
1045  *            scatter-gather DMA requires aligned fragments.
1046  * 128:       Limit the pbuf/memory overhead to 20%.
1047  * TCP_MSS:   Try to create unfragmented TCP packets.
1048  * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
1049  */
1050 #ifndef TCP_OVERSIZE
1051 #define TCP_OVERSIZE                    TCP_MSS
1052 #endif
1053
1054 /**
1055  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
1056  */
1057 #ifndef LWIP_TCP_TIMESTAMPS
1058 #define LWIP_TCP_TIMESTAMPS             0
1059 #endif
1060
1061 /**
1062  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
1063  * explicit window update
1064  */
1065 #ifndef TCP_WND_UPDATE_THRESHOLD
1066 #define TCP_WND_UPDATE_THRESHOLD   (TCP_WND / 4)
1067 #endif
1068
1069 /**
1070  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
1071  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
1072  *         events (accept, sent, etc) that happen in the system.
1073  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
1074  *         for the event. This is the default.
1075  */
1076 #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API)
1077 #define LWIP_EVENT_API                  0
1078 #define LWIP_CALLBACK_API               1
1079 #endif
1080
1081
1082 /*
1083    ----------------------------------
1084    ---------- Pbuf options ----------
1085    ----------------------------------
1086 */
1087 /**
1088  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
1089  * link level header. The default is 14, the standard value for
1090  * Ethernet.
1091  */
1092 #ifndef PBUF_LINK_HLEN
1093 #define PBUF_LINK_HLEN                  (14 + ETH_PAD_SIZE)
1094 #endif
1095
1096 /**
1097  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
1098  * designed to accomodate single full size TCP frame in one pbuf, including
1099  * TCP_MSS, IP header, and link header.
1100  */
1101 #ifndef PBUF_POOL_BUFSIZE
1102 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
1103 #endif
1104
1105 /*
1106    ------------------------------------------------
1107    ---------- Network Interfaces options ----------
1108    ------------------------------------------------
1109 */
1110 /**
1111  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
1112  * field.
1113  */
1114 #ifndef LWIP_NETIF_HOSTNAME
1115 #define LWIP_NETIF_HOSTNAME             0
1116 #endif
1117
1118 /**
1119  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
1120  */
1121 #ifndef LWIP_NETIF_API
1122 #define LWIP_NETIF_API                  0
1123 #endif
1124
1125 /**
1126  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
1127  * changes its up/down status (i.e., due to DHCP IP acquistion)
1128  */
1129 #ifndef LWIP_NETIF_STATUS_CALLBACK
1130 #define LWIP_NETIF_STATUS_CALLBACK      0
1131 #endif
1132
1133 /**
1134  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
1135  * whenever the link changes (i.e., link down)
1136  */
1137 #ifndef LWIP_NETIF_LINK_CALLBACK
1138 #define LWIP_NETIF_LINK_CALLBACK        0
1139 #endif
1140
1141 /**
1142  * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called
1143  * when a netif has been removed
1144  */
1145 #ifndef LWIP_NETIF_REMOVE_CALLBACK
1146 #define LWIP_NETIF_REMOVE_CALLBACK      0
1147 #endif
1148
1149 /**
1150  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
1151  * indices) in struct netif. TCP and UDP can make use of this to prevent
1152  * scanning the ARP table for every sent packet. While this is faster for big
1153  * ARP tables or many concurrent connections, it might be counterproductive
1154  * if you have a tiny ARP table or if there never are concurrent connections.
1155  */
1156 #ifndef LWIP_NETIF_HWADDRHINT
1157 #define LWIP_NETIF_HWADDRHINT           0
1158 #endif
1159
1160 /**
1161  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
1162  * address equal to the netif IP address, looping them back up the stack.
1163  */
1164 #ifndef LWIP_NETIF_LOOPBACK
1165 #define LWIP_NETIF_LOOPBACK             0
1166 #endif
1167
1168 /**
1169  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
1170  * sending for each netif (0 = disabled)
1171  */
1172 #ifndef LWIP_LOOPBACK_MAX_PBUFS
1173 #define LWIP_LOOPBACK_MAX_PBUFS         0
1174 #endif
1175
1176 /**
1177  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
1178  * the system, as netifs must change how they behave depending on this setting
1179  * for the LWIP_NETIF_LOOPBACK option to work.
1180  * Setting this is needed to avoid reentering non-reentrant functions like
1181  * tcp_input().
1182  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
1183  *       multithreaded environment like tcpip.c. In this case, netif->input()
1184  *       is called directly.
1185  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
1186  *       The packets are put on a list and netif_poll() must be called in
1187  *       the main application loop.
1188  */
1189 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
1190 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
1191 #endif
1192
1193 /**
1194  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
1195  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
1196  * MACs that do not support scatter-gather.
1197  * Beware that this might involve CPU-memcpy before transmitting that would not
1198  * be needed without this flag! Use this only if you need to!
1199  *
1200  * @todo: TCP and IP-frag do not work with this, yet:
1201  */
1202 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
1203 #define LWIP_NETIF_TX_SINGLE_PBUF             0
1204 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
1205
1206 /*
1207    ------------------------------------
1208    ---------- LOOPIF options ----------
1209    ------------------------------------
1210 */
1211 /**
1212  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
1213  */
1214 #ifndef LWIP_HAVE_LOOPIF
1215 #define LWIP_HAVE_LOOPIF                0
1216 #endif
1217
1218 /*
1219    ------------------------------------
1220    ---------- SLIPIF options ----------
1221    ------------------------------------
1222 */
1223 /**
1224  * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
1225  */
1226 #ifndef LWIP_HAVE_SLIPIF
1227 #define LWIP_HAVE_SLIPIF                0
1228 #endif
1229
1230 /*
1231    ------------------------------------
1232    ---------- Thread options ----------
1233    ------------------------------------
1234 */
1235 /**
1236  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1237  */
1238 #ifndef TCPIP_THREAD_NAME
1239 #define TCPIP_THREAD_NAME              "tcpip_thread"
1240 #endif
1241
1242 /**
1243  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1244  * The stack size value itself is platform-dependent, but is passed to
1245  * sys_thread_new() when the thread is created.
1246  */
1247 #ifndef TCPIP_THREAD_STACKSIZE
1248 #define TCPIP_THREAD_STACKSIZE          0
1249 #endif
1250
1251 /**
1252  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1253  * The priority value itself is platform-dependent, but is passed to
1254  * sys_thread_new() when the thread is created.
1255  */
1256 #ifndef TCPIP_THREAD_PRIO
1257 #define TCPIP_THREAD_PRIO               1
1258 #endif
1259
1260 /**
1261  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1262  * The queue size value itself is platform-dependent, but is passed to
1263  * sys_mbox_new() when tcpip_init is called.
1264  */
1265 #ifndef TCPIP_MBOX_SIZE
1266 #define TCPIP_MBOX_SIZE                 0
1267 #endif
1268
1269 /**
1270  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1271  */
1272 #ifndef SLIPIF_THREAD_NAME
1273 #define SLIPIF_THREAD_NAME             "slipif_loop"
1274 #endif
1275
1276 /**
1277  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1278  * The stack size value itself is platform-dependent, but is passed to
1279  * sys_thread_new() when the thread is created.
1280  */
1281 #ifndef SLIPIF_THREAD_STACKSIZE
1282 #define SLIPIF_THREAD_STACKSIZE         0
1283 #endif
1284
1285 /**
1286  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1287  * The priority value itself is platform-dependent, but is passed to
1288  * sys_thread_new() when the thread is created.
1289  */
1290 #ifndef SLIPIF_THREAD_PRIO
1291 #define SLIPIF_THREAD_PRIO              1
1292 #endif
1293
1294 /**
1295  * PPP_THREAD_NAME: The name assigned to the pppInputThread.
1296  */
1297 #ifndef PPP_THREAD_NAME
1298 #define PPP_THREAD_NAME                "pppInputThread"
1299 #endif
1300
1301 /**
1302  * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread.
1303  * The stack size value itself is platform-dependent, but is passed to
1304  * sys_thread_new() when the thread is created.
1305  */
1306 #ifndef PPP_THREAD_STACKSIZE
1307 #define PPP_THREAD_STACKSIZE            0
1308 #endif
1309
1310 /**
1311  * PPP_THREAD_PRIO: The priority assigned to the pppInputThread.
1312  * The priority value itself is platform-dependent, but is passed to
1313  * sys_thread_new() when the thread is created.
1314  */
1315 #ifndef PPP_THREAD_PRIO
1316 #define PPP_THREAD_PRIO                 1
1317 #endif
1318
1319 /**
1320  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1321  */
1322 #ifndef DEFAULT_THREAD_NAME
1323 #define DEFAULT_THREAD_NAME            "lwIP"
1324 #endif
1325
1326 /**
1327  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1328  * The stack size value itself is platform-dependent, but is passed to
1329  * sys_thread_new() when the thread is created.
1330  */
1331 #ifndef DEFAULT_THREAD_STACKSIZE
1332 #define DEFAULT_THREAD_STACKSIZE        0
1333 #endif
1334
1335 /**
1336  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1337  * The priority value itself is platform-dependent, but is passed to
1338  * sys_thread_new() when the thread is created.
1339  */
1340 #ifndef DEFAULT_THREAD_PRIO
1341 #define DEFAULT_THREAD_PRIO             1
1342 #endif
1343
1344 /**
1345  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1346  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1347  * to sys_mbox_new() when the recvmbox is created.
1348  */
1349 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1350 #define DEFAULT_RAW_RECVMBOX_SIZE       0
1351 #endif
1352
1353 /**
1354  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1355  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1356  * to sys_mbox_new() when the recvmbox is created.
1357  */
1358 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1359 #define DEFAULT_UDP_RECVMBOX_SIZE       0
1360 #endif
1361
1362 /**
1363  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1364  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1365  * to sys_mbox_new() when the recvmbox is created.
1366  */
1367 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1368 #define DEFAULT_TCP_RECVMBOX_SIZE       0
1369 #endif
1370
1371 /**
1372  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1373  * The queue size value itself is platform-dependent, but is passed to
1374  * sys_mbox_new() when the acceptmbox is created.
1375  */
1376 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1377 #define DEFAULT_ACCEPTMBOX_SIZE         0
1378 #endif
1379
1380 /*
1381    ----------------------------------------------
1382    ---------- Sequential layer options ----------
1383    ----------------------------------------------
1384 */
1385 /**
1386  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
1387  * Don't use it if you're not an active lwIP project member
1388  */
1389 #ifndef LWIP_TCPIP_CORE_LOCKING
1390 #define LWIP_TCPIP_CORE_LOCKING         0
1391 #endif
1392
1393 /**
1394  * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!)
1395  * Don't use it if you're not an active lwIP project member
1396  */
1397 #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
1398 #define LWIP_TCPIP_CORE_LOCKING_INPUT   0
1399 #endif
1400
1401 /**
1402  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
1403  */
1404 #ifndef LWIP_NETCONN
1405 #define LWIP_NETCONN                    1
1406 #endif
1407
1408 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create
1409  * timers running in tcpip_thread from another thread.
1410  */
1411 #ifndef LWIP_TCPIP_TIMEOUT
1412 #define LWIP_TCPIP_TIMEOUT              1
1413 #endif
1414
1415 /*
1416    ------------------------------------
1417    ---------- Socket options ----------
1418    ------------------------------------
1419 */
1420 /**
1421  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1422  */
1423 #ifndef LWIP_SOCKET
1424 #define LWIP_SOCKET                     1
1425 #endif
1426
1427 /**
1428  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
1429  * (only used if you use sockets.c)
1430  */
1431 #ifndef LWIP_COMPAT_SOCKETS
1432 #define LWIP_COMPAT_SOCKETS             1
1433 #endif
1434
1435 /**
1436  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
1437  * Disable this option if you use a POSIX operating system that uses the same
1438  * names (read, write & close). (only used if you use sockets.c)
1439  */
1440 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1441 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
1442 #endif
1443
1444 /**
1445  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1446  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1447  * in seconds. (does not require sockets.c, and will affect tcp.c)
1448  */
1449 #ifndef LWIP_TCP_KEEPALIVE
1450 #define LWIP_TCP_KEEPALIVE              0
1451 #endif
1452
1453 /**
1454  * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
1455  * SO_SNDTIMEO processing.
1456  */
1457 #ifndef LWIP_SO_SNDTIMEO
1458 #define LWIP_SO_SNDTIMEO                0
1459 #endif
1460
1461 /**
1462  * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
1463  * SO_RCVTIMEO processing.
1464  */
1465 #ifndef LWIP_SO_RCVTIMEO
1466 #define LWIP_SO_RCVTIMEO                0
1467 #endif
1468
1469 /**
1470  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1471  */
1472 #ifndef LWIP_SO_RCVBUF
1473 #define LWIP_SO_RCVBUF                  0
1474 #endif
1475
1476 /**
1477  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
1478  */
1479 #ifndef RECV_BUFSIZE_DEFAULT
1480 #define RECV_BUFSIZE_DEFAULT            INT_MAX
1481 #endif
1482
1483 /**
1484  * SO_REUSE==1: Enable SO_REUSEADDR option.
1485  */
1486 #ifndef SO_REUSE
1487 #define SO_REUSE                        0
1488 #endif
1489
1490 /**
1491  * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
1492  * to all local matches if SO_REUSEADDR is turned on.
1493  * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
1494  */
1495 #ifndef SO_REUSE_RXTOALL
1496 #define SO_REUSE_RXTOALL                0
1497 #endif
1498
1499 /**
1500  * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of
1501  * pending data in the network buffer. This is the way windows does it. It's
1502  * the default for lwIP since it is smaller.
1503  * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next
1504  * pending datagram in bytes. This is the way linux does it. This code is only
1505  * here for compatibility.
1506  */
1507 #ifndef LWIP_FIONREAD_LINUXMODE
1508 #define LWIP_FIONREAD_LINUXMODE         0
1509 #endif
1510
1511 /*
1512    ----------------------------------------
1513    ---------- Statistics options ----------
1514    ----------------------------------------
1515 */
1516 /**
1517  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1518  */
1519 #ifndef LWIP_STATS
1520 #define LWIP_STATS                      1
1521 #endif
1522
1523 #if LWIP_STATS
1524
1525 /**
1526  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1527  */
1528 #ifndef LWIP_STATS_DISPLAY
1529 #define LWIP_STATS_DISPLAY              0
1530 #endif
1531
1532 /**
1533  * LINK_STATS==1: Enable link stats.
1534  */
1535 #ifndef LINK_STATS
1536 #define LINK_STATS                      1
1537 #endif
1538
1539 /**
1540  * ETHARP_STATS==1: Enable etharp stats.
1541  */
1542 #ifndef ETHARP_STATS
1543 #define ETHARP_STATS                    (LWIP_ARP)
1544 #endif
1545
1546 /**
1547  * IP_STATS==1: Enable IP stats.
1548  */
1549 #ifndef IP_STATS
1550 #define IP_STATS                        1
1551 #endif
1552
1553 /**
1554  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1555  * on if using either frag or reass.
1556  */
1557 #ifndef IPFRAG_STATS
1558 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
1559 #endif
1560
1561 /**
1562  * ICMP_STATS==1: Enable ICMP stats.
1563  */
1564 #ifndef ICMP_STATS
1565 #define ICMP_STATS                      1
1566 #endif
1567
1568 /**
1569  * IGMP_STATS==1: Enable IGMP stats.
1570  */
1571 #ifndef IGMP_STATS
1572 #define IGMP_STATS                      (LWIP_IGMP)
1573 #endif
1574
1575 /**
1576  * UDP_STATS==1: Enable UDP stats. Default is on if
1577  * UDP enabled, otherwise off.
1578  */
1579 #ifndef UDP_STATS
1580 #define UDP_STATS                       (LWIP_UDP)
1581 #endif
1582
1583 /**
1584  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1585  * enabled, otherwise off.
1586  */
1587 #ifndef TCP_STATS
1588 #define TCP_STATS                       (LWIP_TCP)
1589 #endif
1590
1591 /**
1592  * MEM_STATS==1: Enable mem.c stats.
1593  */
1594 #ifndef MEM_STATS
1595 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
1596 #endif
1597
1598 /**
1599  * MEMP_STATS==1: Enable memp.c pool stats.
1600  */
1601 #ifndef MEMP_STATS
1602 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
1603 #endif
1604
1605 /**
1606  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1607  */
1608 #ifndef SYS_STATS
1609 #define SYS_STATS                       (NO_SYS == 0)
1610 #endif
1611
1612 /**
1613  * IP6_STATS==1: Enable IPv6 stats.
1614  */
1615 #ifndef IP6_STATS
1616 #define IP6_STATS                       (LWIP_IPV6)
1617 #endif
1618
1619 /**
1620  * ICMP6_STATS==1: Enable ICMP for IPv6 stats.
1621  */
1622 #ifndef ICMP6_STATS
1623 #define ICMP6_STATS                     (LWIP_IPV6 && LWIP_ICMP6)
1624 #endif
1625
1626 /**
1627  * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats.
1628  */
1629 #ifndef IP6_FRAG_STATS
1630 #define IP6_FRAG_STATS                  (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS))
1631 #endif
1632
1633 /**
1634  * MLD6_STATS==1: Enable MLD for IPv6 stats.
1635  */
1636 #ifndef MLD6_STATS
1637 #define MLD6_STATS                      (LWIP_IPV6 && LWIP_IPV6_MLD)
1638 #endif
1639
1640 /**
1641  * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats.
1642  */
1643 #ifndef ND6_STATS
1644 #define ND6_STATS                       (LWIP_IPV6)
1645 #endif
1646
1647 #else
1648
1649 #define LINK_STATS                      0
1650 #define IP_STATS                        0
1651 #define IPFRAG_STATS                    0
1652 #define ICMP_STATS                      0
1653 #define IGMP_STATS                      0
1654 #define UDP_STATS                       0
1655 #define TCP_STATS                       0
1656 #define MEM_STATS                       0
1657 #define MEMP_STATS                      0
1658 #define SYS_STATS                       0
1659 #define LWIP_STATS_DISPLAY              0
1660 #define IP6_STATS                       0
1661 #define ICMP6_STATS                     0
1662 #define IP6_FRAG_STATS                  0
1663 #define MLD6_STATS                      0
1664 #define ND6_STATS                       0
1665
1666 #endif /* LWIP_STATS */
1667
1668 /*
1669    ---------------------------------
1670    ---------- PPP options ----------
1671    ---------------------------------
1672 */
1673 /**
1674  * PPP_SUPPORT==1: Enable PPP.
1675  */
1676 #ifndef PPP_SUPPORT
1677 #define PPP_SUPPORT                     0
1678 #endif
1679
1680 /**
1681  * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
1682  */
1683 #ifndef PPPOE_SUPPORT
1684 #define PPPOE_SUPPORT                   0
1685 #endif
1686
1687 /**
1688  * PPPOS_SUPPORT==1: Enable PPP Over Serial
1689  */
1690 #ifndef PPPOS_SUPPORT
1691 #define PPPOS_SUPPORT                   PPP_SUPPORT
1692 #endif
1693
1694 #if PPP_SUPPORT
1695
1696 /**
1697  * NUM_PPP: Max PPP sessions.
1698  */
1699 #ifndef NUM_PPP
1700 #define NUM_PPP                         1
1701 #endif
1702
1703 /**
1704  * PAP_SUPPORT==1: Support PAP.
1705  */
1706 #ifndef PAP_SUPPORT
1707 #define PAP_SUPPORT                     0
1708 #endif
1709
1710 /**
1711  * CHAP_SUPPORT==1: Support CHAP.
1712  */
1713 #ifndef CHAP_SUPPORT
1714 #define CHAP_SUPPORT                    0
1715 #endif
1716
1717 /**
1718  * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1719  */
1720 #ifndef MSCHAP_SUPPORT
1721 #define MSCHAP_SUPPORT                  0
1722 #endif
1723
1724 /**
1725  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1726  */
1727 #ifndef CBCP_SUPPORT
1728 #define CBCP_SUPPORT                    0
1729 #endif
1730
1731 /**
1732  * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1733  */
1734 #ifndef CCP_SUPPORT
1735 #define CCP_SUPPORT                     0
1736 #endif
1737
1738 /**
1739  * VJ_SUPPORT==1: Support VJ header compression.
1740  */
1741 #ifndef VJ_SUPPORT
1742 #define VJ_SUPPORT                      0
1743 #endif
1744
1745 /**
1746  * MD5_SUPPORT==1: Support MD5 (see also CHAP).
1747  */
1748 #ifndef MD5_SUPPORT
1749 #define MD5_SUPPORT                     0
1750 #endif
1751
1752 /*
1753  * Timeouts
1754  */
1755 #ifndef FSM_DEFTIMEOUT
1756 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
1757 #endif
1758
1759 #ifndef FSM_DEFMAXTERMREQS
1760 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
1761 #endif
1762
1763 #ifndef FSM_DEFMAXCONFREQS
1764 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
1765 #endif
1766
1767 #ifndef FSM_DEFMAXNAKLOOPS
1768 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
1769 #endif
1770
1771 #ifndef UPAP_DEFTIMEOUT
1772 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
1773 #endif
1774
1775 #ifndef UPAP_DEFREQTIME
1776 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
1777 #endif
1778
1779 #ifndef CHAP_DEFTIMEOUT
1780 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
1781 #endif
1782
1783 #ifndef CHAP_DEFTRANSMITS
1784 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
1785 #endif
1786
1787 /* Interval in seconds between keepalive echo requests, 0 to disable. */
1788 #ifndef LCP_ECHOINTERVAL
1789 #define LCP_ECHOINTERVAL                0
1790 #endif
1791
1792 /* Number of unanswered echo requests before failure. */
1793 #ifndef LCP_MAXECHOFAILS
1794 #define LCP_MAXECHOFAILS                3
1795 #endif
1796
1797 /* Max Xmit idle time (in jiffies) before resend flag char. */
1798 #ifndef PPP_MAXIDLEFLAG
1799 #define PPP_MAXIDLEFLAG                 100
1800 #endif
1801
1802 /*
1803  * Packet sizes
1804  *
1805  * Note - lcp shouldn't be allowed to negotiate stuff outside these
1806  *    limits.  See lcp.h in the pppd directory.
1807  * (XXX - these constants should simply be shared by lcp.c instead
1808  *    of living in lcp.h)
1809  */
1810 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
1811 #ifndef PPP_MAXMTU
1812 /* #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN) */
1813 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
1814 #endif
1815 #define PPP_MINMTU                      64
1816 #define PPP_MRU                         1500     /* default MRU = max length of info field */
1817 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
1818 #ifndef PPP_DEFMRU
1819 #define PPP_DEFMRU                      296             /* Try for this */
1820 #endif
1821 #define PPP_MINMRU                      128             /* No MRUs below this */
1822
1823 #ifndef MAXNAMELEN
1824 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
1825 #endif
1826 #ifndef MAXSECRETLEN
1827 #define MAXSECRETLEN                    256     /* max length of password or secret */
1828 #endif
1829
1830 #endif /* PPP_SUPPORT */
1831
1832 /*
1833    --------------------------------------
1834    ---------- Checksum options ----------
1835    --------------------------------------
1836 */
1837 /**
1838  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
1839  */
1840 #ifndef CHECKSUM_GEN_IP
1841 #define CHECKSUM_GEN_IP                 1
1842 #endif
1843  
1844 /**
1845  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
1846  */
1847 #ifndef CHECKSUM_GEN_UDP
1848 #define CHECKSUM_GEN_UDP                1
1849 #endif
1850  
1851 /**
1852  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
1853  */
1854 #ifndef CHECKSUM_GEN_TCP
1855 #define CHECKSUM_GEN_TCP                1
1856 #endif
1857  
1858 /**
1859  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
1860  */
1861 #ifndef CHECKSUM_CHECK_IP
1862 #define CHECKSUM_CHECK_IP               1
1863 #endif
1864  
1865 /**
1866  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
1867  */
1868 #ifndef CHECKSUM_CHECK_UDP
1869 #define CHECKSUM_CHECK_UDP              1
1870 #endif
1871
1872 /**
1873  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
1874  */
1875 #ifndef CHECKSUM_CHECK_TCP
1876 #define CHECKSUM_CHECK_TCP              1
1877 #endif
1878
1879 /**
1880  * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
1881  * application buffers to pbufs.
1882  */
1883 #ifndef LWIP_CHECKSUM_ON_COPY
1884 #define LWIP_CHECKSUM_ON_COPY           0
1885 #endif
1886
1887 /*
1888    ---------------------------------------
1889    ---------- IPv6 options ---------------
1890    ---------------------------------------
1891 */
1892 /**
1893  * LWIP_IPV6==1: Enable IPv6
1894  */
1895 #ifndef LWIP_IPV6
1896 #define LWIP_IPV6                       0
1897 #endif
1898
1899 /**
1900  * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
1901  */
1902 #ifndef LWIP_IPV6_NUM_ADDRESSES
1903 #define LWIP_IPV6_NUM_ADDRESSES         3
1904 #endif
1905
1906 /**
1907  * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
1908  */
1909 #ifndef LWIP_IPV6_FORWARD
1910 #define LWIP_IPV6_FORWARD               0
1911 #endif
1912
1913 /**
1914  * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
1915  */
1916 #ifndef LWIP_ICMP6
1917 #define LWIP_ICMP6                      (LWIP_IPV6)
1918 #endif
1919
1920 /**
1921  * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in
1922  * ICMPv6 error messages.
1923  */
1924 #ifndef LWIP_ICMP6_DATASIZE
1925 #define LWIP_ICMP6_DATASIZE             8
1926 #endif
1927
1928 /**
1929  * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
1930  */
1931 #ifndef LWIP_ICMP6_HL
1932 #define LWIP_ICMP6_HL                   255
1933 #endif
1934
1935 /**
1936  * LWIP_ICMP6_CHECKSUM_CHECK==1: verify checksum on ICMPv6 packets
1937  */
1938 #ifndef LWIP_ICMP6_CHECKSUM_CHECK
1939 #define LWIP_ICMP6_CHECKSUM_CHECK       1
1940 #endif
1941
1942 /**
1943  * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol.
1944  */
1945 #ifndef LWIP_IPV6_MLD
1946 #define LWIP_IPV6_MLD                   (LWIP_IPV6)
1947 #endif
1948
1949 /**
1950  * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast that can be joined.
1951  */
1952 #ifndef MEMP_NUM_MLD6_GROUP
1953 #define MEMP_NUM_MLD6_GROUP             4
1954 #endif
1955
1956 /**
1957  * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
1958  */
1959 #ifndef LWIP_IPV6_FRAG
1960 #define LWIP_IPV6_FRAG                  0
1961 #endif
1962
1963 /**
1964  * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
1965  */
1966 #ifndef LWIP_IPV6_REASS
1967 #define LWIP_IPV6_REASS                 (LWIP_IPV6)
1968 #endif
1969
1970 /**
1971  * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address
1972  * is being resolved.
1973  */
1974 #ifndef LWIP_ND6_QUEUEING
1975 #define LWIP_ND6_QUEUEING               (LWIP_IPV6)
1976 #endif
1977
1978 /**
1979  * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
1980  */
1981 #ifndef MEMP_NUM_ND6_QUEUE
1982 #define MEMP_NUM_ND6_QUEUE              20
1983 #endif
1984
1985 /**
1986  * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
1987  */
1988 #ifndef LWIP_ND6_NUM_NEIGHBORS
1989 #define LWIP_ND6_NUM_NEIGHBORS          10
1990 #endif
1991
1992 /**
1993  * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
1994  */
1995 #ifndef LWIP_ND6_NUM_DESTINATIONS
1996 #define LWIP_ND6_NUM_DESTINATIONS       10
1997 #endif
1998
1999 /**
2000  * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
2001  */
2002 #ifndef LWIP_ND6_NUM_PREFIXES
2003 #define LWIP_ND6_NUM_PREFIXES           5
2004 #endif
2005
2006 /**
2007  * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
2008  */
2009 #ifndef LWIP_ND6_NUM_ROUTERS
2010 #define LWIP_ND6_NUM_ROUTERS            3
2011 #endif
2012
2013 /**
2014  * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send
2015  * (neighbor solicit and router solicit)
2016  */
2017 #ifndef LWIP_ND6_MAX_MULTICAST_SOLICIT
2018 #define LWIP_ND6_MAX_MULTICAST_SOLICIT  3
2019 #endif
2020
2021 /**
2022  * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages
2023  * to send during neighbor reachability detection.
2024  */
2025 #ifndef LWIP_ND6_MAX_UNICAST_SOLICIT
2026 #define LWIP_ND6_MAX_UNICAST_SOLICIT    3
2027 #endif
2028
2029 /**
2030  * Unused: See ND RFC (time in milliseconds).
2031  */
2032 #ifndef LWIP_ND6_MAX_ANYCAST_DELAY_TIME
2033 #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000
2034 #endif
2035
2036 /**
2037  * Unused: See ND RFC
2038  */
2039 #ifndef LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT
2040 #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT  3
2041 #endif
2042
2043 /**
2044  * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds).
2045  * May be updated by router advertisement messages.
2046  */
2047 #ifndef LWIP_ND6_REACHABLE_TIME
2048 #define LWIP_ND6_REACHABLE_TIME         30000
2049 #endif
2050
2051 /**
2052  * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
2053  */
2054 #ifndef LWIP_ND6_RETRANS_TIMER
2055 #define LWIP_ND6_RETRANS_TIMER          1000
2056 #endif
2057
2058 /**
2059  * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation
2060  * message is sent, during neighbor reachability detection.
2061  */
2062 #ifndef LWIP_ND6_DELAY_FIRST_PROBE_TIME
2063 #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000
2064 #endif
2065
2066 /**
2067  * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update
2068  * Reachable time and retransmission timers, and netif MTU.
2069  */
2070 #ifndef LWIP_ND6_ALLOW_RA_UPDATES
2071 #define LWIP_ND6_ALLOW_RA_UPDATES       1
2072 #endif
2073
2074 /**
2075  * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during
2076  * network startup.
2077  */
2078 #ifndef LWIP_IPV6_SEND_ROUTER_SOLICIT
2079 #define LWIP_IPV6_SEND_ROUTER_SOLICIT   1
2080 #endif
2081
2082 /**
2083  * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery
2084  * with reachability hints for connected destinations. This helps avoid sending
2085  * unicast neighbor solicitation messages.
2086  */
2087 #ifndef LWIP_ND6_TCP_REACHABILITY_HINTS
2088 #define LWIP_ND6_TCP_REACHABILITY_HINTS 1
2089 #endif
2090
2091 /**
2092  * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
2093  */
2094 #ifndef LWIP_IPV6_AUTOCONFIG
2095 #define LWIP_IPV6_AUTOCONFIG            (LWIP_IPV6)
2096 #endif
2097
2098 /**
2099  * LWIP_IPV6_DUP_DETECT_ATTEMPTS: Number of duplicate address detection attempts.
2100  */
2101 #ifndef LWIP_IPV6_DUP_DETECT_ATTEMPTS
2102 #define LWIP_IPV6_DUP_DETECT_ATTEMPTS   1
2103 #endif
2104
2105 /**
2106  * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration.
2107  */
2108 #ifndef LWIP_IPV6_DHCP6
2109 #define LWIP_IPV6_DHCP6                 0
2110 #endif
2111
2112 /*
2113    ---------------------------------------
2114    ---------- Hook options ---------------
2115    ---------------------------------------
2116 */
2117
2118 /* Hooks are undefined by default, define them to a function if you need them. */
2119
2120 /**
2121  * LWIP_HOOK_IP4_INPUT(pbuf, input_netif):
2122  * - called from ip_input() (IPv4)
2123  * - pbuf: received struct pbuf passed to ip_input()
2124  * - input_netif: struct netif on which the packet has been received
2125  * Return values:
2126  * - 0: Hook has not consumed the packet, packet is processed as normal
2127  * - != 0: Hook has consumed the packet.
2128  * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
2129  * (i.e. free it when done).
2130  */
2131
2132 /**
2133  * LWIP_HOOK_IP4_ROUTE(dest):
2134  * - called from ip_route() (IPv4)
2135  * - dest: destination IPv4 address
2136  * Returns the destination netif or NULL if no destination netif is found. In
2137  * that case, ip_route() continues as normal.
2138  */
2139
2140 /*
2141    ---------------------------------------
2142    ---------- Debugging options ----------
2143    ---------------------------------------
2144 */
2145 /**
2146  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
2147  * compared against this value. If it is smaller, then debugging
2148  * messages are written.
2149  */
2150 #ifndef LWIP_DBG_MIN_LEVEL
2151 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
2152 #endif
2153
2154 /**
2155  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
2156  * debug messages of certain types.
2157  */
2158 #ifndef LWIP_DBG_TYPES_ON
2159 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
2160 #endif
2161
2162 /**
2163  * ETHARP_DEBUG: Enable debugging in etharp.c.
2164  */
2165 #ifndef ETHARP_DEBUG
2166 #define ETHARP_DEBUG                    LWIP_DBG_OFF
2167 #endif
2168
2169 /**
2170  * NETIF_DEBUG: Enable debugging in netif.c.
2171  */
2172 #ifndef NETIF_DEBUG
2173 #define NETIF_DEBUG                     LWIP_DBG_OFF
2174 #endif
2175
2176 /**
2177  * PBUF_DEBUG: Enable debugging in pbuf.c.
2178  */
2179 #ifndef PBUF_DEBUG
2180 #define PBUF_DEBUG                      LWIP_DBG_OFF
2181 #endif
2182
2183 /**
2184  * API_LIB_DEBUG: Enable debugging in api_lib.c.
2185  */
2186 #ifndef API_LIB_DEBUG
2187 #define API_LIB_DEBUG                   LWIP_DBG_OFF
2188 #endif
2189
2190 /**
2191  * API_MSG_DEBUG: Enable debugging in api_msg.c.
2192  */
2193 #ifndef API_MSG_DEBUG
2194 #define API_MSG_DEBUG                   LWIP_DBG_OFF
2195 #endif
2196
2197 /**
2198  * SOCKETS_DEBUG: Enable debugging in sockets.c.
2199  */
2200 #ifndef SOCKETS_DEBUG
2201 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
2202 #endif
2203
2204 /**
2205  * ICMP_DEBUG: Enable debugging in icmp.c.
2206  */
2207 #ifndef ICMP_DEBUG
2208 #define ICMP_DEBUG                      LWIP_DBG_OFF
2209 #endif
2210
2211 /**
2212  * IGMP_DEBUG: Enable debugging in igmp.c.
2213  */
2214 #ifndef IGMP_DEBUG
2215 #define IGMP_DEBUG                      LWIP_DBG_OFF
2216 #endif
2217
2218 /**
2219  * INET_DEBUG: Enable debugging in inet.c.
2220  */
2221 #ifndef INET_DEBUG
2222 #define INET_DEBUG                      LWIP_DBG_OFF
2223 #endif
2224
2225 /**
2226  * IP_DEBUG: Enable debugging for IP.
2227  */
2228 #ifndef IP_DEBUG
2229 #define IP_DEBUG                        LWIP_DBG_OFF
2230 #endif
2231
2232 /**
2233  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
2234  */
2235 #ifndef IP_REASS_DEBUG
2236 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
2237 #endif
2238
2239 /**
2240  * RAW_DEBUG: Enable debugging in raw.c.
2241  */
2242 #ifndef RAW_DEBUG
2243 #define RAW_DEBUG                       LWIP_DBG_OFF
2244 #endif
2245
2246 /**
2247  * MEM_DEBUG: Enable debugging in mem.c.
2248  */
2249 #ifndef MEM_DEBUG
2250 #define MEM_DEBUG                       LWIP_DBG_OFF
2251 #endif
2252
2253 /**
2254  * MEMP_DEBUG: Enable debugging in memp.c.
2255  */
2256 #ifndef MEMP_DEBUG
2257 #define MEMP_DEBUG                      LWIP_DBG_OFF
2258 #endif
2259
2260 /**
2261  * SYS_DEBUG: Enable debugging in sys.c.
2262  */
2263 #ifndef SYS_DEBUG
2264 #define SYS_DEBUG                       LWIP_DBG_OFF
2265 #endif
2266
2267 /**
2268  * TIMERS_DEBUG: Enable debugging in timers.c.
2269  */
2270 #ifndef TIMERS_DEBUG
2271 #define TIMERS_DEBUG                    LWIP_DBG_OFF
2272 #endif
2273
2274 /**
2275  * TCP_DEBUG: Enable debugging for TCP.
2276  */
2277 #ifndef TCP_DEBUG
2278 #define TCP_DEBUG                       LWIP_DBG_OFF
2279 #endif
2280
2281 /**
2282  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
2283  */
2284 #ifndef TCP_INPUT_DEBUG
2285 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
2286 #endif
2287
2288 /**
2289  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
2290  */
2291 #ifndef TCP_FR_DEBUG
2292 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
2293 #endif
2294
2295 /**
2296  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
2297  * timeout.
2298  */
2299 #ifndef TCP_RTO_DEBUG
2300 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
2301 #endif
2302
2303 /**
2304  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
2305  */
2306 #ifndef TCP_CWND_DEBUG
2307 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
2308 #endif
2309
2310 /**
2311  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
2312  */
2313 #ifndef TCP_WND_DEBUG
2314 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
2315 #endif
2316
2317 /**
2318  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
2319  */
2320 #ifndef TCP_OUTPUT_DEBUG
2321 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
2322 #endif
2323
2324 /**
2325  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
2326  */
2327 #ifndef TCP_RST_DEBUG
2328 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
2329 #endif
2330
2331 /**
2332  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
2333  */
2334 #ifndef TCP_QLEN_DEBUG
2335 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
2336 #endif
2337
2338 /**
2339  * UDP_DEBUG: Enable debugging in UDP.
2340  */
2341 #ifndef UDP_DEBUG
2342 #define UDP_DEBUG                       LWIP_DBG_OFF
2343 #endif
2344
2345 /**
2346  * TCPIP_DEBUG: Enable debugging in tcpip.c.
2347  */
2348 #ifndef TCPIP_DEBUG
2349 #define TCPIP_DEBUG                     LWIP_DBG_OFF
2350 #endif
2351
2352 /**
2353  * PPP_DEBUG: Enable debugging for PPP.
2354  */
2355 #ifndef PPP_DEBUG
2356 #define PPP_DEBUG                       LWIP_DBG_OFF
2357 #endif
2358
2359 /**
2360  * SLIP_DEBUG: Enable debugging in slipif.c.
2361  */
2362 #ifndef SLIP_DEBUG
2363 #define SLIP_DEBUG                      LWIP_DBG_OFF
2364 #endif
2365
2366 /**
2367  * DHCP_DEBUG: Enable debugging in dhcp.c.
2368  */
2369 #ifndef DHCP_DEBUG
2370 #define DHCP_DEBUG                      LWIP_DBG_OFF
2371 #endif
2372
2373 /**
2374  * AUTOIP_DEBUG: Enable debugging in autoip.c.
2375  */
2376 #ifndef AUTOIP_DEBUG
2377 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
2378 #endif
2379
2380 /**
2381  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
2382  */
2383 #ifndef SNMP_MSG_DEBUG
2384 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
2385 #endif
2386
2387 /**
2388  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
2389  */
2390 #ifndef SNMP_MIB_DEBUG
2391 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
2392 #endif
2393
2394 /**
2395  * DNS_DEBUG: Enable debugging for DNS.
2396  */
2397 #ifndef DNS_DEBUG
2398 #define DNS_DEBUG                       LWIP_DBG_OFF
2399 #endif
2400
2401 /**
2402  * IP6_DEBUG: Enable debugging for IPv6.
2403  */
2404 #ifndef IP6_DEBUG
2405 #define IP6_DEBUG                       LWIP_DBG_OFF
2406 #endif
2407
2408 #endif /* __LWIP_OPT_H__ */