vm, kernel, top: report memory usage of vm, kernel
[minix.git] / lib / liblwip / include / lwipopts.h
blob8717c8aaed537f5c19cf8b514aecd1d19e669ce1
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 __LWIPOPTS_H__
39 #define __LWIPOPTS_H__
42 #define LWIP_DEBUG 1
43 #define RAW_DEBUG LWIP_DBG_ON
44 #define IP_DEBUG LWIP_DBG_ON
45 #define NETIF_DEBUG LWIP_DBG_ON
46 #define ETHARP_DEBUG LWIP_DBG_ON
47 #define TCP_DEBUG LWIP_DBG_ON
48 #define TCP_RST_DEBUG LWIP_DBG_ON
49 #define TCP_DEBUG_PCB_LISTS LWIP_DBG_ON
50 #define TCP_INPUT_DEBUG LWIP_DBG_ON
51 #define TCP_OUTPUT_DEBUG LWIP_DBG_ON
52 #define TCPIP_DEBUG LWIP_DBG_ON
53 #define UDP_DEBUG LWIP_DBG_ON
54 #define PBUF_DEBUG LWIP_DBG_ON
55 #define TCP_CWND_DEBUG LWIP_DBG_ON
58 #define LWIP_DBG_TYPES_ON (LWIP_DBG_ON | LWIP_DBG_TRACE)
60 #define LWIP_NETIF_LOOPBACK 1
61 #define LWIP_NETIF_API 0
63 #define CHECKSUM_GEN_IP 1
64 #define CHECKSUM_GEN_UDP 1
65 #define CHECKSUM_GEN_TCP 1
66 #define CHECKSUM_CHECK_IP 1
67 #define CHECKSUM_CHECK_UDP 1
68 #define CHECKSUM_CHECK_TCP 1
70 #define TCP_MSS (1460)
71 #define TCP_SND_BUF (256 * TCP_MSS)
72 #define TCP_SNDLOWAT (256)
73 #define TCP_SND_QUEUELEN (512)
74 #define TCP_WND ((1 << 16) - 1)
75 #define PBUF_POOL_BUFSIZE (2048)
78 * Include user defined options first. Anything not defined in these files
79 * will be set to standard values. Override anything you dont like!
81 #include "lwip/debug.h"
84 #define MEM_LIBC_MALLOC 1
87 -----------------------------------------------
88 ---------- Platform specific locking ----------
89 -----------------------------------------------
92 /**
93 * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
94 * critical regions during buffer allocation, deallocation and memory
95 * allocation and deallocation.
97 #define SYS_LIGHTWEIGHT_PROT 0
99 /**
100 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
101 * use lwIP facilities.
103 #define NO_SYS 1
106 ------------------------------------
107 ---------- Memory options ----------
108 ------------------------------------
112 * MEM_ALIGNMENT: should be set to the alignment of the CPU
113 * 4 byte alignment -> #define MEM_ALIGNMENT 4
114 * 2 byte alignment -> #define MEM_ALIGNMENT 2
116 #define MEM_ALIGNMENT 4
119 * MEM_SIZE: the size of the heap memory. If the application will send
120 * a lot of data that needs to be copied, this should be set high.
122 #define MEM_SIZE (1 << 21)
125 ------------------------------------------------
126 ---------- Internal Memory Pool Sizes ----------
127 ------------------------------------------------
130 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
131 * If the application sends a lot of data out of ROM (or other static memory),
132 * this should be set high.
134 #define MEMP_NUM_PBUF 128
137 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
138 * (requires the LWIP_RAW option)
140 #define MEMP_NUM_RAW_PCB 64
143 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
144 * per active UDP "connection".
145 * (requires the LWIP_UDP option)
147 #define MEMP_NUM_UDP_PCB 64
150 * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
151 * (requires the LWIP_TCP option)
153 #define MEMP_NUM_TCP_PCB 64
156 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
157 * (requires the LWIP_TCP option)
159 #define MEMP_NUM_TCP_PCB_LISTEN 16
162 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
163 * (requires the LWIP_TCP option)
165 #define MEMP_NUM_TCP_SEG 512
168 * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
169 * reassembly (whole packets, not fragments!)
171 #define MEMP_NUM_REASSDATA 4
174 * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
175 * packets (pbufs) that are waiting for an ARP request (to resolve
176 * their destination address) to finish.
177 * (requires the ARP_QUEUEING option)
179 #define MEMP_NUM_ARP_QUEUE 4
182 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
183 * (requires NO_SYS==0)
185 #define MEMP_NUM_SYS_TIMEOUT 8
188 * MEMP_NUM_NETBUF: the number of struct netbufs.
189 * (only needed if you use the sequential API, like api_lib.c)
191 #define MEMP_NUM_NETBUF 128
194 * MEMP_NUM_NETCONN: the number of struct netconns.
195 * (only needed if you use the sequential API, like api_lib.c)
197 #define MEMP_NUM_NETCONN 32
200 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
201 * for callback/timeout API communication.
202 * (only needed if you use tcpip.c)
204 #define MEMP_NUM_TCPIP_MSG_API 256
207 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
208 * for incoming packets.
209 * (only needed if you use tcpip.c)
211 #define MEMP_NUM_TCPIP_MSG_INPKT 256
214 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
216 #define PBUF_POOL_SIZE (1 << 10)
219 ---------------------------------
220 ---------- ARP options ----------
221 ---------------------------------
224 * LWIP_ARP==1: Enable ARP functionality.
226 #define LWIP_ARP 1
229 --------------------------------
230 ---------- IP options ----------
231 --------------------------------
234 * IP_FORWARD==1: Enables the ability to forward IP packets across network
235 * interfaces. If you are going to run lwIP on a device with only one network
236 * interface, define this to 0.
238 #define IP_FORWARD 0
241 * IP_OPTIONS: Defines the behavior for IP options.
242 * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
243 * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
245 #define IP_OPTIONS_ALLOWED 1
248 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
249 * this option does not affect outgoing packet sizes, which can be controlled
250 * via IP_FRAG.
252 #define IP_REASSEMBLY 1
255 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
256 * that this option does not affect incoming packet sizes, which can be
257 * controlled via IP_REASSEMBLY.
259 #define IP_FRAG 1
262 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
263 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
264 * in this time, the whole packet is discarded.
266 #define IP_REASS_MAXAGE 3
269 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
270 * Since the received pbufs are enqueued, be sure to configure
271 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
272 * packets even if the maximum amount of fragments is enqueued for reassembly!
274 #define IP_REASS_MAX_PBUFS 4
277 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
278 * fragmentation. Otherwise pbufs are allocated and reference the original
279 * packet data to be fragmented.
281 #define IP_FRAG_USES_STATIC_BUF 1
284 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
286 #define IP_DEFAULT_TTL 255
289 ----------------------------------
290 ---------- ICMP options ----------
291 ----------------------------------
294 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
295 * Be careful, disable that make your product non-compliant to RFC1122
297 #define LWIP_ICMP 1
300 ---------------------------------
301 ---------- RAW options ----------
302 ---------------------------------
305 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
307 #define LWIP_RAW 1
310 ----------------------------------
311 ---------- DHCP options ----------
312 ----------------------------------
315 * LWIP_DHCP==1: Enable DHCP module.
317 #define LWIP_DHCP 0
321 ------------------------------------
322 ---------- AUTOIP options ----------
323 ------------------------------------
326 * LWIP_AUTOIP==1: Enable AUTOIP module.
328 #define LWIP_AUTOIP 0
331 ----------------------------------
332 ---------- SNMP options ----------
333 ----------------------------------
336 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
337 * transport.
339 #define LWIP_SNMP 0
342 ----------------------------------
343 ---------- IGMP options ----------
344 ----------------------------------
347 * LWIP_IGMP==1: Turn on IGMP module.
349 #define LWIP_IGMP 0
352 ----------------------------------
353 ---------- DNS options -----------
354 ----------------------------------
357 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
358 * transport.
360 #define LWIP_DNS 1
363 ---------------------------------
364 ---------- UDP options ----------
365 ---------------------------------
368 * LWIP_UDP==1: Turn on UDP.
370 #define LWIP_UDP 1
373 ---------------------------------
374 ---------- TCP options ----------
375 ---------------------------------
378 * LWIP_TCP==1: Turn on TCP.
380 #define LWIP_TCP 1
382 #define LWIP_LISTEN_BACKLOG 0
385 ----------------------------------
386 ---------- Pbuf options ----------
387 ----------------------------------
390 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
391 * link level header. The default is 14, the standard value for
392 * Ethernet.
394 #define PBUF_LINK_HLEN 14
397 * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
398 * designed to accomodate single full size TCP frame in one pbuf, including
399 * TCP_MSS, IP header, and link header.
404 ------------------------------------
405 ---------- LOOPIF options ----------
406 ------------------------------------
409 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
411 #define LWIP_HAVE_LOOPIF 1
414 ----------------------------------------------
415 ---------- Sequential layer options ----------
416 ----------------------------------------------
420 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
422 #define LWIP_NETCONN 0
425 ------------------------------------
426 ---------- Socket options ----------
427 ------------------------------------
430 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
432 #define LWIP_SOCKET 0
434 #define LWIP_COMPAT_SOCKETS 0
437 ----------------------------------------
438 ---------- Statistics options ----------
439 ----------------------------------------
442 * LWIP_STATS==1: Enable statistics collection in lwip_stats.
444 #define LWIP_STATS 0
446 ---------------------------------
447 ---------- PPP options ----------
448 ---------------------------------
451 * PPP_SUPPORT==1: Enable PPP.
453 #define PPP_SUPPORT 0
456 /* Misc */
458 #define LWIP_TIMEVAL_PRIVATE 0
460 #endif /* __LWIPOPTS_H__ */