Update project.
[bertos.git] / boards / stm32-p103 / templates / stm32-p103_kernel / cfg / cfg_lwip.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \author Andrea Righi <arighi@develer.com>
34  *
35  * \brief Configuration file for the lwIP TCP/IP stack module
36  */
37
38 /*
39  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
40  * All rights reserved. 
41  * 
42  * Redistribution and use in source and binary forms, with or without modification, 
43  * are permitted provided that the following conditions are met:
44  *
45  * 1. Redistributions of source code must retain the above copyright notice,
46  *    this list of conditions and the following disclaimer.
47  * 2. Redistributions in binary form must reproduce the above copyright notice,
48  *    this list of conditions and the following disclaimer in the documentation
49  *    and/or other materials provided with the distribution.
50  * 3. The name of the author may not be used to endorse or promote products
51  *    derived from this software without specific prior written permission. 
52  *
53  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
54  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
55  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
56  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
57  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
58  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
59  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
60  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
61  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
62  * OF SUCH DAMAGE.
63  *
64  * This file is part of the lwIP TCP/IP stack.
65  * 
66  * Author: Adam Dunkels <adam@sics.se>
67  *
68  */
69 #ifndef CFG_LWIP_H
70 #define CFG_LWIP_H
71
72 /*
73    -----------------------------------------------
74    ---------- Platform specific locking ----------
75    -----------------------------------------------
76 */
77
78 /**
79  * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
80  * critical regions during buffer allocation, deallocation and memory
81  * allocation and deallocation.
82  */
83 #ifndef SYS_LIGHTWEIGHT_PROT
84 #define SYS_LIGHTWEIGHT_PROT            1
85 #endif
86
87 /** 
88  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
89  * use lwIP facilities.
90  */
91 #ifndef NO_SYS
92 #define NO_SYS                          0
93 #endif
94
95 /**
96  * MEMCPY: override this if you have a faster implementation at hand than the
97  * one included in your C library
98  */
99 #ifndef MEMCPY
100 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
101 #endif
102
103 /**
104  * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
105  * call to memcpy() if the length is known at compile time and is small.
106  */
107 #ifndef SMEMCPY
108 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
109 #endif
110
111 /*
112    ------------------------------------
113    ---------- Memory options ----------
114    ------------------------------------
115 */
116 /**
117  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
118  * instead of the lwip internal allocator. Can save code size if you
119  * already use it.
120  */
121 #ifndef MEM_LIBC_MALLOC
122 #define MEM_LIBC_MALLOC                 0
123 #endif
124
125 /**
126  * Use mem_malloc/mem_free instead of the lwip pool allocator.
127  *
128  * $WIZ$ type = "boolean"
129  */
130 #ifndef MEMP_MEM_MALLOC
131 #define MEMP_MEM_MALLOC                 0
132 #endif
133
134 /**
135  * MEM_ALIGNMENT: should be set to the alignment of the CPU
136  * \verbatim
137  *    4 byte alignment -> #define MEM_ALIGNMENT 4
138  *    2 byte alignment -> #define MEM_ALIGNMENT 2
139  * \endverbatim
140  */
141 #ifndef MEM_ALIGNMENT
142 #define MEM_ALIGNMENT                   4
143 #endif
144
145 /**
146  * The size of the lwIP heap memory.
147  *
148  * If the application will send a lot of data that needs to be copied, this
149  * should be set high.
150  *
151  * $WIZ$ type = "int"; min = 1600
152  */
153 #define MEM_SIZE                        1600
154
155 /**
156  * Dynamic pool memory overflow protection check level.
157  *
158  *    MEMP_OVERFLOW_CHECK == 0 no checking
159  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
160  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
161  *      memp_malloc() or memp_free() is called (useful but slow!)
162  *
163  *  $WIZ$ type = "int"; min = "0"; max = "2"
164  */
165 #define MEMP_OVERFLOW_CHECK             0
166
167 /**
168  * Run a sanity check after each memp_free().
169  *
170  * $WIZ$ type = "boolean"
171  */
172 #define MEMP_SANITY_CHECK               0
173
174 /**
175  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
176  * of memory pools of various sizes. When mem_malloc is called, an element of
177  * the smallest pool that can provide the length needed is returned.
178  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
179  */
180 #ifndef MEM_USE_POOLS
181 #define MEM_USE_POOLS                   0
182 #endif
183
184 /**
185  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
186  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
187  * reliable. */
188 #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
189 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
190 #endif
191
192 /**
193  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
194  * that defines additional pools beyond the "standard" ones required
195  * by lwIP. If you set this to 1, you must have lwippools.h in your 
196  * inlude path somewhere. 
197  */
198 #ifndef MEMP_USE_CUSTOM_POOLS
199 #define MEMP_USE_CUSTOM_POOLS           0
200 #endif
201
202 /**
203  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
204  * interrupt context (or another context that doesn't allow waiting for a
205  * semaphore).
206  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
207  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
208  * with each loop so that mem_free can run.
209  *
210  * ATTENTION: As you can see from the above description, this leads to dis-/
211  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
212  * can need longer.
213  *
214  * If you don't want that, at least for NO_SYS=0, you can still use the following
215  * functions to enqueue a deallocation call which then runs in the tcpip_thread
216  * context:
217  * - pbuf_free_callback(p);
218  * - mem_free_callback(m);
219  */
220 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
221 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
222 #endif
223
224 /*
225    ------------------------------------------------
226    ---------- Internal Memory Pool Sizes ----------
227    ------------------------------------------------
228 */
229 /**
230  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
231  * If the application sends a lot of data out of ROM (or other static memory),
232  * this should be set high.
233  */
234 #ifndef MEMP_NUM_PBUF
235 #define MEMP_NUM_PBUF                   16
236 #endif
237
238 /**
239  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
240  * (requires the LWIP_RAW option)
241  */
242 #ifndef MEMP_NUM_RAW_PCB
243 #define MEMP_NUM_RAW_PCB                4
244 #endif
245
246 /**
247  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
248  * per active UDP "connection".
249  * (requires the LWIP_UDP option)
250  */
251 #ifndef MEMP_NUM_UDP_PCB
252 #define MEMP_NUM_UDP_PCB                4
253 #endif
254
255 /**
256  * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
257  * (requires the LWIP_TCP option)
258  */
259 #ifndef MEMP_NUM_TCP_PCB
260 #define MEMP_NUM_TCP_PCB                5
261 #endif
262
263 /**
264  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
265  * (requires the LWIP_TCP option)
266  */
267 #ifndef MEMP_NUM_TCP_PCB_LISTEN
268 #define MEMP_NUM_TCP_PCB_LISTEN         8
269 #endif
270
271 /**
272  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
273  * (requires the LWIP_TCP option)
274  */
275 #ifndef MEMP_NUM_TCP_SEG
276 #define MEMP_NUM_TCP_SEG                16
277 #endif
278
279 /**
280  * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
281  * reassembly (whole packets, not fragments!)
282  */
283 #ifndef MEMP_NUM_REASSDATA
284 #define MEMP_NUM_REASSDATA              5
285 #endif
286
287 /**
288  * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
289  * packets (pbufs) that are waiting for an ARP request (to resolve
290  * their destination address) to finish.
291  * (requires the ARP_QUEUEING option)
292  */
293 #ifndef MEMP_NUM_ARP_QUEUE
294 #define MEMP_NUM_ARP_QUEUE              30
295 #endif
296
297 /**
298  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
299  * can be members et the same time (one per netif - allsystems group -, plus one
300  * per netif membership).
301  * (requires the LWIP_IGMP option)
302  */
303 #ifndef MEMP_NUM_IGMP_GROUP
304 #define MEMP_NUM_IGMP_GROUP             8
305 #endif
306
307 /**
308  * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
309  * (requires NO_SYS==0)
310  */
311 #ifndef MEMP_NUM_SYS_TIMEOUT
312 #define MEMP_NUM_SYS_TIMEOUT            8
313 #endif
314
315 /**
316  * MEMP_NUM_NETBUF: the number of struct netbufs.
317  * (only needed if you use the sequential API, like api_lib.c)
318  */
319 #ifndef MEMP_NUM_NETBUF
320 #define MEMP_NUM_NETBUF                 2
321 #endif
322
323 /**
324  * MEMP_NUM_NETCONN: the number of struct netconns.
325  * (only needed if you use the sequential API, like api_lib.c)
326  */
327 #ifndef MEMP_NUM_NETCONN
328 #define MEMP_NUM_NETCONN                4
329 #endif
330
331 /**
332  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
333  * for callback/timeout API communication. 
334  * (only needed if you use tcpip.c)
335  */
336 #ifndef MEMP_NUM_TCPIP_MSG_API
337 #define MEMP_NUM_TCPIP_MSG_API          8
338 #endif
339
340 /**
341  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
342  * for incoming packets. 
343  * (only needed if you use tcpip.c)
344  */
345 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
346 #define MEMP_NUM_TCPIP_MSG_INPKT        8
347 #endif
348
349 /**
350  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 
351  */
352 #ifndef PBUF_POOL_SIZE
353 #define PBUF_POOL_SIZE                  16
354 #endif
355
356 /*
357    ---------------------------------
358    ---------- ARP options ----------
359    ---------------------------------
360 */
361 /**
362  * LWIP_ARP==1: Enable ARP functionality.
363  */
364 #ifndef LWIP_ARP
365 #define LWIP_ARP                        1
366 #endif
367
368 /**
369  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
370  */
371 #ifndef ARP_TABLE_SIZE
372 #define ARP_TABLE_SIZE                  10
373 #endif
374
375 /**
376  * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
377  * resolution.
378  */
379 #ifndef ARP_QUEUEING
380 #define ARP_QUEUEING                    1
381 #endif
382
383 /**
384  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
385  * updated with the source MAC and IP addresses supplied in the packet.
386  * You may want to disable this if you do not trust LAN peers to have the
387  * correct addresses, or as a limited approach to attempt to handle
388  * spoofing. If disabled, lwIP will need to make a new ARP request if
389  * the peer is not already in the ARP table, adding a little latency.
390  */
391 #ifndef ETHARP_TRUST_IP_MAC
392 #define ETHARP_TRUST_IP_MAC             1
393 #endif
394
395 /**
396  * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
397  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
398  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
399  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
400  */
401 #ifndef ETHARP_SUPPORT_VLAN
402 #define ETHARP_SUPPORT_VLAN             0
403 #endif
404
405 /*
406    --------------------------------
407    ---------- IP options ----------
408    --------------------------------
409 */
410 /**
411  * IP_FORWARD==1: Enables the ability to forward IP packets across network
412  * interfaces. If you are going to run lwIP on a device with only one network
413  * interface, define this to 0.
414  */
415 #ifndef IP_FORWARD
416 #define IP_FORWARD                      0
417 #endif
418
419 /**
420  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
421  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
422  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
423  */
424 #ifndef IP_OPTIONS_ALLOWED
425 #define IP_OPTIONS_ALLOWED              1
426 #endif
427
428 /**
429  * Reassemble incoming fragmented IP packets.
430  *
431  * $WIZ$ type = "boolean"
432  */
433 #define IP_REASSEMBLY                   1
434
435 /**
436  * Fragment outgoing IP packets if their size exceeds MTU.
437  *
438  * $WIZ$ type = "boolean"
439  */
440 #define IP_FRAG                         1
441
442 /**
443  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
444  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
445  * in this time, the whole packet is discarded.
446  */
447 #ifndef IP_REASS_MAXAGE
448 #define IP_REASS_MAXAGE                 3
449 #endif
450
451 /**
452  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
453  * Since the received pbufs are enqueued, be sure to configure
454  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
455  * packets even if the maximum amount of fragments is enqueued for reassembly!
456  */
457 #ifndef IP_REASS_MAX_PBUFS
458 #define IP_REASS_MAX_PBUFS              10
459 #endif
460
461 /**
462  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
463  * fragmentation. Otherwise pbufs are allocated and reference the original
464  * packet data to be fragmented.
465  */
466 #ifndef IP_FRAG_USES_STATIC_BUF
467 #define IP_FRAG_USES_STATIC_BUF         1
468 #endif
469
470 /**
471  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
472  * (requires IP_FRAG_USES_STATIC_BUF==1)
473  */
474 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
475 #define IP_FRAG_MAX_MTU                 1500
476 #endif
477
478 /**
479  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
480  */
481 #ifndef IP_DEFAULT_TTL
482 #define IP_DEFAULT_TTL                  255
483 #endif
484
485 /**
486  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
487  * filter per pcb on udp and raw send operations. To enable broadcast filter
488  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
489  */
490 #ifndef IP_SOF_BROADCAST
491 #define IP_SOF_BROADCAST                0
492 #endif
493
494 /**
495  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
496  * filter on recv operations.
497  */
498 #ifndef IP_SOF_BROADCAST_RECV
499 #define IP_SOF_BROADCAST_RECV           0
500 #endif
501
502 /*
503    ----------------------------------
504    ---------- ICMP options ----------
505    ----------------------------------
506 */
507 /**
508  * Enable ICMP module inside the IP stack.
509  *
510  * $WIZ$ type = "boolean"
511  */
512 #define LWIP_ICMP                       1
513
514 /**
515  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
516  */
517 #ifndef ICMP_TTL
518 #define ICMP_TTL                       (IP_DEFAULT_TTL)
519 #endif
520
521 /**
522  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
523  */
524 #ifndef LWIP_BROADCAST_PING
525 #define LWIP_BROADCAST_PING             0
526 #endif
527
528 /**
529  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
530  */
531 #ifndef LWIP_MULTICAST_PING
532 #define LWIP_MULTICAST_PING             0
533 #endif
534
535 /*
536    ---------------------------------
537    ---------- RAW options ----------
538    ---------------------------------
539 */
540 /**
541  * Enable application layer to hook into the IP layer itself.
542  *
543  * $WIZ$ type = "boolean"
544  */
545 #define LWIP_RAW                        1
546
547 /**
548  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
549  */
550 #ifndef RAW_TTL
551 #define RAW_TTL                        (IP_DEFAULT_TTL)
552 #endif
553
554 /*
555    ----------------------------------
556    ---------- DHCP options ----------
557    ----------------------------------
558 */
559 /**
560  * Enable DHCP module. UDP must be also available.
561  *
562  * $WIZ$ type = "boolean"
563  */
564 #define LWIP_DHCP                       1
565
566 /**
567  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
568  */
569 #ifndef DHCP_DOES_ARP_CHECK
570 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
571 #endif
572
573 /*
574    ------------------------------------
575    ---------- AUTOIP options ----------
576    ------------------------------------
577 */
578 /**
579  * LWIP_AUTOIP==1: Enable AUTOIP module.
580  */
581 #ifndef LWIP_AUTOIP
582 #define LWIP_AUTOIP                     0
583 #endif
584
585 /**
586  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
587  * the same interface at the same time.
588  */
589 #ifndef LWIP_DHCP_AUTOIP_COOP
590 #define LWIP_DHCP_AUTOIP_COOP           0
591 #endif
592
593 /**
594  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
595  * that should be sent before falling back on AUTOIP. This can be set
596  * as low as 1 to get an AutoIP address very quickly, but you should
597  * be prepared to handle a changing IP address when DHCP overrides
598  * AutoIP.
599  */
600 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
601 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
602 #endif
603
604 /*
605    ----------------------------------
606    ---------- SNMP options ----------
607    ----------------------------------
608 */
609 /**
610  * Turn on SNMP module. UDP must be also available.
611  *
612  * $WIZ$ type = "boolean"
613  */
614 #define LWIP_SNMP                       0
615
616 /**
617  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
618  * allow. At least one request buffer is required. 
619  */
620 #ifndef SNMP_CONCURRENT_REQUESTS
621 #define SNMP_CONCURRENT_REQUESTS        1
622 #endif
623
624 /**
625  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
626  * destination is required
627  */
628 #ifndef SNMP_TRAP_DESTINATIONS
629 #define SNMP_TRAP_DESTINATIONS          1
630 #endif
631
632 /**
633  * SNMP_PRIVATE_MIB: 
634  */
635 #ifndef SNMP_PRIVATE_MIB
636 #define SNMP_PRIVATE_MIB                0
637 #endif
638
639 /**
640  * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
641  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
642  * Unsafe requests are disabled by default!
643  */
644 #ifndef SNMP_SAFE_REQUESTS
645 #define SNMP_SAFE_REQUESTS              1
646 #endif
647
648 /*
649    ----------------------------------
650    ---------- IGMP options ----------
651    ----------------------------------
652 */
653 /**
654  * Turn on IGMP module.
655  *
656  * $WIZ$ type = "boolean"
657  */
658 #define LWIP_IGMP                       0
659
660 /*
661    ----------------------------------
662    ---------- DNS options -----------
663    ----------------------------------
664 */
665 /**
666  * Turn on DNS module. UDP must be available for DNS transport.
667  *
668  * $WIZ$ type = "boolean"
669  */
670 #define LWIP_DNS                        0
671
672 /** DNS maximum number of entries to maintain locally. */
673 #ifndef DNS_TABLE_SIZE
674 #define DNS_TABLE_SIZE                  4
675 #endif
676
677 /** DNS maximum host name length supported in the name table. */
678 #ifndef DNS_MAX_NAME_LENGTH
679 #define DNS_MAX_NAME_LENGTH             256
680 #endif
681
682 /** The maximum of DNS servers */
683 #ifndef DNS_MAX_SERVERS
684 #define DNS_MAX_SERVERS                 2
685 #endif
686
687 /** DNS do a name checking between the query and the response. */
688 #ifndef DNS_DOES_NAME_CHECK
689 #define DNS_DOES_NAME_CHECK             1
690 #endif
691
692 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
693     DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
694     The buffer will be of size DNS_MSG_SIZE */
695 #ifndef DNS_USES_STATIC_BUF
696 #define DNS_USES_STATIC_BUF             1
697 #endif
698
699 /** DNS message max. size. Default value is RFC compliant. */
700 #ifndef DNS_MSG_SIZE
701 #define DNS_MSG_SIZE                    512
702 #endif
703
704 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
705  *  you have to define
706  *  \code
707  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
708  *  \endcode
709  *  (an array of structs name/address, where address is an u32_t in network
710  *  byte order).
711  *
712  *  Instead, you can also use an external function:
713  *  \code
714  *  #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
715  *  \endcode
716  *  that returns the IP address or INADDR_NONE if not found.
717  */
718 #ifndef DNS_LOCAL_HOSTLIST
719 #define DNS_LOCAL_HOSTLIST              0
720 #endif /* DNS_LOCAL_HOSTLIST */
721
722 /** If this is turned on, the local host-list can be dynamically changed
723  *  at runtime. */
724 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
725 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
726 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
727
728 /*
729    ---------------------------------
730    ---------- UDP options ----------
731    ---------------------------------
732 */
733 /**
734  * Turn on UDP.
735  *
736  * $WIZ$ type = "boolean"
737  */
738 #define LWIP_UDP                        1
739
740 /**
741  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
742  */
743 #ifndef LWIP_UDPLITE
744 #define LWIP_UDPLITE                    0
745 #endif
746
747 /**
748  * UDP_TTL: Default Time-To-Live value.
749  */
750 #ifndef UDP_TTL
751 #define UDP_TTL                         (IP_DEFAULT_TTL)
752 #endif
753
754 /**
755  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
756  */
757 #ifndef LWIP_NETBUF_RECVINFO
758 #define LWIP_NETBUF_RECVINFO            0
759 #endif
760
761 /*
762    ---------------------------------
763    ---------- TCP options ----------
764    ---------------------------------
765 */
766 /**
767  * Turn on TCP.
768  *
769  * $WIZ$ type = "boolean"
770  */
771 #define LWIP_TCP                        1
772
773 /**
774  * TCP_TTL: Default Time-To-Live value.
775  */
776 #ifndef TCP_TTL
777 #define TCP_TTL                         (IP_DEFAULT_TTL)
778 #endif
779
780 /**
781  * TCP_WND: The size of a TCP window.  This must be at least 
782  * (2 * TCP_MSS) for things to work well
783  */
784 #ifndef TCP_WND
785 #define TCP_WND                         (4 * TCP_MSS)
786 #endif 
787
788 /**
789  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
790  */
791 #ifndef TCP_MAXRTX
792 #define TCP_MAXRTX                      12
793 #endif
794
795 /**
796  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
797  */
798 #ifndef TCP_SYNMAXRTX
799 #define TCP_SYNMAXRTX                   6
800 #endif
801
802 /**
803  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
804  * Define to 0 if your device is low on memory.
805  */
806 #ifndef TCP_QUEUE_OOSEQ
807 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
808 #endif
809
810 /**
811  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
812  * you might want to increase this.)
813  * For the receive side, this MSS is advertised to the remote side
814  * when opening a connection. For the transmit size, this MSS sets
815  * an upper limit on the MSS advertised by the remote host.
816  */
817 #ifndef TCP_MSS
818 #define TCP_MSS                         536
819 #endif
820
821 /**
822  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
823  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
824  * reflects the available reassembly buffer size at the remote host) and the
825  * largest size permitted by the IP layer" (RFC 1122)
826  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
827  * netif used for a connection and limits the MSS if it would be too big otherwise.
828  */
829 #ifndef TCP_CALCULATE_EFF_SEND_MSS
830 #define TCP_CALCULATE_EFF_SEND_MSS      1
831 #endif
832
833
834 /**
835  * TCP_SND_BUF: TCP sender buffer space (bytes). 
836  */
837 #ifndef TCP_SND_BUF
838 #define TCP_SND_BUF                     (2 * TCP_MSS)
839 #endif
840
841 /**
842  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
843  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
844  */
845 #ifndef TCP_SND_QUEUELEN
846 #define TCP_SND_QUEUELEN                (4 * (TCP_SND_BUF)/(TCP_MSS))
847 #endif
848
849 /**
850  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
851  * to TCP_SND_BUF. It is the amount of space which must be available in the
852  * TCP snd_buf for select to return writable.
853  */
854 #ifndef TCP_SNDLOWAT
855 #define TCP_SNDLOWAT                    ((TCP_SND_BUF)/2)
856 #endif
857
858 /**
859  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
860  */
861 #ifndef TCP_LISTEN_BACKLOG
862 #define TCP_LISTEN_BACKLOG              0
863 #endif
864
865 /**
866  * The maximum allowed backlog for TCP listen netconns.
867  * This backlog is used unless another is explicitly specified.
868  * 0xff is the maximum (u8_t).
869  */
870 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
871 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
872 #endif
873
874 /**
875  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
876  */
877 #ifndef LWIP_TCP_TIMESTAMPS
878 #define LWIP_TCP_TIMESTAMPS             0
879 #endif
880
881 /**
882  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
883  * explicit window update
884  */
885 #ifndef TCP_WND_UPDATE_THRESHOLD
886 #define TCP_WND_UPDATE_THRESHOLD   (TCP_WND / 4)
887 #endif
888
889 /*
890    ----------------------------------
891    ---------- Pbuf options ----------
892    ----------------------------------
893 */
894 /**
895  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
896  * link level header. The default is 14, the standard value for
897  * Ethernet.
898  */
899 #ifndef PBUF_LINK_HLEN
900 #define PBUF_LINK_HLEN                  14
901 #endif
902
903 /**
904  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
905  * designed to accomodate single full size TCP frame in one pbuf, including
906  * TCP_MSS, IP header, and link header.
907  */
908 #ifndef PBUF_POOL_BUFSIZE
909 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
910 #endif
911
912 /*
913    ------------------------------------------------
914    ---------- Network Interfaces options ----------
915    ------------------------------------------------
916 */
917 /**
918  * Use DHCP_OPTION_HOSTNAME with netif's hostname field.
919  *
920  * $WIZ$ type = "boolean"
921  */
922 #define LWIP_NETIF_HOSTNAME             1
923
924 /**
925  * Support netif api (in netifapi.c)
926  *
927  * $WIZ$ type = "boolean"
928  */
929 #define LWIP_NETIF_API                  0
930
931 /**
932  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
933  * changes its up/down status (i.e., due to DHCP IP acquistion)
934  */
935 #ifndef LWIP_NETIF_STATUS_CALLBACK
936 #define LWIP_NETIF_STATUS_CALLBACK      0
937 #endif
938
939 /**
940  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
941  * whenever the link changes (i.e., link down)
942  */
943 #ifndef LWIP_NETIF_LINK_CALLBACK
944 #define LWIP_NETIF_LINK_CALLBACK        0
945 #endif
946
947 /**
948  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
949  * indices) in struct netif. TCP and UDP can make use of this to prevent
950  * scanning the ARP table for every sent packet. While this is faster for big
951  * ARP tables or many concurrent connections, it might be counterproductive
952  * if you have a tiny ARP table or if there never are concurrent connections.
953  */
954 #ifndef LWIP_NETIF_HWADDRHINT
955 #define LWIP_NETIF_HWADDRHINT           0
956 #endif
957
958 /**
959  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
960  * address equal to the netif IP address, looping them back up the stack.
961  */
962 #ifndef LWIP_NETIF_LOOPBACK
963 #define LWIP_NETIF_LOOPBACK             0
964 #endif
965
966 /**
967  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
968  * sending for each netif (0 = disabled)
969  */
970 #ifndef LWIP_LOOPBACK_MAX_PBUFS
971 #define LWIP_LOOPBACK_MAX_PBUFS         0
972 #endif
973
974 /**
975  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
976  * the system, as netifs must change how they behave depending on this setting
977  * for the LWIP_NETIF_LOOPBACK option to work.
978  * Setting this is needed to avoid reentering non-reentrant functions like
979  * tcp_input().
980  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
981  *       multithreaded environment like tcpip.c. In this case, netif->input()
982  *       is called directly.
983  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
984  *       The packets are put on a list and netif_poll() must be called in
985  *       the main application loop.
986  */
987 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
988 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
989 #endif
990
991 /**
992  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
993  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
994  * MACs that do not support scatter-gather.
995  * Beware that this might involve CPU-memcpy before transmitting that would not
996  * be needed without this flag! Use this only if you need to!
997  *
998  * @todo: TCP and IP-frag do not work with this, yet:
999  */
1000 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
1001 #define LWIP_NETIF_TX_SINGLE_PBUF             0
1002 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
1003
1004 /*
1005    ------------------------------------
1006    ---------- LOOPIF options ----------
1007    ------------------------------------
1008 */
1009 /**
1010  * Support loop interface (127.0.0.1) and loopif.c
1011  *
1012  * $WIZ$ type = "boolean"
1013  */
1014 #define LWIP_HAVE_LOOPIF                0
1015
1016 /*
1017    ------------------------------------
1018    ---------- SLIPIF options ----------
1019    ------------------------------------
1020 */
1021 /**
1022  * Support slip interface and slipif.c
1023  *
1024  * $WIZ$ type = "boolean"
1025  */
1026 #define LWIP_HAVE_SLIPIF                0
1027
1028 /*
1029    ------------------------------------
1030    ---------- Thread options ----------
1031    ------------------------------------
1032 */
1033 /**
1034  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1035  */
1036 #ifndef TCPIP_THREAD_NAME
1037 #define TCPIP_THREAD_NAME              "tcpip_thread"
1038 #endif
1039
1040 /**
1041  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1042  * The stack size value itself is platform-dependent, but is passed to
1043  * sys_thread_new() when the thread is created.
1044  */
1045 #ifndef TCPIP_THREAD_STACKSIZE
1046 #define TCPIP_THREAD_STACKSIZE          (KERN_MINSTACKSIZE * 3)
1047 #endif
1048
1049 /**
1050  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1051  * The priority value itself is platform-dependent, but is passed to
1052  * sys_thread_new() when the thread is created.
1053  */
1054 #ifndef TCPIP_THREAD_PRIO
1055 #define TCPIP_THREAD_PRIO               0
1056 #endif
1057
1058 /**
1059  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1060  * The queue size value itself is platform-dependent, but is passed to
1061  * sys_mbox_new() when tcpip_init is called.
1062  */
1063 #ifndef TCPIP_MBOX_SIZE
1064 #define TCPIP_MBOX_SIZE                 0
1065 #endif
1066
1067 /**
1068  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1069  */
1070 #ifndef SLIPIF_THREAD_NAME
1071 #define SLIPIF_THREAD_NAME             "slipif_loop"
1072 #endif
1073
1074 /**
1075  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1076  * The stack size value itself is platform-dependent, but is passed to
1077  * sys_thread_new() when the thread is created.
1078  */
1079 #ifndef SLIPIF_THREAD_STACKSIZE
1080 #define SLIPIF_THREAD_STACKSIZE         0
1081 #endif
1082
1083 /**
1084  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1085  * The priority value itself is platform-dependent, but is passed to
1086  * sys_thread_new() when the thread is created.
1087  */
1088 #ifndef SLIPIF_THREAD_PRIO
1089 #define SLIPIF_THREAD_PRIO              1
1090 #endif
1091
1092 /**
1093  * PPP_THREAD_NAME: The name assigned to the pppMain thread.
1094  */
1095 #ifndef PPP_THREAD_NAME
1096 #define PPP_THREAD_NAME                "pppMain"
1097 #endif
1098
1099 /**
1100  * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.
1101  * The stack size value itself is platform-dependent, but is passed to
1102  * sys_thread_new() when the thread is created.
1103  */
1104 #ifndef PPP_THREAD_STACKSIZE
1105 #define PPP_THREAD_STACKSIZE            0
1106 #endif
1107
1108 /**
1109  * PPP_THREAD_PRIO: The priority assigned to the pppMain thread.
1110  * The priority value itself is platform-dependent, but is passed to
1111  * sys_thread_new() when the thread is created.
1112  */
1113 #ifndef PPP_THREAD_PRIO
1114 #define PPP_THREAD_PRIO                 1
1115 #endif
1116
1117 /**
1118  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1119  */
1120 #ifndef DEFAULT_THREAD_NAME
1121 #define DEFAULT_THREAD_NAME            "lwIP"
1122 #endif
1123
1124 /**
1125  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1126  * The stack size value itself is platform-dependent, but is passed to
1127  * sys_thread_new() when the thread is created.
1128  */
1129 #ifndef DEFAULT_THREAD_STACKSIZE
1130 #define DEFAULT_THREAD_STACKSIZE        (KERN_MINSTACKSIZE * 3)
1131 #endif
1132
1133 /**
1134  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1135  * The priority value itself is platform-dependent, but is passed to
1136  * sys_thread_new() when the thread is created.
1137  */
1138 #ifndef DEFAULT_THREAD_PRIO
1139 #define DEFAULT_THREAD_PRIO             1
1140 #endif
1141
1142 /**
1143  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1144  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1145  * to sys_mbox_new() when the recvmbox is created.
1146  */
1147 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1148 #define DEFAULT_RAW_RECVMBOX_SIZE       0
1149 #endif
1150
1151 /**
1152  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1153  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1154  * to sys_mbox_new() when the recvmbox is created.
1155  */
1156 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1157 #define DEFAULT_UDP_RECVMBOX_SIZE       0
1158 #endif
1159
1160 /**
1161  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1162  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1163  * to sys_mbox_new() when the recvmbox is created.
1164  */
1165 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1166 #define DEFAULT_TCP_RECVMBOX_SIZE       0
1167 #endif
1168
1169 /**
1170  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1171  * The queue size value itself is platform-dependent, but is passed to
1172  * sys_mbox_new() when the acceptmbox is created.
1173  */
1174 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1175 #define DEFAULT_ACCEPTMBOX_SIZE         0
1176 #endif
1177
1178 /*
1179    ----------------------------------------------
1180    ---------- Sequential layer options ----------
1181    ----------------------------------------------
1182 */
1183 /**
1184  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
1185  * Don't use it if you're not an active lwIP project member
1186  */
1187 #ifndef LWIP_TCPIP_CORE_LOCKING
1188 #define LWIP_TCPIP_CORE_LOCKING         0
1189 #endif
1190
1191 /**
1192  * Enable Netconn API (require to use api_lib.c)
1193  *
1194  * $WIZ$ type = "boolean"
1195  */
1196 #define LWIP_NETCONN                    1
1197
1198 /*
1199    ------------------------------------
1200    ---------- Socket options ----------
1201    ------------------------------------
1202 */
1203 /**
1204  * Enable Socket API (require to use sockets.c)
1205  *
1206  * $WIZ$ type = "boolean"
1207  */
1208 #define LWIP_SOCKET                     1
1209 #if LWIP_SOCKET
1210         /*
1211          * The sockets.c file requires this macro to be defined to really
1212          * set errno on errors.
1213          */
1214         #define ERRNO
1215 #endif
1216
1217 /**
1218  * Enable BSD-style sockets functions names.
1219  *
1220  * NOTE: do not change this!!!
1221  */
1222 #ifndef LWIP_COMPAT_SOCKETS
1223 #define LWIP_COMPAT_SOCKETS             0
1224 #endif
1225
1226 /**
1227  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
1228  * Disable this option if you use a POSIX operating system that uses the same
1229  * names (read, write & close). (only used if you use sockets.c)
1230  */
1231 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1232 #define LWIP_POSIX_SOCKETS_IO_NAMES     0
1233 #endif
1234
1235 /**
1236  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1237  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1238  * in seconds. (does not require sockets.c, and will affect tcp.c)
1239  */
1240 #ifndef LWIP_TCP_KEEPALIVE
1241 #define LWIP_TCP_KEEPALIVE              0
1242 #endif
1243
1244 /**
1245  * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
1246  */
1247 #ifndef LWIP_SO_RCVTIMEO
1248 #define LWIP_SO_RCVTIMEO                0
1249 #endif
1250
1251 /**
1252  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1253  */
1254 #ifndef LWIP_SO_RCVBUF
1255 #define LWIP_SO_RCVBUF                  0
1256 #endif
1257
1258 /**
1259  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
1260  */
1261 #ifndef RECV_BUFSIZE_DEFAULT
1262 #define RECV_BUFSIZE_DEFAULT            INT_MAX
1263 #endif
1264
1265 /**
1266  * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE!
1267  */
1268 #ifndef SO_REUSE
1269 #define SO_REUSE                        0
1270 #endif
1271
1272 /*
1273    ----------------------------------------
1274    ---------- Statistics options ----------
1275    ----------------------------------------
1276 */
1277 /**
1278  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1279  */
1280 #ifndef LWIP_STATS
1281 #define LWIP_STATS                      0
1282 #endif
1283
1284 #if LWIP_STATS
1285
1286 /**
1287  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1288  */
1289 #ifndef LWIP_STATS_DISPLAY
1290 #define LWIP_STATS_DISPLAY              0
1291 #endif
1292
1293 /**
1294  * LINK_STATS==1: Enable link stats.
1295  */
1296 #ifndef LINK_STATS
1297 #define LINK_STATS                      1
1298 #endif
1299
1300 /**
1301  * ETHARP_STATS==1: Enable etharp stats.
1302  */
1303 #ifndef ETHARP_STATS
1304 #define ETHARP_STATS                    (LWIP_ARP)
1305 #endif
1306
1307 /**
1308  * IP_STATS==1: Enable IP stats.
1309  */
1310 #ifndef IP_STATS
1311 #define IP_STATS                        1
1312 #endif
1313
1314 /**
1315  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1316  * on if using either frag or reass.
1317  */
1318 #ifndef IPFRAG_STATS
1319 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
1320 #endif
1321
1322 /**
1323  * ICMP_STATS==1: Enable ICMP stats.
1324  */
1325 #ifndef ICMP_STATS
1326 #define ICMP_STATS                      1
1327 #endif
1328
1329 /**
1330  * IGMP_STATS==1: Enable IGMP stats.
1331  */
1332 #ifndef IGMP_STATS
1333 #define IGMP_STATS                      (LWIP_IGMP)
1334 #endif
1335
1336 /**
1337  * UDP_STATS==1: Enable UDP stats. Default is on if
1338  * UDP enabled, otherwise off.
1339  */
1340 #ifndef UDP_STATS
1341 #define UDP_STATS                       (LWIP_UDP)
1342 #endif
1343
1344 /**
1345  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1346  * enabled, otherwise off.
1347  */
1348 #ifndef TCP_STATS
1349 #define TCP_STATS                       (LWIP_TCP)
1350 #endif
1351
1352 /**
1353  * MEM_STATS==1: Enable mem.c stats.
1354  */
1355 #ifndef MEM_STATS
1356 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
1357 #endif
1358
1359 /**
1360  * MEMP_STATS==1: Enable memp.c pool stats.
1361  */
1362 #ifndef MEMP_STATS
1363 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
1364 #endif
1365
1366 /**
1367  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1368  */
1369 #ifndef SYS_STATS
1370 #define SYS_STATS                       (NO_SYS == 0)
1371 #endif
1372
1373 #else
1374
1375 #define LINK_STATS                      0
1376 #define ETHARP_STATS                    0
1377 #define IP_STATS                        0
1378 #define IPFRAG_STATS                    0
1379 #define ICMP_STATS                      0
1380 #define IGMP_STATS                      0
1381 #define UDP_STATS                       0
1382 #define TCP_STATS                       0
1383 #define MEM_STATS                       0
1384 #define MEMP_STATS                      0
1385 #define SYS_STATS                       0
1386 #define LWIP_STATS_DISPLAY              0
1387
1388 #endif /* LWIP_STATS */
1389
1390 /*
1391    ---------------------------------
1392    ---------- PPP options ----------
1393    ---------------------------------
1394 */
1395 /**
1396  * Enable PPP.
1397  *
1398  * $WIZ$ type = "boolean"
1399  */
1400 #define PPP_SUPPORT                     0
1401
1402 /**
1403  * Enable PPP Over Ethernet.
1404  *
1405  * $WIZ$ type = "boolean"
1406  */
1407 #define PPPOE_SUPPORT                   0
1408
1409 /**
1410  * PPPOS_SUPPORT==1: Enable PPP Over Serial
1411  */
1412 #ifndef PPPOS_SUPPORT
1413 #define PPPOS_SUPPORT                   PPP_SUPPORT
1414 #endif
1415
1416 #if PPP_SUPPORT
1417
1418 /**
1419  * NUM_PPP: Max PPP sessions.
1420  */
1421 #ifndef NUM_PPP
1422 #define NUM_PPP                         1
1423 #endif
1424
1425 /**
1426  * PAP_SUPPORT==1: Support PAP.
1427  */
1428 #ifndef PAP_SUPPORT
1429 #define PAP_SUPPORT                     0
1430 #endif
1431
1432 /**
1433  * CHAP_SUPPORT==1: Support CHAP.
1434  */
1435 #ifndef CHAP_SUPPORT
1436 #define CHAP_SUPPORT                    0
1437 #endif
1438
1439 /**
1440  * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1441  */
1442 #ifndef MSCHAP_SUPPORT
1443 #define MSCHAP_SUPPORT                  0
1444 #endif
1445
1446 /**
1447  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1448  */
1449 #ifndef CBCP_SUPPORT
1450 #define CBCP_SUPPORT                    0
1451 #endif
1452
1453 /**
1454  * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1455  */
1456 #ifndef CCP_SUPPORT
1457 #define CCP_SUPPORT                     0
1458 #endif
1459
1460 /**
1461  * VJ_SUPPORT==1: Support VJ header compression.
1462  */
1463 #ifndef VJ_SUPPORT
1464 #define VJ_SUPPORT                      0
1465 #endif
1466
1467 /**
1468  * MD5_SUPPORT==1: Support MD5 (see also CHAP).
1469  */
1470 #ifndef MD5_SUPPORT
1471 #define MD5_SUPPORT                     0
1472 #endif
1473
1474 /*
1475  * Timeouts
1476  */
1477 #ifndef FSM_DEFTIMEOUT
1478 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
1479 #endif
1480
1481 #ifndef FSM_DEFMAXTERMREQS
1482 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
1483 #endif
1484
1485 #ifndef FSM_DEFMAXCONFREQS
1486 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
1487 #endif
1488
1489 #ifndef FSM_DEFMAXNAKLOOPS
1490 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
1491 #endif
1492
1493 #ifndef UPAP_DEFTIMEOUT
1494 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
1495 #endif
1496
1497 #ifndef UPAP_DEFREQTIME
1498 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
1499 #endif
1500
1501 #ifndef CHAP_DEFTIMEOUT
1502 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
1503 #endif
1504
1505 #ifndef CHAP_DEFTRANSMITS
1506 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
1507 #endif
1508
1509 /* Interval in seconds between keepalive echo requests, 0 to disable. */
1510 #ifndef LCP_ECHOINTERVAL
1511 #define LCP_ECHOINTERVAL                0
1512 #endif
1513
1514 /* Number of unanswered echo requests before failure. */
1515 #ifndef LCP_MAXECHOFAILS
1516 #define LCP_MAXECHOFAILS                3
1517 #endif
1518
1519 /* Max Xmit idle time (in jiffies) before resend flag char. */
1520 #ifndef PPP_MAXIDLEFLAG
1521 #define PPP_MAXIDLEFLAG                 100
1522 #endif
1523
1524 /*
1525  * Packet sizes
1526  *
1527  * Note - lcp shouldn't be allowed to negotiate stuff outside these
1528  *    limits.  See lcp.h in the pppd directory.
1529  * (XXX - these constants should simply be shared by lcp.c instead
1530  *    of living in lcp.h)
1531  */
1532 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
1533 #ifndef PPP_MAXMTU
1534 /* #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN) */
1535 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
1536 #endif
1537 #define PPP_MINMTU                      64
1538 #define PPP_MRU                         1500     /* default MRU = max length of info field */
1539 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
1540 #ifndef PPP_DEFMRU
1541 #define PPP_DEFMRU                      296             /* Try for this */
1542 #endif
1543 #define PPP_MINMRU                      128             /* No MRUs below this */
1544
1545 #ifndef MAXNAMELEN
1546 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
1547 #endif
1548 #ifndef MAXSECRETLEN
1549 #define MAXSECRETLEN                    256     /* max length of password or secret */
1550 #endif
1551
1552 #endif /* PPP_SUPPORT */
1553
1554 /*
1555    --------------------------------------
1556    ---------- Checksum options ----------
1557    --------------------------------------
1558 */
1559 /**
1560  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
1561  */
1562 #ifndef CHECKSUM_GEN_IP
1563 #define CHECKSUM_GEN_IP                 1
1564 #endif
1565  
1566 /**
1567  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
1568  */
1569 #ifndef CHECKSUM_GEN_UDP
1570 #define CHECKSUM_GEN_UDP                1
1571 #endif
1572  
1573 /**
1574  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
1575  */
1576 #ifndef CHECKSUM_GEN_TCP
1577 #define CHECKSUM_GEN_TCP                1
1578 #endif
1579  
1580 /**
1581  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
1582  */
1583 #ifndef CHECKSUM_CHECK_IP
1584 #define CHECKSUM_CHECK_IP               1
1585 #endif
1586  
1587 /**
1588  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
1589  */
1590 #ifndef CHECKSUM_CHECK_UDP
1591 #define CHECKSUM_CHECK_UDP              1
1592 #endif
1593
1594 /**
1595  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
1596  */
1597 #ifndef CHECKSUM_CHECK_TCP
1598 #define CHECKSUM_CHECK_TCP              1
1599 #endif
1600
1601 /*
1602    ---------------------------------------
1603    ---------- Debugging options ----------
1604    ---------------------------------------
1605 */
1606
1607 #ifdef _DEBUG
1608 #define LWIP_DEBUG
1609 #endif
1610
1611 /**
1612  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
1613  * compared against this value. If it is smaller, then debugging
1614  * messages are written.
1615  */
1616 #ifndef LWIP_DBG_MIN_LEVEL
1617 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
1618 #endif
1619
1620 /**
1621  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1622  * debug messages of certain types.
1623  */
1624 #ifndef LWIP_DBG_TYPES_ON
1625 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
1626 #endif
1627
1628 /**
1629  * ETHARP_DEBUG: Enable debugging in etharp.c.
1630  */
1631 #ifndef ETHARP_DEBUG
1632 #define ETHARP_DEBUG                    LWIP_DBG_OFF
1633 #endif
1634
1635 /**
1636  * NETIF_DEBUG: Enable debugging in netif.c.
1637  */
1638 #ifndef NETIF_DEBUG
1639 #define NETIF_DEBUG                     LWIP_DBG_OFF
1640 #endif
1641
1642 /**
1643  * PBUF_DEBUG: Enable debugging in pbuf.c.
1644  */
1645 #ifndef PBUF_DEBUG
1646 #define PBUF_DEBUG                      LWIP_DBG_OFF
1647 #endif
1648
1649 /**
1650  * API_LIB_DEBUG: Enable debugging in api_lib.c.
1651  */
1652 #ifndef API_LIB_DEBUG
1653 #define API_LIB_DEBUG                   LWIP_DBG_OFF
1654 #endif
1655
1656 /**
1657  * API_MSG_DEBUG: Enable debugging in api_msg.c.
1658  */
1659 #ifndef API_MSG_DEBUG
1660 #define API_MSG_DEBUG                   LWIP_DBG_OFF
1661 #endif
1662
1663 /**
1664  * SOCKETS_DEBUG: Enable debugging in sockets.c.
1665  */
1666 #ifndef SOCKETS_DEBUG
1667 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
1668 #endif
1669
1670 /**
1671  * ICMP_DEBUG: Enable debugging in icmp.c.
1672  */
1673 #ifndef ICMP_DEBUG
1674 #define ICMP_DEBUG                      LWIP_DBG_OFF
1675 #endif
1676
1677 /**
1678  * IGMP_DEBUG: Enable debugging in igmp.c.
1679  */
1680 #ifndef IGMP_DEBUG
1681 #define IGMP_DEBUG                      LWIP_DBG_OFF
1682 #endif
1683
1684 /**
1685  * INET_DEBUG: Enable debugging in inet.c.
1686  */
1687 #ifndef INET_DEBUG
1688 #define INET_DEBUG                      LWIP_DBG_OFF
1689 #endif
1690
1691 /**
1692  * IP_DEBUG: Enable debugging for IP.
1693  */
1694 #ifndef IP_DEBUG
1695 #define IP_DEBUG                        LWIP_DBG_OFF
1696 #endif
1697
1698 /**
1699  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
1700  */
1701 #ifndef IP_REASS_DEBUG
1702 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
1703 #endif
1704
1705 /**
1706  * RAW_DEBUG: Enable debugging in raw.c.
1707  */
1708 #ifndef RAW_DEBUG
1709 #define RAW_DEBUG                       LWIP_DBG_OFF
1710 #endif
1711
1712 /**
1713  * MEM_DEBUG: Enable debugging in mem.c.
1714  */
1715 #ifndef MEM_DEBUG
1716 #define MEM_DEBUG                       LWIP_DBG_OFF
1717 #endif
1718
1719 /**
1720  * MEMP_DEBUG: Enable debugging in memp.c.
1721  */
1722 #ifndef MEMP_DEBUG
1723 #define MEMP_DEBUG                      LWIP_DBG_OFF
1724 #endif
1725
1726 /**
1727  * SYS_DEBUG: Enable debugging in sys.c.
1728  */
1729 #ifndef SYS_DEBUG
1730 #define SYS_DEBUG                       LWIP_DBG_OFF
1731 #endif
1732
1733 /**
1734  * TCP_DEBUG: Enable debugging for TCP.
1735  */
1736 #ifndef TCP_DEBUG
1737 #define TCP_DEBUG                       LWIP_DBG_OFF
1738 #endif
1739
1740 /**
1741  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
1742  */
1743 #ifndef TCP_INPUT_DEBUG
1744 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
1745 #endif
1746
1747 /**
1748  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
1749  */
1750 #ifndef TCP_FR_DEBUG
1751 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
1752 #endif
1753
1754 /**
1755  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
1756  * timeout.
1757  */
1758 #ifndef TCP_RTO_DEBUG
1759 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
1760 #endif
1761
1762 /**
1763  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
1764  */
1765 #ifndef TCP_CWND_DEBUG
1766 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
1767 #endif
1768
1769 /**
1770  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
1771  */
1772 #ifndef TCP_WND_DEBUG
1773 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
1774 #endif
1775
1776 /**
1777  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
1778  */
1779 #ifndef TCP_OUTPUT_DEBUG
1780 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
1781 #endif
1782
1783 /**
1784  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
1785  */
1786 #ifndef TCP_RST_DEBUG
1787 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
1788 #endif
1789
1790 /**
1791  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
1792  */
1793 #ifndef TCP_QLEN_DEBUG
1794 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
1795 #endif
1796
1797 /**
1798  * UDP_DEBUG: Enable debugging in UDP.
1799  */
1800 #ifndef UDP_DEBUG
1801 #define UDP_DEBUG                       LWIP_DBG_OFF
1802 #endif
1803
1804 /**
1805  * TCPIP_DEBUG: Enable debugging in tcpip.c.
1806  */
1807 #ifndef TCPIP_DEBUG
1808 #define TCPIP_DEBUG                     LWIP_DBG_OFF
1809 #endif
1810
1811 /**
1812  * PPP_DEBUG: Enable debugging for PPP.
1813  */
1814 #ifndef PPP_DEBUG
1815 #define PPP_DEBUG                       LWIP_DBG_OFF
1816 #endif
1817
1818 /**
1819  * SLIP_DEBUG: Enable debugging in slipif.c.
1820  */
1821 #ifndef SLIP_DEBUG
1822 #define SLIP_DEBUG                      LWIP_DBG_OFF
1823 #endif
1824
1825 /**
1826  * DHCP_DEBUG: Enable debugging in dhcp.c.
1827  */
1828 #ifndef DHCP_DEBUG
1829 #define DHCP_DEBUG                      LWIP_DBG_OFF
1830 #endif
1831
1832 /**
1833  * AUTOIP_DEBUG: Enable debugging in autoip.c.
1834  */
1835 #ifndef AUTOIP_DEBUG
1836 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
1837 #endif
1838
1839 /**
1840  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
1841  */
1842 #ifndef SNMP_MSG_DEBUG
1843 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
1844 #endif
1845
1846 /**
1847  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
1848  */
1849 #ifndef SNMP_MIB_DEBUG
1850 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
1851 #endif
1852
1853 /**
1854  * DNS_DEBUG: Enable debugging for DNS.
1855  */
1856 #ifndef DNS_DEBUG
1857 #define DNS_DEBUG                       LWIP_DBG_OFF
1858 #endif
1859
1860 /* Custom definitions: !!!DO NOT CHANGE THIS SECTION!!! */
1861 #define LWIP_TIMEVAL_PRIVATE            0
1862
1863 #endif /* CFG_LWIP_H */