A version of LWIP, provided for backwards compatibility.

Dependents:   AA_DemoBoard DemoBoard HelloServerDemo DemoBoard_RangeIndicator ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers opt.h Source File

opt.h

Go to the documentation of this file.
00001 /**
00002  * @file
00003  *
00004  * lwIP Options Configuration
00005  */
00006 
00007 /*
00008  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
00009  * All rights reserved. 
00010  * 
00011  * Redistribution and use in source and binary forms, with or without modification, 
00012  * are permitted provided that the following conditions are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright notice,
00015  *    this list of conditions and the following disclaimer.
00016  * 2. Redistributions in binary form must reproduce the above copyright notice,
00017  *    this list of conditions and the following disclaimer in the documentation
00018  *    and/or other materials provided with the distribution.
00019  * 3. The name of the author may not be used to endorse or promote products
00020  *    derived from this software without specific prior written permission. 
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
00023  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00024  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
00025  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00026  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
00027  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
00030  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
00031  * OF SUCH DAMAGE.
00032  *
00033  * This file is part of the lwIP TCP/IP stack.
00034  * 
00035  * Author: Adam Dunkels <adam@sics.se>
00036  *
00037  */
00038 #ifndef __LWIP_OPT_H__
00039 #define __LWIP_OPT_H__
00040 
00041 /*
00042  * Include user defined options first. Anything not defined in these files
00043  * will be set to standard values. Override anything you dont like!
00044  */
00045 #include "lwipopts.h"
00046 #include "lwip/debug.h"
00047 
00048 /*
00049    -----------------------------------------------
00050    ---------- Platform specific locking ----------
00051    -----------------------------------------------
00052 */
00053 
00054 /**
00055  * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
00056  * critical regions during buffer allocation, deallocation and memory
00057  * allocation and deallocation.
00058  */
00059 #ifndef SYS_LIGHTWEIGHT_PROT
00060 #define SYS_LIGHTWEIGHT_PROT            0
00061 #endif
00062 
00063 /** 
00064  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
00065  * use lwIP facilities.
00066  */
00067 #ifndef NO_SYS
00068 #define NO_SYS                          0
00069 #endif
00070 
00071 /**
00072  * MEMCPY: override this if you have a faster implementation at hand than the
00073  * one included in your C library
00074  */
00075 #ifndef MEMCPY
00076 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
00077 #endif
00078 
00079 /**
00080  * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
00081  * call to memcpy() if the length is known at compile time and is small.
00082  */
00083 #ifndef SMEMCPY
00084 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
00085 #endif
00086 
00087 /*
00088    ------------------------------------
00089    ---------- Memory options ----------
00090    ------------------------------------
00091 */
00092 /**
00093  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
00094  * instead of the lwip internal allocator. Can save code size if you
00095  * already use it.
00096  */
00097 #ifndef MEM_LIBC_MALLOC
00098 #define MEM_LIBC_MALLOC                 0
00099 #endif
00100 
00101 /**
00102 * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
00103 * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
00104 * speed and usage from interrupts!
00105 */
00106 #ifndef MEMP_MEM_MALLOC
00107 #define MEMP_MEM_MALLOC                 0
00108 #endif
00109 
00110 /**
00111  * MEM_ALIGNMENT: should be set to the alignment of the CPU
00112  *    4 byte alignment -> #define MEM_ALIGNMENT 4
00113  *    2 byte alignment -> #define MEM_ALIGNMENT 2
00114  */
00115 #ifndef MEM_ALIGNMENT
00116 #define MEM_ALIGNMENT                   1
00117 #endif
00118 
00119 /**
00120  * MEM_SIZE: the size of the heap memory. If the application will send
00121  * a lot of data that needs to be copied, this should be set high.
00122  */
00123 #ifndef MEM_SIZE
00124 #define MEM_SIZE                        1600
00125 #endif
00126 
00127 /**
00128  * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
00129  * amount of bytes before and after each memp element in every pool and fills
00130  * it with a prominent default value.
00131  *    MEMP_OVERFLOW_CHECK == 0 no checking
00132  *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
00133  *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
00134  *      memp_malloc() or memp_free() is called (useful but slow!)
00135  */
00136 #ifndef MEMP_OVERFLOW_CHECK
00137 #define MEMP_OVERFLOW_CHECK             0
00138 #endif
00139 
00140 /**
00141  * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
00142  * sure that there are no cycles in the linked lists.
00143  */
00144 #ifndef MEMP_SANITY_CHECK
00145 #define MEMP_SANITY_CHECK               0
00146 #endif
00147 
00148 /**
00149  * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
00150  * of memory pools of various sizes. When mem_malloc is called, an element of
00151  * the smallest pool that can provide the length needed is returned.
00152  * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
00153  */
00154 #ifndef MEM_USE_POOLS
00155 #define MEM_USE_POOLS                   0
00156 #endif
00157 
00158 /**
00159  * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
00160  * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
00161  * reliable. */
00162 #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
00163 #define MEM_USE_POOLS_TRY_BIGGER_POOL   0
00164 #endif
00165 
00166 /**
00167  * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
00168  * that defines additional pools beyond the "standard" ones required
00169  * by lwIP. If you set this to 1, you must have lwippools.h in your 
00170  * inlude path somewhere. 
00171  */
00172 #ifndef MEMP_USE_CUSTOM_POOLS
00173 #define MEMP_USE_CUSTOM_POOLS           0
00174 #endif
00175 
00176 /**
00177  * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
00178  * interrupt context (or another context that doesn't allow waiting for a
00179  * semaphore).
00180  * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
00181  * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
00182  * with each loop so that mem_free can run.
00183  *
00184  * ATTENTION: As you can see from the above description, this leads to dis-/
00185  * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
00186  * can need longer.
00187  *
00188  * If you don't want that, at least for NO_SYS=0, you can still use the following
00189  * functions to enqueue a deallocation call which then runs in the tcpip_thread
00190  * context:
00191  * - pbuf_free_callback(p);
00192  * - mem_free_callback(m);
00193  */
00194 #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
00195 #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
00196 #endif
00197 
00198 /*
00199    ------------------------------------------------
00200    ---------- Internal Memory Pool Sizes ----------
00201    ------------------------------------------------
00202 */
00203 /**
00204  * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
00205  * If the application sends a lot of data out of ROM (or other static memory),
00206  * this should be set high.
00207  */
00208 #ifndef MEMP_NUM_PBUF
00209 #define MEMP_NUM_PBUF                   16
00210 #endif
00211 
00212 /**
00213  * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
00214  * (requires the LWIP_RAW option)
00215  */
00216 #ifndef MEMP_NUM_RAW_PCB
00217 #define MEMP_NUM_RAW_PCB                4
00218 #endif
00219 
00220 /**
00221  * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00222  * per active UDP "connection".
00223  * (requires the LWIP_UDP option)
00224  */
00225 #ifndef MEMP_NUM_UDP_PCB
00226 #define MEMP_NUM_UDP_PCB                4
00227 #endif
00228 
00229 /**
00230  * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
00231  * (requires the LWIP_TCP option)
00232  */
00233 #ifndef MEMP_NUM_TCP_PCB
00234 #define MEMP_NUM_TCP_PCB                5
00235 #endif
00236 
00237 /**
00238  * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
00239  * (requires the LWIP_TCP option)
00240  */
00241 #ifndef MEMP_NUM_TCP_PCB_LISTEN
00242 #define MEMP_NUM_TCP_PCB_LISTEN         8
00243 #endif
00244 
00245 /**
00246  * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
00247  * (requires the LWIP_TCP option)
00248  */
00249 #ifndef MEMP_NUM_TCP_SEG
00250 #define MEMP_NUM_TCP_SEG                16
00251 #endif
00252 
00253 /**
00254  * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
00255  * reassembly (whole packets, not fragments!)
00256  */
00257 #ifndef MEMP_NUM_REASSDATA
00258 #define MEMP_NUM_REASSDATA              5
00259 #endif
00260 
00261 /**
00262  * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
00263  * packets (pbufs) that are waiting for an ARP request (to resolve
00264  * their destination address) to finish.
00265  * (requires the ARP_QUEUEING option)
00266  */
00267 #ifndef MEMP_NUM_ARP_QUEUE
00268 #define MEMP_NUM_ARP_QUEUE              30
00269 #endif
00270 
00271 /**
00272  * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
00273  * can be members et the same time (one per netif - allsystems group -, plus one
00274  * per netif membership).
00275  * (requires the LWIP_IGMP option)
00276  */
00277 #ifndef MEMP_NUM_IGMP_GROUP
00278 #define MEMP_NUM_IGMP_GROUP             8
00279 #endif
00280 
00281 /**
00282  * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
00283  * (requires NO_SYS==0)
00284  */
00285 #ifndef MEMP_NUM_SYS_TIMEOUT
00286 #define MEMP_NUM_SYS_TIMEOUT            3
00287 #endif
00288 
00289 /**
00290  * MEMP_NUM_NETBUF: the number of struct netbufs.
00291  * (only needed if you use the sequential API, like api_lib.c)
00292  */
00293 #ifndef MEMP_NUM_NETBUF
00294 #define MEMP_NUM_NETBUF                 2
00295 #endif
00296 
00297 /**
00298  * MEMP_NUM_NETCONN: the number of struct netconns.
00299  * (only needed if you use the sequential API, like api_lib.c)
00300  */
00301 #ifndef MEMP_NUM_NETCONN
00302 #define MEMP_NUM_NETCONN                4
00303 #endif
00304 
00305 /**
00306  * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
00307  * for callback/timeout API communication. 
00308  * (only needed if you use tcpip.c)
00309  */
00310 #ifndef MEMP_NUM_TCPIP_MSG_API
00311 #define MEMP_NUM_TCPIP_MSG_API          8
00312 #endif
00313 
00314 /**
00315  * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
00316  * for incoming packets. 
00317  * (only needed if you use tcpip.c)
00318  */
00319 #ifndef MEMP_NUM_TCPIP_MSG_INPKT
00320 #define MEMP_NUM_TCPIP_MSG_INPKT        8
00321 #endif
00322 
00323 /**
00324  * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. 
00325  */
00326 #ifndef PBUF_POOL_SIZE
00327 #define PBUF_POOL_SIZE                  16
00328 #endif
00329 
00330 /*
00331    ---------------------------------
00332    ---------- ARP options ----------
00333    ---------------------------------
00334 */
00335 /**
00336  * LWIP_ARP==1: Enable ARP functionality.
00337  */
00338 #ifndef LWIP_ARP
00339 #define LWIP_ARP                        1
00340 #endif
00341 
00342 /**
00343  * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
00344  */
00345 #ifndef ARP_TABLE_SIZE
00346 #define ARP_TABLE_SIZE                  10
00347 #endif
00348 
00349 /**
00350  * ARP_QUEUEING==1: Outgoing packets are queued during hardware address
00351  * resolution.
00352  */
00353 #ifndef ARP_QUEUEING
00354 #define ARP_QUEUEING                    1
00355 #endif
00356 
00357 /**
00358  * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
00359  * updated with the source MAC and IP addresses supplied in the packet.
00360  * You may want to disable this if you do not trust LAN peers to have the
00361  * correct addresses, or as a limited approach to attempt to handle
00362  * spoofing. If disabled, lwIP will need to make a new ARP request if
00363  * the peer is not already in the ARP table, adding a little latency.
00364  */
00365 #ifndef ETHARP_TRUST_IP_MAC
00366 #define ETHARP_TRUST_IP_MAC             1
00367 #endif
00368 
00369 /*
00370    --------------------------------
00371    ---------- IP options ----------
00372    --------------------------------
00373 */
00374 /**
00375  * IP_FORWARD==1: Enables the ability to forward IP packets across network
00376  * interfaces. If you are going to run lwIP on a device with only one network
00377  * interface, define this to 0.
00378  */
00379 #ifndef IP_FORWARD
00380 #define IP_FORWARD                      0
00381 #endif
00382 
00383 /**
00384  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
00385  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
00386  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
00387  */
00388 #ifndef IP_OPTIONS_ALLOWED
00389 #define IP_OPTIONS_ALLOWED              1
00390 #endif
00391 
00392 /**
00393  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
00394  * this option does not affect outgoing packet sizes, which can be controlled
00395  * via IP_FRAG.
00396  */
00397 #ifndef IP_REASSEMBLY
00398 #define IP_REASSEMBLY                   1
00399 #endif
00400 
00401 /**
00402  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
00403  * that this option does not affect incoming packet sizes, which can be
00404  * controlled via IP_REASSEMBLY.
00405  */
00406 #ifndef IP_FRAG
00407 #define IP_FRAG                         1
00408 #endif
00409 
00410 /**
00411  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
00412  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
00413  * in this time, the whole packet is discarded.
00414  */
00415 #ifndef IP_REASS_MAXAGE
00416 #define IP_REASS_MAXAGE                 3
00417 #endif
00418 
00419 /**
00420  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
00421  * Since the received pbufs are enqueued, be sure to configure
00422  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
00423  * packets even if the maximum amount of fragments is enqueued for reassembly!
00424  */
00425 #ifndef IP_REASS_MAX_PBUFS
00426 #define IP_REASS_MAX_PBUFS              10
00427 #endif
00428 
00429 /**
00430  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
00431  * fragmentation. Otherwise pbufs are allocated and reference the original
00432  * packet data to be fragmented.
00433  */
00434 #ifndef IP_FRAG_USES_STATIC_BUF
00435 #define IP_FRAG_USES_STATIC_BUF         1
00436 #endif
00437 
00438 /**
00439  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
00440  * (requires IP_FRAG_USES_STATIC_BUF==1)
00441  */
00442 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
00443 #define IP_FRAG_MAX_MTU                 1500
00444 #endif
00445 
00446 /**
00447  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
00448  */
00449 #ifndef IP_DEFAULT_TTL
00450 #define IP_DEFAULT_TTL                  255
00451 #endif
00452 
00453 /*
00454    ----------------------------------
00455    ---------- ICMP options ----------
00456    ----------------------------------
00457 */
00458 /**
00459  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
00460  * Be careful, disable that make your product non-compliant to RFC1122
00461  */
00462 #ifndef LWIP_ICMP
00463 #define LWIP_ICMP                       1
00464 #endif
00465 
00466 /**
00467  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
00468  */
00469 #ifndef ICMP_TTL
00470 #define ICMP_TTL                       (IP_DEFAULT_TTL)
00471 #endif
00472 
00473 /**
00474  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
00475  */
00476 #ifndef LWIP_BROADCAST_PING
00477 #define LWIP_BROADCAST_PING             0
00478 #endif
00479 
00480 /**
00481  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
00482  */
00483 #ifndef LWIP_MULTICAST_PING
00484 #define LWIP_MULTICAST_PING             0
00485 #endif
00486 
00487 /*
00488    ---------------------------------
00489    ---------- RAW options ----------
00490    ---------------------------------
00491 */
00492 /**
00493  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
00494  */
00495 #ifndef LWIP_RAW
00496 #define LWIP_RAW                        1
00497 #endif
00498 
00499 /**
00500  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
00501  */
00502 #ifndef RAW_TTL
00503 #define RAW_TTL                        (IP_DEFAULT_TTL)
00504 #endif
00505 
00506 /*
00507    ----------------------------------
00508    ---------- DHCP options ----------
00509    ----------------------------------
00510 */
00511 /**
00512  * LWIP_DHCP==1: Enable DHCP module.
00513  */
00514 #ifndef LWIP_DHCP
00515 #define LWIP_DHCP                       0
00516 #endif
00517 
00518 /**
00519  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
00520  */
00521 #ifndef DHCP_DOES_ARP_CHECK
00522 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
00523 #endif
00524 
00525 /*
00526    ------------------------------------
00527    ---------- AUTOIP options ----------
00528    ------------------------------------
00529 */
00530 /**
00531  * LWIP_AUTOIP==1: Enable AUTOIP module.
00532  */
00533 #ifndef LWIP_AUTOIP
00534 #define LWIP_AUTOIP                     0
00535 #endif
00536 
00537 /**
00538  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
00539  * the same interface at the same time.
00540  */
00541 #ifndef LWIP_DHCP_AUTOIP_COOP
00542 #define LWIP_DHCP_AUTOIP_COOP           0
00543 #endif
00544 
00545 /*
00546    ----------------------------------
00547    ---------- SNMP options ----------
00548    ----------------------------------
00549 */
00550 /**
00551  * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
00552  * transport.
00553  */
00554 #ifndef LWIP_SNMP
00555 #define LWIP_SNMP                       0
00556 #endif
00557 
00558 /**
00559  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
00560  * allow. At least one request buffer is required. 
00561  */
00562 #ifndef SNMP_CONCURRENT_REQUESTS
00563 #define SNMP_CONCURRENT_REQUESTS        1
00564 #endif
00565 
00566 /**
00567  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
00568  * destination is required
00569  */
00570 #ifndef SNMP_TRAP_DESTINATIONS
00571 #define SNMP_TRAP_DESTINATIONS          1
00572 #endif
00573 
00574 /**
00575  * SNMP_PRIVATE_MIB: 
00576  */
00577 #ifndef SNMP_PRIVATE_MIB
00578 #define SNMP_PRIVATE_MIB                0
00579 #endif
00580 
00581 /**
00582  * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
00583  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
00584  * Unsafe requests are disabled by default!
00585  */
00586 #ifndef SNMP_SAFE_REQUESTS
00587 #define SNMP_SAFE_REQUESTS              1
00588 #endif
00589 
00590 /*
00591    ----------------------------------
00592    ---------- IGMP options ----------
00593    ----------------------------------
00594 */
00595 /**
00596  * LWIP_IGMP==1: Turn on IGMP module. 
00597  */
00598 #ifndef LWIP_IGMP
00599 #define LWIP_IGMP                       0
00600 #endif
00601 
00602 /*
00603    ----------------------------------
00604    ---------- DNS options -----------
00605    ----------------------------------
00606 */
00607 /**
00608  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
00609  * transport.
00610  */
00611 #ifndef LWIP_DNS
00612 #define LWIP_DNS                        0
00613 #endif
00614 
00615 /** DNS maximum number of entries to maintain locally. */
00616 #ifndef DNS_TABLE_SIZE
00617 #define DNS_TABLE_SIZE                  4
00618 #endif
00619 
00620 /** DNS maximum host name length supported in the name table. */
00621 #ifndef DNS_MAX_NAME_LENGTH
00622 #define DNS_MAX_NAME_LENGTH             256
00623 #endif
00624 
00625 /** The maximum of DNS servers */
00626 #ifndef DNS_MAX_SERVERS
00627 #define DNS_MAX_SERVERS                 2
00628 #endif
00629 
00630 /** DNS do a name checking between the query and the response. */
00631 #ifndef DNS_DOES_NAME_CHECK
00632 #define DNS_DOES_NAME_CHECK             1
00633 #endif
00634 
00635 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
00636     DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
00637     The buffer will be of size DNS_MSG_SIZE */
00638 #ifndef DNS_USES_STATIC_BUF
00639 #define DNS_USES_STATIC_BUF             1
00640 #endif
00641 
00642 /** DNS message max. size. Default value is RFC compliant. */
00643 #ifndef DNS_MSG_SIZE
00644 #define DNS_MSG_SIZE                    512
00645 #endif
00646 
00647 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
00648  *  you have to define
00649  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
00650  *  (an array of structs name/address, where address is an u32_t in network
00651  *  byte order).
00652  */
00653 #ifndef DNS_LOCAL_HOSTLIST
00654 #define DNS_LOCAL_HOSTLIST              0
00655 #endif /* DNS_LOCAL_HOSTLIST */
00656 
00657 /** If this is turned on, the local host-list can be dynamically changed
00658  *  at runtime. */
00659 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
00660 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
00661 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
00662 
00663 /*
00664    ---------------------------------
00665    ---------- UDP options ----------
00666    ---------------------------------
00667 */
00668 /**
00669  * LWIP_UDP==1: Turn on UDP.
00670  */
00671 #ifndef LWIP_UDP
00672 #define LWIP_UDP                        1
00673 #endif
00674 
00675 /**
00676  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
00677  */
00678 #ifndef LWIP_UDPLITE
00679 #define LWIP_UDPLITE                    0
00680 #endif
00681 
00682 /**
00683  * UDP_TTL: Default Time-To-Live value.
00684  */
00685 #ifndef UDP_TTL
00686 #define UDP_TTL                         (IP_DEFAULT_TTL)
00687 #endif
00688 
00689 /*
00690    ---------------------------------
00691    ---------- TCP options ----------
00692    ---------------------------------
00693 */
00694 /**
00695  * LWIP_TCP==1: Turn on TCP.
00696  */
00697 #ifndef LWIP_TCP
00698 #define LWIP_TCP                        1
00699 #endif
00700 
00701 /**
00702  * TCP_TTL: Default Time-To-Live value.
00703  */
00704 #ifndef TCP_TTL
00705 #define TCP_TTL                         (IP_DEFAULT_TTL)
00706 #endif
00707 
00708 /**
00709  * TCP_WND: The size of a TCP window.  This must be at least 
00710  * (2 * TCP_MSS) for things to work well
00711  */
00712 #ifndef TCP_WND
00713 #define TCP_WND                         2048
00714 #endif 
00715 
00716 /**
00717  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
00718  */
00719 #ifndef TCP_MAXRTX
00720 #define TCP_MAXRTX                      12
00721 #endif
00722 
00723 /**
00724  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
00725  */
00726 #ifndef TCP_SYNMAXRTX
00727 #define TCP_SYNMAXRTX                   6
00728 #endif
00729 
00730 /**
00731  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
00732  * Define to 0 if your device is low on memory.
00733  */
00734 #ifndef TCP_QUEUE_OOSEQ
00735 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
00736 #endif
00737 
00738 /**
00739  * TCP_MSS: TCP Maximum segment size. (default is 128, a *very*
00740  * conservative default.)
00741  * For the receive side, this MSS is advertised to the remote side
00742  * when opening a connection. For the transmit size, this MSS sets
00743  * an upper limit on the MSS advertised by the remote host.
00744  */
00745 #ifndef TCP_MSS
00746 #define TCP_MSS                         128
00747 #endif
00748 
00749 /**
00750  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
00751  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
00752  * reflects the available reassembly buffer size at the remote host) and the
00753  * largest size permitted by the IP layer" (RFC 1122)
00754  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
00755  * netif used for a connection and limits the MSS if it would be too big otherwise.
00756  */
00757 #ifndef TCP_CALCULATE_EFF_SEND_MSS
00758 #define TCP_CALCULATE_EFF_SEND_MSS      1
00759 #endif
00760 
00761 
00762 /**
00763  * TCP_SND_BUF: TCP sender buffer space (bytes). 
00764  */
00765 #ifndef TCP_SND_BUF
00766 #define TCP_SND_BUF                     256
00767 #endif
00768 
00769 /**
00770  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
00771  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
00772  */
00773 #ifndef TCP_SND_QUEUELEN
00774 #define TCP_SND_QUEUELEN                (4 * (TCP_SND_BUF/TCP_MSS))
00775 #endif
00776 
00777 /**
00778  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
00779  * to TCP_SND_BUF. It is the amount of space which must be available in the
00780  * TCP snd_buf for select to return writable.
00781  */
00782 #ifndef TCP_SNDLOWAT
00783 #define TCP_SNDLOWAT                    (TCP_SND_BUF/2)
00784 #endif
00785 
00786 /**
00787  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
00788  */
00789 #ifndef TCP_LISTEN_BACKLOG
00790 #define TCP_LISTEN_BACKLOG              0
00791 #endif
00792 
00793 /**
00794  * The maximum allowed backlog for TCP listen netconns.
00795  * This backlog is used unless another is explicitly specified.
00796  * 0xff is the maximum (u8_t).
00797  */
00798 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
00799 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
00800 #endif
00801 
00802 /**
00803  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
00804  */
00805 #ifndef LWIP_TCP_TIMESTAMPS
00806 #define LWIP_TCP_TIMESTAMPS             0
00807 #endif
00808 
00809 /**
00810  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
00811  * explicit window update
00812  */
00813 #ifndef TCP_WND_UPDATE_THRESHOLD
00814 #define TCP_WND_UPDATE_THRESHOLD   (TCP_WND / 4)
00815 #endif
00816 
00817 /**
00818  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
00819  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
00820  *         events (accept, sent, etc) that happen in the system.
00821  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
00822  *         for the event.
00823  */
00824 #ifndef LWIP_EVENT_API
00825 #define LWIP_EVENT_API                  0
00826 #define LWIP_CALLBACK_API               1
00827 #else 
00828 #define LWIP_EVENT_API                  1
00829 #define LWIP_CALLBACK_API               0
00830 #endif
00831 
00832 
00833 /*
00834    ----------------------------------
00835    ---------- Pbuf options ----------
00836    ----------------------------------
00837 */
00838 /**
00839  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00840  * link level header. The default is 14, the standard value for
00841  * Ethernet.
00842  */
00843 #ifndef PBUF_LINK_HLEN
00844 #define PBUF_LINK_HLEN                  14
00845 #endif
00846 
00847 /**
00848  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
00849  * designed to accomodate single full size TCP frame in one pbuf, including
00850  * TCP_MSS, IP header, and link header.
00851  */
00852 #ifndef PBUF_POOL_BUFSIZE
00853 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
00854 #endif
00855 
00856 /*
00857    ------------------------------------------------
00858    ---------- Network Interfaces options ----------
00859    ------------------------------------------------
00860 */
00861 /**
00862  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
00863  * field.
00864  */
00865 #ifndef LWIP_NETIF_HOSTNAME
00866 #define LWIP_NETIF_HOSTNAME             0
00867 #endif
00868 
00869 /**
00870  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
00871  */
00872 #ifndef LWIP_NETIF_API
00873 #define LWIP_NETIF_API                  0
00874 #endif
00875 
00876 /**
00877  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
00878  * changes its up/down status (i.e., due to DHCP IP acquistion)
00879  */
00880 #ifndef LWIP_NETIF_STATUS_CALLBACK
00881 #define LWIP_NETIF_STATUS_CALLBACK      0
00882 #endif
00883 
00884 /**
00885  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
00886  * whenever the link changes (i.e., link down)
00887  */
00888 #ifndef LWIP_NETIF_LINK_CALLBACK
00889 #define LWIP_NETIF_LINK_CALLBACK        0
00890 #endif
00891 
00892 /**
00893  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
00894  * indices) in struct netif. TCP and UDP can make use of this to prevent
00895  * scanning the ARP table for every sent packet. While this is faster for big
00896  * ARP tables or many concurrent connections, it might be counterproductive
00897  * if you have a tiny ARP table or if there never are concurrent connections.
00898  */
00899 #ifndef LWIP_NETIF_HWADDRHINT
00900 #define LWIP_NETIF_HWADDRHINT           0
00901 #endif
00902 
00903 /**
00904  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
00905  * address equal to the netif IP address, looping them back up the stack.
00906  */
00907 #ifndef LWIP_NETIF_LOOPBACK
00908 #define LWIP_NETIF_LOOPBACK             0
00909 #endif
00910 
00911 /**
00912  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
00913  * sending for each netif (0 = disabled)
00914  */
00915 #ifndef LWIP_LOOPBACK_MAX_PBUFS
00916 #define LWIP_LOOPBACK_MAX_PBUFS         0
00917 #endif
00918 
00919 /**
00920  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
00921  * the system, as netifs must change how they behave depending on this setting
00922  * for the LWIP_NETIF_LOOPBACK option to work.
00923  * Setting this is needed to avoid reentering non-reentrant functions like
00924  * tcp_input().
00925  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
00926  *       multithreaded environment like tcpip.c. In this case, netif->input()
00927  *       is called directly.
00928  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
00929  *       The packets are put on a list and netif_poll() must be called in
00930  *       the main application loop.
00931  */
00932 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
00933 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
00934 #endif
00935 
00936 /*
00937    ------------------------------------
00938    ---------- LOOPIF options ----------
00939    ------------------------------------
00940 */
00941 /**
00942  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
00943  */
00944 #ifndef LWIP_HAVE_LOOPIF
00945 #define LWIP_HAVE_LOOPIF                0
00946 #endif
00947 
00948 /*
00949    ------------------------------------
00950    ---------- SLIPIF options ----------
00951    ------------------------------------
00952 */
00953 /**
00954  * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
00955  */
00956 #ifndef LWIP_HAVE_SLIPIF
00957 #define LWIP_HAVE_SLIPIF                0
00958 #endif
00959 
00960 /*
00961    ------------------------------------
00962    ---------- Thread options ----------
00963    ------------------------------------
00964 */
00965 /**
00966  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
00967  */
00968 #ifndef TCPIP_THREAD_NAME
00969 #define TCPIP_THREAD_NAME              "tcpip_thread"
00970 #endif
00971 
00972 /**
00973  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
00974  * The stack size value itself is platform-dependent, but is passed to
00975  * sys_thread_new() when the thread is created.
00976  */
00977 #ifndef TCPIP_THREAD_STACKSIZE
00978 #define TCPIP_THREAD_STACKSIZE          0
00979 #endif
00980 
00981 /**
00982  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
00983  * The priority value itself is platform-dependent, but is passed to
00984  * sys_thread_new() when the thread is created.
00985  */
00986 #ifndef TCPIP_THREAD_PRIO
00987 #define TCPIP_THREAD_PRIO               1
00988 #endif
00989 
00990 /**
00991  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
00992  * The queue size value itself is platform-dependent, but is passed to
00993  * sys_mbox_new() when tcpip_init is called.
00994  */
00995 #ifndef TCPIP_MBOX_SIZE
00996 #define TCPIP_MBOX_SIZE                 0
00997 #endif
00998 
00999 /**
01000  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
01001  */
01002 #ifndef SLIPIF_THREAD_NAME
01003 #define SLIPIF_THREAD_NAME             "slipif_loop"
01004 #endif
01005 
01006 /**
01007  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
01008  * The stack size value itself is platform-dependent, but is passed to
01009  * sys_thread_new() when the thread is created.
01010  */
01011 #ifndef SLIPIF_THREAD_STACKSIZE
01012 #define SLIPIF_THREAD_STACKSIZE         0
01013 #endif
01014 
01015 /**
01016  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
01017  * The priority value itself is platform-dependent, but is passed to
01018  * sys_thread_new() when the thread is created.
01019  */
01020 #ifndef SLIPIF_THREAD_PRIO
01021 #define SLIPIF_THREAD_PRIO              1
01022 #endif
01023 
01024 /**
01025  * PPP_THREAD_NAME: The name assigned to the pppMain thread.
01026  */
01027 #ifndef PPP_THREAD_NAME
01028 #define PPP_THREAD_NAME                "pppMain"
01029 #endif
01030 
01031 /**
01032  * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.
01033  * The stack size value itself is platform-dependent, but is passed to
01034  * sys_thread_new() when the thread is created.
01035  */
01036 #ifndef PPP_THREAD_STACKSIZE
01037 #define PPP_THREAD_STACKSIZE            0
01038 #endif
01039 
01040 /**
01041  * PPP_THREAD_PRIO: The priority assigned to the pppMain thread.
01042  * The priority value itself is platform-dependent, but is passed to
01043  * sys_thread_new() when the thread is created.
01044  */
01045 #ifndef PPP_THREAD_PRIO
01046 #define PPP_THREAD_PRIO                 1
01047 #endif
01048 
01049 /**
01050  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
01051  */
01052 #ifndef DEFAULT_THREAD_NAME
01053 #define DEFAULT_THREAD_NAME            "lwIP"
01054 #endif
01055 
01056 /**
01057  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
01058  * The stack size value itself is platform-dependent, but is passed to
01059  * sys_thread_new() when the thread is created.
01060  */
01061 #ifndef DEFAULT_THREAD_STACKSIZE
01062 #define DEFAULT_THREAD_STACKSIZE        0
01063 #endif
01064 
01065 /**
01066  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
01067  * The priority value itself is platform-dependent, but is passed to
01068  * sys_thread_new() when the thread is created.
01069  */
01070 #ifndef DEFAULT_THREAD_PRIO
01071 #define DEFAULT_THREAD_PRIO             1
01072 #endif
01073 
01074 /**
01075  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01076  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
01077  * to sys_mbox_new() when the recvmbox is created.
01078  */
01079 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
01080 #define DEFAULT_RAW_RECVMBOX_SIZE       0
01081 #endif
01082 
01083 /**
01084  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01085  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
01086  * to sys_mbox_new() when the recvmbox is created.
01087  */
01088 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
01089 #define DEFAULT_UDP_RECVMBOX_SIZE       0
01090 #endif
01091 
01092 /**
01093  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01094  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
01095  * to sys_mbox_new() when the recvmbox is created.
01096  */
01097 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
01098 #define DEFAULT_TCP_RECVMBOX_SIZE       0
01099 #endif
01100 
01101 /**
01102  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
01103  * The queue size value itself is platform-dependent, but is passed to
01104  * sys_mbox_new() when the acceptmbox is created.
01105  */
01106 #ifndef DEFAULT_ACCEPTMBOX_SIZE
01107 #define DEFAULT_ACCEPTMBOX_SIZE         0
01108 #endif
01109 
01110 /*
01111    ----------------------------------------------
01112    ---------- Sequential layer options ----------
01113    ----------------------------------------------
01114 */
01115 /**
01116  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
01117  * Don't use it if you're not an active lwIP project member
01118  */
01119 #ifndef LWIP_TCPIP_CORE_LOCKING
01120 #define LWIP_TCPIP_CORE_LOCKING         0
01121 #endif
01122 
01123 /**
01124  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
01125  */
01126 #ifndef LWIP_NETCONN
01127 #define LWIP_NETCONN                    1
01128 #endif
01129 
01130 /*
01131    ------------------------------------
01132    ---------- Socket options ----------
01133    ------------------------------------
01134 */
01135 /**
01136  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
01137  */
01138 #ifndef LWIP_SOCKET
01139 #define LWIP_SOCKET                     1
01140 #endif
01141 
01142 /**
01143  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
01144  * (only used if you use sockets.c)
01145  */
01146 #ifndef LWIP_COMPAT_SOCKETS
01147 #define LWIP_COMPAT_SOCKETS             1
01148 #endif
01149 
01150 /**
01151  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
01152  * Disable this option if you use a POSIX operating system that uses the same
01153  * names (read, write & close). (only used if you use sockets.c)
01154  */
01155 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
01156 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
01157 #endif
01158 
01159 /**
01160  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
01161  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
01162  * in seconds. (does not require sockets.c, and will affect tcp.c)
01163  */
01164 #ifndef LWIP_TCP_KEEPALIVE
01165 #define LWIP_TCP_KEEPALIVE              0
01166 #endif
01167 
01168 /**
01169  * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
01170  */
01171 #ifndef LWIP_SO_RCVTIMEO
01172 #define LWIP_SO_RCVTIMEO                0
01173 #endif
01174 
01175 /**
01176  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
01177  */
01178 #ifndef LWIP_SO_RCVBUF
01179 #define LWIP_SO_RCVBUF                  0
01180 #endif
01181 
01182 /**
01183  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
01184  */
01185 #ifndef RECV_BUFSIZE_DEFAULT
01186 #define RECV_BUFSIZE_DEFAULT            INT_MAX
01187 #endif
01188 
01189 /**
01190  * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE!
01191  */
01192 #ifndef SO_REUSE
01193 #define SO_REUSE                        0
01194 #endif
01195 
01196 /*
01197    ----------------------------------------
01198    ---------- Statistics options ----------
01199    ----------------------------------------
01200 */
01201 /**
01202  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
01203  */
01204 #ifndef LWIP_STATS
01205 #define LWIP_STATS                      1
01206 #endif
01207 
01208 #if LWIP_STATS
01209 
01210 /**
01211  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
01212  */
01213 #ifndef LWIP_STATS_DISPLAY
01214 #define LWIP_STATS_DISPLAY              0
01215 #endif
01216 
01217 /**
01218  * LINK_STATS==1: Enable link stats.
01219  */
01220 #ifndef LINK_STATS
01221 #define LINK_STATS                      1
01222 #endif
01223 
01224 /**
01225  * ETHARP_STATS==1: Enable etharp stats.
01226  */
01227 #ifndef ETHARP_STATS
01228 #define ETHARP_STATS                    (LWIP_ARP)
01229 #endif
01230 
01231 /**
01232  * IP_STATS==1: Enable IP stats.
01233  */
01234 #ifndef IP_STATS
01235 #define IP_STATS                        1
01236 #endif
01237 
01238 /**
01239  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
01240  * on if using either frag or reass.
01241  */
01242 #ifndef IPFRAG_STATS
01243 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
01244 #endif
01245 
01246 /**
01247  * ICMP_STATS==1: Enable ICMP stats.
01248  */
01249 #ifndef ICMP_STATS
01250 #define ICMP_STATS                      1
01251 #endif
01252 
01253 /**
01254  * IGMP_STATS==1: Enable IGMP stats.
01255  */
01256 #ifndef IGMP_STATS
01257 #define IGMP_STATS                      (LWIP_IGMP)
01258 #endif
01259 
01260 /**
01261  * UDP_STATS==1: Enable UDP stats. Default is on if
01262  * UDP enabled, otherwise off.
01263  */
01264 #ifndef UDP_STATS
01265 #define UDP_STATS                       (LWIP_UDP)
01266 #endif
01267 
01268 /**
01269  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
01270  * enabled, otherwise off.
01271  */
01272 #ifndef TCP_STATS
01273 #define TCP_STATS                       (LWIP_TCP)
01274 #endif
01275 
01276 /**
01277  * MEM_STATS==1: Enable mem.c stats.
01278  */
01279 #ifndef MEM_STATS
01280 #define MEM_STATS                       1
01281 #endif
01282 
01283 /**
01284  * MEMP_STATS==1: Enable memp.c pool stats.
01285  */
01286 #ifndef MEMP_STATS
01287 #define MEMP_STATS                      1
01288 #endif
01289 
01290 /**
01291  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
01292  */
01293 #ifndef SYS_STATS
01294 #define SYS_STATS                       1
01295 #endif
01296 
01297 #else
01298 
01299 #define LINK_STATS                      0
01300 #define IP_STATS                        0
01301 #define IPFRAG_STATS                    0
01302 #define ICMP_STATS                      0
01303 #define IGMP_STATS                      0
01304 #define UDP_STATS                       0
01305 #define TCP_STATS                       0
01306 #define MEM_STATS                       0
01307 #define MEMP_STATS                      0
01308 #define SYS_STATS                       0
01309 #define LWIP_STATS_DISPLAY              0
01310 
01311 #endif /* LWIP_STATS */
01312 
01313 /*
01314    ---------------------------------
01315    ---------- PPP options ----------
01316    ---------------------------------
01317 */
01318 /**
01319  * PPP_SUPPORT==1: Enable PPP.
01320  */
01321 #ifndef PPP_SUPPORT
01322 #define PPP_SUPPORT                     0
01323 #endif
01324 
01325 /**
01326  * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
01327  */
01328 #ifndef PPPOE_SUPPORT
01329 #define PPPOE_SUPPORT                   0
01330 #endif
01331 
01332 /**
01333  * PPPOS_SUPPORT==1: Enable PPP Over Serial
01334  */
01335 #ifndef PPPOS_SUPPORT
01336 #define PPPOS_SUPPORT                   PPP_SUPPORT
01337 #endif
01338 
01339 #if PPP_SUPPORT
01340 
01341 /**
01342  * NUM_PPP: Max PPP sessions.
01343  */
01344 #ifndef NUM_PPP
01345 #define NUM_PPP                         1
01346 #endif
01347 
01348 /**
01349  * PAP_SUPPORT==1: Support PAP.
01350  */
01351 #ifndef PAP_SUPPORT
01352 #define PAP_SUPPORT                     0
01353 #endif
01354 
01355 /**
01356  * CHAP_SUPPORT==1: Support CHAP.
01357  */
01358 #ifndef CHAP_SUPPORT
01359 #define CHAP_SUPPORT                    0
01360 #endif
01361 
01362 /**
01363  * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01364  */
01365 #ifndef MSCHAP_SUPPORT
01366 #define MSCHAP_SUPPORT                  0
01367 #endif
01368 
01369 /**
01370  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01371  */
01372 #ifndef CBCP_SUPPORT
01373 #define CBCP_SUPPORT                    0
01374 #endif
01375 
01376 /**
01377  * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01378  */
01379 #ifndef CCP_SUPPORT
01380 #define CCP_SUPPORT                     0
01381 #endif
01382 
01383 /**
01384  * VJ_SUPPORT==1: Support VJ header compression.
01385  */
01386 #ifndef VJ_SUPPORT
01387 #define VJ_SUPPORT                      0
01388 #endif
01389 
01390 /**
01391  * MD5_SUPPORT==1: Support MD5 (see also CHAP).
01392  */
01393 #ifndef MD5_SUPPORT
01394 #define MD5_SUPPORT                     0
01395 #endif
01396 
01397 /*
01398  * Timeouts
01399  */
01400 #ifndef FSM_DEFTIMEOUT
01401 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
01402 #endif
01403 
01404 #ifndef FSM_DEFMAXTERMREQS
01405 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
01406 #endif
01407 
01408 #ifndef FSM_DEFMAXCONFREQS
01409 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
01410 #endif
01411 
01412 #ifndef FSM_DEFMAXNAKLOOPS
01413 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
01414 #endif
01415 
01416 #ifndef UPAP_DEFTIMEOUT
01417 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
01418 #endif
01419 
01420 #ifndef UPAP_DEFREQTIME
01421 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
01422 #endif
01423 
01424 #ifndef CHAP_DEFTIMEOUT
01425 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
01426 #endif
01427 
01428 #ifndef CHAP_DEFTRANSMITS
01429 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
01430 #endif
01431 
01432 /* Interval in seconds between keepalive echo requests, 0 to disable. */
01433 #ifndef LCP_ECHOINTERVAL
01434 #define LCP_ECHOINTERVAL                0
01435 #endif
01436 
01437 /* Number of unanswered echo requests before failure. */
01438 #ifndef LCP_MAXECHOFAILS
01439 #define LCP_MAXECHOFAILS                3
01440 #endif
01441 
01442 /* Max Xmit idle time (in jiffies) before resend flag char. */
01443 #ifndef PPP_MAXIDLEFLAG
01444 #define PPP_MAXIDLEFLAG                 100
01445 #endif
01446 
01447 /*
01448  * Packet sizes
01449  *
01450  * Note - lcp shouldn't be allowed to negotiate stuff outside these
01451  *    limits.  See lcp.h in the pppd directory.
01452  * (XXX - these constants should simply be shared by lcp.c instead
01453  *    of living in lcp.h)
01454  */
01455 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
01456 #ifndef PPP_MAXMTU
01457 /* #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN) */
01458 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
01459 #endif
01460 #define PPP_MINMTU                      64
01461 #define PPP_MRU                         1500     /* default MRU = max length of info field */
01462 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
01463 #ifndef PPP_DEFMRU
01464 #define PPP_DEFMRU                      296             /* Try for this */
01465 #endif
01466 #define PPP_MINMRU                      128             /* No MRUs below this */
01467 
01468 
01469 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
01470 #define MAXSECRETLEN                    256     /* max length of password or secret */
01471 
01472 #endif /* PPP_SUPPORT */
01473 
01474 /*
01475    --------------------------------------
01476    ---------- Checksum options ----------
01477    --------------------------------------
01478 */
01479 /**
01480  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
01481  */
01482 #ifndef CHECKSUM_GEN_IP
01483 #define CHECKSUM_GEN_IP                 1
01484 #endif
01485  
01486 /**
01487  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
01488  */
01489 #ifndef CHECKSUM_GEN_UDP
01490 #define CHECKSUM_GEN_UDP                1
01491 #endif
01492  
01493 /**
01494  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
01495  */
01496 #ifndef CHECKSUM_GEN_TCP
01497 #define CHECKSUM_GEN_TCP                1
01498 #endif
01499  
01500 /**
01501  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
01502  */
01503 #ifndef CHECKSUM_CHECK_IP
01504 #define CHECKSUM_CHECK_IP               1
01505 #endif
01506  
01507 /**
01508  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
01509  */
01510 #ifndef CHECKSUM_CHECK_UDP
01511 #define CHECKSUM_CHECK_UDP              1
01512 #endif
01513 
01514 /**
01515  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
01516  */
01517 #ifndef CHECKSUM_CHECK_TCP
01518 #define CHECKSUM_CHECK_TCP              1
01519 #endif
01520 
01521 /*
01522    ---------------------------------------
01523    ---------- Debugging options ----------
01524    ---------------------------------------
01525 */
01526 /**
01527  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
01528  * compared against this value. If it is smaller, then debugging
01529  * messages are written.
01530  */
01531 #ifndef LWIP_DBG_MIN_LEVEL
01532 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_OFF
01533 #endif
01534 
01535 /**
01536  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
01537  * debug messages of certain types.
01538  */
01539 #ifndef LWIP_DBG_TYPES_ON
01540 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
01541 #endif
01542 
01543 /**
01544  * ETHARP_DEBUG: Enable debugging in etharp.c.
01545  */
01546 #ifndef ETHARP_DEBUG
01547 #define ETHARP_DEBUG                    LWIP_DBG_OFF
01548 #endif
01549 
01550 /**
01551  * NETIF_DEBUG: Enable debugging in netif.c.
01552  */
01553 #ifndef NETIF_DEBUG
01554 #define NETIF_DEBUG                     LWIP_DBG_OFF
01555 #endif
01556 
01557 /**
01558  * PBUF_DEBUG: Enable debugging in pbuf.c.
01559  */
01560 #ifndef PBUF_DEBUG
01561 #define PBUF_DEBUG                      LWIP_DBG_OFF
01562 #endif
01563 
01564 /**
01565  * API_LIB_DEBUG: Enable debugging in api_lib.c.
01566  */
01567 #ifndef API_LIB_DEBUG
01568 #define API_LIB_DEBUG                   LWIP_DBG_OFF
01569 #endif
01570 
01571 /**
01572  * API_MSG_DEBUG: Enable debugging in api_msg.c.
01573  */
01574 #ifndef API_MSG_DEBUG
01575 #define API_MSG_DEBUG                   LWIP_DBG_OFF
01576 #endif
01577 
01578 /**
01579  * SOCKETS_DEBUG: Enable debugging in sockets.c.
01580  */
01581 #ifndef SOCKETS_DEBUG
01582 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
01583 #endif
01584 
01585 /**
01586  * ICMP_DEBUG: Enable debugging in icmp.c.
01587  */
01588 #ifndef ICMP_DEBUG
01589 #define ICMP_DEBUG                      LWIP_DBG_OFF
01590 #endif
01591 
01592 /**
01593  * IGMP_DEBUG: Enable debugging in igmp.c.
01594  */
01595 #ifndef IGMP_DEBUG
01596 #define IGMP_DEBUG                      LWIP_DBG_OFF
01597 #endif
01598 
01599 /**
01600  * INET_DEBUG: Enable debugging in inet.c.
01601  */
01602 #ifndef INET_DEBUG
01603 #define INET_DEBUG                      LWIP_DBG_OFF
01604 #endif
01605 
01606 /**
01607  * IP_DEBUG: Enable debugging for IP.
01608  */
01609 #ifndef IP_DEBUG
01610 #define IP_DEBUG                        LWIP_DBG_OFF
01611 #endif
01612 
01613 /**
01614  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
01615  */
01616 #ifndef IP_REASS_DEBUG
01617 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
01618 #endif
01619 
01620 /**
01621  * RAW_DEBUG: Enable debugging in raw.c.
01622  */
01623 #ifndef RAW_DEBUG
01624 #define RAW_DEBUG                       LWIP_DBG_OFF
01625 #endif
01626 
01627 /**
01628  * MEM_DEBUG: Enable debugging in mem.c.
01629  */
01630 #ifndef MEM_DEBUG
01631 #define MEM_DEBUG                       LWIP_DBG_OFF
01632 #endif
01633 
01634 /**
01635  * MEMP_DEBUG: Enable debugging in memp.c.
01636  */
01637 #ifndef MEMP_DEBUG
01638 #define MEMP_DEBUG                      LWIP_DBG_OFF
01639 #endif
01640 
01641 /**
01642  * SYS_DEBUG: Enable debugging in sys.c.
01643  */
01644 #ifndef SYS_DEBUG
01645 #define SYS_DEBUG                       LWIP_DBG_OFF
01646 #endif
01647 
01648 /**
01649  * TCP_DEBUG: Enable debugging for TCP.
01650  */
01651 #ifndef TCP_DEBUG
01652 #define TCP_DEBUG                       LWIP_DBG_OFF
01653 #endif
01654 
01655 /**
01656  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
01657  */
01658 #ifndef TCP_INPUT_DEBUG
01659 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
01660 #endif
01661 
01662 /**
01663  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
01664  */
01665 #ifndef TCP_FR_DEBUG
01666 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
01667 #endif
01668 
01669 /**
01670  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
01671  * timeout.
01672  */
01673 #ifndef TCP_RTO_DEBUG
01674 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
01675 #endif
01676 
01677 /**
01678  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
01679  */
01680 #ifndef TCP_CWND_DEBUG
01681 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
01682 #endif
01683 
01684 /**
01685  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
01686  */
01687 #ifndef TCP_WND_DEBUG
01688 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
01689 #endif
01690 
01691 /**
01692  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
01693  */
01694 #ifndef TCP_OUTPUT_DEBUG
01695 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
01696 #endif
01697 
01698 /**
01699  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
01700  */
01701 #ifndef TCP_RST_DEBUG
01702 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
01703 #endif
01704 
01705 /**
01706  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
01707  */
01708 #ifndef TCP_QLEN_DEBUG
01709 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
01710 #endif
01711 
01712 /**
01713  * UDP_DEBUG: Enable debugging in UDP.
01714  */
01715 #ifndef UDP_DEBUG
01716 #define UDP_DEBUG                       LWIP_DBG_OFF
01717 #endif
01718 
01719 /**
01720  * TCPIP_DEBUG: Enable debugging in tcpip.c.
01721  */
01722 #ifndef TCPIP_DEBUG
01723 #define TCPIP_DEBUG                     LWIP_DBG_OFF
01724 #endif
01725 
01726 /**
01727  * PPP_DEBUG: Enable debugging for PPP.
01728  */
01729 #ifndef PPP_DEBUG
01730 #define PPP_DEBUG                       LWIP_DBG_OFF
01731 #endif
01732 
01733 /**
01734  * SLIP_DEBUG: Enable debugging in slipif.c.
01735  */
01736 #ifndef SLIP_DEBUG
01737 #define SLIP_DEBUG                      LWIP_DBG_OFF
01738 #endif
01739 
01740 /**
01741  * DHCP_DEBUG: Enable debugging in dhcp.c.
01742  */
01743 #ifndef DHCP_DEBUG
01744 #define DHCP_DEBUG                      LWIP_DBG_OFF
01745 #endif
01746 
01747 /**
01748  * AUTOIP_DEBUG: Enable debugging in autoip.c.
01749  */
01750 #ifndef AUTOIP_DEBUG
01751 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
01752 #endif
01753 
01754 /**
01755  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
01756  */
01757 #ifndef SNMP_MSG_DEBUG
01758 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
01759 #endif
01760 
01761 /**
01762  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
01763  */
01764 #ifndef SNMP_MIB_DEBUG
01765 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
01766 #endif
01767 
01768 /**
01769  * DNS_DEBUG: Enable debugging for DNS.
01770  */
01771 #ifndef DNS_DEBUG
01772 #define DNS_DEBUG                       LWIP_DBG_OFF
01773 #endif
01774 
01775 #endif /* __LWIP_OPT_H__ */