4 * lwIP Options Configuration
8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
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
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!
46 #include "lwip/debug.h"
49 -----------------------------------------------
50 ---------- Platform specific locking ----------
51 -----------------------------------------------
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
64 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
65 * use lwIP facilities.
72 * MEMCPY: override this if you have a faster implementation at hand than the
73 * one included in your C library
76 #define MEMCPY(dst,src,len) memcpy(dst,src,len)
80 * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
81 * call to memcpy() if the length is known at compile time and is small.
84 #define SMEMCPY(dst,src,len) memcpy(dst,src,len)
88 ------------------------------------
89 ---------- Memory options ----------
90 ------------------------------------
93 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
94 * instead of the lwip internal allocator. Can save code size if you
97 #ifndef MEM_LIBC_MALLOC
98 #define MEM_LIBC_MALLOC 0
102 * MEM_ALIGNMENT: should be set to the alignment of the CPU
103 * 4 byte alignment -> #define MEM_ALIGNMENT 4
104 * 2 byte alignment -> #define MEM_ALIGNMENT 2
106 #ifndef MEM_ALIGNMENT
107 #define MEM_ALIGNMENT 1
111 * MEM_SIZE: the size of the heap memory. If the application will send
112 * a lot of data that needs to be copied, this should be set high.
115 #define MEM_SIZE 1600
119 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
120 * amount of bytes before and after each memp element in every pool and fills
121 * it with a prominent default value.
122 * MEMP_OVERFLOW_CHECK == 0 no checking
123 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
124 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
125 * memp_malloc() or memp_free() is called (useful but slow!)
127 #ifndef MEMP_OVERFLOW_CHECK
128 #define MEMP_OVERFLOW_CHECK 0
132 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
133 * sure that there are no cycles in the linked lists.
135 #ifndef MEMP_SANITY_CHECK
136 #define MEMP_SANITY_CHECK 0
140 * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
141 * of memory pools of various sizes. When mem_malloc is called, an element of
142 * the smallest pool that can provide the lenght needed is returned.
144 #ifndef MEM_USE_POOLS
145 #define MEM_USE_POOLS 0
149 * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
150 * that defines additional pools beyond the "standard" ones required
151 * by lwIP. If you set this to 1, you must have lwippools.h in your
152 * inlude path somewhere.
154 #ifndef MEMP_USE_CUSTOM_POOLS
155 #define MEMP_USE_CUSTOM_POOLS 0
160 ------------------------------------------------
161 ---------- Internal Memory Pool Sizes ----------
162 ------------------------------------------------
165 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
166 * If the application sends a lot of data out of ROM (or other static memory),
167 * this should be set high.
169 #ifndef MEMP_NUM_PBUF
170 #define MEMP_NUM_PBUF 16
174 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
175 * (requires the LWIP_RAW option)
177 #ifndef MEMP_NUM_RAW_PCB
178 #define MEMP_NUM_RAW_PCB 4
182 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
183 * per active UDP "connection".
184 * (requires the LWIP_UDP option)
186 #ifndef MEMP_NUM_UDP_PCB
187 #define MEMP_NUM_UDP_PCB 4
191 * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
192 * (requires the LWIP_TCP option)
194 #ifndef MEMP_NUM_TCP_PCB
195 #define MEMP_NUM_TCP_PCB 5
199 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
200 * (requires the LWIP_TCP option)
202 #ifndef MEMP_NUM_TCP_PCB_LISTEN
203 #define MEMP_NUM_TCP_PCB_LISTEN 8
207 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
208 * (requires the LWIP_TCP option)
210 #ifndef MEMP_NUM_TCP_SEG
211 #define MEMP_NUM_TCP_SEG 16
215 * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
216 * reassembly (whole packets, not fragments!)
218 #ifndef MEMP_NUM_REASSDATA
219 #define MEMP_NUM_REASSDATA 5
223 * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
224 * packets (pbufs) that are waiting for an ARP request (to resolve
225 * their destination address) to finish.
226 * (requires the ARP_QUEUEING option)
228 #ifndef MEMP_NUM_ARP_QUEUE
229 #define MEMP_NUM_ARP_QUEUE 30
233 * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
234 * can be members et the same time (one per netif - allsystems group -, plus one
235 * per netif membership).
236 * (requires the LWIP_IGMP option)
238 #ifndef MEMP_NUM_IGMP_GROUP
239 #define MEMP_NUM_IGMP_GROUP 8
243 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
244 * (requires NO_SYS==0)
246 #ifndef MEMP_NUM_SYS_TIMEOUT
247 #define MEMP_NUM_SYS_TIMEOUT 3
251 * MEMP_NUM_NETBUF: the number of struct netbufs.
252 * (only needed if you use the sequential API, like api_lib.c)
254 #ifndef MEMP_NUM_NETBUF
255 #define MEMP_NUM_NETBUF 2
259 * MEMP_NUM_NETCONN: the number of struct netconns.
260 * (only needed if you use the sequential API, like api_lib.c)
262 #ifndef MEMP_NUM_NETCONN
263 #define MEMP_NUM_NETCONN 4
267 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
268 * for callback/timeout API communication.
269 * (only needed if you use tcpip.c)
271 #ifndef MEMP_NUM_TCPIP_MSG_API
272 #define MEMP_NUM_TCPIP_MSG_API 8
276 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
277 * for incoming packets.
278 * (only needed if you use tcpip.c)
280 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
281 #define MEMP_NUM_TCPIP_MSG_INPKT 8
285 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
287 #ifndef PBUF_POOL_SIZE
288 #define PBUF_POOL_SIZE 16
292 ---------------------------------
293 ---------- ARP options ----------
294 ---------------------------------
297 * LWIP_ARP==1: Enable ARP functionality.
304 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
306 #ifndef ARP_TABLE_SIZE
307 #define ARP_TABLE_SIZE 10
311 * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
315 #define ARP_QUEUEING 1
319 * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
320 * updated with the source MAC and IP addresses supplied in the packet.
321 * You may want to disable this if you do not trust LAN peers to have the
322 * correct addresses, or as a limited approach to attempt to handle
323 * spoofing. If disabled, lwIP will need to make a new ARP request if
324 * the peer is not already in the ARP table, adding a little latency.
326 #ifndef ETHARP_TRUST_IP_MAC
327 #define ETHARP_TRUST_IP_MAC 1
331 --------------------------------
332 ---------- IP options ----------
333 --------------------------------
336 * IP_FORWARD==1: Enables the ability to forward IP packets across network
337 * interfaces. If you are going to run lwIP on a device with only one network
338 * interface, define this to 0.
345 * IP_OPTIONS: Defines the behavior for IP options.
346 * IP_OPTIONS==0: All packets with IP options are dropped.
347 * IP_OPTIONS==1: IP options are allowed (but not parsed).
354 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
355 * this option does not affect outgoing packet sizes, which can be controlled
358 #ifndef IP_REASSEMBLY
359 #define IP_REASSEMBLY 1
363 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
364 * that this option does not affect incoming packet sizes, which can be
365 * controlled via IP_REASSEMBLY.
372 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
373 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
374 * in this time, the whole packet is discarded.
376 #ifndef IP_REASS_MAXAGE
377 #define IP_REASS_MAXAGE 3
381 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
382 * Since the received pbufs are enqueued, be sure to configure
383 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
384 * packets even if the maximum amount of fragments is enqueued for reassembly!
386 #ifndef IP_REASS_MAX_PBUFS
387 #define IP_REASS_MAX_PBUFS 10
391 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
392 * fragmentation. Otherwise pbufs are allocated and reference the original
393 * packet data to be fragmented.
395 #ifndef IP_FRAG_USES_STATIC_BUF
396 #define IP_FRAG_USES_STATIC_BUF 1
400 * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
401 * (requires IP_FRAG_USES_STATIC_BUF==1)
403 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
404 #define IP_FRAG_MAX_MTU 1500
408 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
410 #ifndef IP_DEFAULT_TTL
411 #define IP_DEFAULT_TTL 255
415 ----------------------------------
416 ---------- ICMP options ----------
417 ----------------------------------
420 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
421 * Be careful, disable that make your product non-compliant to RFC1122
428 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
431 #define ICMP_TTL (IP_DEFAULT_TTL)
435 ---------------------------------
436 ---------- RAW options ----------
437 ---------------------------------
440 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
447 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
450 #define RAW_TTL (IP_DEFAULT_TTL)
454 ----------------------------------
455 ---------- DHCP options ----------
456 ----------------------------------
459 * LWIP_DHCP==1: Enable DHCP module.
466 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
468 #ifndef DHCP_DOES_ARP_CHECK
469 #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
473 ------------------------------------
474 ---------- AUTOIP options ----------
475 ------------------------------------
478 * LWIP_AUTOIP==1: Enable AUTOIP module.
481 #define LWIP_AUTOIP 0
485 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
486 * the same interface at the same time.
488 #ifndef LWIP_DHCP_AUTOIP_COOP
489 #define LWIP_DHCP_AUTOIP_COOP 0
493 ----------------------------------
494 ---------- SNMP options ----------
495 ----------------------------------
498 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
506 * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
507 * allow. At least one request buffer is required.
509 #ifndef SNMP_CONCURRENT_REQUESTS
510 #define SNMP_CONCURRENT_REQUESTS 1
514 * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
515 * destination is required
517 #ifndef SNMP_TRAP_DESTINATIONS
518 #define SNMP_TRAP_DESTINATIONS 1
524 #ifndef SNMP_PRIVATE_MIB
525 #define SNMP_PRIVATE_MIB 0
529 * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
530 * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
531 * Unsafe requests are disabled by default!
533 #ifndef SNMP_SAFE_REQUESTS
534 #define SNMP_SAFE_REQUESTS 1
538 ----------------------------------
539 ---------- IGMP options ----------
540 ----------------------------------
543 * LWIP_IGMP==1: Turn on IGMP module.
550 ----------------------------------
551 ---------- DNS options -----------
552 ----------------------------------
555 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
562 /** DNS maximum number of entries to maintain locally. */
563 #ifndef DNS_TABLE_SIZE
564 #define DNS_TABLE_SIZE 4
567 /** DNS maximum host name length supported in the name table. */
568 #ifndef DNS_MAX_NAME_LENGTH
569 #define DNS_MAX_NAME_LENGTH 256
572 /** The maximum of DNS servers */
573 #ifndef DNS_MAX_SERVERS
574 #define DNS_MAX_SERVERS 2
577 /** DNS do a name checking between the query and the response. */
578 #ifndef DNS_DOES_NAME_CHECK
579 #define DNS_DOES_NAME_CHECK 1
582 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
583 DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
584 The buffer will be of size DNS_MSG_SIZE */
585 #ifndef DNS_USES_STATIC_BUF
586 #define DNS_USES_STATIC_BUF 1
589 /** DNS message max. size. Default value is RFC compliant. */
591 #define DNS_MSG_SIZE 512
595 ---------------------------------
596 ---------- UDP options ----------
597 ---------------------------------
600 * LWIP_UDP==1: Turn on UDP.
607 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
610 #define LWIP_UDPLITE 0
614 * UDP_TTL: Default Time-To-Live value.
617 #define UDP_TTL (IP_DEFAULT_TTL)
621 ---------------------------------
622 ---------- TCP options ----------
623 ---------------------------------
626 * LWIP_TCP==1: Turn on TCP.
633 * TCP_TTL: Default Time-To-Live value.
636 #define TCP_TTL (IP_DEFAULT_TTL)
640 * TCP_WND: The size of a TCP window.
647 * TCP_MAXRTX: Maximum number of retransmissions of data segments.
650 #define TCP_MAXRTX 12
654 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
656 #ifndef TCP_SYNMAXRTX
657 #define TCP_SYNMAXRTX 6
661 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
662 * Define to 0 if your device is low on memory.
664 #ifndef TCP_QUEUE_OOSEQ
665 #define TCP_QUEUE_OOSEQ 1
669 * TCP_MSS: TCP Maximum segment size. (default is 128, a *very*
670 * conservative default.)
671 * For the receive side, this MSS is advertised to the remote side
672 * when opening a connection. For the transmit size, this MSS sets
673 * an upper limit on the MSS advertised by the remote host.
680 * LWIP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
681 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
682 * reflects the available reassembly buffer size at the remote host) and the
683 * largest size permitted by the IP layer" (RFC 1122)
684 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
685 * netif used for a connection and limits the MSS it would be too big otherwise.
687 #ifndef LWIP_CALCULATE_EFF_SEND_MSS
688 #define LWIP_CALCULATE_EFF_SEND_MSS 1
693 * TCP_SND_BUF: TCP sender buffer space (bytes).
696 #define TCP_SND_BUF 256
700 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
701 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
703 #ifndef TCP_SND_QUEUELEN
704 #define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS))
708 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
709 * to TCP_SND_BUF. It is the amount of space which must be available in the
710 * TCP snd_buf for select to return writable.
713 #define TCP_SNDLOWAT (TCP_SND_BUF/2)
717 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
719 #ifndef TCP_LISTEN_BACKLOG
720 #define TCP_LISTEN_BACKLOG 0
724 * The maximum allowed backlog for TCP listen netconns.
725 * This backlog is used unless another is explicitly specified.
726 * 0xff is the maximum (u8_t).
728 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
729 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff
733 * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
734 * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
735 * events (accept, sent, etc) that happen in the system.
736 * LWIP_CALLBACK_API==1: The PCB callback function is called directly
739 #ifndef LWIP_EVENT_API
740 #define LWIP_EVENT_API 0
741 #define LWIP_CALLBACK_API 1
743 #define LWIP_EVENT_API 1
744 #define LWIP_CALLBACK_API 0
749 ----------------------------------
750 ---------- Pbuf options ----------
751 ----------------------------------
754 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
755 * link level header. The default is 14, the standard value for
758 #ifndef PBUF_LINK_HLEN
759 #define PBUF_LINK_HLEN 14
763 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
764 * designed to accomodate single full size TCP frame in one pbuf, including
765 * TCP_MSS, IP header, and link header.
768 #ifndef PBUF_POOL_BUFSIZE
769 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
773 ------------------------------------------------
774 ---------- Network Interfaces options ----------
775 ------------------------------------------------
778 * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
781 #ifndef LWIP_NETIF_HOSTNAME
782 #define LWIP_NETIF_HOSTNAME 0
786 * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
788 #ifndef LWIP_NETIF_API
789 #define LWIP_NETIF_API 0
793 * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
794 * changes its up/down status (i.e., due to DHCP IP acquistion)
796 #ifndef LWIP_NETIF_STATUS_CALLBACK
797 #define LWIP_NETIF_STATUS_CALLBACK 0
801 * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
802 * whenever the link changes (i.e., link down)
804 #ifndef LWIP_NETIF_LINK_CALLBACK
805 #define LWIP_NETIF_LINK_CALLBACK 0
809 * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
810 * indices) in struct netif. TCP and UDP can make use of this to prevent
811 * scanning the ARP table for every sent packet. While this is faster for big
812 * ARP tables or many concurrent connections, it might be counterproductive
813 * if you have a tiny ARP table or if there never are concurrent connections.
815 #ifndef LWIP_NETIF_HWADDRHINT
816 #define LWIP_NETIF_HWADDRHINT 0
820 ------------------------------------
821 ---------- LOOPIF options ----------
822 ------------------------------------
825 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
827 #ifndef LWIP_HAVE_LOOPIF
828 #define LWIP_HAVE_LOOPIF 0
832 * LWIP_LOOPIF_MULTITHREADING: Indicates whether threading is enabled in
833 * the system, as LOOPIF must change how it behaves depending on this setting.
834 * Setting this is needed to avoid reentering non-reentrant functions like
836 * LWIP_LOOPIF_MULTITHREADING==1: Indicates that the user is using a
837 * multithreaded environment like tcpip.c. In this case, netif->input()
838 * is called directly.
839 * LWIP_LOOPIF_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
840 * The packets are put on a list and loopif_poll() must be called in
841 * the main application loop.
843 #ifndef LWIP_LOOPIF_MULTITHREADING
844 #define LWIP_LOOPIF_MULTITHREADING 1
848 ------------------------------------
849 ---------- Thread options ----------
850 ------------------------------------
853 * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
855 #ifndef TCPIP_THREAD_NAME
856 #define TCPIP_THREAD_NAME "tcpip_thread"
860 * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
861 * The stack size value itself is platform-dependent, but is passed to
862 * sys_thread_new() when the thread is created.
864 #ifndef TCPIP_THREAD_STACKSIZE
865 #define TCPIP_THREAD_STACKSIZE 0
869 * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
870 * The priority value itself is platform-dependent, but is passed to
871 * sys_thread_new() when the thread is created.
873 #ifndef TCPIP_THREAD_PRIO
874 #define TCPIP_THREAD_PRIO 1
878 * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
879 * The queue size value itself is platform-dependent, but is passed to
880 * sys_mbox_new() when tcpip_init is called.
882 #ifndef TCPIP_MBOX_SIZE
883 #define TCPIP_MBOX_SIZE 0
887 * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
889 #ifndef SLIPIF_THREAD_NAME
890 #define SLIPIF_THREAD_NAME "slipif_loop"
894 * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
895 * The stack size value itself is platform-dependent, but is passed to
896 * sys_thread_new() when the thread is created.
898 #ifndef SLIPIF_THREAD_STACKSIZE
899 #define SLIPIF_THREAD_STACKSIZE 0
903 * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
904 * The priority value itself is platform-dependent, but is passed to
905 * sys_thread_new() when the thread is created.
907 #ifndef SLIPIF_THREAD_PRIO
908 #define SLIPIF_THREAD_PRIO 1
912 * PPP_THREAD_NAME: The name assigned to the pppMain thread.
914 #ifndef PPP_THREAD_NAME
915 #define PPP_THREAD_NAME "pppMain"
919 * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.
920 * The stack size value itself is platform-dependent, but is passed to
921 * sys_thread_new() when the thread is created.
923 #ifndef PPP_THREAD_STACKSIZE
924 #define PPP_THREAD_STACKSIZE 0
928 * PPP_THREAD_PRIO: The priority assigned to the pppMain thread.
929 * The priority value itself is platform-dependent, but is passed to
930 * sys_thread_new() when the thread is created.
932 #ifndef PPP_THREAD_PRIO
933 #define PPP_THREAD_PRIO 1
937 * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
939 #ifndef DEFAULT_THREAD_NAME
940 #define DEFAULT_THREAD_NAME "lwIP"
944 * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
945 * The stack size value itself is platform-dependent, but is passed to
946 * sys_thread_new() when the thread is created.
948 #ifndef DEFAULT_THREAD_STACKSIZE
949 #define DEFAULT_THREAD_STACKSIZE 0
953 * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
954 * The priority value itself is platform-dependent, but is passed to
955 * sys_thread_new() when the thread is created.
957 #ifndef DEFAULT_THREAD_PRIO
958 #define DEFAULT_THREAD_PRIO 1
962 * DEFAULT_RECVMBOX_SIZE: The mailbox size for the incoming packets.
963 * The queue size value itself is platform-dependent, but is passed to
964 * sys_mbox_new() when the recvmbox is created.
966 #ifndef DEFAULT_RECVMBOX_SIZE
967 #define DEFAULT_RECVMBOX_SIZE 0
971 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
972 * The queue size value itself is platform-dependent, but is passed to
973 * sys_mbox_new() when the acceptmbox is created.
975 #ifndef DEFAULT_ACCEPTMBOX_SIZE
976 #define DEFAULT_ACCEPTMBOX_SIZE 0
980 ----------------------------------------------
981 ---------- Sequential layer options ----------
982 ----------------------------------------------
985 * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
986 * Don't use it if you're not an active lwIP project member
988 #ifndef LWIP_TCPIP_CORE_LOCKING
989 #define LWIP_TCPIP_CORE_LOCKING 0
993 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
996 #define LWIP_NETCONN 1
1000 ------------------------------------
1001 ---------- Socket options ----------
1002 ------------------------------------
1005 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1008 #define LWIP_SOCKET 1
1012 * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
1013 * (only used if you use sockets.c)
1015 #ifndef LWIP_COMPAT_SOCKETS
1016 #define LWIP_COMPAT_SOCKETS 1
1020 * LWIP_COMPAT_SOCKETS==1: Enable POSIX-style sockets functions names. Disable
1021 * this option if you use a POSIX operating system that uses the same names
1022 * (read, write & close). (only used if you use sockets.c)
1024 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1025 #define LWIP_POSIX_SOCKETS_IO_NAMES 1
1029 * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1030 * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1031 * in seconds. (does not require sockets.c, and will affect tcp.c)
1033 #ifndef LWIP_TCP_KEEPALIVE
1034 #define LWIP_TCP_KEEPALIVE 0
1038 * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
1040 #ifndef LWIP_SO_RCVTIMEO
1041 #define LWIP_SO_RCVTIMEO 0
1045 * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1047 #ifndef LWIP_SO_RCVBUF
1048 #define LWIP_SO_RCVBUF 0
1052 * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE!
1059 ----------------------------------------
1060 ---------- Statistics options ----------
1061 ----------------------------------------
1064 * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1067 #define LWIP_STATS 1
1073 * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1075 #ifndef LWIP_STATS_DISPLAY
1076 #define LWIP_STATS_DISPLAY 0
1080 * LINK_STATS==1: Enable link stats.
1083 #define LINK_STATS 1
1087 * ETHARP_STATS==1: Enable etharp stats.
1089 #ifndef ETHARP_STATS
1090 #define ETHARP_STATS (LWIP_ARP)
1094 * IP_STATS==1: Enable IP stats.
1101 * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1102 * on if using either frag or reass.
1104 #ifndef IPFRAG_STATS
1105 #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG)
1109 * ICMP_STATS==1: Enable ICMP stats.
1112 #define ICMP_STATS 1
1116 * IGMP_STATS==1: Enable IGMP stats.
1119 #define IGMP_STATS (LWIP_IGMP)
1123 * UDP_STATS==1: Enable UDP stats. Default is on if
1124 * UDP enabled, otherwise off.
1127 #define UDP_STATS (LWIP_UDP)
1131 * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1132 * enabled, otherwise off.
1135 #define TCP_STATS (LWIP_TCP)
1139 * MEM_STATS==1: Enable mem.c stats.
1146 * MEMP_STATS==1: Enable memp.c pool stats.
1149 #define MEMP_STATS 1
1153 * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1161 #define LINK_STATS 0
1163 #define IPFRAG_STATS 0
1164 #define ICMP_STATS 0
1165 #define IGMP_STATS 0
1169 #define MEMP_STATS 0
1171 #define LWIP_STATS_DISPLAY 0
1173 #endif /* LWIP_STATS */
1176 ---------------------------------
1177 ---------- PPP options ----------
1178 ---------------------------------
1181 * PPP_SUPPORT==1: Enable PPP.
1184 #define PPP_SUPPORT 0
1188 * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
1190 #ifndef PPPOE_SUPPORT
1191 #define PPPOE_SUPPORT 0
1195 * PPPOS_SUPPORT==1: Enable PPP Over Serial
1197 #ifndef PPPOS_SUPPORT
1198 #define PPPOS_SUPPORT PPP_SUPPORT
1204 * NUM_PPP: Max PPP sessions.
1211 * PAP_SUPPORT==1: Support PAP.
1214 #define PAP_SUPPORT 0
1218 * CHAP_SUPPORT==1: Support CHAP.
1220 #ifndef CHAP_SUPPORT
1221 #define CHAP_SUPPORT 0
1225 * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1227 #ifndef MSCHAP_SUPPORT
1228 #define MSCHAP_SUPPORT 0
1232 * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1234 #ifndef CBCP_SUPPORT
1235 #define CBCP_SUPPORT 0
1239 * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1242 #define CCP_SUPPORT 0
1246 * VJ_SUPPORT==1: Support VJ header compression.
1249 #define VJ_SUPPORT 0
1253 * MD5_SUPPORT==1: Support MD5 (see also CHAP).
1256 #define MD5_SUPPORT 0
1262 #ifndef FSM_DEFTIMEOUT
1263 #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */
1266 #ifndef FSM_DEFMAXTERMREQS
1267 #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
1270 #ifndef FSM_DEFMAXCONFREQS
1271 #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
1274 #ifndef FSM_DEFMAXNAKLOOPS
1275 #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
1278 #ifndef UPAP_DEFTIMEOUT
1279 #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
1282 #ifndef UPAP_DEFREQTIME
1283 #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
1286 #ifndef CHAP_DEFTIMEOUT
1287 #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */
1290 #ifndef CHAP_DEFTRANSMITS
1291 #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */
1294 /* Interval in seconds between keepalive echo requests, 0 to disable. */
1295 #ifndef LCP_ECHOINTERVAL
1296 #define LCP_ECHOINTERVAL 0
1299 /* Number of unanswered echo requests before failure. */
1300 #ifndef LCP_MAXECHOFAILS
1301 #define LCP_MAXECHOFAILS 3
1304 /* Max Xmit idle time (in jiffies) before resend flag char. */
1305 #ifndef PPP_MAXIDLEFLAG
1306 #define PPP_MAXIDLEFLAG 100
1312 * Note - lcp shouldn't be allowed to negotiate stuff outside these
1313 * limits. See lcp.h in the pppd directory.
1314 * (XXX - these constants should simply be shared by lcp.c instead
1315 * of living in lcp.h)
1317 #define PPP_MTU 1500 /* Default MTU (size of Info field) */
1319 /* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */
1320 #define PPP_MAXMTU 1500 /* Largest MTU we allow */
1322 #define PPP_MINMTU 64
1323 #define PPP_MRU 1500 /* default MRU = max length of info field */
1324 #define PPP_MAXMRU 1500 /* Largest MRU we allow */
1326 #define PPP_DEFMRU 296 /* Try for this */
1328 #define PPP_MINMRU 128 /* No MRUs below this */
1331 #define MAXNAMELEN 256 /* max length of hostname or name for auth */
1332 #define MAXSECRETLEN 256 /* max length of password or secret */
1334 #endif /* PPP_SUPPORT */
1337 --------------------------------------
1338 ---------- Checksum options ----------
1339 --------------------------------------
1342 * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
1344 #ifndef CHECKSUM_GEN_IP
1345 #define CHECKSUM_GEN_IP 1
1349 * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
1351 #ifndef CHECKSUM_GEN_UDP
1352 #define CHECKSUM_GEN_UDP 1
1356 * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
1358 #ifndef CHECKSUM_GEN_TCP
1359 #define CHECKSUM_GEN_TCP 1
1363 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
1365 #ifndef CHECKSUM_CHECK_IP
1366 #define CHECKSUM_CHECK_IP 1
1370 * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
1372 #ifndef CHECKSUM_CHECK_UDP
1373 #define CHECKSUM_CHECK_UDP 1
1377 * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
1379 #ifndef CHECKSUM_CHECK_TCP
1380 #define CHECKSUM_CHECK_TCP 1
1384 ---------------------------------------
1385 ---------- Debugging options ----------
1386 ---------------------------------------
1389 * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
1390 * compared against this value. If it is smaller, then debugging
1391 * messages are written.
1393 #ifndef LWIP_DBG_MIN_LEVEL
1394 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF
1398 * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1399 * debug messages of certain types.
1401 #ifndef LWIP_DBG_TYPES_ON
1402 #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
1406 * ETHARP_DEBUG: Enable debugging in etharp.c.
1408 #ifndef ETHARP_DEBUG
1409 #define ETHARP_DEBUG LWIP_DBG_OFF
1413 * NETIF_DEBUG: Enable debugging in netif.c.
1416 #define NETIF_DEBUG LWIP_DBG_OFF
1420 * PBUF_DEBUG: Enable debugging in pbuf.c.
1423 #define PBUF_DEBUG LWIP_DBG_OFF
1427 * API_LIB_DEBUG: Enable debugging in api_lib.c.
1429 #ifndef API_LIB_DEBUG
1430 #define API_LIB_DEBUG LWIP_DBG_OFF
1434 * API_MSG_DEBUG: Enable debugging in api_msg.c.
1436 #ifndef API_MSG_DEBUG
1437 #define API_MSG_DEBUG LWIP_DBG_OFF
1441 * SOCKETS_DEBUG: Enable debugging in sockets.c.
1443 #ifndef SOCKETS_DEBUG
1444 #define SOCKETS_DEBUG LWIP_DBG_OFF
1448 * ICMP_DEBUG: Enable debugging in icmp.c.
1451 #define ICMP_DEBUG LWIP_DBG_OFF
1455 * IGMP_DEBUG: Enable debugging in igmp.c.
1458 #define IGMP_DEBUG LWIP_DBG_OFF
1462 * INET_DEBUG: Enable debugging in inet.c.
1465 #define INET_DEBUG LWIP_DBG_OFF
1469 * IP_DEBUG: Enable debugging for IP.
1472 #define IP_DEBUG LWIP_DBG_OFF
1476 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
1478 #ifndef IP_REASS_DEBUG
1479 #define IP_REASS_DEBUG LWIP_DBG_OFF
1483 * RAW_DEBUG: Enable debugging in raw.c.
1486 #define RAW_DEBUG LWIP_DBG_OFF
1490 * MEM_DEBUG: Enable debugging in mem.c.
1493 #define MEM_DEBUG LWIP_DBG_OFF
1497 * MEMP_DEBUG: Enable debugging in memp.c.
1500 #define MEMP_DEBUG LWIP_DBG_OFF
1504 * SYS_DEBUG: Enable debugging in sys.c.
1507 #define SYS_DEBUG LWIP_DBG_OFF
1511 * TCP_DEBUG: Enable debugging for TCP.
1514 #define TCP_DEBUG LWIP_DBG_OFF
1518 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
1520 #ifndef TCP_INPUT_DEBUG
1521 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
1525 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
1527 #ifndef TCP_FR_DEBUG
1528 #define TCP_FR_DEBUG LWIP_DBG_OFF
1532 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
1535 #ifndef TCP_RTO_DEBUG
1536 #define TCP_RTO_DEBUG LWIP_DBG_OFF
1540 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
1542 #ifndef TCP_CWND_DEBUG
1543 #define TCP_CWND_DEBUG LWIP_DBG_OFF
1547 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
1549 #ifndef TCP_WND_DEBUG
1550 #define TCP_WND_DEBUG LWIP_DBG_OFF
1554 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
1556 #ifndef TCP_OUTPUT_DEBUG
1557 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
1561 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
1563 #ifndef TCP_RST_DEBUG
1564 #define TCP_RST_DEBUG LWIP_DBG_OFF
1568 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
1570 #ifndef TCP_QLEN_DEBUG
1571 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
1575 * UDP_DEBUG: Enable debugging in UDP.
1578 #define UDP_DEBUG LWIP_DBG_OFF
1582 * TCPIP_DEBUG: Enable debugging in tcpip.c.
1585 #define TCPIP_DEBUG LWIP_DBG_OFF
1589 * PPP_DEBUG: Enable debugging for PPP.
1592 #define PPP_DEBUG LWIP_DBG_OFF
1596 * SLIP_DEBUG: Enable debugging in slipif.c.
1599 #define SLIP_DEBUG LWIP_DBG_OFF
1603 * DHCP_DEBUG: Enable debugging in dhcp.c.
1606 #define DHCP_DEBUG LWIP_DBG_OFF
1610 * AUTOIP_DEBUG: Enable debugging in autoip.c.
1612 #ifndef AUTOIP_DEBUG
1613 #define AUTOIP_DEBUG LWIP_DBG_OFF
1617 * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
1619 #ifndef SNMP_MSG_DEBUG
1620 #define SNMP_MSG_DEBUG LWIP_DBG_OFF
1624 * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
1626 #ifndef SNMP_MIB_DEBUG
1627 #define SNMP_MIB_DEBUG LWIP_DBG_OFF
1631 * DNS_DEBUG: Enable debugging for DNS.
1634 #define DNS_DEBUG LWIP_DBG_OFF
1637 #endif /* __LWIP_OPT_H__ */