Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/lwip/opt.h need to be fixed.

0001 /**
0002  * @file
0003  *
0004  * lwIP Options Configuration
0005  */
0006 
0007 /*
0008  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
0009  * All rights reserved. 
0010  * 
0011  * Redistribution and use in source and binary forms, with or without modification, 
0012  * are permitted provided that the following conditions are met:
0013  *
0014  * 1. Redistributions of source code must retain the above copyright notice,
0015  *    this list of conditions and the following disclaimer.
0016  * 2. Redistributions in binary form must reproduce the above copyright notice,
0017  *    this list of conditions and the following disclaimer in the documentation
0018  *    and/or other materials provided with the distribution.
0019  * 3. The name of the author may not be used to endorse or promote products
0020  *    derived from this software without specific prior written permission. 
0021  *
0022  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
0023  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
0024  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
0025  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
0026  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
0027  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
0028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
0029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
0030  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
0031  * OF SUCH DAMAGE.
0032  *
0033  * This file is part of the lwIP TCP/IP stack.
0034  * 
0035  * Author: Adam Dunkels <adam@sics.se>
0036  *
0037  */
0038 #ifndef __LWIP_OPT_H__
0039 #define __LWIP_OPT_H__
0040 
0041 /*
0042  * Include user defined options first. Anything not defined in these files
0043  * will be set to standard values. Override anything you dont like!
0044  */
0045 #include "lwipopts.h"
0046 #include "lwip/debug.h"
0047 
0048 /*
0049    -----------------------------------------------
0050    ---------- Platform specific locking ----------
0051    -----------------------------------------------
0052 */
0053 
0054 /**
0055  * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
0056  * critical regions during buffer allocation, deallocation and memory
0057  * allocation and deallocation.
0058  */
0059 #ifndef SYS_LIGHTWEIGHT_PROT
0060 #define SYS_LIGHTWEIGHT_PROT            0
0061 #endif
0062 
0063 /** 
0064  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
0065  * use lwIP facilities.
0066  */
0067 #ifndef NO_SYS
0068 #define NO_SYS                          0
0069 #endif
0070 
0071 /**
0072  * MEMCPY: override this if you have a faster implementation at hand than the
0073  * one included in your C library
0074  */
0075 #ifndef MEMCPY
0076 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
0077 #endif
0078 
0079 /**
0080  * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
0081  * call to memcpy() if the length is known at compile time and is small.
0082  */
0083 #ifndef SMEMCPY
0084 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
0085 #endif
0086 
0087 /*
0088    ------------------------------------
0089    ---------- Memory options ----------
0090    ------------------------------------
0091 */
0092 /**
0093  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
0094  * instead of the lwip internal allocator. Can save code size if you
0095  * already use it.
0096  */
0097 #ifndef MEM_LIBC_MALLOC
0098 #define MEM_LIBC_MALLOC                 0
0099 #endif
0100 
0101 /**
0102 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
0103 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
0104 * speed and usage from interrupts!
0105 */
0106 #ifndef MEMP_MEM_MALLOC
0107 #define MEMP_MEM_MALLOC                 0
0108 #endif
0109 
0110 /**
0111  * MEM_ALIGNMENT: should be set to the alignment of the CPU
0112  *    4 byte alignment -> #define MEM_ALIGNMENT 4
0113  *    2 byte alignment -> #define MEM_ALIGNMENT 2
0114  */
0115 #ifndef MEM_ALIGNMENT
0116 #define MEM_ALIGNMENT                   1
0117 #endif
0118 
0119 /**
0120  * MEM_SIZE: the size of the heap memory. If the application will send
0121  * a lot of data that needs to be copied, this should be set high.
0122  */
0123 #ifndef MEM_SIZE
0124 #define MEM_SIZE                        1600
0125 #endif
0126 
0127 /**
0128  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
0129  * amount of bytes before and after each memp element in every pool and fills
0130  * it with a prominent default value.
0131  *    MEMP_OVERFLOW_CHECK == 0 no checking
0132  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
0133  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
0134  *      memp_malloc() or memp_free() is called (useful but slow!)
0135  */
0136 #ifndef MEMP_OVERFLOW_CHECK
0137 #define MEMP_OVERFLOW_CHECK             0
0138 #endif
0139 
0140 /**
0141  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
0142  * sure that there are no cycles in the linked lists.
0143  */
0144 #ifndef MEMP_SANITY_CHECK
0145 #define MEMP_SANITY_CHECK               0
0146 #endif
0147 
0148 /**
0149  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
0150  * of memory pools of various sizes. When mem_malloc is called, an element of
0151  * the smallest pool that can provide the length needed is returned.
0152  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
0153  */
0154 #ifndef MEM_USE_POOLS
0155 #define MEM_USE_POOLS                   0
0156 #endif
0157 
0158 /**
0159  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
0160  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
0161  * reliable. */
0162 #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
0163 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
0164 #endif
0165 
0166 /**
0167  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
0168  * that defines additional pools beyond the "standard" ones required
0169  * by lwIP. If you set this to 1, you must have lwippools.h in your 
0170  * inlude path somewhere. 
0171  */
0172 #ifndef MEMP_USE_CUSTOM_POOLS
0173 #define MEMP_USE_CUSTOM_POOLS           0
0174 #endif
0175 
0176 /**
0177  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
0178  * interrupt context (or another context that doesn't allow waiting for a
0179  * semaphore).
0180  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
0181  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
0182  * with each loop so that mem_free can run.
0183  *
0184  * ATTENTION: As you can see from the above description, this leads to dis-/
0185  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
0186  * can need longer.
0187  *
0188  * If you don't want that, at least for NO_SYS=0, you can still use the following
0189  * functions to enqueue a deallocation call which then runs in the tcpip_thread
0190  * context:
0191  * - pbuf_free_callback(p);
0192  * - mem_free_callback(m);
0193  */
0194 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
0195 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
0196 #endif
0197 
0198 /*
0199    ------------------------------------------------
0200    ---------- Internal Memory Pool Sizes ----------
0201    ------------------------------------------------
0202 */
0203 /**
0204  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
0205  * If the application sends a lot of data out of ROM (or other static memory),
0206  * this should be set high.
0207  */
0208 #ifndef MEMP_NUM_PBUF
0209 #define MEMP_NUM_PBUF                   16
0210 #endif
0211 
0212 /**
0213  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
0214  * (requires the LWIP_RAW option)
0215  */
0216 #ifndef MEMP_NUM_RAW_PCB
0217 #define MEMP_NUM_RAW_PCB                4
0218 #endif
0219 
0220 /**
0221  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
0222  * per active UDP "connection".
0223  * (requires the LWIP_UDP option)
0224  */
0225 #ifndef MEMP_NUM_UDP_PCB
0226 #define MEMP_NUM_UDP_PCB                4
0227 #endif
0228 
0229 /**
0230  * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
0231  * (requires the LWIP_TCP option)
0232  */
0233 #ifndef MEMP_NUM_TCP_PCB
0234 #define MEMP_NUM_TCP_PCB                5
0235 #endif
0236 
0237 /**
0238  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
0239  * (requires the LWIP_TCP option)
0240  */
0241 #ifndef MEMP_NUM_TCP_PCB_LISTEN
0242 #define MEMP_NUM_TCP_PCB_LISTEN         8
0243 #endif
0244 
0245 /**
0246  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
0247  * (requires the LWIP_TCP option)
0248  */
0249 #ifndef MEMP_NUM_TCP_SEG
0250 #define MEMP_NUM_TCP_SEG                16
0251 #endif
0252 
0253 /**
0254  * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
0255  * reassembly (whole packets, not fragments!)
0256  */
0257 #ifndef MEMP_NUM_REASSDATA
0258 #define MEMP_NUM_REASSDATA              5
0259 #endif
0260 
0261 /**
0262  * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
0263  * packets (pbufs) that are waiting for an ARP request (to resolve
0264  * their destination address) to finish.
0265  * (requires the ARP_QUEUEING option)
0266  */
0267 #ifndef MEMP_NUM_ARP_QUEUE
0268 #define MEMP_NUM_ARP_QUEUE              30
0269 #endif
0270 
0271 /**
0272  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
0273  * can be members et the same time (one per netif - allsystems group -, plus one
0274  * per netif membership).
0275  * (requires the LWIP_IGMP option)
0276  */
0277 #ifndef MEMP_NUM_IGMP_GROUP
0278 #define MEMP_NUM_IGMP_GROUP             8
0279 #endif
0280 
0281 /**
0282  * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
0283  * (requires NO_SYS==0)
0284  */
0285 #ifndef MEMP_NUM_SYS_TIMEOUT
0286 #define MEMP_NUM_SYS_TIMEOUT            3
0287 #endif
0288 
0289 /**
0290  * MEMP_NUM_NETBUF: the number of struct netbufs.
0291  * (only needed if you use the sequential API, like api_lib.c)
0292  */
0293 #ifndef MEMP_NUM_NETBUF
0294 #define MEMP_NUM_NETBUF                 2
0295 #endif
0296 
0297 /**
0298  * MEMP_NUM_NETCONN: the number of struct netconns.
0299  * (only needed if you use the sequential API, like api_lib.c)
0300  */
0301 #ifndef MEMP_NUM_NETCONN
0302 #define MEMP_NUM_NETCONN                4
0303 #endif
0304 
0305 /**
0306  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
0307  * for callback/timeout API communication. 
0308  * (only needed if you use tcpip.c)
0309  */
0310 #ifndef MEMP_NUM_TCPIP_MSG_API
0311 #define MEMP_NUM_TCPIP_MSG_API          8
0312 #endif
0313 
0314 /**
0315  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
0316  * for incoming packets. 
0317  * (only needed if you use tcpip.c)
0318  */
0319 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
0320 #define MEMP_NUM_TCPIP_MSG_INPKT        8
0321 #endif
0322 
0323 /**
0324  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 
0325  */
0326 #ifndef PBUF_POOL_SIZE
0327 #define PBUF_POOL_SIZE                  16
0328 #endif
0329 
0330 /*
0331    ---------------------------------
0332    ---------- ARP options ----------
0333    ---------------------------------
0334 */
0335 /**
0336  * LWIP_ARP==1: Enable ARP functionality.
0337  */
0338 #ifndef LWIP_ARP
0339 #define LWIP_ARP                        1
0340 #endif
0341 
0342 /**
0343  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
0344  */
0345 #ifndef ARP_TABLE_SIZE
0346 #define ARP_TABLE_SIZE                  10
0347 #endif
0348 
0349 /**
0350  * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
0351  * resolution.
0352  */
0353 #ifndef ARP_QUEUEING
0354 #define ARP_QUEUEING                    1
0355 #endif
0356 
0357 /**
0358  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
0359  * updated with the source MAC and IP addresses supplied in the packet.
0360  * You may want to disable this if you do not trust LAN peers to have the
0361  * correct addresses, or as a limited approach to attempt to handle
0362  * spoofing. If disabled, lwIP will need to make a new ARP request if
0363  * the peer is not already in the ARP table, adding a little latency.
0364  */
0365 #ifndef ETHARP_TRUST_IP_MAC
0366 #define ETHARP_TRUST_IP_MAC             1
0367 #endif
0368 
0369 /**
0370  * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
0371  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
0372  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
0373  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
0374  */
0375 #ifndef ETHARP_SUPPORT_VLAN
0376 #define ETHARP_SUPPORT_VLAN             0
0377 #endif
0378 
0379 /*
0380    --------------------------------
0381    ---------- IP options ----------
0382    --------------------------------
0383 */
0384 /**
0385  * IP_FORWARD==1: Enables the ability to forward IP packets across network
0386  * interfaces. If you are going to run lwIP on a device with only one network
0387  * interface, define this to 0.
0388  */
0389 #ifndef IP_FORWARD
0390 #define IP_FORWARD                      0
0391 #endif
0392 
0393 /**
0394  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
0395  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
0396  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
0397  */
0398 #ifndef IP_OPTIONS_ALLOWED
0399 #define IP_OPTIONS_ALLOWED              1
0400 #endif
0401 
0402 /**
0403  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
0404  * this option does not affect outgoing packet sizes, which can be controlled
0405  * via IP_FRAG.
0406  */
0407 #ifndef IP_REASSEMBLY
0408 #define IP_REASSEMBLY                   1
0409 #endif
0410 
0411 /**
0412  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
0413  * that this option does not affect incoming packet sizes, which can be
0414  * controlled via IP_REASSEMBLY.
0415  */
0416 #ifndef IP_FRAG
0417 #define IP_FRAG                         1
0418 #endif
0419 
0420 /**
0421  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
0422  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
0423  * in this time, the whole packet is discarded.
0424  */
0425 #ifndef IP_REASS_MAXAGE
0426 #define IP_REASS_MAXAGE                 3
0427 #endif
0428 
0429 /**
0430  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
0431  * Since the received pbufs are enqueued, be sure to configure
0432  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
0433  * packets even if the maximum amount of fragments is enqueued for reassembly!
0434  */
0435 #ifndef IP_REASS_MAX_PBUFS
0436 #define IP_REASS_MAX_PBUFS              10
0437 #endif
0438 
0439 /**
0440  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
0441  * fragmentation. Otherwise pbufs are allocated and reference the original
0442  * packet data to be fragmented.
0443  */
0444 #ifndef IP_FRAG_USES_STATIC_BUF
0445 #define IP_FRAG_USES_STATIC_BUF         1
0446 #endif
0447 
0448 /**
0449  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
0450  * (requires IP_FRAG_USES_STATIC_BUF==1)
0451  */
0452 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
0453 #define IP_FRAG_MAX_MTU                 1500
0454 #endif
0455 
0456 /**
0457  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
0458  */
0459 #ifndef IP_DEFAULT_TTL
0460 #define IP_DEFAULT_TTL                  255
0461 #endif
0462 
0463 /**
0464  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
0465  * filter per pcb on udp and raw send operations. To enable broadcast filter
0466  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
0467  */
0468 #ifndef IP_SOF_BROADCAST
0469 #define IP_SOF_BROADCAST                0
0470 #endif
0471 
0472 /**
0473  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
0474  * filter on recv operations.
0475  */
0476 #ifndef IP_SOF_BROADCAST_RECV
0477 #define IP_SOF_BROADCAST_RECV           0
0478 #endif
0479 
0480 /*
0481    ----------------------------------
0482    ---------- ICMP options ----------
0483    ----------------------------------
0484 */
0485 /**
0486  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
0487  * Be careful, disable that make your product non-compliant to RFC1122
0488  */
0489 #ifndef LWIP_ICMP
0490 #define LWIP_ICMP                       1
0491 #endif
0492 
0493 /**
0494  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
0495  */
0496 #ifndef ICMP_TTL
0497 #define ICMP_TTL                       (IP_DEFAULT_TTL)
0498 #endif
0499 
0500 /**
0501  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
0502  */
0503 #ifndef LWIP_BROADCAST_PING
0504 #define LWIP_BROADCAST_PING             0
0505 #endif
0506 
0507 /**
0508  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
0509  */
0510 #ifndef LWIP_MULTICAST_PING
0511 #define LWIP_MULTICAST_PING             0
0512 #endif
0513 
0514 /*
0515    ---------------------------------
0516    ---------- RAW options ----------
0517    ---------------------------------
0518 */
0519 /**
0520  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
0521  */
0522 #ifndef LWIP_RAW
0523 #define LWIP_RAW                        1
0524 #endif
0525 
0526 /**
0527  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
0528  */
0529 #ifndef RAW_TTL
0530 #define RAW_TTL                        (IP_DEFAULT_TTL)
0531 #endif
0532 
0533 /*
0534    ----------------------------------
0535    ---------- DHCP options ----------
0536    ----------------------------------
0537 */
0538 /**
0539  * LWIP_DHCP==1: Enable DHCP module.
0540  */
0541 #ifndef LWIP_DHCP
0542 #define LWIP_DHCP                       0
0543 #endif
0544 
0545 /**
0546  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
0547  */
0548 #ifndef DHCP_DOES_ARP_CHECK
0549 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
0550 #endif
0551 
0552 /*
0553    ------------------------------------
0554    ---------- AUTOIP options ----------
0555    ------------------------------------
0556 */
0557 /**
0558  * LWIP_AUTOIP==1: Enable AUTOIP module.
0559  */
0560 #ifndef LWIP_AUTOIP
0561 #define LWIP_AUTOIP                     0
0562 #endif
0563 
0564 /**
0565  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
0566  * the same interface at the same time.
0567  */
0568 #ifndef LWIP_DHCP_AUTOIP_COOP
0569 #define LWIP_DHCP_AUTOIP_COOP           0
0570 #endif
0571 
0572 /**
0573  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
0574  * that should be sent before falling back on AUTOIP. This can be set
0575  * as low as 1 to get an AutoIP address very quickly, but you should
0576  * be prepared to handle a changing IP address when DHCP overrides
0577  * AutoIP.
0578  */
0579 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
0580 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
0581 #endif
0582 
0583 /*
0584    ----------------------------------
0585    ---------- SNMP options ----------
0586    ----------------------------------
0587 */
0588 /**
0589  * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
0590  * transport.
0591  */
0592 #ifndef LWIP_SNMP
0593 #define LWIP_SNMP                       0
0594 #endif
0595 
0596 /**
0597  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
0598  * allow. At least one request buffer is required. 
0599  */
0600 #ifndef SNMP_CONCURRENT_REQUESTS
0601 #define SNMP_CONCURRENT_REQUESTS        1
0602 #endif
0603 
0604 /**
0605  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
0606  * destination is required
0607  */
0608 #ifndef SNMP_TRAP_DESTINATIONS
0609 #define SNMP_TRAP_DESTINATIONS          1
0610 #endif
0611 
0612 /**
0613  * SNMP_PRIVATE_MIB: 
0614  */
0615 #ifndef SNMP_PRIVATE_MIB
0616 #define SNMP_PRIVATE_MIB                0
0617 #endif
0618 
0619 /**
0620  * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
0621  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
0622  * Unsafe requests are disabled by default!
0623  */
0624 #ifndef SNMP_SAFE_REQUESTS
0625 #define SNMP_SAFE_REQUESTS              1
0626 #endif
0627 
0628 /*
0629    ----------------------------------
0630    ---------- IGMP options ----------
0631    ----------------------------------
0632 */
0633 /**
0634  * LWIP_IGMP==1: Turn on IGMP module. 
0635  */
0636 #ifndef LWIP_IGMP
0637 #define LWIP_IGMP                       0
0638 #endif
0639 
0640 /*
0641    ----------------------------------
0642    ---------- DNS options -----------
0643    ----------------------------------
0644 */
0645 /**
0646  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
0647  * transport.
0648  */
0649 #ifndef LWIP_DNS
0650 #define LWIP_DNS                        0
0651 #endif
0652 
0653 /** DNS maximum number of entries to maintain locally. */
0654 #ifndef DNS_TABLE_SIZE
0655 #define DNS_TABLE_SIZE                  4
0656 #endif
0657 
0658 /** DNS maximum host name length supported in the name table. */
0659 #ifndef DNS_MAX_NAME_LENGTH
0660 #define DNS_MAX_NAME_LENGTH             256
0661 #endif
0662 
0663 /** The maximum of DNS servers */
0664 #ifndef DNS_MAX_SERVERS
0665 #define DNS_MAX_SERVERS                 2
0666 #endif
0667 
0668 /** DNS do a name checking between the query and the response. */
0669 #ifndef DNS_DOES_NAME_CHECK
0670 #define DNS_DOES_NAME_CHECK             1
0671 #endif
0672 
0673 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
0674     DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
0675     The buffer will be of size DNS_MSG_SIZE */
0676 #ifndef DNS_USES_STATIC_BUF
0677 #define DNS_USES_STATIC_BUF             1
0678 #endif
0679 
0680 /** DNS message max. size. Default value is RFC compliant. */
0681 #ifndef DNS_MSG_SIZE
0682 #define DNS_MSG_SIZE                    512
0683 #endif
0684 
0685 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
0686  *  you have to define
0687  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
0688  *  (an array of structs name/address, where address is an u32_t in network
0689  *  byte order).
0690  *
0691  *  Instead, you can also use an external function:
0692  *  #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
0693  *  that returns the IP address or INADDR_NONE if not found.
0694  */
0695 #ifndef DNS_LOCAL_HOSTLIST
0696 #define DNS_LOCAL_HOSTLIST              0
0697 #endif /* DNS_LOCAL_HOSTLIST */
0698 
0699 /** If this is turned on, the local host-list can be dynamically changed
0700  *  at runtime. */
0701 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
0702 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
0703 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
0704 
0705 /*
0706    ---------------------------------
0707    ---------- UDP options ----------
0708    ---------------------------------
0709 */
0710 /**
0711  * LWIP_UDP==1: Turn on UDP.
0712  */
0713 #ifndef LWIP_UDP
0714 #define LWIP_UDP                        1
0715 #endif
0716 
0717 /**
0718  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
0719  */
0720 #ifndef LWIP_UDPLITE
0721 #define LWIP_UDPLITE                    0
0722 #endif
0723 
0724 /**
0725  * UDP_TTL: Default Time-To-Live value.
0726  */
0727 #ifndef UDP_TTL
0728 #define UDP_TTL                         (IP_DEFAULT_TTL)
0729 #endif
0730 
0731 /**
0732  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
0733  */
0734 #ifndef LWIP_NETBUF_RECVINFO
0735 #define LWIP_NETBUF_RECVINFO            0
0736 #endif
0737 
0738 /*
0739    ---------------------------------
0740    ---------- TCP options ----------
0741    ---------------------------------
0742 */
0743 /**
0744  * LWIP_TCP==1: Turn on TCP.
0745  */
0746 #ifndef LWIP_TCP
0747 #define LWIP_TCP                        1
0748 #endif
0749 
0750 /**
0751  * TCP_TTL: Default Time-To-Live value.
0752  */
0753 #ifndef TCP_TTL
0754 #define TCP_TTL                         (IP_DEFAULT_TTL)
0755 #endif
0756 
0757 /**
0758  * TCP_WND: The size of a TCP window.  This must be at least 
0759  * (2 * TCP_MSS) for things to work well
0760  */
0761 #ifndef TCP_WND
0762 #define TCP_WND                         (4 * TCP_MSS)
0763 #endif 
0764 
0765 /**
0766  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
0767  */
0768 #ifndef TCP_MAXRTX
0769 #define TCP_MAXRTX                      12
0770 #endif
0771 
0772 /**
0773  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
0774  */
0775 #ifndef TCP_SYNMAXRTX
0776 #define TCP_SYNMAXRTX                   6
0777 #endif
0778 
0779 /**
0780  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
0781  * Define to 0 if your device is low on memory.
0782  */
0783 #ifndef TCP_QUEUE_OOSEQ
0784 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
0785 #endif
0786 
0787 /**
0788  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
0789  * you might want to increase this.)
0790  * For the receive side, this MSS is advertised to the remote side
0791  * when opening a connection. For the transmit size, this MSS sets
0792  * an upper limit on the MSS advertised by the remote host.
0793  */
0794 #ifndef TCP_MSS
0795 #define TCP_MSS                         536
0796 #endif
0797 
0798 /**
0799  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
0800  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
0801  * reflects the available reassembly buffer size at the remote host) and the
0802  * largest size permitted by the IP layer" (RFC 1122)
0803  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
0804  * netif used for a connection and limits the MSS if it would be too big otherwise.
0805  */
0806 #ifndef TCP_CALCULATE_EFF_SEND_MSS
0807 #define TCP_CALCULATE_EFF_SEND_MSS      1
0808 #endif
0809 
0810 
0811 /**
0812  * TCP_SND_BUF: TCP sender buffer space (bytes). 
0813  */
0814 #ifndef TCP_SND_BUF
0815 #define TCP_SND_BUF                     256
0816 #endif
0817 
0818 /**
0819  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
0820  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
0821  */
0822 #ifndef TCP_SND_QUEUELEN
0823 #define TCP_SND_QUEUELEN                (4 * (TCP_SND_BUF)/(TCP_MSS))
0824 #endif
0825 
0826 /**
0827  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
0828  * to TCP_SND_BUF. It is the amount of space which must be available in the
0829  * TCP snd_buf for select to return writable.
0830  */
0831 #ifndef TCP_SNDLOWAT
0832 #define TCP_SNDLOWAT                    ((TCP_SND_BUF)/2)
0833 #endif
0834 
0835 /**
0836  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
0837  */
0838 #ifndef TCP_LISTEN_BACKLOG
0839 #define TCP_LISTEN_BACKLOG              0
0840 #endif
0841 
0842 /**
0843  * The maximum allowed backlog for TCP listen netconns.
0844  * This backlog is used unless another is explicitly specified.
0845  * 0xff is the maximum (u8_t).
0846  */
0847 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
0848 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
0849 #endif
0850 
0851 /**
0852  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
0853  */
0854 #ifndef LWIP_TCP_TIMESTAMPS
0855 #define LWIP_TCP_TIMESTAMPS             0
0856 #endif
0857 
0858 /**
0859  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
0860  * explicit window update
0861  */
0862 #ifndef TCP_WND_UPDATE_THRESHOLD
0863 #define TCP_WND_UPDATE_THRESHOLD   (TCP_WND / 4)
0864 #endif
0865 
0866 /**
0867  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
0868  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
0869  *         events (accept, sent, etc) that happen in the system.
0870  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
0871  *         for the event.
0872  */
0873 #ifndef LWIP_EVENT_API
0874 #define LWIP_EVENT_API                  0
0875 #define LWIP_CALLBACK_API               1
0876 #else 
0877 #define LWIP_EVENT_API                  1
0878 #define LWIP_CALLBACK_API               0
0879 #endif
0880 
0881 
0882 /*
0883    ----------------------------------
0884    ---------- Pbuf options ----------
0885    ----------------------------------
0886 */
0887 /**
0888  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
0889  * link level header. The default is 14, the standard value for
0890  * Ethernet.
0891  */
0892 #ifndef PBUF_LINK_HLEN
0893 #define PBUF_LINK_HLEN                  14
0894 #endif
0895 
0896 /**
0897  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
0898  * designed to accomodate single full size TCP frame in one pbuf, including
0899  * TCP_MSS, IP header, and link header.
0900  */
0901 #ifndef PBUF_POOL_BUFSIZE
0902 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
0903 #endif
0904 
0905 /*
0906    ------------------------------------------------
0907    ---------- Network Interfaces options ----------
0908    ------------------------------------------------
0909 */
0910 /**
0911  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
0912  * field.
0913  */
0914 #ifndef LWIP_NETIF_HOSTNAME
0915 #define LWIP_NETIF_HOSTNAME             0
0916 #endif
0917 
0918 /**
0919  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
0920  */
0921 #ifndef LWIP_NETIF_API
0922 #define LWIP_NETIF_API                  0
0923 #endif
0924 
0925 /**
0926  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
0927  * changes its up/down status (i.e., due to DHCP IP acquistion)
0928  */
0929 #ifndef LWIP_NETIF_STATUS_CALLBACK
0930 #define LWIP_NETIF_STATUS_CALLBACK      0
0931 #endif
0932 
0933 /**
0934  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
0935  * whenever the link changes (i.e., link down)
0936  */
0937 #ifndef LWIP_NETIF_LINK_CALLBACK
0938 #define LWIP_NETIF_LINK_CALLBACK        0
0939 #endif
0940 
0941 /**
0942  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
0943  * indices) in struct netif. TCP and UDP can make use of this to prevent
0944  * scanning the ARP table for every sent packet. While this is faster for big
0945  * ARP tables or many concurrent connections, it might be counterproductive
0946  * if you have a tiny ARP table or if there never are concurrent connections.
0947  */
0948 #ifndef LWIP_NETIF_HWADDRHINT
0949 #define LWIP_NETIF_HWADDRHINT           0
0950 #endif
0951 
0952 /**
0953  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
0954  * address equal to the netif IP address, looping them back up the stack.
0955  */
0956 #ifndef LWIP_NETIF_LOOPBACK
0957 #define LWIP_NETIF_LOOPBACK             0
0958 #endif
0959 
0960 /**
0961  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
0962  * sending for each netif (0 = disabled)
0963  */
0964 #ifndef LWIP_LOOPBACK_MAX_PBUFS
0965 #define LWIP_LOOPBACK_MAX_PBUFS         0
0966 #endif
0967 
0968 /**
0969  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
0970  * the system, as netifs must change how they behave depending on this setting
0971  * for the LWIP_NETIF_LOOPBACK option to work.
0972  * Setting this is needed to avoid reentering non-reentrant functions like
0973  * tcp_input().
0974  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
0975  *       multithreaded environment like tcpip.c. In this case, netif->input()
0976  *       is called directly.
0977  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
0978  *       The packets are put on a list and netif_poll() must be called in
0979  *       the main application loop.
0980  */
0981 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
0982 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
0983 #endif
0984 
0985 /**
0986  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
0987  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
0988  * MACs that do not support scatter-gather.
0989  * Beware that this might involve CPU-memcpy before transmitting that would not
0990  * be needed without this flag! Use this only if you need to!
0991  *
0992  * @todo: TCP and IP-frag do not work with this, yet:
0993  */
0994 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
0995 #define LWIP_NETIF_TX_SINGLE_PBUF             0
0996 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
0997 
0998 /*
0999    ------------------------------------
1000    ---------- LOOPIF options ----------
1001    ------------------------------------
1002 */
1003 /**
1004  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
1005  */
1006 #ifndef LWIP_HAVE_LOOPIF
1007 #define LWIP_HAVE_LOOPIF                0
1008 #endif
1009 
1010 /*
1011    ------------------------------------
1012    ---------- SLIPIF options ----------
1013    ------------------------------------
1014 */
1015 /**
1016  * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
1017  */
1018 #ifndef LWIP_HAVE_SLIPIF
1019 #define LWIP_HAVE_SLIPIF                0
1020 #endif
1021 
1022 /*
1023    ------------------------------------
1024    ---------- Thread options ----------
1025    ------------------------------------
1026 */
1027 /**
1028  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
1029  */
1030 #ifndef TCPIP_THREAD_NAME
1031 #define TCPIP_THREAD_NAME              "tcpip_thread"
1032 #endif
1033 
1034 /**
1035  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
1036  * The stack size value itself is platform-dependent, but is passed to
1037  * sys_thread_new() when the thread is created.
1038  */
1039 #ifndef TCPIP_THREAD_STACKSIZE
1040 #define TCPIP_THREAD_STACKSIZE          0
1041 #endif
1042 
1043 /**
1044  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
1045  * The priority value itself is platform-dependent, but is passed to
1046  * sys_thread_new() when the thread is created.
1047  */
1048 #ifndef TCPIP_THREAD_PRIO
1049 #define TCPIP_THREAD_PRIO               1
1050 #endif
1051 
1052 /**
1053  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
1054  * The queue size value itself is platform-dependent, but is passed to
1055  * sys_mbox_new() when tcpip_init is called.
1056  */
1057 #ifndef TCPIP_MBOX_SIZE
1058 #define TCPIP_MBOX_SIZE                 0
1059 #endif
1060 
1061 /**
1062  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
1063  */
1064 #ifndef SLIPIF_THREAD_NAME
1065 #define SLIPIF_THREAD_NAME             "slipif_loop"
1066 #endif
1067 
1068 /**
1069  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
1070  * The stack size value itself is platform-dependent, but is passed to
1071  * sys_thread_new() when the thread is created.
1072  */
1073 #ifndef SLIPIF_THREAD_STACKSIZE
1074 #define SLIPIF_THREAD_STACKSIZE         0
1075 #endif
1076 
1077 /**
1078  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
1079  * The priority value itself is platform-dependent, but is passed to
1080  * sys_thread_new() when the thread is created.
1081  */
1082 #ifndef SLIPIF_THREAD_PRIO
1083 #define SLIPIF_THREAD_PRIO              1
1084 #endif
1085 
1086 /**
1087  * PPP_THREAD_NAME: The name assigned to the pppMain thread.
1088  */
1089 #ifndef PPP_THREAD_NAME
1090 #define PPP_THREAD_NAME                "pppMain"
1091 #endif
1092 
1093 /**
1094  * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.
1095  * The stack size value itself is platform-dependent, but is passed to
1096  * sys_thread_new() when the thread is created.
1097  */
1098 #ifndef PPP_THREAD_STACKSIZE
1099 #define PPP_THREAD_STACKSIZE            0
1100 #endif
1101 
1102 /**
1103  * PPP_THREAD_PRIO: The priority assigned to the pppMain thread.
1104  * The priority value itself is platform-dependent, but is passed to
1105  * sys_thread_new() when the thread is created.
1106  */
1107 #ifndef PPP_THREAD_PRIO
1108 #define PPP_THREAD_PRIO                 1
1109 #endif
1110 
1111 /**
1112  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
1113  */
1114 #ifndef DEFAULT_THREAD_NAME
1115 #define DEFAULT_THREAD_NAME            "lwIP"
1116 #endif
1117 
1118 /**
1119  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
1120  * The stack size value itself is platform-dependent, but is passed to
1121  * sys_thread_new() when the thread is created.
1122  */
1123 #ifndef DEFAULT_THREAD_STACKSIZE
1124 #define DEFAULT_THREAD_STACKSIZE        0
1125 #endif
1126 
1127 /**
1128  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
1129  * The priority value itself is platform-dependent, but is passed to
1130  * sys_thread_new() when the thread is created.
1131  */
1132 #ifndef DEFAULT_THREAD_PRIO
1133 #define DEFAULT_THREAD_PRIO             1
1134 #endif
1135 
1136 /**
1137  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1138  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
1139  * to sys_mbox_new() when the recvmbox is created.
1140  */
1141 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
1142 #define DEFAULT_RAW_RECVMBOX_SIZE       0
1143 #endif
1144 
1145 /**
1146  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1147  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
1148  * to sys_mbox_new() when the recvmbox is created.
1149  */
1150 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
1151 #define DEFAULT_UDP_RECVMBOX_SIZE       0
1152 #endif
1153 
1154 /**
1155  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
1156  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
1157  * to sys_mbox_new() when the recvmbox is created.
1158  */
1159 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
1160 #define DEFAULT_TCP_RECVMBOX_SIZE       0
1161 #endif
1162 
1163 /**
1164  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
1165  * The queue size value itself is platform-dependent, but is passed to
1166  * sys_mbox_new() when the acceptmbox is created.
1167  */
1168 #ifndef DEFAULT_ACCEPTMBOX_SIZE
1169 #define DEFAULT_ACCEPTMBOX_SIZE         0
1170 #endif
1171 
1172 /*
1173    ----------------------------------------------
1174    ---------- Sequential layer options ----------
1175    ----------------------------------------------
1176 */
1177 /**
1178  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
1179  * Don't use it if you're not an active lwIP project member
1180  */
1181 #ifndef LWIP_TCPIP_CORE_LOCKING
1182 #define LWIP_TCPIP_CORE_LOCKING         0
1183 #endif
1184 
1185 /**
1186  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
1187  */
1188 #ifndef LWIP_NETCONN
1189 #define LWIP_NETCONN                    1
1190 #endif
1191 
1192 /*
1193    ------------------------------------
1194    ---------- Socket options ----------
1195    ------------------------------------
1196 */
1197 /**
1198  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
1199  */
1200 #ifndef LWIP_SOCKET
1201 #define LWIP_SOCKET                     1
1202 #endif
1203 
1204 /**
1205  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
1206  * (only used if you use sockets.c)
1207  */
1208 #ifndef LWIP_COMPAT_SOCKETS
1209 #define LWIP_COMPAT_SOCKETS             1
1210 #endif
1211 
1212 /**
1213  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
1214  * Disable this option if you use a POSIX operating system that uses the same
1215  * names (read, write & close). (only used if you use sockets.c)
1216  */
1217 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
1218 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
1219 #endif
1220 
1221 /**
1222  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
1223  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
1224  * in seconds. (does not require sockets.c, and will affect tcp.c)
1225  */
1226 #ifndef LWIP_TCP_KEEPALIVE
1227 #define LWIP_TCP_KEEPALIVE              0
1228 #endif
1229 
1230 /**
1231  * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
1232  */
1233 #ifndef LWIP_SO_RCVTIMEO
1234 #define LWIP_SO_RCVTIMEO                0
1235 #endif
1236 
1237 /**
1238  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
1239  */
1240 #ifndef LWIP_SO_RCVBUF
1241 #define LWIP_SO_RCVBUF                  0
1242 #endif
1243 
1244 /**
1245  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
1246  */
1247 #ifndef RECV_BUFSIZE_DEFAULT
1248 #define RECV_BUFSIZE_DEFAULT            INT_MAX
1249 #endif
1250 
1251 /**
1252  * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE!
1253  */
1254 #ifndef SO_REUSE
1255 #define SO_REUSE                        0
1256 #endif
1257 
1258 /*
1259    ----------------------------------------
1260    ---------- Statistics options ----------
1261    ----------------------------------------
1262 */
1263 /**
1264  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
1265  */
1266 #ifndef LWIP_STATS
1267 #define LWIP_STATS                      1
1268 #endif
1269 
1270 #if LWIP_STATS
1271 
1272 /**
1273  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
1274  */
1275 #ifndef LWIP_STATS_DISPLAY
1276 #define LWIP_STATS_DISPLAY              0
1277 #endif
1278 
1279 /**
1280  * LINK_STATS==1: Enable link stats.
1281  */
1282 #ifndef LINK_STATS
1283 #define LINK_STATS                      1
1284 #endif
1285 
1286 /**
1287  * ETHARP_STATS==1: Enable etharp stats.
1288  */
1289 #ifndef ETHARP_STATS
1290 #define ETHARP_STATS                    (LWIP_ARP)
1291 #endif
1292 
1293 /**
1294  * IP_STATS==1: Enable IP stats.
1295  */
1296 #ifndef IP_STATS
1297 #define IP_STATS                        1
1298 #endif
1299 
1300 /**
1301  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
1302  * on if using either frag or reass.
1303  */
1304 #ifndef IPFRAG_STATS
1305 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
1306 #endif
1307 
1308 /**
1309  * ICMP_STATS==1: Enable ICMP stats.
1310  */
1311 #ifndef ICMP_STATS
1312 #define ICMP_STATS                      1
1313 #endif
1314 
1315 /**
1316  * IGMP_STATS==1: Enable IGMP stats.
1317  */
1318 #ifndef IGMP_STATS
1319 #define IGMP_STATS                      (LWIP_IGMP)
1320 #endif
1321 
1322 /**
1323  * UDP_STATS==1: Enable UDP stats. Default is on if
1324  * UDP enabled, otherwise off.
1325  */
1326 #ifndef UDP_STATS
1327 #define UDP_STATS                       (LWIP_UDP)
1328 #endif
1329 
1330 /**
1331  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
1332  * enabled, otherwise off.
1333  */
1334 #ifndef TCP_STATS
1335 #define TCP_STATS                       (LWIP_TCP)
1336 #endif
1337 
1338 /**
1339  * MEM_STATS==1: Enable mem.c stats.
1340  */
1341 #ifndef MEM_STATS
1342 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
1343 #endif
1344 
1345 /**
1346  * MEMP_STATS==1: Enable memp.c pool stats.
1347  */
1348 #ifndef MEMP_STATS
1349 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
1350 #endif
1351 
1352 /**
1353  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
1354  */
1355 #ifndef SYS_STATS
1356 #define SYS_STATS                       (NO_SYS == 0)
1357 #endif
1358 
1359 #else
1360 
1361 #define LINK_STATS                      0
1362 #define IP_STATS                        0
1363 #define IPFRAG_STATS                    0
1364 #define ICMP_STATS                      0
1365 #define IGMP_STATS                      0
1366 #define UDP_STATS                       0
1367 #define TCP_STATS                       0
1368 #define MEM_STATS                       0
1369 #define MEMP_STATS                      0
1370 #define SYS_STATS                       0
1371 #define LWIP_STATS_DISPLAY              0
1372 
1373 #endif /* LWIP_STATS */
1374 
1375 /*
1376    ---------------------------------
1377    ---------- PPP options ----------
1378    ---------------------------------
1379 */
1380 /**
1381  * PPP_SUPPORT==1: Enable PPP.
1382  */
1383 #ifndef PPP_SUPPORT
1384 #define PPP_SUPPORT                     0
1385 #endif
1386 
1387 /**
1388  * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
1389  */
1390 #ifndef PPPOE_SUPPORT
1391 #define PPPOE_SUPPORT                   0
1392 #endif
1393 
1394 /**
1395  * PPPOS_SUPPORT==1: Enable PPP Over Serial
1396  */
1397 #ifndef PPPOS_SUPPORT
1398 #define PPPOS_SUPPORT                   PPP_SUPPORT
1399 #endif
1400 
1401 #if PPP_SUPPORT
1402 
1403 /**
1404  * NUM_PPP: Max PPP sessions.
1405  */
1406 #ifndef NUM_PPP
1407 #define NUM_PPP                         1
1408 #endif
1409 
1410 /**
1411  * PAP_SUPPORT==1: Support PAP.
1412  */
1413 #ifndef PAP_SUPPORT
1414 #define PAP_SUPPORT                     0
1415 #endif
1416 
1417 /**
1418  * CHAP_SUPPORT==1: Support CHAP.
1419  */
1420 #ifndef CHAP_SUPPORT
1421 #define CHAP_SUPPORT                    0
1422 #endif
1423 
1424 /**
1425  * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1426  */
1427 #ifndef MSCHAP_SUPPORT
1428 #define MSCHAP_SUPPORT                  0
1429 #endif
1430 
1431 /**
1432  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1433  */
1434 #ifndef CBCP_SUPPORT
1435 #define CBCP_SUPPORT                    0
1436 #endif
1437 
1438 /**
1439  * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
1440  */
1441 #ifndef CCP_SUPPORT
1442 #define CCP_SUPPORT                     0
1443 #endif
1444 
1445 /**
1446  * VJ_SUPPORT==1: Support VJ header compression.
1447  */
1448 #ifndef VJ_SUPPORT
1449 #define VJ_SUPPORT                      0
1450 #endif
1451 
1452 /**
1453  * MD5_SUPPORT==1: Support MD5 (see also CHAP).
1454  */
1455 #ifndef MD5_SUPPORT
1456 #define MD5_SUPPORT                     0
1457 #endif
1458 
1459 /*
1460  * Timeouts
1461  */
1462 #ifndef FSM_DEFTIMEOUT
1463 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
1464 #endif
1465 
1466 #ifndef FSM_DEFMAXTERMREQS
1467 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
1468 #endif
1469 
1470 #ifndef FSM_DEFMAXCONFREQS
1471 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
1472 #endif
1473 
1474 #ifndef FSM_DEFMAXNAKLOOPS
1475 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
1476 #endif
1477 
1478 #ifndef UPAP_DEFTIMEOUT
1479 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
1480 #endif
1481 
1482 #ifndef UPAP_DEFREQTIME
1483 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
1484 #endif
1485 
1486 #ifndef CHAP_DEFTIMEOUT
1487 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
1488 #endif
1489 
1490 #ifndef CHAP_DEFTRANSMITS
1491 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
1492 #endif
1493 
1494 /* Interval in seconds between keepalive echo requests, 0 to disable. */
1495 #ifndef LCP_ECHOINTERVAL
1496 #define LCP_ECHOINTERVAL                0
1497 #endif
1498 
1499 /* Number of unanswered echo requests before failure. */
1500 #ifndef LCP_MAXECHOFAILS
1501 #define LCP_MAXECHOFAILS                3
1502 #endif
1503 
1504 /* Max Xmit idle time (in jiffies) before resend flag char. */
1505 #ifndef PPP_MAXIDLEFLAG
1506 #define PPP_MAXIDLEFLAG                 100
1507 #endif
1508 
1509 /*
1510  * Packet sizes
1511  *
1512  * Note - lcp shouldn't be allowed to negotiate stuff outside these
1513  *    limits.  See lcp.h in the pppd directory.
1514  * (XXX - these constants should simply be shared by lcp.c instead
1515  *    of living in lcp.h)
1516  */
1517 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
1518 #ifndef PPP_MAXMTU
1519 /* #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN) */
1520 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
1521 #endif
1522 #define PPP_MINMTU                      64
1523 #define PPP_MRU                         1500     /* default MRU = max length of info field */
1524 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
1525 #ifndef PPP_DEFMRU
1526 #define PPP_DEFMRU                      296             /* Try for this */
1527 #endif
1528 #define PPP_MINMRU                      128             /* No MRUs below this */
1529 
1530 #ifndef MAXNAMELEN
1531 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
1532 #endif
1533 #ifndef MAXSECRETLEN
1534 #define MAXSECRETLEN                    256     /* max length of password or secret */
1535 #endif
1536 
1537 #endif /* PPP_SUPPORT */
1538 
1539 /*
1540    --------------------------------------
1541    ---------- Checksum options ----------
1542    --------------------------------------
1543 */
1544 /**
1545  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
1546  */
1547 #ifndef CHECKSUM_GEN_IP
1548 #define CHECKSUM_GEN_IP                 1
1549 #endif
1550  
1551 /**
1552  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
1553  */
1554 #ifndef CHECKSUM_GEN_UDP
1555 #define CHECKSUM_GEN_UDP                1
1556 #endif
1557  
1558 /**
1559  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
1560  */
1561 #ifndef CHECKSUM_GEN_TCP
1562 #define CHECKSUM_GEN_TCP                1
1563 #endif
1564  
1565 /**
1566  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
1567  */
1568 #ifndef CHECKSUM_CHECK_IP
1569 #define CHECKSUM_CHECK_IP               1
1570 #endif
1571  
1572 /**
1573  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
1574  */
1575 #ifndef CHECKSUM_CHECK_UDP
1576 #define CHECKSUM_CHECK_UDP              1
1577 #endif
1578 
1579 /**
1580  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
1581  */
1582 #ifndef CHECKSUM_CHECK_TCP
1583 #define CHECKSUM_CHECK_TCP              1
1584 #endif
1585 
1586 /*
1587    ---------------------------------------
1588    ---------- Debugging options ----------
1589    ---------------------------------------
1590 */
1591 /**
1592  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
1593  * compared against this value. If it is smaller, then debugging
1594  * messages are written.
1595  */
1596 #ifndef LWIP_DBG_MIN_LEVEL
1597 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
1598 #endif
1599 
1600 /**
1601  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
1602  * debug messages of certain types.
1603  */
1604 #ifndef LWIP_DBG_TYPES_ON
1605 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
1606 #endif
1607 
1608 /**
1609  * ETHARP_DEBUG: Enable debugging in etharp.c.
1610  */
1611 #ifndef ETHARP_DEBUG
1612 #define ETHARP_DEBUG                    LWIP_DBG_OFF
1613 #endif
1614 
1615 /**
1616  * NETIF_DEBUG: Enable debugging in netif.c.
1617  */
1618 #ifndef NETIF_DEBUG
1619 #define NETIF_DEBUG                     LWIP_DBG_OFF
1620 #endif
1621 
1622 /**
1623  * PBUF_DEBUG: Enable debugging in pbuf.c.
1624  */
1625 #ifndef PBUF_DEBUG
1626 #define PBUF_DEBUG                      LWIP_DBG_OFF
1627 #endif
1628 
1629 /**
1630  * API_LIB_DEBUG: Enable debugging in api_lib.c.
1631  */
1632 #ifndef API_LIB_DEBUG
1633 #define API_LIB_DEBUG                   LWIP_DBG_OFF
1634 #endif
1635 
1636 /**
1637  * API_MSG_DEBUG: Enable debugging in api_msg.c.
1638  */
1639 #ifndef API_MSG_DEBUG
1640 #define API_MSG_DEBUG                   LWIP_DBG_OFF
1641 #endif
1642 
1643 /**
1644  * SOCKETS_DEBUG: Enable debugging in sockets.c.
1645  */
1646 #ifndef SOCKETS_DEBUG
1647 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
1648 #endif
1649 
1650 /**
1651  * ICMP_DEBUG: Enable debugging in icmp.c.
1652  */
1653 #ifndef ICMP_DEBUG
1654 #define ICMP_DEBUG                      LWIP_DBG_OFF
1655 #endif
1656 
1657 /**
1658  * IGMP_DEBUG: Enable debugging in igmp.c.
1659  */
1660 #ifndef IGMP_DEBUG
1661 #define IGMP_DEBUG                      LWIP_DBG_OFF
1662 #endif
1663 
1664 /**
1665  * INET_DEBUG: Enable debugging in inet.c.
1666  */
1667 #ifndef INET_DEBUG
1668 #define INET_DEBUG                      LWIP_DBG_OFF
1669 #endif
1670 
1671 /**
1672  * IP_DEBUG: Enable debugging for IP.
1673  */
1674 #ifndef IP_DEBUG
1675 #define IP_DEBUG                        LWIP_DBG_OFF
1676 #endif
1677 
1678 /**
1679  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
1680  */
1681 #ifndef IP_REASS_DEBUG
1682 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
1683 #endif
1684 
1685 /**
1686  * RAW_DEBUG: Enable debugging in raw.c.
1687  */
1688 #ifndef RAW_DEBUG
1689 #define RAW_DEBUG                       LWIP_DBG_OFF
1690 #endif
1691 
1692 /**
1693  * MEM_DEBUG: Enable debugging in mem.c.
1694  */
1695 #ifndef MEM_DEBUG
1696 #define MEM_DEBUG                       LWIP_DBG_OFF
1697 #endif
1698 
1699 /**
1700  * MEMP_DEBUG: Enable debugging in memp.c.
1701  */
1702 #ifndef MEMP_DEBUG
1703 #define MEMP_DEBUG                      LWIP_DBG_OFF
1704 #endif
1705 
1706 /**
1707  * SYS_DEBUG: Enable debugging in sys.c.
1708  */
1709 #ifndef SYS_DEBUG
1710 #define SYS_DEBUG                       LWIP_DBG_OFF
1711 #endif
1712 
1713 /**
1714  * TCP_DEBUG: Enable debugging for TCP.
1715  */
1716 #ifndef TCP_DEBUG
1717 #define TCP_DEBUG                       LWIP_DBG_OFF
1718 #endif
1719 
1720 /**
1721  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
1722  */
1723 #ifndef TCP_INPUT_DEBUG
1724 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
1725 #endif
1726 
1727 /**
1728  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
1729  */
1730 #ifndef TCP_FR_DEBUG
1731 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
1732 #endif
1733 
1734 /**
1735  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
1736  * timeout.
1737  */
1738 #ifndef TCP_RTO_DEBUG
1739 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
1740 #endif
1741 
1742 /**
1743  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
1744  */
1745 #ifndef TCP_CWND_DEBUG
1746 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
1747 #endif
1748 
1749 /**
1750  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
1751  */
1752 #ifndef TCP_WND_DEBUG
1753 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
1754 #endif
1755 
1756 /**
1757  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
1758  */
1759 #ifndef TCP_OUTPUT_DEBUG
1760 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
1761 #endif
1762 
1763 /**
1764  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
1765  */
1766 #ifndef TCP_RST_DEBUG
1767 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
1768 #endif
1769 
1770 /**
1771  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
1772  */
1773 #ifndef TCP_QLEN_DEBUG
1774 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
1775 #endif
1776 
1777 /**
1778  * UDP_DEBUG: Enable debugging in UDP.
1779  */
1780 #ifndef UDP_DEBUG
1781 #define UDP_DEBUG                       LWIP_DBG_OFF
1782 #endif
1783 
1784 /**
1785  * TCPIP_DEBUG: Enable debugging in tcpip.c.
1786  */
1787 #ifndef TCPIP_DEBUG
1788 #define TCPIP_DEBUG                     LWIP_DBG_OFF
1789 #endif
1790 
1791 /**
1792  * PPP_DEBUG: Enable debugging for PPP.
1793  */
1794 #ifndef PPP_DEBUG
1795 #define PPP_DEBUG                       LWIP_DBG_OFF
1796 #endif
1797 
1798 /**
1799  * SLIP_DEBUG: Enable debugging in slipif.c.
1800  */
1801 #ifndef SLIP_DEBUG
1802 #define SLIP_DEBUG                      LWIP_DBG_OFF
1803 #endif
1804 
1805 /**
1806  * DHCP_DEBUG: Enable debugging in dhcp.c.
1807  */
1808 #ifndef DHCP_DEBUG
1809 #define DHCP_DEBUG                      LWIP_DBG_OFF
1810 #endif
1811 
1812 /**
1813  * AUTOIP_DEBUG: Enable debugging in autoip.c.
1814  */
1815 #ifndef AUTOIP_DEBUG
1816 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
1817 #endif
1818 
1819 /**
1820  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
1821  */
1822 #ifndef SNMP_MSG_DEBUG
1823 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
1824 #endif
1825 
1826 /**
1827  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
1828  */
1829 #ifndef SNMP_MIB_DEBUG
1830 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
1831 #endif
1832 
1833 /**
1834  * DNS_DEBUG: Enable debugging for DNS.
1835  */
1836 #ifndef DNS_DEBUG
1837 #define DNS_DEBUG                       LWIP_DBG_OFF
1838 #endif
1839 
1840 #endif /* __LWIP_OPT_H__ */