vm: fix a null dereference on out-of-memory
[minix.git] / lib / liblwip / include / lwip / opt.h
blobc5e3967e81c566e54dfc88292d9702f171001eca
1 /**
2 * @file
4 * lwIP Options Configuration
5 */
7 /*
8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
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.
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.
33 * This file is part of the lwIP TCP/IP stack.
35 * Author: Adam Dunkels <adam@sics.se>
38 #ifndef __LWIP_OPT_H__
39 #define __LWIP_OPT_H__
42 * Include user defined options first. Anything not defined in these files
43 * will be set to standard values. Override anything you dont like!
45 #include "lwipopts.h"
46 #include "lwip/debug.h"
49 -----------------------------------------------
50 ---------- Platform specific locking ----------
51 -----------------------------------------------
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.
59 #ifndef SYS_LIGHTWEIGHT_PROT
60 #define SYS_LIGHTWEIGHT_PROT 0
61 #endif
63 /**
64 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
65 * use lwIP facilities.
67 #ifndef NO_SYS
68 #define NO_SYS 0
69 #endif
71 /**
72 * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1
73 * Mainly for compatibility to old versions.
75 #ifndef NO_SYS_NO_TIMERS
76 #define NO_SYS_NO_TIMERS 0
77 #endif
79 /**
80 * MEMCPY: override this if you have a faster implementation at hand than the
81 * one included in your C library
83 #ifndef MEMCPY
84 #define MEMCPY(dst,src,len) memcpy(dst,src,len)
85 #endif
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.
91 #ifndef SMEMCPY
92 #define SMEMCPY(dst,src,len) memcpy(dst,src,len)
93 #endif
96 ------------------------------------
97 ---------- Memory options ----------
98 ------------------------------------
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.
105 #ifndef MEM_LIBC_MALLOC
106 #define MEM_LIBC_MALLOC 0
107 #endif
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!
114 #ifndef MEMP_MEM_MALLOC
115 #define MEMP_MEM_MALLOC 0
116 #endif
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
123 #ifndef MEM_ALIGNMENT
124 #define MEM_ALIGNMENT 1
125 #endif
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.
131 #ifndef MEM_SIZE
132 #define MEM_SIZE 1600
133 #endif
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
140 #ifndef MEMP_SEPARATE_POOLS
141 #define MEMP_SEPARATE_POOLS 0
142 #endif
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!)
153 #ifndef MEMP_OVERFLOW_CHECK
154 #define MEMP_OVERFLOW_CHECK 0
155 #endif
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.
161 #ifndef MEMP_SANITY_CHECK
162 #define MEMP_SANITY_CHECK 0
163 #endif
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.
171 #ifndef MEM_USE_POOLS
172 #define MEM_USE_POOLS 0
173 #endif
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
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.
189 #ifndef MEMP_USE_CUSTOM_POOLS
190 #define MEMP_USE_CUSTOM_POOLS 0
191 #endif
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.
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.
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);
211 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
212 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
213 #endif
216 ------------------------------------------------
217 ---------- Internal Memory Pool Sizes ----------
218 ------------------------------------------------
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.
225 #ifndef MEMP_NUM_PBUF
226 #define MEMP_NUM_PBUF 16
227 #endif
230 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
231 * (requires the LWIP_RAW option)
233 #ifndef MEMP_NUM_RAW_PCB
234 #define MEMP_NUM_RAW_PCB 4
235 #endif
238 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
239 * per active UDP "connection".
240 * (requires the LWIP_UDP option)
242 #ifndef MEMP_NUM_UDP_PCB
243 #define MEMP_NUM_UDP_PCB 4
244 #endif
247 * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
248 * (requires the LWIP_TCP option)
250 #ifndef MEMP_NUM_TCP_PCB
251 #define MEMP_NUM_TCP_PCB 5
252 #endif
255 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
256 * (requires the LWIP_TCP option)
258 #ifndef MEMP_NUM_TCP_PCB_LISTEN
259 #define MEMP_NUM_TCP_PCB_LISTEN 8
260 #endif
263 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
264 * (requires the LWIP_TCP option)
266 #ifndef MEMP_NUM_TCP_SEG
267 #define MEMP_NUM_TCP_SEG 16
268 #endif
271 * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
272 * reassembly (whole packets, not fragments!)
274 #ifndef MEMP_NUM_REASSDATA
275 #define MEMP_NUM_REASSDATA 5
276 #endif
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.
285 #ifndef MEMP_NUM_FRAG_PBUF
286 #define MEMP_NUM_FRAG_PBUF 15
287 #endif
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)
295 #ifndef MEMP_NUM_ARP_QUEUE
296 #define MEMP_NUM_ARP_QUEUE 30
297 #endif
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)
305 #ifndef MEMP_NUM_IGMP_GROUP
306 #define MEMP_NUM_IGMP_GROUP 8
307 #endif
310 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
311 * (requires NO_SYS==0)
313 #ifndef MEMP_NUM_SYS_TIMEOUT
314 #define MEMP_NUM_SYS_TIMEOUT 3
315 #endif
318 * MEMP_NUM_NETBUF: the number of struct netbufs.
319 * (only needed if you use the sequential API, like api_lib.c)
321 #ifndef MEMP_NUM_NETBUF
322 #define MEMP_NUM_NETBUF 2
323 #endif
326 * MEMP_NUM_NETCONN: the number of struct netconns.
327 * (only needed if you use the sequential API, like api_lib.c)
329 #ifndef MEMP_NUM_NETCONN
330 #define MEMP_NUM_NETCONN 4
331 #endif
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)
338 #ifndef MEMP_NUM_TCPIP_MSG_API
339 #define MEMP_NUM_TCPIP_MSG_API 8
340 #endif
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)
347 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
348 #define MEMP_NUM_TCPIP_MSG_INPKT 8
349 #endif
352 * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree.
354 #ifndef MEMP_NUM_SNMP_NODE
355 #define MEMP_NUM_SNMP_NODE 50
356 #endif
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!
362 #ifndef MEMP_NUM_SNMP_ROOTNODE
363 #define MEMP_NUM_SNMP_ROOTNODE 30
364 #endif
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)
371 #ifndef MEMP_NUM_SNMP_VARBIND
372 #define MEMP_NUM_SNMP_VARBIND 2
373 #endif
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)
380 #ifndef MEMP_NUM_SNMP_VALUE
381 #define MEMP_NUM_SNMP_VALUE 3
382 #endif
385 * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
386 * (before freeing the corresponding memory using lwip_freeaddrinfo()).
388 #ifndef MEMP_NUM_NETDB
389 #define MEMP_NUM_NETDB 1
390 #endif
393 * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
394 * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
396 #ifndef MEMP_NUM_LOCALHOSTLIST
397 #define MEMP_NUM_LOCALHOSTLIST 1
398 #endif
401 * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
402 * interfaces (only used with PPPOE_SUPPORT==1)
404 #ifndef MEMP_NUM_PPPOE_INTERFACES
405 #define MEMP_NUM_PPPOE_INTERFACES 1
406 #endif
409 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
411 #ifndef PBUF_POOL_SIZE
412 #define PBUF_POOL_SIZE 16
413 #endif
416 ---------------------------------
417 ---------- ARP options ----------
418 ---------------------------------
421 * LWIP_ARP==1: Enable ARP functionality.
423 #ifndef LWIP_ARP
424 #define LWIP_ARP 1
425 #endif
428 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
430 #ifndef ARP_TABLE_SIZE
431 #define ARP_TABLE_SIZE 10
432 #endif
435 * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
436 * resolution.
438 #ifndef ARP_QUEUEING
439 #define ARP_QUEUEING 1
440 #endif
443 * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
444 * updated with the source MAC and IP addresses supplied in the packet.
445 * You may want to disable this if you do not trust LAN peers to have the
446 * correct addresses, or as a limited approach to attempt to handle
447 * spoofing. If disabled, lwIP will need to make a new ARP request if
448 * the peer is not already in the ARP table, adding a little latency.
449 * The peer *is* in the ARP table if it requested our address before.
450 * Also notice that this slows down input processing of every IP packet!
452 #ifndef ETHARP_TRUST_IP_MAC
453 #define ETHARP_TRUST_IP_MAC 0
454 #endif
457 * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
458 * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
459 * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
460 * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
462 #ifndef ETHARP_SUPPORT_VLAN
463 #define ETHARP_SUPPORT_VLAN 0
464 #endif
466 /** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP
467 * might be disabled
469 #ifndef LWIP_ETHERNET
470 #define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT)
471 #endif
473 /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
474 * alignment of payload after that header. Since the header is 14 bytes long,
475 * without this padding e.g. addresses in the IP header will not be aligned
476 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
478 #ifndef ETH_PAD_SIZE
479 #define ETH_PAD_SIZE 0
480 #endif
482 /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
483 * entries (using etharp_add_static_entry/etharp_remove_static_entry).
485 #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
486 #define ETHARP_SUPPORT_STATIC_ENTRIES 0
487 #endif
491 --------------------------------
492 ---------- IP options ----------
493 --------------------------------
496 * IP_FORWARD==1: Enables the ability to forward IP packets across network
497 * interfaces. If you are going to run lwIP on a device with only one network
498 * interface, define this to 0.
500 #ifndef IP_FORWARD
501 #define IP_FORWARD 0
502 #endif
505 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
506 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
507 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
509 #ifndef IP_OPTIONS_ALLOWED
510 #define IP_OPTIONS_ALLOWED 1
511 #endif
514 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
515 * this option does not affect outgoing packet sizes, which can be controlled
516 * via IP_FRAG.
518 #ifndef IP_REASSEMBLY
519 #define IP_REASSEMBLY 1
520 #endif
523 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
524 * that this option does not affect incoming packet sizes, which can be
525 * controlled via IP_REASSEMBLY.
527 #ifndef IP_FRAG
528 #define IP_FRAG 1
529 #endif
532 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
533 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
534 * in this time, the whole packet is discarded.
536 #ifndef IP_REASS_MAXAGE
537 #define IP_REASS_MAXAGE 3
538 #endif
541 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
542 * Since the received pbufs are enqueued, be sure to configure
543 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
544 * packets even if the maximum amount of fragments is enqueued for reassembly!
546 #ifndef IP_REASS_MAX_PBUFS
547 #define IP_REASS_MAX_PBUFS 10
548 #endif
551 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
552 * fragmentation. Otherwise pbufs are allocated and reference the original
553 * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
554 * new PBUF_RAM pbufs are used for fragments).
555 * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs!
557 #ifndef IP_FRAG_USES_STATIC_BUF
558 #define IP_FRAG_USES_STATIC_BUF 0
559 #endif
562 * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
563 * (requires IP_FRAG_USES_STATIC_BUF==1)
565 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
566 #define IP_FRAG_MAX_MTU 1500
567 #endif
570 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
572 #ifndef IP_DEFAULT_TTL
573 #define IP_DEFAULT_TTL 255
574 #endif
577 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
578 * filter per pcb on udp and raw send operations. To enable broadcast filter
579 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
581 #ifndef IP_SOF_BROADCAST
582 #define IP_SOF_BROADCAST 0
583 #endif
586 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
587 * filter on recv operations.
589 #ifndef IP_SOF_BROADCAST_RECV
590 #define IP_SOF_BROADCAST_RECV 0
591 #endif
594 ----------------------------------
595 ---------- ICMP options ----------
596 ----------------------------------
599 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
600 * Be careful, disable that make your product non-compliant to RFC1122
602 #ifndef LWIP_ICMP
603 #define LWIP_ICMP 1
604 #endif
607 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
609 #ifndef ICMP_TTL
610 #define ICMP_TTL (IP_DEFAULT_TTL)
611 #endif
614 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
616 #ifndef LWIP_BROADCAST_PING
617 #define LWIP_BROADCAST_PING 0
618 #endif
621 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
623 #ifndef LWIP_MULTICAST_PING
624 #define LWIP_MULTICAST_PING 0
625 #endif
628 ---------------------------------
629 ---------- RAW options ----------
630 ---------------------------------
633 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
635 #ifndef LWIP_RAW
636 #define LWIP_RAW 1
637 #endif
640 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
642 #ifndef RAW_TTL
643 #define RAW_TTL (IP_DEFAULT_TTL)
644 #endif
647 ----------------------------------
648 ---------- DHCP options ----------
649 ----------------------------------
652 * LWIP_DHCP==1: Enable DHCP module.
654 #ifndef LWIP_DHCP
655 #define LWIP_DHCP 0
656 #endif
659 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
661 #ifndef DHCP_DOES_ARP_CHECK
662 #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
663 #endif
666 ------------------------------------
667 ---------- AUTOIP options ----------
668 ------------------------------------
671 * LWIP_AUTOIP==1: Enable AUTOIP module.
673 #ifndef LWIP_AUTOIP
674 #define LWIP_AUTOIP 0
675 #endif
678 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
679 * the same interface at the same time.
681 #ifndef LWIP_DHCP_AUTOIP_COOP
682 #define LWIP_DHCP_AUTOIP_COOP 0
683 #endif
686 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
687 * that should be sent before falling back on AUTOIP. This can be set
688 * as low as 1 to get an AutoIP address very quickly, but you should
689 * be prepared to handle a changing IP address when DHCP overrides
690 * AutoIP.
692 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
693 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9
694 #endif
697 ----------------------------------
698 ---------- SNMP options ----------
699 ----------------------------------
702 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
703 * transport.
705 #ifndef LWIP_SNMP
706 #define LWIP_SNMP 0
707 #endif
710 * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
711 * allow. At least one request buffer is required.
712 * Does not have to be changed unless external MIBs answer request asynchronously
714 #ifndef SNMP_CONCURRENT_REQUESTS
715 #define SNMP_CONCURRENT_REQUESTS 1
716 #endif
719 * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
720 * destination is required
722 #ifndef SNMP_TRAP_DESTINATIONS
723 #define SNMP_TRAP_DESTINATIONS 1
724 #endif
727 * SNMP_PRIVATE_MIB:
728 * When using a private MIB, you have to create a file 'private_mib.h' that contains
729 * a 'struct mib_array_node mib_private' which contains your MIB.
731 #ifndef SNMP_PRIVATE_MIB
732 #define SNMP_PRIVATE_MIB 0
733 #endif
736 * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
737 * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
738 * Unsafe requests are disabled by default!
740 #ifndef SNMP_SAFE_REQUESTS
741 #define SNMP_SAFE_REQUESTS 1
742 #endif
745 * The maximum length of strings used. This affects the size of
746 * MEMP_SNMP_VALUE elements.
748 #ifndef SNMP_MAX_OCTET_STRING_LEN
749 #define SNMP_MAX_OCTET_STRING_LEN 127
750 #endif
753 * The maximum depth of the SNMP tree.
754 * With private MIBs enabled, this depends on your MIB!
755 * This affects the size of MEMP_SNMP_VALUE elements.
757 #ifndef SNMP_MAX_TREE_DEPTH
758 #define SNMP_MAX_TREE_DEPTH 15
759 #endif
762 * The size of the MEMP_SNMP_VALUE elements, normally calculated from
763 * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH.
765 #ifndef SNMP_MAX_VALUE_SIZE
766 #define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH))
767 #endif
770 ----------------------------------
771 ---------- IGMP options ----------
772 ----------------------------------
775 * LWIP_IGMP==1: Turn on IGMP module.
777 #ifndef LWIP_IGMP
778 #define LWIP_IGMP 0
779 #endif
782 ----------------------------------
783 ---------- DNS options -----------
784 ----------------------------------
787 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
788 * transport.
790 #ifndef LWIP_DNS
791 #define LWIP_DNS 0
792 #endif
794 /** DNS maximum number of entries to maintain locally. */
795 #ifndef DNS_TABLE_SIZE
796 #define DNS_TABLE_SIZE 4
797 #endif
799 /** DNS maximum host name length supported in the name table. */
800 #ifndef DNS_MAX_NAME_LENGTH
801 #define DNS_MAX_NAME_LENGTH 256
802 #endif
804 /** The maximum of DNS servers */
805 #ifndef DNS_MAX_SERVERS
806 #define DNS_MAX_SERVERS 2
807 #endif
809 /** DNS do a name checking between the query and the response. */
810 #ifndef DNS_DOES_NAME_CHECK
811 #define DNS_DOES_NAME_CHECK 1
812 #endif
814 /** DNS message max. size. Default value is RFC compliant. */
815 #ifndef DNS_MSG_SIZE
816 #define DNS_MSG_SIZE 512
817 #endif
819 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
820 * you have to define
821 * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
822 * (an array of structs name/address, where address is an u32_t in network
823 * byte order).
825 * Instead, you can also use an external function:
826 * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
827 * that returns the IP address or INADDR_NONE if not found.
829 #ifndef DNS_LOCAL_HOSTLIST
830 #define DNS_LOCAL_HOSTLIST 0
831 #endif /* DNS_LOCAL_HOSTLIST */
833 /** If this is turned on, the local host-list can be dynamically changed
834 * at runtime. */
835 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
836 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0
837 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
840 ---------------------------------
841 ---------- UDP options ----------
842 ---------------------------------
845 * LWIP_UDP==1: Turn on UDP.
847 #ifndef LWIP_UDP
848 #define LWIP_UDP 1
849 #endif
852 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
854 #ifndef LWIP_UDPLITE
855 #define LWIP_UDPLITE 0
856 #endif
859 * UDP_TTL: Default Time-To-Live value.
861 #ifndef UDP_TTL
862 #define UDP_TTL (IP_DEFAULT_TTL)
863 #endif
866 * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
868 #ifndef LWIP_NETBUF_RECVINFO
869 #define LWIP_NETBUF_RECVINFO 0
870 #endif
873 ---------------------------------
874 ---------- TCP options ----------
875 ---------------------------------
878 * LWIP_TCP==1: Turn on TCP.
880 #ifndef LWIP_TCP
881 #define LWIP_TCP 1
882 #endif
885 * TCP_TTL: Default Time-To-Live value.
887 #ifndef TCP_TTL
888 #define TCP_TTL (IP_DEFAULT_TTL)
889 #endif
892 * TCP_WND: The size of a TCP window. This must be at least
893 * (2 * TCP_MSS) for things to work well
895 #ifndef TCP_WND
896 #define TCP_WND (4 * TCP_MSS)
897 #endif
900 * TCP_MAXRTX: Maximum number of retransmissions of data segments.
902 #ifndef TCP_MAXRTX
903 #define TCP_MAXRTX 12
904 #endif
907 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
909 #ifndef TCP_SYNMAXRTX
910 #define TCP_SYNMAXRTX 6
911 #endif
914 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
915 * Define to 0 if your device is low on memory.
917 #ifndef TCP_QUEUE_OOSEQ
918 #define TCP_QUEUE_OOSEQ (LWIP_TCP)
919 #endif
922 * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
923 * you might want to increase this.)
924 * For the receive side, this MSS is advertised to the remote side
925 * when opening a connection. For the transmit size, this MSS sets
926 * an upper limit on the MSS advertised by the remote host.
928 #ifndef TCP_MSS
929 #define TCP_MSS 536
930 #endif
933 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
934 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
935 * reflects the available reassembly buffer size at the remote host) and the
936 * largest size permitted by the IP layer" (RFC 1122)
937 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
938 * netif used for a connection and limits the MSS if it would be too big otherwise.
940 #ifndef TCP_CALCULATE_EFF_SEND_MSS
941 #define TCP_CALCULATE_EFF_SEND_MSS 1
942 #endif
946 * TCP_SND_BUF: TCP sender buffer space (bytes).
948 #ifndef TCP_SND_BUF
949 #define TCP_SND_BUF 256
950 #endif
953 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
954 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
956 #ifndef TCP_SND_QUEUELEN
957 #define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF)/(TCP_MSS))
958 #endif
961 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
962 * TCP_SND_BUF. It is the amount of space which must be available in the
963 * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
965 #ifndef TCP_SNDLOWAT
966 #define TCP_SNDLOWAT ((TCP_SND_BUF)/2)
967 #endif
970 * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater
971 * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
972 * this number, select returns writable (combined with TCP_SNDLOWAT).
974 #ifndef TCP_SNDQUEUELOWAT
975 #define TCP_SNDQUEUELOWAT ((TCP_SND_QUEUELEN)/2)
976 #endif
979 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
981 #ifndef TCP_LISTEN_BACKLOG
982 #define TCP_LISTEN_BACKLOG 0
983 #endif
986 * The maximum allowed backlog for TCP listen netconns.
987 * This backlog is used unless another is explicitly specified.
988 * 0xff is the maximum (u8_t).
990 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
991 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff
992 #endif
995 * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
996 * allocate ahead of time in an attempt to create shorter pbuf chains
997 * for transmission. The meaningful range is 0 to TCP_MSS. Some
998 * suggested values are:
1000 * 0: Disable oversized allocation. Each tcp_write() allocates a new
1001 pbuf (old behaviour).
1002 * 1: Allocate size-aligned pbufs with minimal excess. Use this if your
1003 * scatter-gather DMA requires aligned fragments.
1004 * 128: Limit the pbuf/memory overhead to 20%.
1005 * TCP_MSS: Try to create unfragmented TCP packets.
1006 * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
1008 #ifndef TCP_OVERSIZE
1009 #define TCP_OVERSIZE TCP_MSS
1010 #endif
1013 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
1015 #ifndef LWIP_TCP_TIMESTAMPS
1016 #define LWIP_TCP_TIMESTAMPS 0
1017 #endif
1020 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
1021 * explicit window update
1023 #ifndef TCP_WND_UPDATE_THRESHOLD
1024 #define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4)
1025 #endif
1028 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
1029 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
1030 * events (accept, sent, etc) that happen in the system.
1031 * LWIP_CALLBACK_API==1: The PCB callback function is called directly
1032 * for the event.
1034 #ifndef LWIP_EVENT_API
1035 #define LWIP_EVENT_API 0
1036 #define LWIP_CALLBACK_API 1
1037 #else
1038 #define LWIP_EVENT_API 1
1039 #define LWIP_CALLBACK_API 0
1040 #endif
1044 ----------------------------------
1045 ---------- Pbuf options ----------
1046 ----------------------------------
1049 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
1050 * link level header. The default is 14, the standard value for
1051 * Ethernet.
1053 #ifndef PBUF_LINK_HLEN
1054 #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE)
1055 #endif
1058 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
1059 * designed to accomodate single full size TCP frame in one pbuf, including
1060 * TCP_MSS, IP header, and link header.
1062 #ifndef PBUF_POOL_BUFSIZE
1063 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
1064 #endif
1067 ------------------------------------------------
1068 ---------- Network Interfaces options ----------
1069 ------------------------------------------------
1072 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
1073 * field.
1075 #ifndef LWIP_NETIF_HOSTNAME
1076 #define LWIP_NETIF_HOSTNAME 0
1077 #endif
1080 * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
1082 #ifndef LWIP_NETIF_API
1083 #define LWIP_NETIF_API 0
1084 #endif
1087 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
1088 * changes its up/down status (i.e., due to DHCP IP acquistion)
1090 #ifndef LWIP_NETIF_STATUS_CALLBACK
1091 #define LWIP_NETIF_STATUS_CALLBACK 0
1092 #endif
1095 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
1096 * whenever the link changes (i.e., link down)
1098 #ifndef LWIP_NETIF_LINK_CALLBACK
1099 #define LWIP_NETIF_LINK_CALLBACK 0
1100 #endif
1103 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
1104 * indices) in struct netif. TCP and UDP can make use of this to prevent
1105 * scanning the ARP table for every sent packet. While this is faster for big
1106 * ARP tables or many concurrent connections, it might be counterproductive
1107 * if you have a tiny ARP table or if there never are concurrent connections.
1109 #ifndef LWIP_NETIF_HWADDRHINT
1110 #define LWIP_NETIF_HWADDRHINT 0
1111 #endif
1114 * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
1115 * address equal to the netif IP address, looping them back up the stack.
1117 #ifndef LWIP_NETIF_LOOPBACK
1118 #define LWIP_NETIF_LOOPBACK 0
1119 #endif
1122 * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
1123 * sending for each netif (0 = disabled)
1125 #ifndef LWIP_LOOPBACK_MAX_PBUFS
1126 #define LWIP_LOOPBACK_MAX_PBUFS 0
1127 #endif
1130 * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
1131 * the system, as netifs must change how they behave depending on this setting
1132 * for the LWIP_NETIF_LOOPBACK option to work.
1133 * Setting this is needed to avoid reentering non-reentrant functions like
1134 * tcp_input().
1135 * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
1136 * multithreaded environment like tcpip.c. In this case, netif->input()
1137 * is called directly.
1138 * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
1139 * The packets are put on a list and netif_poll() must be called in
1140 * the main application loop.
1142 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
1143 #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS)
1144 #endif
1147 * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
1148 * to be sent into one single pbuf. This is for compatibility with DMA-enabled
1149 * MACs that do not support scatter-gather.
1150 * Beware that this might involve CPU-memcpy before transmitting that would not
1151 * be needed without this flag! Use this only if you need to!
1153 * @todo: TCP and IP-frag do not work with this, yet:
1155 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
1156 #define LWIP_NETIF_TX_SINGLE_PBUF 0
1157 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
1160 ------------------------------------
1161 ---------- LOOPIF options ----------
1162 ------------------------------------
1165 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
1167 #ifndef LWIP_HAVE_LOOPIF
1168 #define LWIP_HAVE_LOOPIF 0
1169 #endif
1172 ------------------------------------
1173 ---------- SLIPIF options ----------
1174 ------------------------------------
1177 * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
1179 #ifndef LWIP_HAVE_SLIPIF
1180 #define LWIP_HAVE_SLIPIF 0
1181 #endif
1184 ------------------------------------
1185 ---------- Thread options ----------
1186 ------------------------------------
1189 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1191 #ifndef TCPIP_THREAD_NAME
1192 #define TCPIP_THREAD_NAME "tcpip_thread"
1193 #endif
1196 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1197 * The stack size value itself is platform-dependent, but is passed to
1198 * sys_thread_new() when the thread is created.
1200 #ifndef TCPIP_THREAD_STACKSIZE
1201 #define TCPIP_THREAD_STACKSIZE 0
1202 #endif
1205 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1206 * The priority value itself is platform-dependent, but is passed to
1207 * sys_thread_new() when the thread is created.
1209 #ifndef TCPIP_THREAD_PRIO
1210 #define TCPIP_THREAD_PRIO 1
1211 #endif
1214 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1215 * The queue size value itself is platform-dependent, but is passed to
1216 * sys_mbox_new() when tcpip_init is called.
1218 #ifndef TCPIP_MBOX_SIZE
1219 #define TCPIP_MBOX_SIZE 0
1220 #endif
1223 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1225 #ifndef SLIPIF_THREAD_NAME
1226 #define SLIPIF_THREAD_NAME "slipif_loop"
1227 #endif
1230 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1231 * The stack size value itself is platform-dependent, but is passed to
1232 * sys_thread_new() when the thread is created.
1234 #ifndef SLIPIF_THREAD_STACKSIZE
1235 #define SLIPIF_THREAD_STACKSIZE 0
1236 #endif
1239 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1240 * The priority value itself is platform-dependent, but is passed to
1241 * sys_thread_new() when the thread is created.
1243 #ifndef SLIPIF_THREAD_PRIO
1244 #define SLIPIF_THREAD_PRIO 1
1245 #endif
1248 * PPP_THREAD_NAME: The name assigned to the pppInputThread.
1250 #ifndef PPP_THREAD_NAME
1251 #define PPP_THREAD_NAME "pppInputThread"
1252 #endif
1255 * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread.
1256 * The stack size value itself is platform-dependent, but is passed to
1257 * sys_thread_new() when the thread is created.
1259 #ifndef PPP_THREAD_STACKSIZE
1260 #define PPP_THREAD_STACKSIZE 0
1261 #endif
1264 * PPP_THREAD_PRIO: The priority assigned to the pppInputThread.
1265 * The priority value itself is platform-dependent, but is passed to
1266 * sys_thread_new() when the thread is created.
1268 #ifndef PPP_THREAD_PRIO
1269 #define PPP_THREAD_PRIO 1
1270 #endif
1273 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1275 #ifndef DEFAULT_THREAD_NAME
1276 #define DEFAULT_THREAD_NAME "lwIP"
1277 #endif
1280 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1281 * The stack size value itself is platform-dependent, but is passed to
1282 * sys_thread_new() when the thread is created.
1284 #ifndef DEFAULT_THREAD_STACKSIZE
1285 #define DEFAULT_THREAD_STACKSIZE 0
1286 #endif
1289 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1290 * The priority value itself is platform-dependent, but is passed to
1291 * sys_thread_new() when the thread is created.
1293 #ifndef DEFAULT_THREAD_PRIO
1294 #define DEFAULT_THREAD_PRIO 1
1295 #endif
1298 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1299 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1300 * to sys_mbox_new() when the recvmbox is created.
1302 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1303 #define DEFAULT_RAW_RECVMBOX_SIZE 0
1304 #endif
1307 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1308 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1309 * to sys_mbox_new() when the recvmbox is created.
1311 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1312 #define DEFAULT_UDP_RECVMBOX_SIZE 0
1313 #endif
1316 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1317 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1318 * to sys_mbox_new() when the recvmbox is created.
1320 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1321 #define DEFAULT_TCP_RECVMBOX_SIZE 0
1322 #endif
1325 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1326 * The queue size value itself is platform-dependent, but is passed to
1327 * sys_mbox_new() when the acceptmbox is created.
1329 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1330 #define DEFAULT_ACCEPTMBOX_SIZE 0
1331 #endif
1334 ----------------------------------------------
1335 ---------- Sequential layer options ----------
1336 ----------------------------------------------
1339 * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
1340 * Don't use it if you're not an active lwIP project member
1342 #ifndef LWIP_TCPIP_CORE_LOCKING
1343 #define LWIP_TCPIP_CORE_LOCKING 0
1344 #endif
1347 * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!)
1348 * Don't use it if you're not an active lwIP project member
1350 #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
1351 #define LWIP_TCPIP_CORE_LOCKING_INPUT 0
1352 #endif
1355 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
1357 #ifndef LWIP_NETCONN
1358 #define LWIP_NETCONN 1
1359 #endif
1361 /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create
1362 * timers running in tcpip_thread from another thread.
1364 #ifndef LWIP_TCPIP_TIMEOUT
1365 #define LWIP_TCPIP_TIMEOUT 1
1366 #endif
1369 ------------------------------------
1370 ---------- Socket options ----------
1371 ------------------------------------
1374 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1376 #ifndef LWIP_SOCKET
1377 #define LWIP_SOCKET 1
1378 #endif
1381 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
1382 * (only used if you use sockets.c)
1384 #ifndef LWIP_COMPAT_SOCKETS
1385 #define LWIP_COMPAT_SOCKETS 1
1386 #endif
1389 * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
1390 * Disable this option if you use a POSIX operating system that uses the same
1391 * names (read, write & close). (only used if you use sockets.c)
1393 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1394 #define LWIP_POSIX_SOCKETS_IO_NAMES 1
1395 #endif
1398 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1399 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1400 * in seconds. (does not require sockets.c, and will affect tcp.c)
1402 #ifndef LWIP_TCP_KEEPALIVE
1403 #define LWIP_TCP_KEEPALIVE 0
1404 #endif
1407 * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
1409 #ifndef LWIP_SO_RCVTIMEO
1410 #define LWIP_SO_RCVTIMEO 0
1411 #endif
1414 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1416 #ifndef LWIP_SO_RCVBUF
1417 #define LWIP_SO_RCVBUF 0
1418 #endif
1421 * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
1423 #ifndef RECV_BUFSIZE_DEFAULT
1424 #define RECV_BUFSIZE_DEFAULT INT_MAX
1425 #endif
1428 * SO_REUSE==1: Enable SO_REUSEADDR option.
1430 #ifndef SO_REUSE
1431 #define SO_REUSE 0
1432 #endif
1435 * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
1436 * to all local matches if SO_REUSEADDR is turned on.
1437 * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
1439 #ifndef SO_REUSE_RXTOALL
1440 #define SO_REUSE_RXTOALL 0
1441 #endif
1444 ----------------------------------------
1445 ---------- Statistics options ----------
1446 ----------------------------------------
1449 * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1451 #ifndef LWIP_STATS
1452 #define LWIP_STATS 1
1453 #endif
1455 #if LWIP_STATS
1458 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1460 #ifndef LWIP_STATS_DISPLAY
1461 #define LWIP_STATS_DISPLAY 0
1462 #endif
1465 * LINK_STATS==1: Enable link stats.
1467 #ifndef LINK_STATS
1468 #define LINK_STATS 1
1469 #endif
1472 * ETHARP_STATS==1: Enable etharp stats.
1474 #ifndef ETHARP_STATS
1475 #define ETHARP_STATS (LWIP_ARP)
1476 #endif
1479 * IP_STATS==1: Enable IP stats.
1481 #ifndef IP_STATS
1482 #define IP_STATS 1
1483 #endif
1486 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1487 * on if using either frag or reass.
1489 #ifndef IPFRAG_STATS
1490 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG)
1491 #endif
1494 * ICMP_STATS==1: Enable ICMP stats.
1496 #ifndef ICMP_STATS
1497 #define ICMP_STATS 1
1498 #endif
1501 * IGMP_STATS==1: Enable IGMP stats.
1503 #ifndef IGMP_STATS
1504 #define IGMP_STATS (LWIP_IGMP)
1505 #endif
1508 * UDP_STATS==1: Enable UDP stats. Default is on if
1509 * UDP enabled, otherwise off.
1511 #ifndef UDP_STATS
1512 #define UDP_STATS (LWIP_UDP)
1513 #endif
1516 * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1517 * enabled, otherwise off.
1519 #ifndef TCP_STATS
1520 #define TCP_STATS (LWIP_TCP)
1521 #endif
1524 * MEM_STATS==1: Enable mem.c stats.
1526 #ifndef MEM_STATS
1527 #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
1528 #endif
1531 * MEMP_STATS==1: Enable memp.c pool stats.
1533 #ifndef MEMP_STATS
1534 #define MEMP_STATS (MEMP_MEM_MALLOC == 0)
1535 #endif
1538 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1540 #ifndef SYS_STATS
1541 #define SYS_STATS (NO_SYS == 0)
1542 #endif
1544 #else
1546 #define LINK_STATS 0
1547 #define IP_STATS 0
1548 #define IPFRAG_STATS 0
1549 #define ICMP_STATS 0
1550 #define IGMP_STATS 0
1551 #define UDP_STATS 0
1552 #define TCP_STATS 0
1553 #define MEM_STATS 0
1554 #define MEMP_STATS 0
1555 #define SYS_STATS 0
1556 #define LWIP_STATS_DISPLAY 0
1558 #endif /* LWIP_STATS */
1561 ---------------------------------
1562 ---------- PPP options ----------
1563 ---------------------------------
1566 * PPP_SUPPORT==1: Enable PPP.
1568 #ifndef PPP_SUPPORT
1569 #define PPP_SUPPORT 0
1570 #endif
1573 * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
1575 #ifndef PPPOE_SUPPORT
1576 #define PPPOE_SUPPORT 0
1577 #endif
1580 * PPPOS_SUPPORT==1: Enable PPP Over Serial
1582 #ifndef PPPOS_SUPPORT
1583 #define PPPOS_SUPPORT PPP_SUPPORT
1584 #endif
1586 #if PPP_SUPPORT
1589 * NUM_PPP: Max PPP sessions.
1591 #ifndef NUM_PPP
1592 #define NUM_PPP 1
1593 #endif
1596 * PAP_SUPPORT==1: Support PAP.
1598 #ifndef PAP_SUPPORT
1599 #define PAP_SUPPORT 0
1600 #endif
1603 * CHAP_SUPPORT==1: Support CHAP.
1605 #ifndef CHAP_SUPPORT
1606 #define CHAP_SUPPORT 0
1607 #endif
1610 * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1612 #ifndef MSCHAP_SUPPORT
1613 #define MSCHAP_SUPPORT 0
1614 #endif
1617 * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1619 #ifndef CBCP_SUPPORT
1620 #define CBCP_SUPPORT 0
1621 #endif
1624 * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1626 #ifndef CCP_SUPPORT
1627 #define CCP_SUPPORT 0
1628 #endif
1631 * VJ_SUPPORT==1: Support VJ header compression.
1633 #ifndef VJ_SUPPORT
1634 #define VJ_SUPPORT 0
1635 #endif
1638 * MD5_SUPPORT==1: Support MD5 (see also CHAP).
1640 #ifndef MD5_SUPPORT
1641 #define MD5_SUPPORT 0
1642 #endif
1645 * Timeouts
1647 #ifndef FSM_DEFTIMEOUT
1648 #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */
1649 #endif
1651 #ifndef FSM_DEFMAXTERMREQS
1652 #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
1653 #endif
1655 #ifndef FSM_DEFMAXCONFREQS
1656 #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
1657 #endif
1659 #ifndef FSM_DEFMAXNAKLOOPS
1660 #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
1661 #endif
1663 #ifndef UPAP_DEFTIMEOUT
1664 #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
1665 #endif
1667 #ifndef UPAP_DEFREQTIME
1668 #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
1669 #endif
1671 #ifndef CHAP_DEFTIMEOUT
1672 #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */
1673 #endif
1675 #ifndef CHAP_DEFTRANSMITS
1676 #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */
1677 #endif
1679 /* Interval in seconds between keepalive echo requests, 0 to disable. */
1680 #ifndef LCP_ECHOINTERVAL
1681 #define LCP_ECHOINTERVAL 0
1682 #endif
1684 /* Number of unanswered echo requests before failure. */
1685 #ifndef LCP_MAXECHOFAILS
1686 #define LCP_MAXECHOFAILS 3
1687 #endif
1689 /* Max Xmit idle time (in jiffies) before resend flag char. */
1690 #ifndef PPP_MAXIDLEFLAG
1691 #define PPP_MAXIDLEFLAG 100
1692 #endif
1695 * Packet sizes
1697 * Note - lcp shouldn't be allowed to negotiate stuff outside these
1698 * limits. See lcp.h in the pppd directory.
1699 * (XXX - these constants should simply be shared by lcp.c instead
1700 * of living in lcp.h)
1702 #define PPP_MTU 1500 /* Default MTU (size of Info field) */
1703 #ifndef PPP_MAXMTU
1704 /* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */
1705 #define PPP_MAXMTU 1500 /* Largest MTU we allow */
1706 #endif
1707 #define PPP_MINMTU 64
1708 #define PPP_MRU 1500 /* default MRU = max length of info field */
1709 #define PPP_MAXMRU 1500 /* Largest MRU we allow */
1710 #ifndef PPP_DEFMRU
1711 #define PPP_DEFMRU 296 /* Try for this */
1712 #endif
1713 #define PPP_MINMRU 128 /* No MRUs below this */
1715 #ifndef MAXNAMELEN
1716 #define MAXNAMELEN 256 /* max length of hostname or name for auth */
1717 #endif
1718 #ifndef MAXSECRETLEN
1719 #define MAXSECRETLEN 256 /* max length of password or secret */
1720 #endif
1722 #endif /* PPP_SUPPORT */
1725 --------------------------------------
1726 ---------- Checksum options ----------
1727 --------------------------------------
1730 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
1732 #ifndef CHECKSUM_GEN_IP
1733 #define CHECKSUM_GEN_IP 1
1734 #endif
1737 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
1739 #ifndef CHECKSUM_GEN_UDP
1740 #define CHECKSUM_GEN_UDP 1
1741 #endif
1744 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
1746 #ifndef CHECKSUM_GEN_TCP
1747 #define CHECKSUM_GEN_TCP 1
1748 #endif
1751 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
1753 #ifndef CHECKSUM_CHECK_IP
1754 #define CHECKSUM_CHECK_IP 1
1755 #endif
1758 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
1760 #ifndef CHECKSUM_CHECK_UDP
1761 #define CHECKSUM_CHECK_UDP 1
1762 #endif
1765 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
1767 #ifndef CHECKSUM_CHECK_TCP
1768 #define CHECKSUM_CHECK_TCP 1
1769 #endif
1772 * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
1773 * application buffers to pbufs.
1775 #ifndef LWIP_CHECKSUM_ON_COPY
1776 #define LWIP_CHECKSUM_ON_COPY 0
1777 #endif
1780 ---------------------------------------
1781 ---------- Debugging options ----------
1782 ---------------------------------------
1785 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
1786 * compared against this value. If it is smaller, then debugging
1787 * messages are written.
1789 #ifndef LWIP_DBG_MIN_LEVEL
1790 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
1791 #endif
1794 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1795 * debug messages of certain types.
1797 #ifndef LWIP_DBG_TYPES_ON
1798 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
1799 #endif
1802 * ETHARP_DEBUG: Enable debugging in etharp.c.
1804 #ifndef ETHARP_DEBUG
1805 #define ETHARP_DEBUG LWIP_DBG_OFF
1806 #endif
1809 * NETIF_DEBUG: Enable debugging in netif.c.
1811 #ifndef NETIF_DEBUG
1812 #define NETIF_DEBUG LWIP_DBG_OFF
1813 #endif
1816 * PBUF_DEBUG: Enable debugging in pbuf.c.
1818 #ifndef PBUF_DEBUG
1819 #define PBUF_DEBUG LWIP_DBG_OFF
1820 #endif
1823 * API_LIB_DEBUG: Enable debugging in api_lib.c.
1825 #ifndef API_LIB_DEBUG
1826 #define API_LIB_DEBUG LWIP_DBG_OFF
1827 #endif
1830 * API_MSG_DEBUG: Enable debugging in api_msg.c.
1832 #ifndef API_MSG_DEBUG
1833 #define API_MSG_DEBUG LWIP_DBG_OFF
1834 #endif
1837 * SOCKETS_DEBUG: Enable debugging in sockets.c.
1839 #ifndef SOCKETS_DEBUG
1840 #define SOCKETS_DEBUG LWIP_DBG_OFF
1841 #endif
1844 * ICMP_DEBUG: Enable debugging in icmp.c.
1846 #ifndef ICMP_DEBUG
1847 #define ICMP_DEBUG LWIP_DBG_OFF
1848 #endif
1851 * IGMP_DEBUG: Enable debugging in igmp.c.
1853 #ifndef IGMP_DEBUG
1854 #define IGMP_DEBUG LWIP_DBG_OFF
1855 #endif
1858 * INET_DEBUG: Enable debugging in inet.c.
1860 #ifndef INET_DEBUG
1861 #define INET_DEBUG LWIP_DBG_OFF
1862 #endif
1865 * IP_DEBUG: Enable debugging for IP.
1867 #ifndef IP_DEBUG
1868 #define IP_DEBUG LWIP_DBG_OFF
1869 #endif
1872 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
1874 #ifndef IP_REASS_DEBUG
1875 #define IP_REASS_DEBUG LWIP_DBG_OFF
1876 #endif
1879 * RAW_DEBUG: Enable debugging in raw.c.
1881 #ifndef RAW_DEBUG
1882 #define RAW_DEBUG LWIP_DBG_OFF
1883 #endif
1886 * MEM_DEBUG: Enable debugging in mem.c.
1888 #ifndef MEM_DEBUG
1889 #define MEM_DEBUG LWIP_DBG_OFF
1890 #endif
1893 * MEMP_DEBUG: Enable debugging in memp.c.
1895 #ifndef MEMP_DEBUG
1896 #define MEMP_DEBUG LWIP_DBG_OFF
1897 #endif
1900 * SYS_DEBUG: Enable debugging in sys.c.
1902 #ifndef SYS_DEBUG
1903 #define SYS_DEBUG LWIP_DBG_OFF
1904 #endif
1907 * TIMERS_DEBUG: Enable debugging in timers.c.
1909 #ifndef TIMERS_DEBUG
1910 #define TIMERS_DEBUG LWIP_DBG_OFF
1911 #endif
1914 * TCP_DEBUG: Enable debugging for TCP.
1916 #ifndef TCP_DEBUG
1917 #define TCP_DEBUG LWIP_DBG_OFF
1918 #endif
1921 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
1923 #ifndef TCP_INPUT_DEBUG
1924 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
1925 #endif
1928 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
1930 #ifndef TCP_FR_DEBUG
1931 #define TCP_FR_DEBUG LWIP_DBG_OFF
1932 #endif
1935 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
1936 * timeout.
1938 #ifndef TCP_RTO_DEBUG
1939 #define TCP_RTO_DEBUG LWIP_DBG_OFF
1940 #endif
1943 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
1945 #ifndef TCP_CWND_DEBUG
1946 #define TCP_CWND_DEBUG LWIP_DBG_OFF
1947 #endif
1950 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
1952 #ifndef TCP_WND_DEBUG
1953 #define TCP_WND_DEBUG LWIP_DBG_OFF
1954 #endif
1957 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
1959 #ifndef TCP_OUTPUT_DEBUG
1960 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
1961 #endif
1964 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
1966 #ifndef TCP_RST_DEBUG
1967 #define TCP_RST_DEBUG LWIP_DBG_OFF
1968 #endif
1971 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
1973 #ifndef TCP_QLEN_DEBUG
1974 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
1975 #endif
1978 * UDP_DEBUG: Enable debugging in UDP.
1980 #ifndef UDP_DEBUG
1981 #define UDP_DEBUG LWIP_DBG_OFF
1982 #endif
1985 * TCPIP_DEBUG: Enable debugging in tcpip.c.
1987 #ifndef TCPIP_DEBUG
1988 #define TCPIP_DEBUG LWIP_DBG_OFF
1989 #endif
1992 * PPP_DEBUG: Enable debugging for PPP.
1994 #ifndef PPP_DEBUG
1995 #define PPP_DEBUG LWIP_DBG_OFF
1996 #endif
1999 * SLIP_DEBUG: Enable debugging in slipif.c.
2001 #ifndef SLIP_DEBUG
2002 #define SLIP_DEBUG LWIP_DBG_OFF
2003 #endif
2006 * DHCP_DEBUG: Enable debugging in dhcp.c.
2008 #ifndef DHCP_DEBUG
2009 #define DHCP_DEBUG LWIP_DBG_OFF
2010 #endif
2013 * AUTOIP_DEBUG: Enable debugging in autoip.c.
2015 #ifndef AUTOIP_DEBUG
2016 #define AUTOIP_DEBUG LWIP_DBG_OFF
2017 #endif
2020 * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
2022 #ifndef SNMP_MSG_DEBUG
2023 #define SNMP_MSG_DEBUG LWIP_DBG_OFF
2024 #endif
2027 * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
2029 #ifndef SNMP_MIB_DEBUG
2030 #define SNMP_MIB_DEBUG LWIP_DBG_OFF
2031 #endif
2034 * DNS_DEBUG: Enable debugging for DNS.
2036 #ifndef DNS_DEBUG
2037 #define DNS_DEBUG LWIP_DBG_OFF
2038 #endif
2040 #endif /* __LWIP_OPT_H__ */