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 __LWIPOPTS_H__
39 #define __LWIPOPTS_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 #define SYS_LIGHTWEIGHT_PROT 0
62 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
63 * use lwIP facilities.
68 ------------------------------------
69 ---------- Memory options ----------
70 ------------------------------------
74 * MEM_ALIGNMENT: should be set to the alignment of the CPU
75 * 4 byte alignment -> #define MEM_ALIGNMENT 4
76 * 2 byte alignment -> #define MEM_ALIGNMENT 2
78 #define MEM_ALIGNMENT 1
81 * MEM_SIZE: the size of the heap memory. If the application will send
82 * a lot of data that needs to be copied, this should be set high.
87 ------------------------------------------------
88 ---------- Internal Memory Pool Sizes ----------
89 ------------------------------------------------
92 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
93 * If the application sends a lot of data out of ROM (or other static memory),
94 * this should be set high.
96 #define MEMP_NUM_PBUF 16
99 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
100 * (requires the LWIP_RAW option)
102 #define MEMP_NUM_RAW_PCB 4
105 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
106 * per active UDP "connection".
107 * (requires the LWIP_UDP option)
109 #define MEMP_NUM_UDP_PCB 4
112 * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
113 * (requires the LWIP_TCP option)
115 #define MEMP_NUM_TCP_PCB 4
118 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
119 * (requires the LWIP_TCP option)
121 #define MEMP_NUM_TCP_PCB_LISTEN 4
124 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
125 * (requires the LWIP_TCP option)
127 #define MEMP_NUM_TCP_SEG 16
130 * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
131 * reassembly (whole packets, not fragments!)
133 #define MEMP_NUM_REASSDATA 1
136 * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
137 * packets (pbufs) that are waiting for an ARP request (to resolve
138 * their destination address) to finish.
139 * (requires the ARP_QUEUEING option)
141 #define MEMP_NUM_ARP_QUEUE 2
144 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
145 * (requires NO_SYS==0)
147 #define MEMP_NUM_SYS_TIMEOUT 3
150 * MEMP_NUM_NETBUF: the number of struct netbufs.
151 * (only needed if you use the sequential API, like api_lib.c)
153 #define MEMP_NUM_NETBUF 2
156 * MEMP_NUM_NETCONN: the number of struct netconns.
157 * (only needed if you use the sequential API, like api_lib.c)
159 #define MEMP_NUM_NETCONN 4
162 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
163 * for callback/timeout API communication.
164 * (only needed if you use tcpip.c)
166 #define MEMP_NUM_TCPIP_MSG_API 8
169 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
170 * for incoming packets.
171 * (only needed if you use tcpip.c)
173 #define MEMP_NUM_TCPIP_MSG_INPKT 8
176 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
178 #define PBUF_POOL_SIZE 8
181 ---------------------------------
182 ---------- ARP options ----------
183 ---------------------------------
186 * LWIP_ARP==1: Enable ARP functionality.
191 --------------------------------
192 ---------- IP options ----------
193 --------------------------------
196 * IP_FORWARD==1: Enables the ability to forward IP packets across network
197 * interfaces. If you are going to run lwIP on a device with only one network
198 * interface, define this to 0.
203 * IP_OPTIONS: Defines the behavior for IP options.
204 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
205 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
207 #define IP_OPTIONS_ALLOWED 1
210 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
211 * this option does not affect outgoing packet sizes, which can be controlled
214 #define IP_REASSEMBLY 1
217 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
218 * that this option does not affect incoming packet sizes, which can be
219 * controlled via IP_REASSEMBLY.
224 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
225 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
226 * in this time, the whole packet is discarded.
228 #define IP_REASS_MAXAGE 3
231 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
232 * Since the received pbufs are enqueued, be sure to configure
233 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
234 * packets even if the maximum amount of fragments is enqueued for reassembly!
236 #define IP_REASS_MAX_PBUFS 4
239 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
240 * fragmentation. Otherwise pbufs are allocated and reference the original
241 * packet data to be fragmented.
243 #define IP_FRAG_USES_STATIC_BUF 0
246 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
248 #define IP_DEFAULT_TTL 255
251 ----------------------------------
252 ---------- ICMP options ----------
253 ----------------------------------
256 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
257 * Be careful, disable that make your product non-compliant to RFC1122
262 ---------------------------------
263 ---------- RAW options ----------
264 ---------------------------------
267 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
272 ----------------------------------
273 ---------- DHCP options ----------
274 ----------------------------------
277 * LWIP_DHCP==1: Enable DHCP module.
283 ------------------------------------
284 ---------- AUTOIP options ----------
285 ------------------------------------
288 * LWIP_AUTOIP==1: Enable AUTOIP module.
290 #define LWIP_AUTOIP 0
293 ----------------------------------
294 ---------- SNMP options ----------
295 ----------------------------------
298 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
304 ----------------------------------
305 ---------- IGMP options ----------
306 ----------------------------------
309 * LWIP_IGMP==1: Turn on IGMP module.
314 ----------------------------------
315 ---------- DNS options -----------
316 ----------------------------------
319 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
325 ---------------------------------
326 ---------- UDP options ----------
327 ---------------------------------
330 * LWIP_UDP==1: Turn on UDP.
335 ---------------------------------
336 ---------- TCP options ----------
337 ---------------------------------
340 * LWIP_TCP==1: Turn on TCP.
344 #define LWIP_LISTEN_BACKLOG 0
347 ----------------------------------
348 ---------- Pbuf options ----------
349 ----------------------------------
352 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
353 * link level header. The default is 14, the standard value for
356 #define PBUF_LINK_HLEN 16
359 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
360 * designed to accomodate single full size TCP frame in one pbuf, including
361 * TCP_MSS, IP header, and link header.
364 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
367 ------------------------------------
368 ---------- LOOPIF options ----------
369 ------------------------------------
372 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
374 #define LWIP_HAVE_LOOPIF 0
377 ----------------------------------------------
378 ---------- Sequential layer options ----------
379 ----------------------------------------------
383 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
385 #define LWIP_NETCONN 1
388 ------------------------------------
389 ---------- Socket options ----------
390 ------------------------------------
393 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
395 #define LWIP_SOCKET 1
398 ----------------------------------------
399 ---------- Statistics options ----------
400 ----------------------------------------
403 * LWIP_STATS==1: Enable statistics collection in lwip_stats.
407 ---------------------------------
408 ---------- PPP options ----------
409 ---------------------------------
412 * PPP_SUPPORT==1: Enable PPP.
414 #define PPP_SUPPORT 0
417 /* use errno provided by lwip, Lei */
418 #define LWIP_PROVIDE_ERRNO 1
423 #define LWIP_TIMEVAL_PRIVATE 1
425 #endif /* __LWIPOPTS_H__ */