]>
Commit | Line | Data |
---|---|---|
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 <adam@sics.se> | |
36 | * | |
37 | */ | |
38 | #ifndef __LWIP_OPT_H__ | |
39 | #define __LWIP_OPT_H__ | |
40 | ||
41 | /* | |
42 | * Include user defined options first. Anything not defined in these files | |
43 | * will be set to standard values. Override anything you dont like! | |
44 | */ | |
45 | #include "lwipopts.h" | |
46 | #include "lwip/debug.h" | |
47 | ||
48 | /* | |
49 | ----------------------------------------------- | |
50 | ---------- Platform specific locking ---------- | |
51 | ----------------------------------------------- | |
52 | */ | |
53 | ||
54 | /** | |
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. | |
58 | */ | |
59 | #ifndef SYS_LIGHTWEIGHT_PROT | |
60 | #define SYS_LIGHTWEIGHT_PROT 0 | |
61 | #endif | |
62 | ||
63 | /** | |
64 | * NO_SYS==1: Provides VERY minimal functionality. Otherwise, | |
65 | * use lwIP facilities. | |
66 | */ | |
67 | #ifndef NO_SYS | |
68 | #define NO_SYS 0 | |
69 | #endif | |
70 | ||
71 | /** | |
72 | * MEMCPY: override this if you have a faster implementation at hand than the | |
73 | * one included in your C library | |
74 | */ | |
75 | #ifndef MEMCPY | |
76 | #define MEMCPY(dst,src,len) memcpy(dst,src,len) | |
77 | #endif | |
78 | ||
79 | /** | |
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. | |
82 | */ | |
83 | #ifndef SMEMCPY | |
84 | #define SMEMCPY(dst,src,len) memcpy(dst,src,len) | |
85 | #endif | |
86 | ||
87 | /* | |
88 | ------------------------------------ | |
89 | ---------- Memory options ---------- | |
90 | ------------------------------------ | |
91 | */ | |
92 | /** | |
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 | |
95 | * already use it. | |
96 | */ | |
97 | #ifndef MEM_LIBC_MALLOC | |
98 | #define MEM_LIBC_MALLOC 0 | |
99 | #endif | |
100 | ||
101 | /** | |
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 | |
105 | */ | |
106 | #ifndef MEM_ALIGNMENT | |
107 | #define MEM_ALIGNMENT 1 | |
108 | #endif | |
109 | ||
110 | /** | |
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. | |
113 | */ | |
114 | #ifndef MEM_SIZE | |
115 | #define MEM_SIZE 1600 | |
116 | #endif | |
117 | ||
118 | /** | |
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!) | |
126 | */ | |
127 | #ifndef MEMP_OVERFLOW_CHECK | |
128 | #define MEMP_OVERFLOW_CHECK 0 | |
129 | #endif | |
130 | ||
131 | /** | |
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. | |
134 | */ | |
135 | #ifndef MEMP_SANITY_CHECK | |
136 | #define MEMP_SANITY_CHECK 0 | |
137 | #endif | |
138 | ||
139 | /** | |
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. | |
143 | */ | |
144 | #ifndef MEM_USE_POOLS | |
145 | #define MEM_USE_POOLS 0 | |
146 | #endif | |
147 | ||
148 | /** | |
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. | |
153 | */ | |
154 | #ifndef MEMP_USE_CUSTOM_POOLS | |
155 | #define MEMP_USE_CUSTOM_POOLS 0 | |
156 | #endif | |
157 | ||
158 | ||
159 | /* | |
160 | ------------------------------------------------ | |
161 | ---------- Internal Memory Pool Sizes ---------- | |
162 | ------------------------------------------------ | |
163 | */ | |
164 | /** | |
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. | |
168 | */ | |
169 | #ifndef MEMP_NUM_PBUF | |
170 | #define MEMP_NUM_PBUF 16 | |
171 | #endif | |
172 | ||
173 | /** | |
174 | * MEMP_NUM_RAW_PCB: Number of raw connection PCBs | |
175 | * (requires the LWIP_RAW option) | |
176 | */ | |
177 | #ifndef MEMP_NUM_RAW_PCB | |
178 | #define MEMP_NUM_RAW_PCB 4 | |
179 | #endif | |
180 | ||
181 | /** | |
182 | * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One | |
183 | * per active UDP "connection". | |
184 | * (requires the LWIP_UDP option) | |
185 | */ | |
186 | #ifndef MEMP_NUM_UDP_PCB | |
187 | #define MEMP_NUM_UDP_PCB 4 | |
188 | #endif | |
189 | ||
190 | /** | |
191 | * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. | |
192 | * (requires the LWIP_TCP option) | |
193 | */ | |
194 | #ifndef MEMP_NUM_TCP_PCB | |
195 | #define MEMP_NUM_TCP_PCB 5 | |
196 | #endif | |
197 | ||
198 | /** | |
199 | * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. | |
200 | * (requires the LWIP_TCP option) | |
201 | */ | |
202 | #ifndef MEMP_NUM_TCP_PCB_LISTEN | |
203 | #define MEMP_NUM_TCP_PCB_LISTEN 8 | |
204 | #endif | |
205 | ||
206 | /** | |
207 | * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. | |
208 | * (requires the LWIP_TCP option) | |
209 | */ | |
210 | #ifndef MEMP_NUM_TCP_SEG | |
211 | #define MEMP_NUM_TCP_SEG 16 | |
212 | #endif | |
213 | ||
214 | /** | |
215 | * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for | |
216 | * reassembly (whole packets, not fragments!) | |
217 | */ | |
218 | #ifndef MEMP_NUM_REASSDATA | |
219 | #define MEMP_NUM_REASSDATA 5 | |
220 | #endif | |
221 | ||
222 | /** | |
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) | |
227 | */ | |
228 | #ifndef MEMP_NUM_ARP_QUEUE | |
229 | #define MEMP_NUM_ARP_QUEUE 30 | |
230 | #endif | |
231 | ||
232 | /** | |
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) | |
237 | */ | |
238 | #ifndef MEMP_NUM_IGMP_GROUP | |
239 | #define MEMP_NUM_IGMP_GROUP 8 | |
240 | #endif | |
241 | ||
242 | /** | |
243 | * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. | |
244 | * (requires NO_SYS==0) | |
245 | */ | |
246 | #ifndef MEMP_NUM_SYS_TIMEOUT | |
247 | #define MEMP_NUM_SYS_TIMEOUT 3 | |
248 | #endif | |
249 | ||
250 | /** | |
251 | * MEMP_NUM_NETBUF: the number of struct netbufs. | |
252 | * (only needed if you use the sequential API, like api_lib.c) | |
253 | */ | |
254 | #ifndef MEMP_NUM_NETBUF | |
255 | #define MEMP_NUM_NETBUF 2 | |
256 | #endif | |
257 | ||
258 | /** | |
259 | * MEMP_NUM_NETCONN: the number of struct netconns. | |
260 | * (only needed if you use the sequential API, like api_lib.c) | |
261 | */ | |
262 | #ifndef MEMP_NUM_NETCONN | |
263 | #define MEMP_NUM_NETCONN 4 | |
264 | #endif | |
265 | ||
266 | /** | |
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) | |
270 | */ | |
271 | #ifndef MEMP_NUM_TCPIP_MSG_API | |
272 | #define MEMP_NUM_TCPIP_MSG_API 8 | |
273 | #endif | |
274 | ||
275 | /** | |
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) | |
279 | */ | |
280 | #ifndef MEMP_NUM_TCPIP_MSG_INPKT | |
281 | #define MEMP_NUM_TCPIP_MSG_INPKT 8 | |
282 | #endif | |
283 | ||
284 | /** | |
285 | * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. | |
286 | */ | |
287 | #ifndef PBUF_POOL_SIZE | |
288 | #define PBUF_POOL_SIZE 16 | |
289 | #endif | |
290 | ||
291 | /* | |
292 | --------------------------------- | |
293 | ---------- ARP options ---------- | |
294 | --------------------------------- | |
295 | */ | |
296 | /** | |
297 | * LWIP_ARP==1: Enable ARP functionality. | |
298 | */ | |
299 | #ifndef LWIP_ARP | |
300 | #define LWIP_ARP 1 | |
301 | #endif | |
302 | ||
303 | /** | |
304 | * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. | |
305 | */ | |
306 | #ifndef ARP_TABLE_SIZE | |
307 | #define ARP_TABLE_SIZE 10 | |
308 | #endif | |
309 | ||
310 | /** | |
311 | * ARP_QUEUEING==1: Outgoing packets are queued during hardware address | |
312 | * resolution. | |
313 | */ | |
314 | #ifndef ARP_QUEUEING | |
315 | #define ARP_QUEUEING 1 | |
316 | #endif | |
317 | ||
318 | /** | |
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. | |
325 | */ | |
326 | #ifndef ETHARP_TRUST_IP_MAC | |
327 | #define ETHARP_TRUST_IP_MAC 1 | |
328 | #endif | |
329 | ||
330 | /* | |
331 | -------------------------------- | |
332 | ---------- IP options ---------- | |
333 | -------------------------------- | |
334 | */ | |
335 | /** | |
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. | |
339 | */ | |
340 | #ifndef IP_FORWARD | |
341 | #define IP_FORWARD 0 | |
342 | #endif | |
343 | ||
344 | /** | |
345 | * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. | |
346 | * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. | |
347 | * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). | |
348 | */ | |
349 | #ifndef IP_OPTIONS_ALLOWED | |
350 | #define IP_OPTIONS_ALLOWED 1 | |
351 | #endif | |
352 | ||
353 | /** | |
354 | * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that | |
355 | * this option does not affect outgoing packet sizes, which can be controlled | |
356 | * via IP_FRAG. | |
357 | */ | |
358 | #ifndef IP_REASSEMBLY | |
359 | #define IP_REASSEMBLY 1 | |
360 | #endif | |
361 | ||
362 | /** | |
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. | |
366 | */ | |
367 | #ifndef IP_FRAG | |
368 | #define IP_FRAG 1 | |
369 | #endif | |
370 | ||
371 | /** | |
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. | |
375 | */ | |
376 | #ifndef IP_REASS_MAXAGE | |
377 | #define IP_REASS_MAXAGE 3 | |
378 | #endif | |
379 | ||
380 | /** | |
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! | |
385 | */ | |
386 | #ifndef IP_REASS_MAX_PBUFS | |
387 | #define IP_REASS_MAX_PBUFS 10 | |
388 | #endif | |
389 | ||
390 | /** | |
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. | |
394 | */ | |
395 | #ifndef IP_FRAG_USES_STATIC_BUF | |
396 | #define IP_FRAG_USES_STATIC_BUF 1 | |
397 | #endif | |
398 | ||
399 | /** | |
400 | * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer | |
401 | * (requires IP_FRAG_USES_STATIC_BUF==1) | |
402 | */ | |
403 | #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) | |
404 | #define IP_FRAG_MAX_MTU 1500 | |
405 | #endif | |
406 | ||
407 | /** | |
408 | * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. | |
409 | */ | |
410 | #ifndef IP_DEFAULT_TTL | |
411 | #define IP_DEFAULT_TTL 255 | |
412 | #endif | |
413 | ||
414 | /* | |
415 | ---------------------------------- | |
416 | ---------- ICMP options ---------- | |
417 | ---------------------------------- | |
418 | */ | |
419 | /** | |
420 | * LWIP_ICMP==1: Enable ICMP module inside the IP stack. | |
421 | * Be careful, disable that make your product non-compliant to RFC1122 | |
422 | */ | |
423 | #ifndef LWIP_ICMP | |
424 | #define LWIP_ICMP 1 | |
425 | #endif | |
426 | ||
427 | /** | |
428 | * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. | |
429 | */ | |
430 | #ifndef ICMP_TTL | |
431 | #define ICMP_TTL (IP_DEFAULT_TTL) | |
432 | #endif | |
433 | ||
434 | /* | |
435 | --------------------------------- | |
436 | ---------- RAW options ---------- | |
437 | --------------------------------- | |
438 | */ | |
439 | /** | |
440 | * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. | |
441 | */ | |
442 | #ifndef LWIP_RAW | |
443 | #define LWIP_RAW 1 | |
444 | #endif | |
445 | ||
446 | /** | |
447 | * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. | |
448 | */ | |
449 | #ifndef RAW_TTL | |
450 | #define RAW_TTL (IP_DEFAULT_TTL) | |
451 | #endif | |
452 | ||
453 | /* | |
454 | ---------------------------------- | |
455 | ---------- DHCP options ---------- | |
456 | ---------------------------------- | |
457 | */ | |
458 | /** | |
459 | * LWIP_DHCP==1: Enable DHCP module. | |
460 | */ | |
461 | #ifndef LWIP_DHCP | |
462 | #define LWIP_DHCP 0 | |
463 | #endif | |
464 | ||
465 | /** | |
466 | * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. | |
467 | */ | |
468 | #ifndef DHCP_DOES_ARP_CHECK | |
469 | #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) | |
470 | #endif | |
471 | ||
472 | /* | |
473 | ------------------------------------ | |
474 | ---------- AUTOIP options ---------- | |
475 | ------------------------------------ | |
476 | */ | |
477 | /** | |
478 | * LWIP_AUTOIP==1: Enable AUTOIP module. | |
479 | */ | |
480 | #ifndef LWIP_AUTOIP | |
481 | #define LWIP_AUTOIP 0 | |
482 | #endif | |
483 | ||
484 | /** | |
485 | * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on | |
486 | * the same interface at the same time. | |
487 | */ | |
488 | #ifndef LWIP_DHCP_AUTOIP_COOP | |
489 | #define LWIP_DHCP_AUTOIP_COOP 0 | |
490 | #endif | |
491 | ||
492 | /* | |
493 | ---------------------------------- | |
494 | ---------- SNMP options ---------- | |
495 | ---------------------------------- | |
496 | */ | |
497 | /** | |
498 | * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP | |
499 | * transport. | |
500 | */ | |
501 | #ifndef LWIP_SNMP | |
502 | #define LWIP_SNMP 0 | |
503 | #endif | |
504 | ||
505 | /** | |
506 | * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will | |
507 | * allow. At least one request buffer is required. | |
508 | */ | |
509 | #ifndef SNMP_CONCURRENT_REQUESTS | |
510 | #define SNMP_CONCURRENT_REQUESTS 1 | |
511 | #endif | |
512 | ||
513 | /** | |
514 | * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap | |
515 | * destination is required | |
516 | */ | |
517 | #ifndef SNMP_TRAP_DESTINATIONS | |
518 | #define SNMP_TRAP_DESTINATIONS 1 | |
519 | #endif | |
520 | ||
521 | /** | |
522 | * SNMP_PRIVATE_MIB: | |
523 | */ | |
524 | #ifndef SNMP_PRIVATE_MIB | |
525 | #define SNMP_PRIVATE_MIB 0 | |
526 | #endif | |
527 | ||
528 | /** | |
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! | |
532 | */ | |
533 | #ifndef SNMP_SAFE_REQUESTS | |
534 | #define SNMP_SAFE_REQUESTS 1 | |
535 | #endif | |
536 | ||
537 | /* | |
538 | ---------------------------------- | |
539 | ---------- IGMP options ---------- | |
540 | ---------------------------------- | |
541 | */ | |
542 | /** | |
543 | * LWIP_IGMP==1: Turn on IGMP module. | |
544 | */ | |
545 | #ifndef LWIP_IGMP | |
546 | #define LWIP_IGMP 0 | |
547 | #endif | |
548 | ||
549 | /* | |
550 | ---------------------------------- | |
551 | ---------- DNS options ----------- | |
552 | ---------------------------------- | |
553 | */ | |
554 | /** | |
555 | * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS | |
556 | * transport. | |
557 | */ | |
558 | #ifndef LWIP_DNS | |
559 | #define LWIP_DNS 0 | |
560 | #endif | |
561 | ||
562 | /** DNS maximum number of entries to maintain locally. */ | |
563 | #ifndef DNS_TABLE_SIZE | |
564 | #define DNS_TABLE_SIZE 4 | |
565 | #endif | |
566 | ||
567 | /** DNS maximum host name length supported in the name table. */ | |
568 | #ifndef DNS_MAX_NAME_LENGTH | |
569 | #define DNS_MAX_NAME_LENGTH 256 | |
570 | #endif | |
571 | ||
572 | /** The maximum of DNS servers */ | |
573 | #ifndef DNS_MAX_SERVERS | |
574 | #define DNS_MAX_SERVERS 2 | |
575 | #endif | |
576 | ||
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 | |
580 | #endif | |
581 | ||
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 | |
587 | #endif | |
588 | ||
589 | /** DNS message max. size. Default value is RFC compliant. */ | |
590 | #ifndef DNS_MSG_SIZE | |
591 | #define DNS_MSG_SIZE 512 | |
592 | #endif | |
593 | ||
594 | /* | |
595 | --------------------------------- | |
596 | ---------- UDP options ---------- | |
597 | --------------------------------- | |
598 | */ | |
599 | /** | |
600 | * LWIP_UDP==1: Turn on UDP. | |
601 | */ | |
602 | #ifndef LWIP_UDP | |
603 | #define LWIP_UDP 1 | |
604 | #endif | |
605 | ||
606 | /** | |
607 | * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) | |
608 | */ | |
609 | #ifndef LWIP_UDPLITE | |
610 | #define LWIP_UDPLITE 0 | |
611 | #endif | |
612 | ||
613 | /** | |
614 | * UDP_TTL: Default Time-To-Live value. | |
615 | */ | |
616 | #ifndef UDP_TTL | |
617 | #define UDP_TTL (IP_DEFAULT_TTL) | |
618 | #endif | |
619 | ||
620 | /* | |
621 | --------------------------------- | |
622 | ---------- TCP options ---------- | |
623 | --------------------------------- | |
624 | */ | |
625 | /** | |
626 | * LWIP_TCP==1: Turn on TCP. | |
627 | */ | |
628 | #ifndef LWIP_TCP | |
629 | #define LWIP_TCP 1 | |
630 | #endif | |
631 | ||
632 | /** | |
633 | * TCP_TTL: Default Time-To-Live value. | |
634 | */ | |
635 | #ifndef TCP_TTL | |
636 | #define TCP_TTL (IP_DEFAULT_TTL) | |
637 | #endif | |
638 | ||
639 | /** | |
640 | * TCP_WND: The size of a TCP window. | |
641 | */ | |
642 | #ifndef TCP_WND | |
643 | #define TCP_WND 2048 | |
644 | #endif | |
645 | ||
646 | /** | |
647 | * TCP_MAXRTX: Maximum number of retransmissions of data segments. | |
648 | */ | |
649 | #ifndef TCP_MAXRTX | |
650 | #define TCP_MAXRTX 12 | |
651 | #endif | |
652 | ||
653 | /** | |
654 | * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. | |
655 | */ | |
656 | #ifndef TCP_SYNMAXRTX | |
657 | #define TCP_SYNMAXRTX 6 | |
658 | #endif | |
659 | ||
660 | /** | |
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. | |
663 | */ | |
664 | #ifndef TCP_QUEUE_OOSEQ | |
665 | #define TCP_QUEUE_OOSEQ 1 | |
666 | #endif | |
667 | ||
668 | /** | |
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. | |
674 | */ | |
675 | #ifndef TCP_MSS | |
676 | #define TCP_MSS 128 | |
677 | #endif | |
678 | ||
679 | /** | |
680 | * TCP_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 if it would be too big otherwise. | |
686 | */ | |
687 | #ifndef TCP_CALCULATE_EFF_SEND_MSS | |
688 | #define TCP_CALCULATE_EFF_SEND_MSS 1 | |
689 | #endif | |
690 | ||
691 | ||
692 | /** | |
693 | * TCP_SND_BUF: TCP sender buffer space (bytes). | |
694 | */ | |
695 | #ifndef TCP_SND_BUF | |
696 | #define TCP_SND_BUF 256 | |
697 | #endif | |
698 | ||
699 | /** | |
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. | |
702 | */ | |
703 | #ifndef TCP_SND_QUEUELEN | |
704 | #define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS)) | |
705 | #endif | |
706 | ||
707 | /** | |
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. | |
711 | */ | |
712 | #ifndef TCP_SNDLOWAT | |
713 | #define TCP_SNDLOWAT (TCP_SND_BUF/2) | |
714 | #endif | |
715 | ||
716 | /** | |
717 | * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. | |
718 | */ | |
719 | #ifndef TCP_LISTEN_BACKLOG | |
720 | #define TCP_LISTEN_BACKLOG 0 | |
721 | #endif | |
722 | ||
723 | /** | |
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). | |
727 | */ | |
728 | #ifndef TCP_DEFAULT_LISTEN_BACKLOG | |
729 | #define TCP_DEFAULT_LISTEN_BACKLOG 0xff | |
730 | #endif | |
731 | ||
732 | /** | |
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 | |
737 | * for the event. | |
738 | */ | |
739 | #ifndef LWIP_EVENT_API | |
740 | #define LWIP_EVENT_API 0 | |
741 | #define LWIP_CALLBACK_API 1 | |
742 | #else | |
743 | #define LWIP_EVENT_API 1 | |
744 | #define LWIP_CALLBACK_API 0 | |
745 | #endif | |
746 | ||
747 | ||
748 | /* | |
749 | ---------------------------------- | |
750 | ---------- Pbuf options ---------- | |
751 | ---------------------------------- | |
752 | */ | |
753 | /** | |
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 | |
756 | * Ethernet. | |
757 | */ | |
758 | #ifndef PBUF_LINK_HLEN | |
759 | #define PBUF_LINK_HLEN 14 | |
760 | #endif | |
761 | ||
762 | /** | |
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. | |
766 | */ | |
767 | #ifndef PBUF_POOL_BUFSIZE | |
768 | #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) | |
769 | #endif | |
770 | ||
771 | /* | |
772 | ------------------------------------------------ | |
773 | ---------- Network Interfaces options ---------- | |
774 | ------------------------------------------------ | |
775 | */ | |
776 | /** | |
777 | * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname | |
778 | * field. | |
779 | */ | |
780 | #ifndef LWIP_NETIF_HOSTNAME | |
781 | #define LWIP_NETIF_HOSTNAME 0 | |
782 | #endif | |
783 | ||
784 | /** | |
785 | * LWIP_NETIF_API==1: Support netif api (in netifapi.c) | |
786 | */ | |
787 | #ifndef LWIP_NETIF_API | |
788 | #define LWIP_NETIF_API 0 | |
789 | #endif | |
790 | ||
791 | /** | |
792 | * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface | |
793 | * changes its up/down status (i.e., due to DHCP IP acquistion) | |
794 | */ | |
795 | #ifndef LWIP_NETIF_STATUS_CALLBACK | |
796 | #define LWIP_NETIF_STATUS_CALLBACK 0 | |
797 | #endif | |
798 | ||
799 | /** | |
800 | * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface | |
801 | * whenever the link changes (i.e., link down) | |
802 | */ | |
803 | #ifndef LWIP_NETIF_LINK_CALLBACK | |
804 | #define LWIP_NETIF_LINK_CALLBACK 0 | |
805 | #endif | |
806 | ||
807 | /** | |
808 | * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table | |
809 | * indices) in struct netif. TCP and UDP can make use of this to prevent | |
810 | * scanning the ARP table for every sent packet. While this is faster for big | |
811 | * ARP tables or many concurrent connections, it might be counterproductive | |
812 | * if you have a tiny ARP table or if there never are concurrent connections. | |
813 | */ | |
814 | #ifndef LWIP_NETIF_HWADDRHINT | |
815 | #define LWIP_NETIF_HWADDRHINT 0 | |
816 | #endif | |
817 | ||
818 | /* | |
819 | ------------------------------------ | |
820 | ---------- LOOPIF options ---------- | |
821 | ------------------------------------ | |
822 | */ | |
823 | /** | |
824 | * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c | |
825 | */ | |
826 | #ifndef LWIP_HAVE_LOOPIF | |
827 | #define LWIP_HAVE_LOOPIF 0 | |
828 | #endif | |
829 | ||
830 | /** | |
831 | * LWIP_LOOPIF_MULTITHREADING: Indicates whether threading is enabled in | |
832 | * the system, as LOOPIF must change how it behaves depending on this setting. | |
833 | * Setting this is needed to avoid reentering non-reentrant functions like | |
834 | * tcp_input(). | |
835 | * LWIP_LOOPIF_MULTITHREADING==1: Indicates that the user is using a | |
836 | * multithreaded environment like tcpip.c. In this case, netif->input() | |
837 | * is called directly. | |
838 | * LWIP_LOOPIF_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. | |
839 | * The packets are put on a list and loopif_poll() must be called in | |
840 | * the main application loop. | |
841 | */ | |
842 | #ifndef LWIP_LOOPIF_MULTITHREADING | |
843 | #define LWIP_LOOPIF_MULTITHREADING 1 | |
844 | #endif | |
845 | ||
846 | /* | |
847 | ------------------------------------ | |
848 | ---------- Thread options ---------- | |
849 | ------------------------------------ | |
850 | */ | |
851 | /** | |
852 | * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. | |
853 | */ | |
854 | #ifndef TCPIP_THREAD_NAME | |
855 | #define TCPIP_THREAD_NAME "tcpip_thread" | |
856 | #endif | |
857 | ||
858 | /** | |
859 | * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. | |
860 | * The stack size value itself is platform-dependent, but is passed to | |
861 | * sys_thread_new() when the thread is created. | |
862 | */ | |
863 | #ifndef TCPIP_THREAD_STACKSIZE | |
864 | #define TCPIP_THREAD_STACKSIZE 0 | |
865 | #endif | |
866 | ||
867 | /** | |
868 | * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. | |
869 | * The priority value itself is platform-dependent, but is passed to | |
870 | * sys_thread_new() when the thread is created. | |
871 | */ | |
872 | #ifndef TCPIP_THREAD_PRIO | |
873 | #define TCPIP_THREAD_PRIO 1 | |
874 | #endif | |
875 | ||
876 | /** | |
877 | * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages | |
878 | * The queue size value itself is platform-dependent, but is passed to | |
879 | * sys_mbox_new() when tcpip_init is called. | |
880 | */ | |
881 | #ifndef TCPIP_MBOX_SIZE | |
882 | #define TCPIP_MBOX_SIZE 0 | |
883 | #endif | |
884 | ||
885 | /** | |
886 | * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. | |
887 | */ | |
888 | #ifndef SLIPIF_THREAD_NAME | |
889 | #define SLIPIF_THREAD_NAME "slipif_loop" | |
890 | #endif | |
891 | ||
892 | /** | |
893 | * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. | |
894 | * The stack size value itself is platform-dependent, but is passed to | |
895 | * sys_thread_new() when the thread is created. | |
896 | */ | |
897 | #ifndef SLIPIF_THREAD_STACKSIZE | |
898 | #define SLIPIF_THREAD_STACKSIZE 0 | |
899 | #endif | |
900 | ||
901 | /** | |
902 | * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. | |
903 | * The priority value itself is platform-dependent, but is passed to | |
904 | * sys_thread_new() when the thread is created. | |
905 | */ | |
906 | #ifndef SLIPIF_THREAD_PRIO | |
907 | #define SLIPIF_THREAD_PRIO 1 | |
908 | #endif | |
909 | ||
910 | /** | |
911 | * PPP_THREAD_NAME: The name assigned to the pppMain thread. | |
912 | */ | |
913 | #ifndef PPP_THREAD_NAME | |
914 | #define PPP_THREAD_NAME "pppMain" | |
915 | #endif | |
916 | ||
917 | /** | |
918 | * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread. | |
919 | * The stack size value itself is platform-dependent, but is passed to | |
920 | * sys_thread_new() when the thread is created. | |
921 | */ | |
922 | #ifndef PPP_THREAD_STACKSIZE | |
923 | #define PPP_THREAD_STACKSIZE 0 | |
924 | #endif | |
925 | ||
926 | /** | |
927 | * PPP_THREAD_PRIO: The priority assigned to the pppMain thread. | |
928 | * The priority value itself is platform-dependent, but is passed to | |
929 | * sys_thread_new() when the thread is created. | |
930 | */ | |
931 | #ifndef PPP_THREAD_PRIO | |
932 | #define PPP_THREAD_PRIO 1 | |
933 | #endif | |
934 | ||
935 | /** | |
936 | * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. | |
937 | */ | |
938 | #ifndef DEFAULT_THREAD_NAME | |
939 | #define DEFAULT_THREAD_NAME "lwIP" | |
940 | #endif | |
941 | ||
942 | /** | |
943 | * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. | |
944 | * The stack size value itself is platform-dependent, but is passed to | |
945 | * sys_thread_new() when the thread is created. | |
946 | */ | |
947 | #ifndef DEFAULT_THREAD_STACKSIZE | |
948 | #define DEFAULT_THREAD_STACKSIZE 0 | |
949 | #endif | |
950 | ||
951 | /** | |
952 | * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. | |
953 | * The priority value itself is platform-dependent, but is passed to | |
954 | * sys_thread_new() when the thread is created. | |
955 | */ | |
956 | #ifndef DEFAULT_THREAD_PRIO | |
957 | #define DEFAULT_THREAD_PRIO 1 | |
958 | #endif | |
959 | ||
960 | /** | |
961 | * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a | |
962 | * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed | |
963 | * to sys_mbox_new() when the recvmbox is created. | |
964 | */ | |
965 | #ifndef DEFAULT_RAW_RECVMBOX_SIZE | |
966 | #define DEFAULT_RAW_RECVMBOX_SIZE 0 | |
967 | #endif | |
968 | ||
969 | /** | |
970 | * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a | |
971 | * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed | |
972 | * to sys_mbox_new() when the recvmbox is created. | |
973 | */ | |
974 | #ifndef DEFAULT_UDP_RECVMBOX_SIZE | |
975 | #define DEFAULT_UDP_RECVMBOX_SIZE 0 | |
976 | #endif | |
977 | ||
978 | /** | |
979 | * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a | |
980 | * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed | |
981 | * to sys_mbox_new() when the recvmbox is created. | |
982 | */ | |
983 | #ifndef DEFAULT_TCP_RECVMBOX_SIZE | |
984 | #define DEFAULT_TCP_RECVMBOX_SIZE 0 | |
985 | #endif | |
986 | ||
987 | /** | |
988 | * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. | |
989 | * The queue size value itself is platform-dependent, but is passed to | |
990 | * sys_mbox_new() when the acceptmbox is created. | |
991 | */ | |
992 | #ifndef DEFAULT_ACCEPTMBOX_SIZE | |
993 | #define DEFAULT_ACCEPTMBOX_SIZE 0 | |
994 | #endif | |
995 | ||
996 | /* | |
997 | ---------------------------------------------- | |
998 | ---------- Sequential layer options ---------- | |
999 | ---------------------------------------------- | |
1000 | */ | |
1001 | /** | |
1002 | * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) | |
1003 | * Don't use it if you're not an active lwIP project member | |
1004 | */ | |
1005 | #ifndef LWIP_TCPIP_CORE_LOCKING | |
1006 | #define LWIP_TCPIP_CORE_LOCKING 0 | |
1007 | #endif | |
1008 | ||
1009 | /** | |
1010 | * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) | |
1011 | */ | |
1012 | #ifndef LWIP_NETCONN | |
1013 | #define LWIP_NETCONN 1 | |
1014 | #endif | |
1015 | ||
1016 | /* | |
1017 | ------------------------------------ | |
1018 | ---------- Socket options ---------- | |
1019 | ------------------------------------ | |
1020 | */ | |
1021 | /** | |
1022 | * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) | |
1023 | */ | |
1024 | #ifndef LWIP_SOCKET | |
1025 | #define LWIP_SOCKET 1 | |
1026 | #endif | |
1027 | ||
1028 | /** | |
1029 | * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. | |
1030 | * (only used if you use sockets.c) | |
1031 | */ | |
1032 | #ifndef LWIP_COMPAT_SOCKETS | |
1033 | #define LWIP_COMPAT_SOCKETS 1 | |
1034 | #endif | |
1035 | ||
1036 | /** | |
1037 | * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. | |
1038 | * Disable this option if you use a POSIX operating system that uses the same | |
1039 | * names (read, write & close). (only used if you use sockets.c) | |
1040 | */ | |
1041 | #ifndef LWIP_POSIX_SOCKETS_IO_NAMES | |
1042 | #define LWIP_POSIX_SOCKETS_IO_NAMES 1 | |
1043 | #endif | |
1044 | ||
1045 | /** | |
1046 | * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT | |
1047 | * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set | |
1048 | * in seconds. (does not require sockets.c, and will affect tcp.c) | |
1049 | */ | |
1050 | #ifndef LWIP_TCP_KEEPALIVE | |
1051 | #define LWIP_TCP_KEEPALIVE 0 | |
1052 | #endif | |
1053 | ||
1054 | /** | |
1055 | * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. | |
1056 | */ | |
1057 | #ifndef LWIP_SO_RCVTIMEO | |
1058 | #define LWIP_SO_RCVTIMEO 0 | |
1059 | #endif | |
1060 | ||
1061 | /** | |
1062 | * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. | |
1063 | */ | |
1064 | #ifndef LWIP_SO_RCVBUF | |
1065 | #define LWIP_SO_RCVBUF 0 | |
1066 | #endif | |
1067 | ||
1068 | /** | |
1069 | * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE! | |
1070 | */ | |
1071 | #ifndef SO_REUSE | |
1072 | #define SO_REUSE 0 | |
1073 | #endif | |
1074 | ||
1075 | /* | |
1076 | ---------------------------------------- | |
1077 | ---------- Statistics options ---------- | |
1078 | ---------------------------------------- | |
1079 | */ | |
1080 | /** | |
1081 | * LWIP_STATS==1: Enable statistics collection in lwip_stats. | |
1082 | */ | |
1083 | #ifndef LWIP_STATS | |
1084 | #define LWIP_STATS 1 | |
1085 | #endif | |
1086 | ||
1087 | #if LWIP_STATS | |
1088 | ||
1089 | /** | |
1090 | * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. | |
1091 | */ | |
1092 | #ifndef LWIP_STATS_DISPLAY | |
1093 | #define LWIP_STATS_DISPLAY 0 | |
1094 | #endif | |
1095 | ||
1096 | /** | |
1097 | * LINK_STATS==1: Enable link stats. | |
1098 | */ | |
1099 | #ifndef LINK_STATS | |
1100 | #define LINK_STATS 1 | |
1101 | #endif | |
1102 | ||
1103 | /** | |
1104 | * ETHARP_STATS==1: Enable etharp stats. | |
1105 | */ | |
1106 | #ifndef ETHARP_STATS | |
1107 | #define ETHARP_STATS (LWIP_ARP) | |
1108 | #endif | |
1109 | ||
1110 | /** | |
1111 | * IP_STATS==1: Enable IP stats. | |
1112 | */ | |
1113 | #ifndef IP_STATS | |
1114 | #define IP_STATS 1 | |
1115 | #endif | |
1116 | ||
1117 | /** | |
1118 | * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is | |
1119 | * on if using either frag or reass. | |
1120 | */ | |
1121 | #ifndef IPFRAG_STATS | |
1122 | #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) | |
1123 | #endif | |
1124 | ||
1125 | /** | |
1126 | * ICMP_STATS==1: Enable ICMP stats. | |
1127 | */ | |
1128 | #ifndef ICMP_STATS | |
1129 | #define ICMP_STATS 1 | |
1130 | #endif | |
1131 | ||
1132 | /** | |
1133 | * IGMP_STATS==1: Enable IGMP stats. | |
1134 | */ | |
1135 | #ifndef IGMP_STATS | |
1136 | #define IGMP_STATS (LWIP_IGMP) | |
1137 | #endif | |
1138 | ||
1139 | /** | |
1140 | * UDP_STATS==1: Enable UDP stats. Default is on if | |
1141 | * UDP enabled, otherwise off. | |
1142 | */ | |
1143 | #ifndef UDP_STATS | |
1144 | #define UDP_STATS (LWIP_UDP) | |
1145 | #endif | |
1146 | ||
1147 | /** | |
1148 | * TCP_STATS==1: Enable TCP stats. Default is on if TCP | |
1149 | * enabled, otherwise off. | |
1150 | */ | |
1151 | #ifndef TCP_STATS | |
1152 | #define TCP_STATS (LWIP_TCP) | |
1153 | #endif | |
1154 | ||
1155 | /** | |
1156 | * MEM_STATS==1: Enable mem.c stats. | |
1157 | */ | |
1158 | #ifndef MEM_STATS | |
1159 | #define MEM_STATS 1 | |
1160 | #endif | |
1161 | ||
1162 | /** | |
1163 | * MEMP_STATS==1: Enable memp.c pool stats. | |
1164 | */ | |
1165 | #ifndef MEMP_STATS | |
1166 | #define MEMP_STATS 1 | |
1167 | #endif | |
1168 | ||
1169 | /** | |
1170 | * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). | |
1171 | */ | |
1172 | #ifndef SYS_STATS | |
1173 | #define SYS_STATS 1 | |
1174 | #endif | |
1175 | ||
1176 | #else | |
1177 | ||
1178 | #define LINK_STATS 0 | |
1179 | #define IP_STATS 0 | |
1180 | #define IPFRAG_STATS 0 | |
1181 | #define ICMP_STATS 0 | |
1182 | #define IGMP_STATS 0 | |
1183 | #define UDP_STATS 0 | |
1184 | #define TCP_STATS 0 | |
1185 | #define MEM_STATS 0 | |
1186 | #define MEMP_STATS 0 | |
1187 | #define SYS_STATS 0 | |
1188 | #define LWIP_STATS_DISPLAY 0 | |
1189 | ||
1190 | #endif /* LWIP_STATS */ | |
1191 | ||
1192 | /* | |
1193 | --------------------------------- | |
1194 | ---------- PPP options ---------- | |
1195 | --------------------------------- | |
1196 | */ | |
1197 | /** | |
1198 | * PPP_SUPPORT==1: Enable PPP. | |
1199 | */ | |
1200 | #ifndef PPP_SUPPORT | |
1201 | #define PPP_SUPPORT 0 | |
1202 | #endif | |
1203 | ||
1204 | /** | |
1205 | * PPPOE_SUPPORT==1: Enable PPP Over Ethernet | |
1206 | */ | |
1207 | #ifndef PPPOE_SUPPORT | |
1208 | #define PPPOE_SUPPORT 0 | |
1209 | #endif | |
1210 | ||
1211 | /** | |
1212 | * PPPOS_SUPPORT==1: Enable PPP Over Serial | |
1213 | */ | |
1214 | #ifndef PPPOS_SUPPORT | |
1215 | #define PPPOS_SUPPORT PPP_SUPPORT | |
1216 | #endif | |
1217 | ||
1218 | #if PPP_SUPPORT | |
1219 | ||
1220 | /** | |
1221 | * NUM_PPP: Max PPP sessions. | |
1222 | */ | |
1223 | #ifndef NUM_PPP | |
1224 | #define NUM_PPP 1 | |
1225 | #endif | |
1226 | ||
1227 | /** | |
1228 | * PAP_SUPPORT==1: Support PAP. | |
1229 | */ | |
1230 | #ifndef PAP_SUPPORT | |
1231 | #define PAP_SUPPORT 0 | |
1232 | #endif | |
1233 | ||
1234 | /** | |
1235 | * CHAP_SUPPORT==1: Support CHAP. | |
1236 | */ | |
1237 | #ifndef CHAP_SUPPORT | |
1238 | #define CHAP_SUPPORT 0 | |
1239 | #endif | |
1240 | ||
1241 | /** | |
1242 | * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! | |
1243 | */ | |
1244 | #ifndef MSCHAP_SUPPORT | |
1245 | #define MSCHAP_SUPPORT 0 | |
1246 | #endif | |
1247 | ||
1248 | /** | |
1249 | * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! | |
1250 | */ | |
1251 | #ifndef CBCP_SUPPORT | |
1252 | #define CBCP_SUPPORT 0 | |
1253 | #endif | |
1254 | ||
1255 | /** | |
1256 | * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! | |
1257 | */ | |
1258 | #ifndef CCP_SUPPORT | |
1259 | #define CCP_SUPPORT 0 | |
1260 | #endif | |
1261 | ||
1262 | /** | |
1263 | * VJ_SUPPORT==1: Support VJ header compression. | |
1264 | */ | |
1265 | #ifndef VJ_SUPPORT | |
1266 | #define VJ_SUPPORT 0 | |
1267 | #endif | |
1268 | ||
1269 | /** | |
1270 | * MD5_SUPPORT==1: Support MD5 (see also CHAP). | |
1271 | */ | |
1272 | #ifndef MD5_SUPPORT | |
1273 | #define MD5_SUPPORT 0 | |
1274 | #endif | |
1275 | ||
1276 | /* | |
1277 | * Timeouts | |
1278 | */ | |
1279 | #ifndef FSM_DEFTIMEOUT | |
1280 | #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ | |
1281 | #endif | |
1282 | ||
1283 | #ifndef FSM_DEFMAXTERMREQS | |
1284 | #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ | |
1285 | #endif | |
1286 | ||
1287 | #ifndef FSM_DEFMAXCONFREQS | |
1288 | #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ | |
1289 | #endif | |
1290 | ||
1291 | #ifndef FSM_DEFMAXNAKLOOPS | |
1292 | #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ | |
1293 | #endif | |
1294 | ||
1295 | #ifndef UPAP_DEFTIMEOUT | |
1296 | #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ | |
1297 | #endif | |
1298 | ||
1299 | #ifndef UPAP_DEFREQTIME | |
1300 | #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ | |
1301 | #endif | |
1302 | ||
1303 | #ifndef CHAP_DEFTIMEOUT | |
1304 | #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ | |
1305 | #endif | |
1306 | ||
1307 | #ifndef CHAP_DEFTRANSMITS | |
1308 | #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ | |
1309 | #endif | |
1310 | ||
1311 | /* Interval in seconds between keepalive echo requests, 0 to disable. */ | |
1312 | #ifndef LCP_ECHOINTERVAL | |
1313 | #define LCP_ECHOINTERVAL 0 | |
1314 | #endif | |
1315 | ||
1316 | /* Number of unanswered echo requests before failure. */ | |
1317 | #ifndef LCP_MAXECHOFAILS | |
1318 | #define LCP_MAXECHOFAILS 3 | |
1319 | #endif | |
1320 | ||
1321 | /* Max Xmit idle time (in jiffies) before resend flag char. */ | |
1322 | #ifndef PPP_MAXIDLEFLAG | |
1323 | #define PPP_MAXIDLEFLAG 100 | |
1324 | #endif | |
1325 | ||
1326 | /* | |
1327 | * Packet sizes | |
1328 | * | |
1329 | * Note - lcp shouldn't be allowed to negotiate stuff outside these | |
1330 | * limits. See lcp.h in the pppd directory. | |
1331 | * (XXX - these constants should simply be shared by lcp.c instead | |
1332 | * of living in lcp.h) | |
1333 | */ | |
1334 | #define PPP_MTU 1500 /* Default MTU (size of Info field) */ | |
1335 | #ifndef PPP_MAXMTU | |
1336 | /* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */ | |
1337 | #define PPP_MAXMTU 1500 /* Largest MTU we allow */ | |
1338 | #endif | |
1339 | #define PPP_MINMTU 64 | |
1340 | #define PPP_MRU 1500 /* default MRU = max length of info field */ | |
1341 | #define PPP_MAXMRU 1500 /* Largest MRU we allow */ | |
1342 | #ifndef PPP_DEFMRU | |
1343 | #define PPP_DEFMRU 296 /* Try for this */ | |
1344 | #endif | |
1345 | #define PPP_MINMRU 128 /* No MRUs below this */ | |
1346 | ||
1347 | ||
1348 | #define MAXNAMELEN 256 /* max length of hostname or name for auth */ | |
1349 | #define MAXSECRETLEN 256 /* max length of password or secret */ | |
1350 | ||
1351 | #endif /* PPP_SUPPORT */ | |
1352 | ||
1353 | /* | |
1354 | -------------------------------------- | |
1355 | ---------- Checksum options ---------- | |
1356 | -------------------------------------- | |
1357 | */ | |
1358 | /** | |
1359 | * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. | |
1360 | */ | |
1361 | #ifndef CHECKSUM_GEN_IP | |
1362 | #define CHECKSUM_GEN_IP 1 | |
1363 | #endif | |
1364 | ||
1365 | /** | |
1366 | * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. | |
1367 | */ | |
1368 | #ifndef CHECKSUM_GEN_UDP | |
1369 | #define CHECKSUM_GEN_UDP 1 | |
1370 | #endif | |
1371 | ||
1372 | /** | |
1373 | * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. | |
1374 | */ | |
1375 | #ifndef CHECKSUM_GEN_TCP | |
1376 | #define CHECKSUM_GEN_TCP 1 | |
1377 | #endif | |
1378 | ||
1379 | /** | |
1380 | * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. | |
1381 | */ | |
1382 | #ifndef CHECKSUM_CHECK_IP | |
1383 | #define CHECKSUM_CHECK_IP 1 | |
1384 | #endif | |
1385 | ||
1386 | /** | |
1387 | * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. | |
1388 | */ | |
1389 | #ifndef CHECKSUM_CHECK_UDP | |
1390 | #define CHECKSUM_CHECK_UDP 1 | |
1391 | #endif | |
1392 | ||
1393 | /** | |
1394 | * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. | |
1395 | */ | |
1396 | #ifndef CHECKSUM_CHECK_TCP | |
1397 | #define CHECKSUM_CHECK_TCP 1 | |
1398 | #endif | |
1399 | ||
1400 | /* | |
1401 | --------------------------------------- | |
1402 | ---------- Debugging options ---------- | |
1403 | --------------------------------------- | |
1404 | */ | |
1405 | /** | |
1406 | * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is | |
1407 | * compared against this value. If it is smaller, then debugging | |
1408 | * messages are written. | |
1409 | */ | |
1410 | #ifndef LWIP_DBG_MIN_LEVEL | |
1411 | #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF | |
1412 | #endif | |
1413 | ||
1414 | /** | |
1415 | * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable | |
1416 | * debug messages of certain types. | |
1417 | */ | |
1418 | #ifndef LWIP_DBG_TYPES_ON | |
1419 | #define LWIP_DBG_TYPES_ON LWIP_DBG_ON | |
1420 | #endif | |
1421 | ||
1422 | /** | |
1423 | * ETHARP_DEBUG: Enable debugging in etharp.c. | |
1424 | */ | |
1425 | #ifndef ETHARP_DEBUG | |
1426 | #define ETHARP_DEBUG LWIP_DBG_OFF | |
1427 | #endif | |
1428 | ||
1429 | /** | |
1430 | * NETIF_DEBUG: Enable debugging in netif.c. | |
1431 | */ | |
1432 | #ifndef NETIF_DEBUG | |
1433 | #define NETIF_DEBUG LWIP_DBG_OFF | |
1434 | #endif | |
1435 | ||
1436 | /** | |
1437 | * PBUF_DEBUG: Enable debugging in pbuf.c. | |
1438 | */ | |
1439 | #ifndef PBUF_DEBUG | |
1440 | #define PBUF_DEBUG LWIP_DBG_OFF | |
1441 | #endif | |
1442 | ||
1443 | /** | |
1444 | * API_LIB_DEBUG: Enable debugging in api_lib.c. | |
1445 | */ | |
1446 | #ifndef API_LIB_DEBUG | |
1447 | #define API_LIB_DEBUG LWIP_DBG_OFF | |
1448 | #endif | |
1449 | ||
1450 | /** | |
1451 | * API_MSG_DEBUG: Enable debugging in api_msg.c. | |
1452 | */ | |
1453 | #ifndef API_MSG_DEBUG | |
1454 | #define API_MSG_DEBUG LWIP_DBG_OFF | |
1455 | #endif | |
1456 | ||
1457 | /** | |
1458 | * SOCKETS_DEBUG: Enable debugging in sockets.c. | |
1459 | */ | |
1460 | #ifndef SOCKETS_DEBUG | |
1461 | #define SOCKETS_DEBUG LWIP_DBG_OFF | |
1462 | #endif | |
1463 | ||
1464 | /** | |
1465 | * ICMP_DEBUG: Enable debugging in icmp.c. | |
1466 | */ | |
1467 | #ifndef ICMP_DEBUG | |
1468 | #define ICMP_DEBUG LWIP_DBG_OFF | |
1469 | #endif | |
1470 | ||
1471 | /** | |
1472 | * IGMP_DEBUG: Enable debugging in igmp.c. | |
1473 | */ | |
1474 | #ifndef IGMP_DEBUG | |
1475 | #define IGMP_DEBUG LWIP_DBG_OFF | |
1476 | #endif | |
1477 | ||
1478 | /** | |
1479 | * INET_DEBUG: Enable debugging in inet.c. | |
1480 | */ | |
1481 | #ifndef INET_DEBUG | |
1482 | #define INET_DEBUG LWIP_DBG_OFF | |
1483 | #endif | |
1484 | ||
1485 | /** | |
1486 | * IP_DEBUG: Enable debugging for IP. | |
1487 | */ | |
1488 | #ifndef IP_DEBUG | |
1489 | #define IP_DEBUG LWIP_DBG_OFF | |
1490 | #endif | |
1491 | ||
1492 | /** | |
1493 | * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. | |
1494 | */ | |
1495 | #ifndef IP_REASS_DEBUG | |
1496 | #define IP_REASS_DEBUG LWIP_DBG_OFF | |
1497 | #endif | |
1498 | ||
1499 | /** | |
1500 | * RAW_DEBUG: Enable debugging in raw.c. | |
1501 | */ | |
1502 | #ifndef RAW_DEBUG | |
1503 | #define RAW_DEBUG LWIP_DBG_OFF | |
1504 | #endif | |
1505 | ||
1506 | /** | |
1507 | * MEM_DEBUG: Enable debugging in mem.c. | |
1508 | */ | |
1509 | #ifndef MEM_DEBUG | |
1510 | #define MEM_DEBUG LWIP_DBG_OFF | |
1511 | #endif | |
1512 | ||
1513 | /** | |
1514 | * MEMP_DEBUG: Enable debugging in memp.c. | |
1515 | */ | |
1516 | #ifndef MEMP_DEBUG | |
1517 | #define MEMP_DEBUG LWIP_DBG_OFF | |
1518 | #endif | |
1519 | ||
1520 | /** | |
1521 | * SYS_DEBUG: Enable debugging in sys.c. | |
1522 | */ | |
1523 | #ifndef SYS_DEBUG | |
1524 | #define SYS_DEBUG LWIP_DBG_OFF | |
1525 | #endif | |
1526 | ||
1527 | /** | |
1528 | * TCP_DEBUG: Enable debugging for TCP. | |
1529 | */ | |
1530 | #ifndef TCP_DEBUG | |
1531 | #define TCP_DEBUG LWIP_DBG_OFF | |
1532 | #endif | |
1533 | ||
1534 | /** | |
1535 | * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. | |
1536 | */ | |
1537 | #ifndef TCP_INPUT_DEBUG | |
1538 | #define TCP_INPUT_DEBUG LWIP_DBG_OFF | |
1539 | #endif | |
1540 | ||
1541 | /** | |
1542 | * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. | |
1543 | */ | |
1544 | #ifndef TCP_FR_DEBUG | |
1545 | #define TCP_FR_DEBUG LWIP_DBG_OFF | |
1546 | #endif | |
1547 | ||
1548 | /** | |
1549 | * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit | |
1550 | * timeout. | |
1551 | */ | |
1552 | #ifndef TCP_RTO_DEBUG | |
1553 | #define TCP_RTO_DEBUG LWIP_DBG_OFF | |
1554 | #endif | |
1555 | ||
1556 | /** | |
1557 | * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. | |
1558 | */ | |
1559 | #ifndef TCP_CWND_DEBUG | |
1560 | #define TCP_CWND_DEBUG LWIP_DBG_OFF | |
1561 | #endif | |
1562 | ||
1563 | /** | |
1564 | * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. | |
1565 | */ | |
1566 | #ifndef TCP_WND_DEBUG | |
1567 | #define TCP_WND_DEBUG LWIP_DBG_OFF | |
1568 | #endif | |
1569 | ||
1570 | /** | |
1571 | * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. | |
1572 | */ | |
1573 | #ifndef TCP_OUTPUT_DEBUG | |
1574 | #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF | |
1575 | #endif | |
1576 | ||
1577 | /** | |
1578 | * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. | |
1579 | */ | |
1580 | #ifndef TCP_RST_DEBUG | |
1581 | #define TCP_RST_DEBUG LWIP_DBG_OFF | |
1582 | #endif | |
1583 | ||
1584 | /** | |
1585 | * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. | |
1586 | */ | |
1587 | #ifndef TCP_QLEN_DEBUG | |
1588 | #define TCP_QLEN_DEBUG LWIP_DBG_OFF | |
1589 | #endif | |
1590 | ||
1591 | /** | |
1592 | * UDP_DEBUG: Enable debugging in UDP. | |
1593 | */ | |
1594 | #ifndef UDP_DEBUG | |
1595 | #define UDP_DEBUG LWIP_DBG_OFF | |
1596 | #endif | |
1597 | ||
1598 | /** | |
1599 | * TCPIP_DEBUG: Enable debugging in tcpip.c. | |
1600 | */ | |
1601 | #ifndef TCPIP_DEBUG | |
1602 | #define TCPIP_DEBUG LWIP_DBG_OFF | |
1603 | #endif | |
1604 | ||
1605 | /** | |
1606 | * PPP_DEBUG: Enable debugging for PPP. | |
1607 | */ | |
1608 | #ifndef PPP_DEBUG | |
1609 | #define PPP_DEBUG LWIP_DBG_OFF | |
1610 | #endif | |
1611 | ||
1612 | /** | |
1613 | * SLIP_DEBUG: Enable debugging in slipif.c. | |
1614 | */ | |
1615 | #ifndef SLIP_DEBUG | |
1616 | #define SLIP_DEBUG LWIP_DBG_OFF | |
1617 | #endif | |
1618 | ||
1619 | /** | |
1620 | * DHCP_DEBUG: Enable debugging in dhcp.c. | |
1621 | */ | |
1622 | #ifndef DHCP_DEBUG | |
1623 | #define DHCP_DEBUG LWIP_DBG_OFF | |
1624 | #endif | |
1625 | ||
1626 | /** | |
1627 | * AUTOIP_DEBUG: Enable debugging in autoip.c. | |
1628 | */ | |
1629 | #ifndef AUTOIP_DEBUG | |
1630 | #define AUTOIP_DEBUG LWIP_DBG_OFF | |
1631 | #endif | |
1632 | ||
1633 | /** | |
1634 | * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. | |
1635 | */ | |
1636 | #ifndef SNMP_MSG_DEBUG | |
1637 | #define SNMP_MSG_DEBUG LWIP_DBG_OFF | |
1638 | #endif | |
1639 | ||
1640 | /** | |
1641 | * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. | |
1642 | */ | |
1643 | #ifndef SNMP_MIB_DEBUG | |
1644 | #define SNMP_MIB_DEBUG LWIP_DBG_OFF | |
1645 | #endif | |
1646 | ||
1647 | /** | |
1648 | * DNS_DEBUG: Enable debugging for DNS. | |
1649 | */ | |
1650 | #ifndef DNS_DEBUG | |
1651 | #define DNS_DEBUG LWIP_DBG_OFF | |
1652 | #endif | |
1653 | ||
1654 | #endif /* __LWIP_OPT_H__ */ |