]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/net/lwip_tcpip/v2_0/include/lwip/opt.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / net / lwip_tcpip / v2_0 / include / lwip / opt.h
1 /*
2  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
3  * All rights reserved. 
4  * 
5  * Redistribution and use in source and binary forms, with or without modification, 
6  * are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  *    derived from this software without specific prior written permission. 
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
25  * OF SUCH DAMAGE.
26  *
27  * This file is part of the lwIP TCP/IP stack.
28  * 
29  * Author: Adam Dunkels <adam@sics.se>
30  *
31  */
32 #ifndef __LWIP_OPT_H__
33 #define __LWIP_OPT_H__
34
35 /* Include user defined options first */
36 #include "lwipopts.h"
37 #include "lwip/debug.h"
38
39 /* Define default values for unconfigured parameters. */
40
41 /* Platform specific locking */
42
43 /*
44  * enable SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
45  * for certain critical regions during buffer allocation, deallocation and memory
46  * allocation and deallocation.
47  */
48 #ifndef SYS_LIGHTWEIGHT_PROT
49 #define SYS_LIGHTWEIGHT_PROT            0
50 #endif
51
52 #ifndef NO_SYS
53 #define NO_SYS                          0
54 #endif
55 /* ---------- Memory options ---------- */
56 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
57    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
58    byte alignment -> define MEM_ALIGNMENT to 2. */
59
60 #ifndef MEM_ALIGNMENT
61 #define MEM_ALIGNMENT                   1
62 #endif
63
64 /* MEM_SIZE: the size of the heap memory. If the application will send
65 a lot of data that needs to be copied, this should be set high. */
66 #ifndef MEM_SIZE
67 #define MEM_SIZE                        1600
68 #endif
69
70 #ifndef MEMP_SANITY_CHECK
71 #define MEMP_SANITY_CHECK       0
72 #endif
73
74 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
75    sends a lot of data out of ROM (or other static memory), this
76    should be set high. */
77 #ifndef MEMP_NUM_PBUF
78 #define MEMP_NUM_PBUF                   16
79 #endif
80
81 /* Number of raw connection PCBs */
82 #ifndef MEMP_NUM_RAW_PCB
83 #define MEMP_NUM_RAW_PCB                4
84 #endif
85
86 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
87    per active UDP "connection". */
88 #ifndef MEMP_NUM_UDP_PCB
89 #define MEMP_NUM_UDP_PCB                4
90 #endif
91 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
92    connections. */
93 #ifndef MEMP_NUM_TCP_PCB
94 #define MEMP_NUM_TCP_PCB                5
95 #endif
96 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
97    connections. */
98 #ifndef MEMP_NUM_TCP_PCB_LISTEN
99 #define MEMP_NUM_TCP_PCB_LISTEN         8
100 #endif
101 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
102    segments. */
103 #ifndef MEMP_NUM_TCP_SEG
104 #define MEMP_NUM_TCP_SEG                16
105 #endif
106 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
107    timeouts. */
108 #ifndef MEMP_NUM_SYS_TIMEOUT
109 #define MEMP_NUM_SYS_TIMEOUT            3
110 #endif
111
112 /* The following four are used only with the sequential API and can be
113    set to 0 if the application only will use the raw API. */
114 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
115 #ifndef MEMP_NUM_NETBUF
116 #define MEMP_NUM_NETBUF                 2
117 #endif
118 /* MEMP_NUM_NETCONN: the number of struct netconns. */
119 #ifndef MEMP_NUM_NETCONN
120 #define MEMP_NUM_NETCONN                4
121 #endif
122 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for
123    communication between the TCP/IP stack and the sequential
124    programs. */
125 #ifndef MEMP_NUM_API_MSG
126 #define MEMP_NUM_API_MSG                8
127 #endif
128 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
129    for sequential API communication and incoming packets. Used in
130    src/api/tcpip.c. */
131 #ifndef MEMP_NUM_TCPIP_MSG
132 #define MEMP_NUM_TCPIP_MSG              8
133 #endif
134
135 /* ---------- Pbuf options ---------- */
136 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
137
138 #ifndef PBUF_POOL_SIZE
139 #define PBUF_POOL_SIZE                  16
140 #endif
141
142 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
143
144 #ifndef PBUF_POOL_BUFSIZE
145 #define PBUF_POOL_BUFSIZE               128
146 #endif
147
148 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
149    link level header. Defaults to 14 for Ethernet. */
150
151 #ifndef PBUF_LINK_HLEN
152 #define PBUF_LINK_HLEN                  14
153 #endif
154
155
156
157 /* ---------- ARP options ---------- */
158
159 /** Number of active hardware address, IP address pairs cached */
160 #ifndef ARP_TABLE_SIZE
161 #define ARP_TABLE_SIZE                  10
162 #endif
163
164 /**
165  * If enabled, outgoing packets are queued during hardware address
166  * resolution.
167  *
168  * This feature has not stabilized yet. Single-packet queueing is
169  * believed to be stable, multi-packet queueing is believed to
170  * clash with the TCP segment queueing.
171  * 
172  * As multi-packet-queueing is currently disabled, enabling this
173  * _should_ work, but we need your testing feedback on lwip-users.
174  *
175  */
176 #ifndef ARP_QUEUEING
177 #define ARP_QUEUEING                    1
178 #endif
179
180 /* This option is deprecated */
181 #ifdef ETHARP_QUEUE_FIRST
182 #error ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h.
183 #endif
184
185 /* This option is removed to comply with the ARP standard */
186 #ifdef ETHARP_ALWAYS_INSERT
187 #error ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h.
188 #endif
189
190 /* ---------- IP options ---------- */
191 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
192    IP packets across network interfaces. If you are going to run lwIP
193    on a device with only one network interface, define this to 0. */
194 #ifndef IP_FORWARD
195 #define IP_FORWARD                      0
196 #endif
197
198 /* If defined to 1, IP options are allowed (but not parsed). If
199    defined to 0, all packets with IP options are dropped. */
200 #ifndef IP_OPTIONS
201 #define IP_OPTIONS                      1
202 #endif
203
204 /** IP reassembly and segmentation. Even if they both deal with IP
205  *  fragments, note that these are orthogonal, one dealing with incoming
206  *  packets, the other with outgoing packets
207  */
208
209 /** Reassemble incoming fragmented IP packets */
210 #ifndef IP_REASSEMBLY
211 #define IP_REASSEMBLY                   1
212 #endif
213
214 /** Fragment outgoing IP packets if their size exceeds MTU */
215 #ifndef IP_FRAG
216 #define IP_FRAG                         1
217 #endif
218
219 /* ---------- ICMP options ---------- */
220
221 #ifndef ICMP_TTL
222 #define ICMP_TTL                        255
223 #endif
224
225 /* ---------- RAW options ---------- */
226
227 #ifndef LWIP_RAW
228 #define LWIP_RAW                        1
229 #endif
230
231 #ifndef RAW_TTL
232 #define RAW_TTL                        255
233 #endif
234
235 /* ---------- DHCP options ---------- */
236
237 #ifndef LWIP_DHCP
238 #define LWIP_DHCP                       0
239 #endif
240
241 /* 1 if you want to do an ARP check on the offered address
242    (recommended). */
243 #ifndef DHCP_DOES_ARP_CHECK
244 #define DHCP_DOES_ARP_CHECK             1
245 #endif
246
247 /* ---------- UDP options ---------- */
248 #ifndef LWIP_UDP
249 #define LWIP_UDP                        1
250 #endif
251
252 #ifndef UDP_TTL
253 #define UDP_TTL                         255
254 #endif
255
256 /* ---------- TCP options ---------- */
257 #ifndef LWIP_TCP
258 #define LWIP_TCP                        1
259 #endif
260
261 #ifndef TCP_TTL
262 #define TCP_TTL                         255
263 #endif
264
265 #ifndef TCP_WND
266 #define TCP_WND                         2048
267 #endif 
268
269 #ifndef TCP_MAXRTX
270 #define TCP_MAXRTX                      12
271 #endif
272
273 #ifndef TCP_SYNMAXRTX
274 #define TCP_SYNMAXRTX                   6
275 #endif
276
277
278 /* Controls if TCP should queue segments that arrive out of
279    order. Define to 0 if your device is low on memory. */
280 #ifndef TCP_QUEUE_OOSEQ
281 #define TCP_QUEUE_OOSEQ                 1
282 #endif
283
284 /* TCP Maximum segment size. */
285 #ifndef TCP_MSS
286 #define TCP_MSS                         128 /* A *very* conservative default. */
287 #endif
288
289 /* TCP sender buffer space (bytes). */
290 #ifndef TCP_SND_BUF
291 #define TCP_SND_BUF                     256
292 #endif
293
294 /* TCP sender buffer space (pbufs). This must be at least = 2 *
295    TCP_SND_BUF/TCP_MSS for things to work. */
296 #ifndef TCP_SND_QUEUELEN
297 #define TCP_SND_QUEUELEN                4 * TCP_SND_BUF/TCP_MSS
298 #endif
299
300
301 /* Maximum number of retransmissions of data segments. */
302
303 /* Maximum number of retransmissions of SYN segments. */
304
305 /* TCP writable space (bytes). This must be less than or equal
306    to TCP_SND_BUF. It is the amount of space which must be
307    available in the tcp snd_buf for select to return writable */
308 #ifndef TCP_SNDLOWAT
309 #define TCP_SNDLOWAT                    TCP_SND_BUF/2
310 #endif
311
312 /* Support loop interface (127.0.0.1) */
313 #ifndef LWIP_HAVE_LOOPIF
314 #define LWIP_HAVE_LOOPIF                0
315 #endif
316
317 #ifndef LWIP_EVENT_API
318 #define LWIP_EVENT_API                  0
319 #define LWIP_CALLBACK_API               1
320 #else 
321 #define LWIP_EVENT_API                  1
322 #define LWIP_CALLBACK_API               0
323 #endif 
324
325 #ifndef LWIP_COMPAT_SOCKETS
326 #define LWIP_COMPAT_SOCKETS             1
327 #endif
328
329
330 #ifndef TCPIP_THREAD_PRIO
331 #define TCPIP_THREAD_PRIO               1
332 #endif
333
334 #ifndef SLIPIF_THREAD_PRIO
335 #define SLIPIF_THREAD_PRIO              1
336 #endif
337
338 #ifndef PPP_THREAD_PRIO
339 #define PPP_THREAD_PRIO                 1
340 #endif
341
342 #ifndef DEFAULT_THREAD_PRIO
343 #define DEFAULT_THREAD_PRIO             1
344 #endif
345
346
347 /* ---------- Socket Options ---------- */
348 /* Enable SO_REUSEADDR and SO_REUSEPORT options */ 
349 #define SO_REUSE 0
350 #if SO_REUSE
351 /* I removed the lot since this was an ugly hack. It broke the raw-API.
352    It also came with many ugly goto's, Christiaan Simons. */
353 #error "SO_REUSE currently unavailable, this was a hack"
354 #endif                                                                        
355
356
357 /* ---------- Statistics options ---------- */
358 #ifndef LWIP_STATS
359 #define LWIP_STATS                      1
360 #endif
361
362 #if LWIP_STATS
363
364 #ifndef LWIP_STATS_DISPLAY
365 #define LWIP_STATS_DISPLAY 0
366 #endif
367
368 #ifndef LINK_STATS
369 #define LINK_STATS  1
370 #endif
371
372 #ifndef IP_STATS
373 #define IP_STATS    1
374 #endif
375
376 #ifndef IPFRAG_STATS
377 #define IPFRAG_STATS    1
378 #endif
379
380 #ifndef ICMP_STATS
381 #define ICMP_STATS  1
382 #endif
383
384 #ifndef UDP_STATS
385 #define UDP_STATS   1
386 #endif
387
388 #ifndef TCP_STATS
389 #define TCP_STATS   1
390 #endif
391
392 #ifndef MEM_STATS
393 #define MEM_STATS   1
394 #endif
395
396 #ifndef MEMP_STATS
397 #define MEMP_STATS  1
398 #endif
399
400 #ifndef PBUF_STATS
401 #define PBUF_STATS  1
402 #endif
403
404 #ifndef SYS_STATS
405 #define SYS_STATS   1
406 #endif
407
408 #ifndef RAW_STATS
409 #define RAW_STATS   0
410 #endif
411
412 #else
413
414 #define LINK_STATS  0
415 #define IP_STATS    0
416 #define IPFRAG_STATS    0
417 #define ICMP_STATS  0
418 #define UDP_STATS   0
419 #define TCP_STATS   0
420 #define MEM_STATS   0
421 #define MEMP_STATS  0
422 #define PBUF_STATS  0
423 #define SYS_STATS   0
424 #define RAW_STATS   0
425 #define LWIP_STATS_DISPLAY  0
426
427 #endif /* LWIP_STATS */
428
429 /* ---------- PPP options ---------- */
430
431 #ifndef PPP_SUPPORT
432 #define PPP_SUPPORT                     0      /* Set for PPP */
433 #endif
434
435 #if PPP_SUPPORT 
436
437 #define NUM_PPP                         1      /* Max PPP sessions. */
438
439
440
441 #ifndef PAP_SUPPORT
442 #define PAP_SUPPORT                     0      /* Set for PAP. */
443 #endif
444
445 #ifndef CHAP_SUPPORT
446 #define CHAP_SUPPORT                    0      /* Set for CHAP. */
447 #endif
448
449 #define MSCHAP_SUPPORT                  0      /* Set for MSCHAP (NOT FUNCTIONAL!) */
450 #define CBCP_SUPPORT                    0      /* Set for CBCP (NOT FUNCTIONAL!) */
451 #define CCP_SUPPORT                     0      /* Set for CCP (NOT FUNCTIONAL!) */
452
453 #ifndef VJ_SUPPORT
454 #define VJ_SUPPORT                      0      /* Set for VJ header compression. */
455 #endif
456
457 #ifndef MD5_SUPPORT
458 #define MD5_SUPPORT                     0      /* Set for MD5 (see also CHAP) */
459 #endif
460
461
462 /*
463  * Timeouts.
464  */
465 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
466 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
467 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
468 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
469
470 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
471 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
472
473 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
474 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
475
476
477 /* Interval in seconds between keepalive echo requests, 0 to disable. */
478 #if 1
479 #define LCP_ECHOINTERVAL                0
480 #else
481 #define LCP_ECHOINTERVAL                10
482 #endif
483
484 /* Number of unanswered echo requests before failure. */
485 #define LCP_MAXECHOFAILS                3
486
487 /* Max Xmit idle time (in jiffies) before resend flag char. */
488 #define PPP_MAXIDLEFLAG                 100
489
490 /*
491  * Packet sizes
492  *
493  * Note - lcp shouldn't be allowed to negotiate stuff outside these
494  *    limits.  See lcp.h in the pppd directory.
495  * (XXX - these constants should simply be shared by lcp.c instead
496  *    of living in lcp.h)
497  */
498 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
499 #if 0
500 #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN)
501 #else
502 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
503 #endif
504 #define PPP_MINMTU                      64
505 #define PPP_MRU                         1500     /* default MRU = max length of info field */
506 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
507 #define PPP_DEFMRU                      296             /* Try for this */
508 #define PPP_MINMRU                      128             /* No MRUs below this */
509
510
511 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
512 #define MAXSECRETLEN                    256     /* max length of password or secret */
513
514 #endif /* PPP_SUPPORT */
515
516 /* checksum options - set to zero for hardware checksum support */
517
518 #ifndef CHECKSUM_GEN_IP
519 #define CHECKSUM_GEN_IP                 1
520 #endif
521  
522 #ifndef CHECKSUM_GEN_UDP
523 #define CHECKSUM_GEN_UDP                1
524 #endif
525  
526 #ifndef CHECKSUM_GEN_TCP
527 #define CHECKSUM_GEN_TCP                1
528 #endif
529  
530 #ifndef CHECKSUM_CHECK_IP
531 #define CHECKSUM_CHECK_IP               1
532 #endif
533  
534 #ifndef CHECKSUM_CHECK_UDP
535 #define CHECKSUM_CHECK_UDP              1
536 #endif
537
538 #ifndef CHECKSUM_CHECK_TCP
539 #define CHECKSUM_CHECK_TCP              1
540 #endif
541
542 /* Debugging options all default to off */
543
544 #ifndef DBG_TYPES_ON
545 #define DBG_TYPES_ON                    0
546 #endif
547
548 #ifndef ETHARP_DEBUG
549 #define ETHARP_DEBUG                    DBG_OFF
550 #endif
551
552 #ifndef NETIF_DEBUG
553 #define NETIF_DEBUG                     DBG_OFF
554 #endif
555
556 #ifndef PBUF_DEBUG
557 #define PBUF_DEBUG                      DBG_OFF
558 #endif
559
560 #ifndef API_LIB_DEBUG
561 #define API_LIB_DEBUG                   DBG_OFF
562 #endif
563
564 #ifndef API_MSG_DEBUG
565 #define API_MSG_DEBUG                   DBG_OFF
566 #endif
567
568 #ifndef SOCKETS_DEBUG
569 #define SOCKETS_DEBUG                   DBG_OFF
570 #endif
571
572 #ifndef ICMP_DEBUG
573 #define ICMP_DEBUG                      DBG_OFF
574 #endif
575
576 #ifndef INET_DEBUG
577 #define INET_DEBUG                      DBG_OFF
578 #endif
579
580 #ifndef IP_DEBUG
581 #define IP_DEBUG                        DBG_OFF
582 #endif
583
584 #ifndef IP_REASS_DEBUG
585 #define IP_REASS_DEBUG                  DBG_OFF
586 #endif
587
588 #ifndef RAW_DEBUG
589 #define RAW_DEBUG                       DBG_OFF
590 #endif
591
592 #ifndef MEM_DEBUG
593 #define MEM_DEBUG                       DBG_OFF
594 #endif
595
596 #ifndef MEMP_DEBUG
597 #define MEMP_DEBUG                      DBG_OFF
598 #endif
599
600 #ifndef SYS_DEBUG
601 #define SYS_DEBUG                       DBG_OFF
602 #endif
603
604 #ifndef TCP_DEBUG
605 #define TCP_DEBUG                       DBG_OFF
606 #endif
607
608 #ifndef TCP_INPUT_DEBUG
609 #define TCP_INPUT_DEBUG                 DBG_OFF
610 #endif
611
612 #ifndef TCP_FR_DEBUG
613 #define TCP_FR_DEBUG                    DBG_OFF
614 #endif
615
616 #ifndef TCP_RTO_DEBUG
617 #define TCP_RTO_DEBUG                   DBG_OFF
618 #endif
619
620 #ifndef TCP_REXMIT_DEBUG
621 #define TCP_REXMIT_DEBUG                DBG_OFF
622 #endif
623
624 #ifndef TCP_CWND_DEBUG
625 #define TCP_CWND_DEBUG                  DBG_OFF
626 #endif
627
628 #ifndef TCP_WND_DEBUG
629 #define TCP_WND_DEBUG                   DBG_OFF
630 #endif
631
632 #ifndef TCP_OUTPUT_DEBUG
633 #define TCP_OUTPUT_DEBUG                DBG_OFF
634 #endif
635
636 #ifndef TCP_RST_DEBUG
637 #define TCP_RST_DEBUG                   DBG_OFF
638 #endif
639
640 #ifndef TCP_QLEN_DEBUG
641 #define TCP_QLEN_DEBUG                  DBG_OFF
642 #endif
643
644 #ifndef UDP_DEBUG
645 #define UDP_DEBUG                       DBG_OFF
646 #endif
647
648 #ifndef TCPIP_DEBUG
649 #define TCPIP_DEBUG                     DBG_OFF
650 #endif
651
652 #ifndef PPP_DEBUG 
653 #define PPP_DEBUG                       DBG_OFF
654 #endif
655
656 #ifndef SLIP_DEBUG 
657 #define SLIP_DEBUG                      DBG_OFF
658 #endif
659
660 #ifndef DHCP_DEBUG 
661 #define DHCP_DEBUG                      DBG_OFF
662 #endif
663
664
665 #ifndef DBG_MIN_LEVEL
666 #define DBG_MIN_LEVEL                   DBG_LEVEL_OFF
667 #endif
668
669 #endif /* __LWIP_OPT_H__ */
670
671
672