6 * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
7 * critical regions during buffer allocation, deallocation and memory
8 * allocation and deallocation.
10 #ifndef SYS_LIGHTWEIGHT_PROT
11 #define SYS_LIGHTWEIGHT_PROT 1
15 ------------------------------------
16 ---------- Memory options ----------
17 ------------------------------------
20 * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
21 * instead of the lwip internal allocator. Can save code size if you
24 #ifndef MEM_LIBC_MALLOC
25 #define MEM_LIBC_MALLOC 1
29 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
30 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
31 * speed and usage from interrupts!
33 #ifndef MEMP_MEM_MALLOC
34 #define MEMP_MEM_MALLOC 1
38 * MEM_ALIGNMENT: should be set to the alignment of the CPU
39 * 4 byte alignment -> #define MEM_ALIGNMENT 4
40 * 2 byte alignment -> #define MEM_ALIGNMENT 2
43 #define MEM_ALIGNMENT 4
47 * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
48 * amount of bytes before and after each memp element in every pool and fills
49 * it with a prominent default value.
50 * MEMP_OVERFLOW_CHECK == 0 no checking
51 * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
52 * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
53 * memp_malloc() or memp_free() is called (useful but slow!)
55 #ifndef MEMP_OVERFLOW_CHECK
56 #define MEMP_OVERFLOW_CHECK 1
60 * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
61 * sure that there are no cycles in the linked lists.
63 #ifndef MEMP_SANITY_CHECK
64 #define MEMP_SANITY_CHECK 1
68 ---------------------------------
69 ---------- ARP options ----------
70 ---------------------------------
73 * LWIP_ARP==1: Enable ARP functionality.
80 * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
82 #ifndef ARP_TABLE_SIZE
83 #define ARP_TABLE_SIZE 16
87 * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
91 #define ARP_QUEUEING 1
95 * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
96 * updated with the source MAC and IP addresses supplied in the packet.
97 * You may want to disable this if you do not trust LAN peers to have the
98 * correct addresses, or as a limited approach to attempt to handle
99 * spoofing. If disabled, lwIP will need to make a new ARP request if
100 * the peer is not already in the ARP table, adding a little latency.
102 #ifndef ETHARP_TRUST_IP_MAC
103 #define ETHARP_TRUST_IP_MAC 1
107 --------------------------------
108 ---------- IP options ----------
109 --------------------------------
112 * IP_FORWARD==1: Enables the ability to forward IP packets across network
113 * interfaces. If you are going to run lwIP on a device with only one network
114 * interface, define this to 0.
121 * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
122 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
123 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
125 #ifndef IP_OPTIONS_ALLOWED
126 #define IP_OPTIONS_ALLOWED 1
130 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
131 * this option does not affect outgoing packet sizes, which can be controlled
134 #ifndef IP_REASSEMBLY
135 #define IP_REASSEMBLY 1
139 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
140 * that this option does not affect incoming packet sizes, which can be
141 * controlled via IP_REASSEMBLY.
148 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
149 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
150 * in this time, the whole packet is discarded.
152 #ifndef IP_REASS_MAXAGE
153 #define IP_REASS_MAXAGE 3
157 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
158 * Since the received pbufs are enqueued, be sure to configure
159 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
160 * packets even if the maximum amount of fragments is enqueued for reassembly!
162 #ifndef IP_REASS_MAX_PBUFS
163 #define IP_REASS_MAX_PBUFS 10
167 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
168 * fragmentation. Otherwise pbufs are allocated and reference the original
169 * packet data to be fragmented.
171 #ifndef IP_FRAG_USES_STATIC_BUF
172 #define IP_FRAG_USES_STATIC_BUF 1
176 * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
177 * (requires IP_FRAG_USES_STATIC_BUF==1)
179 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
180 #define IP_FRAG_MAX_MTU 1500
184 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
186 #ifndef IP_DEFAULT_TTL
187 #define IP_DEFAULT_TTL 255
191 * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
192 * filter per pcb on udp and raw send operations. To enable broadcast filter
193 * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
195 #ifndef IP_SOF_BROADCAST
196 #define IP_SOF_BROADCAST 0
200 * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
201 * filter on recv operations.
203 #ifndef IP_SOF_BROADCAST_RECV
204 #define IP_SOF_BROADCAST_RECV 0
208 ----------------------------------
209 ---------- ICMP options ----------
210 ----------------------------------
213 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
214 * Be careful, disable that make your product non-compliant to RFC1122
221 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
224 #define ICMP_TTL (IP_DEFAULT_TTL)
228 * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
230 #ifndef LWIP_BROADCAST_PING
231 #define LWIP_BROADCAST_PING 0
235 * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
237 #ifndef LWIP_MULTICAST_PING
238 #define LWIP_MULTICAST_PING 0
242 ---------------------------------
243 ---------- RAW options ----------
244 ---------------------------------
247 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
254 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
257 #define RAW_TTL (IP_DEFAULT_TTL)
261 ----------------------------------
262 ---------- DHCP options ----------
263 ----------------------------------
266 * LWIP_DHCP==1: Enable DHCP module.
273 * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
275 #ifndef DHCP_DOES_ARP_CHECK
276 #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
280 ------------------------------------
281 ---------- AUTOIP options ----------
282 ------------------------------------
285 * LWIP_AUTOIP==1: Enable AUTOIP module.
288 #define LWIP_AUTOIP 0
292 * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
293 * the same interface at the same time.
295 #ifndef LWIP_DHCP_AUTOIP_COOP
296 #define LWIP_DHCP_AUTOIP_COOP 0
300 * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
301 * that should be sent before falling back on AUTOIP. This can be set
302 * as low as 1 to get an AutoIP address very quickly, but you should
303 * be prepared to handle a changing IP address when DHCP overrides
306 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
307 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9
311 ----------------------------------
312 ---------- SNMP options ----------
313 ----------------------------------
316 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
324 * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
325 * allow. At least one request buffer is required.
327 #ifndef SNMP_CONCURRENT_REQUESTS
328 #define SNMP_CONCURRENT_REQUESTS 1
332 * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
333 * destination is required
335 #ifndef SNMP_TRAP_DESTINATIONS
336 #define SNMP_TRAP_DESTINATIONS 1
342 #ifndef SNMP_PRIVATE_MIB
343 #define SNMP_PRIVATE_MIB 0
347 * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
348 * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
349 * Unsafe requests are disabled by default!
351 #ifndef SNMP_SAFE_REQUESTS
352 #define SNMP_SAFE_REQUESTS 1
356 ----------------------------------
357 ---------- IGMP options ----------
358 ----------------------------------
361 * LWIP_IGMP==1: Turn on IGMP module.
368 ----------------------------------
369 ---------- DNS options -----------
370 ----------------------------------
373 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
380 /** DNS maximum number of entries to maintain locally. */
381 #ifndef DNS_TABLE_SIZE
382 #define DNS_TABLE_SIZE 8
385 /** DNS maximum host name length supported in the name table. */
386 #ifndef DNS_MAX_NAME_LENGTH
387 #define DNS_MAX_NAME_LENGTH 256
390 /** The maximum of DNS servers */
391 #ifndef DNS_MAX_SERVERS
392 #define DNS_MAX_SERVERS 2
395 /** DNS do a name checking between the query and the response. */
396 #ifndef DNS_DOES_NAME_CHECK
397 #define DNS_DOES_NAME_CHECK 1
400 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
401 DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
402 The buffer will be of size DNS_MSG_SIZE */
403 #ifndef DNS_USES_STATIC_BUF
404 #define DNS_USES_STATIC_BUF 1
407 /** DNS message max. size. Default value is RFC compliant. */
409 #define DNS_MSG_SIZE 512
412 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
414 * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
415 * (an array of structs name/address, where address is an u32_t in network
418 * Instead, you can also use an external function:
419 * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
420 * that returns the IP address or INADDR_NONE if not found.
422 #ifndef DNS_LOCAL_HOSTLIST
423 #define DNS_LOCAL_HOSTLIST 1
424 #endif /* DNS_LOCAL_HOSTLIST */
426 /** If this is turned on, the local host-list can be dynamically changed
428 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
429 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 1
430 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
432 #define LWIP_DNS_API_DECLARE_H_ERRNO 0
435 ---------------------------------
436 ---------- UDP options ----------
437 ---------------------------------
440 * LWIP_UDP==1: Turn on UDP.
447 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
450 #define LWIP_UDPLITE 1
454 * UDP_TTL: Default Time-To-Live value.
457 #define UDP_TTL (IP_DEFAULT_TTL)
461 ---------------------------------
462 ---------- TCP options ----------
463 ---------------------------------
466 * LWIP_TCP==1: Turn on TCP.
473 * TCP_TTL: Default Time-To-Live value.
476 #define TCP_TTL (IP_DEFAULT_TTL)
480 * TCP_WND: The size of a TCP window. This must be at least
481 * (2 * TCP_MSS) for things to work well
488 * TCP_MAXRTX: Maximum number of retransmissions of data segments.
491 #define TCP_MAXRTX 12
495 * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
497 #ifndef TCP_SYNMAXRTX
498 #define TCP_SYNMAXRTX 6
502 * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
503 * Define to 0 if your device is low on memory.
505 #ifndef TCP_QUEUE_OOSEQ
506 #define TCP_QUEUE_OOSEQ (LWIP_TCP)
510 * TCP_MSS: TCP Maximum segment size. (default is 128, a *very*
511 * conservative default.)
512 * For the receive side, this MSS is advertised to the remote side
513 * when opening a connection. For the transmit size, this MSS sets
514 * an upper limit on the MSS advertised by the remote host.
521 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
522 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
523 * reflects the available reassembly buffer size at the remote host) and the
524 * largest size permitted by the IP layer" (RFC 1122)
525 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
526 * netif used for a connection and limits the MSS if it would be too big otherwise.
528 #ifndef TCP_CALCULATE_EFF_SEND_MSS
529 #define TCP_CALCULATE_EFF_SEND_MSS 1
534 * TCP_SND_BUF: TCP sender buffer space (bytes).
537 #define TCP_SND_BUF 256
541 * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
542 * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
544 #ifndef TCP_SND_QUEUELEN
545 #define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS))
549 * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
550 * to TCP_SND_BUF. It is the amount of space which must be available in the
551 * TCP snd_buf for select to return writable.
554 #define TCP_SNDLOWAT (TCP_SND_BUF/2)
558 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
560 #ifndef TCP_LISTEN_BACKLOG
561 #define TCP_LISTEN_BACKLOG 0
565 * The maximum allowed backlog for TCP listen netconns.
566 * This backlog is used unless another is explicitly specified.
567 * 0xff is the maximum (u8_t).
569 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
570 #define TCP_DEFAULT_LISTEN_BACKLOG 0xff
574 * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
576 #ifndef LWIP_TCP_TIMESTAMPS
577 #define LWIP_TCP_TIMESTAMPS 0
581 * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
582 * explicit window update
584 #ifndef TCP_WND_UPDATE_THRESHOLD
585 #define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4)
589 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
590 * (requires NO_SYS==0)
592 #ifndef MEMP_NUM_SYS_TIMEOUT
593 #define MEMP_NUM_SYS_TIMEOUT 16