Debian Codegraph @

contrib/ports/unix/proj/minimal/lwipopts.h

raw
1 /**
2 * @file
3 *
4 * lwIP Options Configuration
5 */
6
7 /*
8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 *
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.
21 *
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.
32 *
33 * This file is part of the lwIP TCP/IP stack.
34 *
35 * Author: Adam Dunkels <[email protected]>
36 *
37 */
38 #ifndef LWIP_LWIPOPTS_H
39 #define LWIP_LWIPOPTS_H
40
41 /*
42 -----------------------------------------------
43 ---------- Platform specific locking ----------
44 -----------------------------------------------
45 */
46
47 /**
48 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
49 * use lwIP facilities.
50 */
51 #define NO_SYS 1
52
53
54 /*
55 ------------------------------------
56 ---------- Memory options ----------
57 ------------------------------------
58 */
59 /**
60 * MEM_ALIGNMENT: should be set to the alignment of the CPU
61 * 4 byte alignment -> #define MEM_ALIGNMENT 4
62 * 2 byte alignment -> #define MEM_ALIGNMENT 2
63 */
64 #define MEM_ALIGNMENT 1
65
66 /**
67 * MEM_SIZE: the size of the heap memory. If the application will send
68 * a lot of data that needs to be copied, this should be set high.
69 */
70 #define MEM_SIZE 16000
71
72
73 /*
74 ------------------------------------------------
75 ---------- Internal Memory Pool Sizes ----------
76 ------------------------------------------------
77 */
78 /**
79 * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
80 * If the application sends a lot of data out of ROM (or other static memory),
81 * this should be set high.
82 */
83 #define MEMP_NUM_PBUF 30
84
85 /**
86 * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
87 * (requires the LWIP_RAW option)
88 */
89 #define MEMP_NUM_RAW_PCB 4
90
91 /**
92 * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
93 * per active UDP "connection".
94 * (requires the LWIP_UDP option)
95 */
96 #define MEMP_NUM_UDP_PCB 4
97
98 /**
99 * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
100 * (requires the LWIP_TCP option)
101 */
102 #define MEMP_NUM_TCP_PCB 2
103
104 /**
105 * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
106 * (requires the LWIP_TCP option)
107 */
108 #define MEMP_NUM_TCP_PCB_LISTEN 8
109
110 /**
111 * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
112 * (requires the LWIP_TCP option)
113 */
114 #define MEMP_NUM_TCP_SEG 16
115
116 /**
117 * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
118 * packets (pbufs) that are waiting for an ARP request (to resolve
119 * their destination address) to finish.
120 * (requires the ARP_QUEUEING option)
121 */
122 #define MEMP_NUM_ARP_QUEUE 2
123
124 /**
125 * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
126 */
127 #define MEMP_NUM_SYS_TIMEOUT 3
128
129 /**
130 * MEMP_NUM_NETBUF: the number of struct netbufs.
131 * (only needed if you use the sequential API, like api_lib.c)
132 */
133 #define MEMP_NUM_NETBUF 0
134
135 /**
136 * MEMP_NUM_NETCONN: the number of struct netconns.
137 * (only needed if you use the sequential API, like api_lib.c)
138 */
139 #define MEMP_NUM_NETCONN 0
140
141 /**
142 * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
143 * for callback/timeout API communication.
144 * (only needed if you use tcpip.c)
145 */
146 #define MEMP_NUM_TCPIP_MSG_API 0
147
148 /**
149 * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
150 * for incoming packets.
151 * (only needed if you use tcpip.c)
152 */
153 #define MEMP_NUM_TCPIP_MSG_INPKT 0
154
155 /**
156 * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
157 */
158 #define PBUF_POOL_SIZE 32
159
160 /*
161 ---------------------------------
162 ---------- ARP options ----------
163 ---------------------------------
164 */
165 /**
166 * LWIP_ARP==1: Enable ARP functionality.
167 */
168 #define LWIP_ARP 1
169
170 /*
171 --------------------------------
172 ---------- IP options ----------
173 --------------------------------
174 */
175 /**
176 * IP_FORWARD==1: Enables the ability to forward IP packets across network
177 * interfaces. If you are going to run lwIP on a device with only one network
178 * interface, define this to 0.
179 */
180 #define IP_FORWARD 0
181
182 /**
183 * IP_OPTIONS: Defines the behavior for IP options.
184 * IP_OPTIONS==0_ALLOWED: All packets with IP options are dropped.
185 * IP_OPTIONS==1_ALLOWED: IP options are allowed (but not parsed).
186 */
187 #define IP_OPTIONS_ALLOWED 1
188
189 /**
190 * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
191 * this option does not affect outgoing packet sizes, which can be controlled
192 * via IP_FRAG.
193 */
194 #define IP_REASSEMBLY 1
195
196 /**
197 * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
198 * that this option does not affect incoming packet sizes, which can be
199 * controlled via IP_REASSEMBLY.
200 */
201 #define IP_FRAG 1
202
203 /**
204 * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
205 * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
206 * in this time, the whole packet is discarded.
207 */
208 #define IP_REASS_MAXAGE 3
209
210 /**
211 * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
212 * Since the received pbufs are enqueued, be sure to configure
213 * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
214 * packets even if the maximum amount of fragments is enqueued for reassembly!
215 */
216 #define IP_REASS_MAX_PBUFS 10
217
218 /**
219 * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
220 * fragmentation. Otherwise pbufs are allocated and reference the original
221 * packet data to be fragmented.
222 */
223 #define IP_FRAG_USES_STATIC_BUF 0
224
225 /**
226 * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
227 */
228 #define IP_DEFAULT_TTL 255
229
230 /*
231 ----------------------------------
232 ---------- ICMP options ----------
233 ----------------------------------
234 */
235 /**
236 * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
237 * Be careful, disable that make your product non-compliant to RFC1122
238 */
239 #define LWIP_ICMP 1
240
241 /**
242 * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
243 */
244 #define ICMP_TTL (IP_DEFAULT_TTL)
245
246 /*
247 ---------------------------------
248 ---------- RAW options ----------
249 ---------------------------------
250 */
251 /**
252 * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
253 */
254 #define LWIP_RAW 0
255
256 /*
257 ----------------------------------
258 ---------- DHCP options ----------
259 ----------------------------------
260 */
261 /**
262 * LWIP_DHCP==1: Enable DHCP module.
263 */
264 #define LWIP_DHCP 0
265
266 /*
267 ------------------------------------
268 ---------- AUTOIP options ----------
269 ------------------------------------
270 */
271 /**
272 * LWIP_AUTOIP==1: Enable AUTOIP module.
273 */
274 #define LWIP_AUTOIP 0
275
276 /*
277 ----------------------------------
278 ---------- SNMP options ----------
279 ----------------------------------
280 */
281 /**
282 * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
283 * transport.
284 */
285 #define LWIP_SNMP 1
286 #define SNMP_PRIVATE_MIB 1
287
288 /*
289 ----------------------------------
290 ---------- IGMP options ----------
291 ----------------------------------
292 */
293 /**
294 * LWIP_IGMP==1: Turn on IGMP module.
295 */
296 #define LWIP_IGMP 0
297
298 /*
299 ----------------------------------
300 ---------- DNS options -----------
301 ----------------------------------
302 */
303 /**
304 * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
305 * transport.
306 */
307 #define LWIP_DNS 0
308
309 /*
310 ---------------------------------
311 ---------- UDP options ----------
312 ---------------------------------
313 */
314 /**
315 * LWIP_UDP==1: Turn on UDP.
316 */
317 #define LWIP_UDP 1
318
319 /**
320 * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
321 */
322 #define LWIP_UDPLITE 0
323
324 /**
325 * UDP_TTL: Default Time-To-Live value.
326 */
327 #define UDP_TTL (IP_DEFAULT_TTL)
328
329 /*
330 ---------------------------------
331 ---------- TCP options ----------
332 ---------------------------------
333 */
334 /**
335 * LWIP_TCP==1: Turn on TCP.
336 */
337 #define LWIP_TCP 1
338
339 /*
340 ----------------------------------
341 ---------- Pbuf options ----------
342 ----------------------------------
343 */
344 /**
345 * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
346 * link level header. The default is 14, the standard value for
347 * Ethernet.
348 */
349 #define PBUF_LINK_HLEN 16
350
351 /*
352 ------------------------------------
353 ---------- LOOPIF options ----------
354 ------------------------------------
355 */
356 /**
357 * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
358 */
359 #define LWIP_HAVE_LOOPIF 0
360
361
362 /*
363 ----------------------------------------------
364 ---------- Sequential layer options ----------
365 ----------------------------------------------
366 */
367
368 /**
369 * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
370 */
371 #define LWIP_NETCONN 0
372
373 /*
374 ------------------------------------
375 ---------- Socket options ----------
376 ------------------------------------
377 */
378 /**
379 * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
380 */
381 #define LWIP_SOCKET 0
382
383 /*
384 ----------------------------------------
385 ---------- Statistics options ----------
386 ----------------------------------------
387 */
388 /**
389 * LWIP_STATS==1: Enable statistics collection in lwip_stats.
390 */
391 #define LWIP_STATS 0
392
393 /* Misc */
394
395 #endif /* LWIP_LWIPOPTS_H */