SAMV71 Xplained Ultra Software Package 1.4

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  * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
00371  * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
00372  * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
00373  * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
00374  */
00375 #ifndef ETHARP_SUPPORT_VLAN
00376 #define ETHARP_SUPPORT_VLAN             0
00377 #endif
00378 
00379 /*
00380    --------------------------------
00381    ---------- IP options ----------
00382    --------------------------------
00383 */
00384 /**
00385  * IP_FORWARD==1: Enables the ability to forward IP packets across network
00386  * interfaces. If you are going to run lwIP on a device with only one network
00387  * interface, define this to 0.
00388  */
00389 #ifndef IP_FORWARD
00390 #define IP_FORWARD                      0
00391 #endif
00392 
00393 /**
00394  * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
00395  *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
00396  *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
00397  */
00398 #ifndef IP_OPTIONS_ALLOWED
00399 #define IP_OPTIONS_ALLOWED              1
00400 #endif
00401 
00402 /**
00403  * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
00404  * this option does not affect outgoing packet sizes, which can be controlled
00405  * via IP_FRAG.
00406  */
00407 #ifndef IP_REASSEMBLY
00408 #define IP_REASSEMBLY                   1
00409 #endif
00410 
00411 /**
00412  * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
00413  * that this option does not affect incoming packet sizes, which can be
00414  * controlled via IP_REASSEMBLY.
00415  */
00416 #ifndef IP_FRAG
00417 #define IP_FRAG                         1
00418 #endif
00419 
00420 /**
00421  * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
00422  * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
00423  * in this time, the whole packet is discarded.
00424  */
00425 #ifndef IP_REASS_MAXAGE
00426 #define IP_REASS_MAXAGE                 3
00427 #endif
00428 
00429 /**
00430  * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
00431  * Since the received pbufs are enqueued, be sure to configure
00432  * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
00433  * packets even if the maximum amount of fragments is enqueued for reassembly!
00434  */
00435 #ifndef IP_REASS_MAX_PBUFS
00436 #define IP_REASS_MAX_PBUFS              10
00437 #endif
00438 
00439 /**
00440  * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
00441  * fragmentation. Otherwise pbufs are allocated and reference the original
00442  * packet data to be fragmented.
00443  */
00444 #ifndef IP_FRAG_USES_STATIC_BUF
00445 #define IP_FRAG_USES_STATIC_BUF         1
00446 #endif
00447 
00448 /**
00449  * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
00450  * (requires IP_FRAG_USES_STATIC_BUF==1)
00451  */
00452 #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
00453 #define IP_FRAG_MAX_MTU                 1500
00454 #endif
00455 
00456 /**
00457  * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
00458  */
00459 #ifndef IP_DEFAULT_TTL
00460 #define IP_DEFAULT_TTL                  255
00461 #endif
00462 
00463 /**
00464  * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
00465  * filter per pcb on udp and raw send operations. To enable broadcast filter
00466  * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
00467  */
00468 #ifndef IP_SOF_BROADCAST
00469 #define IP_SOF_BROADCAST                0
00470 #endif
00471 
00472 /**
00473  * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
00474  * filter on recv operations.
00475  */
00476 #ifndef IP_SOF_BROADCAST_RECV
00477 #define IP_SOF_BROADCAST_RECV           0
00478 #endif
00479 
00480 /*
00481    ----------------------------------
00482    ---------- ICMP options ----------
00483    ----------------------------------
00484 */
00485 /**
00486  * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
00487  * Be careful, disable that make your product non-compliant to RFC1122
00488  */
00489 #ifndef LWIP_ICMP
00490 #define LWIP_ICMP                       1
00491 #endif
00492 
00493 /**
00494  * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
00495  */
00496 #ifndef ICMP_TTL
00497 #define ICMP_TTL                       (IP_DEFAULT_TTL)
00498 #endif
00499 
00500 /**
00501  * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
00502  */
00503 #ifndef LWIP_BROADCAST_PING
00504 #define LWIP_BROADCAST_PING             0
00505 #endif
00506 
00507 /**
00508  * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
00509  */
00510 #ifndef LWIP_MULTICAST_PING
00511 #define LWIP_MULTICAST_PING             0
00512 #endif
00513 
00514 /*
00515    ---------------------------------
00516    ---------- RAW options ----------
00517    ---------------------------------
00518 */
00519 /**
00520  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
00521  */
00522 #ifndef LWIP_RAW
00523 #define LWIP_RAW                        1
00524 #endif
00525 
00526 /**
00527  * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
00528  */
00529 #ifndef RAW_TTL
00530 #define RAW_TTL                        (IP_DEFAULT_TTL)
00531 #endif
00532 
00533 /*
00534    ----------------------------------
00535    ---------- DHCP options ----------
00536    ----------------------------------
00537 */
00538 /**
00539  * LWIP_DHCP==1: Enable DHCP module.
00540  */
00541 #ifndef LWIP_DHCP
00542 #define LWIP_DHCP                       0
00543 #endif
00544 
00545 /**
00546  * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
00547  */
00548 #ifndef DHCP_DOES_ARP_CHECK
00549 #define DHCP_DOES_ARP_CHECK             ((LWIP_DHCP) && (LWIP_ARP))
00550 #endif
00551 
00552 /*
00553    ------------------------------------
00554    ---------- AUTOIP options ----------
00555    ------------------------------------
00556 */
00557 /**
00558  * LWIP_AUTOIP==1: Enable AUTOIP module.
00559  */
00560 #ifndef LWIP_AUTOIP
00561 #define LWIP_AUTOIP                     0
00562 #endif
00563 
00564 /**
00565  * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
00566  * the same interface at the same time.
00567  */
00568 #ifndef LWIP_DHCP_AUTOIP_COOP
00569 #define LWIP_DHCP_AUTOIP_COOP           0
00570 #endif
00571 
00572 /**
00573  * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
00574  * that should be sent before falling back on AUTOIP. This can be set
00575  * as low as 1 to get an AutoIP address very quickly, but you should
00576  * be prepared to handle a changing IP address when DHCP overrides
00577  * AutoIP.
00578  */
00579 #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
00580 #define LWIP_DHCP_AUTOIP_COOP_TRIES     9
00581 #endif
00582 
00583 /*
00584    ----------------------------------
00585    ---------- SNMP options ----------
00586    ----------------------------------
00587 */
00588 /**
00589  * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
00590  * transport.
00591  */
00592 #ifndef LWIP_SNMP
00593 #define LWIP_SNMP                       0
00594 #endif
00595 
00596 /**
00597  * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
00598  * allow. At least one request buffer is required. 
00599  */
00600 #ifndef SNMP_CONCURRENT_REQUESTS
00601 #define SNMP_CONCURRENT_REQUESTS        1
00602 #endif
00603 
00604 /**
00605  * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
00606  * destination is required
00607  */
00608 #ifndef SNMP_TRAP_DESTINATIONS
00609 #define SNMP_TRAP_DESTINATIONS          1
00610 #endif
00611 
00612 /**
00613  * SNMP_PRIVATE_MIB: 
00614  */
00615 #ifndef SNMP_PRIVATE_MIB
00616 #define SNMP_PRIVATE_MIB                0
00617 #endif
00618 
00619 /**
00620  * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
00621  * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
00622  * Unsafe requests are disabled by default!
00623  */
00624 #ifndef SNMP_SAFE_REQUESTS
00625 #define SNMP_SAFE_REQUESTS              1
00626 #endif
00627 
00628 /*
00629    ----------------------------------
00630    ---------- IGMP options ----------
00631    ----------------------------------
00632 */
00633 /**
00634  * LWIP_IGMP==1: Turn on IGMP module. 
00635  */
00636 #ifndef LWIP_IGMP
00637 #define LWIP_IGMP                       0
00638 #endif
00639 
00640 /*
00641    ----------------------------------
00642    ---------- DNS options -----------
00643    ----------------------------------
00644 */
00645 /**
00646  * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
00647  * transport.
00648  */
00649 #ifndef LWIP_DNS
00650 #define LWIP_DNS                        0
00651 #endif
00652 
00653 /** DNS maximum number of entries to maintain locally. */
00654 #ifndef DNS_TABLE_SIZE
00655 #define DNS_TABLE_SIZE                  4
00656 #endif
00657 
00658 /** DNS maximum host name length supported in the name table. */
00659 #ifndef DNS_MAX_NAME_LENGTH
00660 #define DNS_MAX_NAME_LENGTH             256
00661 #endif
00662 
00663 /** The maximum of DNS servers */
00664 #ifndef DNS_MAX_SERVERS
00665 #define DNS_MAX_SERVERS                 2
00666 #endif
00667 
00668 /** DNS do a name checking between the query and the response. */
00669 #ifndef DNS_DOES_NAME_CHECK
00670 #define DNS_DOES_NAME_CHECK             1
00671 #endif
00672 
00673 /** DNS use a local buffer if DNS_USES_STATIC_BUF=0, a static one if
00674     DNS_USES_STATIC_BUF=1, or a dynamic one if DNS_USES_STATIC_BUF=2.
00675     The buffer will be of size DNS_MSG_SIZE */
00676 #ifndef DNS_USES_STATIC_BUF
00677 #define DNS_USES_STATIC_BUF             1
00678 #endif
00679 
00680 /** DNS message max. size. Default value is RFC compliant. */
00681 #ifndef DNS_MSG_SIZE
00682 #define DNS_MSG_SIZE                    512
00683 #endif
00684 
00685 /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
00686  *  you have to define
00687  *    #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
00688  *  (an array of structs name/address, where address is an u32_t in network
00689  *  byte order).
00690  *
00691  *  Instead, you can also use an external function:
00692  *  #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
00693  *  that returns the IP address or INADDR_NONE if not found.
00694  */
00695 #ifndef DNS_LOCAL_HOSTLIST
00696 #define DNS_LOCAL_HOSTLIST              0
00697 #endif /* DNS_LOCAL_HOSTLIST */
00698 
00699 /** If this is turned on, the local host-list can be dynamically changed
00700  *  at runtime. */
00701 #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
00702 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC   0
00703 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
00704 
00705 /*
00706    ---------------------------------
00707    ---------- UDP options ----------
00708    ---------------------------------
00709 */
00710 /**
00711  * LWIP_UDP==1: Turn on UDP.
00712  */
00713 #ifndef LWIP_UDP
00714 #define LWIP_UDP                        1
00715 #endif
00716 
00717 /**
00718  * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
00719  */
00720 #ifndef LWIP_UDPLITE
00721 #define LWIP_UDPLITE                    0
00722 #endif
00723 
00724 /**
00725  * UDP_TTL: Default Time-To-Live value.
00726  */
00727 #ifndef UDP_TTL
00728 #define UDP_TTL                         (IP_DEFAULT_TTL)
00729 #endif
00730 
00731 /**
00732  * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
00733  */
00734 #ifndef LWIP_NETBUF_RECVINFO
00735 #define LWIP_NETBUF_RECVINFO            0
00736 #endif
00737 
00738 /*
00739    ---------------------------------
00740    ---------- TCP options ----------
00741    ---------------------------------
00742 */
00743 /**
00744  * LWIP_TCP==1: Turn on TCP.
00745  */
00746 #ifndef LWIP_TCP
00747 #define LWIP_TCP                        1
00748 #endif
00749 
00750 /**
00751  * TCP_TTL: Default Time-To-Live value.
00752  */
00753 #ifndef TCP_TTL
00754 #define TCP_TTL                         (IP_DEFAULT_TTL)
00755 #endif
00756 
00757 /**
00758  * TCP_WND: The size of a TCP window.  This must be at least 
00759  * (2 * TCP_MSS) for things to work well
00760  */
00761 #ifndef TCP_WND
00762 #define TCP_WND                         (4 * TCP_MSS)
00763 #endif 
00764 
00765 /**
00766  * TCP_MAXRTX: Maximum number of retransmissions of data segments.
00767  */
00768 #ifndef TCP_MAXRTX
00769 #define TCP_MAXRTX                      12
00770 #endif
00771 
00772 /**
00773  * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
00774  */
00775 #ifndef TCP_SYNMAXRTX
00776 #define TCP_SYNMAXRTX                   6
00777 #endif
00778 
00779 /**
00780  * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
00781  * Define to 0 if your device is low on memory.
00782  */
00783 #ifndef TCP_QUEUE_OOSEQ
00784 #define TCP_QUEUE_OOSEQ                 (LWIP_TCP)
00785 #endif
00786 
00787 /**
00788  * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
00789  * you might want to increase this.)
00790  * For the receive side, this MSS is advertised to the remote side
00791  * when opening a connection. For the transmit size, this MSS sets
00792  * an upper limit on the MSS advertised by the remote host.
00793  */
00794 #ifndef TCP_MSS
00795 #define TCP_MSS                         536
00796 #endif
00797 
00798 /**
00799  * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
00800  * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
00801  * reflects the available reassembly buffer size at the remote host) and the
00802  * largest size permitted by the IP layer" (RFC 1122)
00803  * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
00804  * netif used for a connection and limits the MSS if it would be too big otherwise.
00805  */
00806 #ifndef TCP_CALCULATE_EFF_SEND_MSS
00807 #define TCP_CALCULATE_EFF_SEND_MSS      1
00808 #endif
00809 
00810 
00811 /**
00812  * TCP_SND_BUF: TCP sender buffer space (bytes). 
00813  */
00814 #ifndef TCP_SND_BUF
00815 #define TCP_SND_BUF                     256
00816 #endif
00817 
00818 /**
00819  * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
00820  * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
00821  */
00822 #ifndef TCP_SND_QUEUELEN
00823 #define TCP_SND_QUEUELEN                (4 * (TCP_SND_BUF)/(TCP_MSS))
00824 #endif
00825 
00826 /**
00827  * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than or equal
00828  * to TCP_SND_BUF. It is the amount of space which must be available in the
00829  * TCP snd_buf for select to return writable.
00830  */
00831 #ifndef TCP_SNDLOWAT
00832 #define TCP_SNDLOWAT                    ((TCP_SND_BUF)/2)
00833 #endif
00834 
00835 /**
00836  * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
00837  */
00838 #ifndef TCP_LISTEN_BACKLOG
00839 #define TCP_LISTEN_BACKLOG              0
00840 #endif
00841 
00842 /**
00843  * The maximum allowed backlog for TCP listen netconns.
00844  * This backlog is used unless another is explicitly specified.
00845  * 0xff is the maximum (u8_t).
00846  */
00847 #ifndef TCP_DEFAULT_LISTEN_BACKLOG
00848 #define TCP_DEFAULT_LISTEN_BACKLOG      0xff
00849 #endif
00850 
00851 /**
00852  * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
00853  */
00854 #ifndef LWIP_TCP_TIMESTAMPS
00855 #define LWIP_TCP_TIMESTAMPS             0
00856 #endif
00857 
00858 /**
00859  * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
00860  * explicit window update
00861  */
00862 #ifndef TCP_WND_UPDATE_THRESHOLD
00863 #define TCP_WND_UPDATE_THRESHOLD   (TCP_WND / 4)
00864 #endif
00865 
00866 /**
00867  * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
00868  *     LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
00869  *         events (accept, sent, etc) that happen in the system.
00870  *     LWIP_CALLBACK_API==1: The PCB callback function is called directly
00871  *         for the event.
00872  */
00873 #ifndef LWIP_EVENT_API
00874 #define LWIP_EVENT_API                  0
00875 #define LWIP_CALLBACK_API               1
00876 #else 
00877 #define LWIP_EVENT_API                  1
00878 #define LWIP_CALLBACK_API               0
00879 #endif
00880 
00881 
00882 /*
00883    ----------------------------------
00884    ---------- Pbuf options ----------
00885    ----------------------------------
00886 */
00887 /**
00888  * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00889  * link level header. The default is 14, the standard value for
00890  * Ethernet.
00891  */
00892 #ifndef PBUF_LINK_HLEN
00893 #define PBUF_LINK_HLEN                  14
00894 #endif
00895 
00896 /**
00897  * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
00898  * designed to accomodate single full size TCP frame in one pbuf, including
00899  * TCP_MSS, IP header, and link header.
00900  */
00901 #ifndef PBUF_POOL_BUFSIZE
00902 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
00903 #endif
00904 
00905 /*
00906    ------------------------------------------------
00907    ---------- Network Interfaces options ----------
00908    ------------------------------------------------
00909 */
00910 /**
00911  * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
00912  * field.
00913  */
00914 #ifndef LWIP_NETIF_HOSTNAME
00915 #define LWIP_NETIF_HOSTNAME             0
00916 #endif
00917 
00918 /**
00919  * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
00920  */
00921 #ifndef LWIP_NETIF_API
00922 #define LWIP_NETIF_API                  0
00923 #endif
00924 
00925 /**
00926  * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
00927  * changes its up/down status (i.e., due to DHCP IP acquistion)
00928  */
00929 #ifndef LWIP_NETIF_STATUS_CALLBACK
00930 #define LWIP_NETIF_STATUS_CALLBACK      0
00931 #endif
00932 
00933 /**
00934  * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
00935  * whenever the link changes (i.e., link down)
00936  */
00937 #ifndef LWIP_NETIF_LINK_CALLBACK
00938 #define LWIP_NETIF_LINK_CALLBACK        0
00939 #endif
00940 
00941 /**
00942  * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
00943  * indices) in struct netif. TCP and UDP can make use of this to prevent
00944  * scanning the ARP table for every sent packet. While this is faster for big
00945  * ARP tables or many concurrent connections, it might be counterproductive
00946  * if you have a tiny ARP table or if there never are concurrent connections.
00947  */
00948 #ifndef LWIP_NETIF_HWADDRHINT
00949 #define LWIP_NETIF_HWADDRHINT           0
00950 #endif
00951 
00952 /**
00953  * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
00954  * address equal to the netif IP address, looping them back up the stack.
00955  */
00956 #ifndef LWIP_NETIF_LOOPBACK
00957 #define LWIP_NETIF_LOOPBACK             0
00958 #endif
00959 
00960 /**
00961  * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
00962  * sending for each netif (0 = disabled)
00963  */
00964 #ifndef LWIP_LOOPBACK_MAX_PBUFS
00965 #define LWIP_LOOPBACK_MAX_PBUFS         0
00966 #endif
00967 
00968 /**
00969  * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
00970  * the system, as netifs must change how they behave depending on this setting
00971  * for the LWIP_NETIF_LOOPBACK option to work.
00972  * Setting this is needed to avoid reentering non-reentrant functions like
00973  * tcp_input().
00974  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
00975  *       multithreaded environment like tcpip.c. In this case, netif->input()
00976  *       is called directly.
00977  *    LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
00978  *       The packets are put on a list and netif_poll() must be called in
00979  *       the main application loop.
00980  */
00981 #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
00982 #define LWIP_NETIF_LOOPBACK_MULTITHREADING    (!NO_SYS)
00983 #endif
00984 
00985 /**
00986  * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
00987  * to be sent into one single pbuf. This is for compatibility with DMA-enabled
00988  * MACs that do not support scatter-gather.
00989  * Beware that this might involve CPU-memcpy before transmitting that would not
00990  * be needed without this flag! Use this only if you need to!
00991  *
00992  * @todo: TCP and IP-frag do not work with this, yet:
00993  */
00994 #ifndef LWIP_NETIF_TX_SINGLE_PBUF
00995 #define LWIP_NETIF_TX_SINGLE_PBUF             0
00996 #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
00997 
00998 /*
00999    ------------------------------------
01000    ---------- LOOPIF options ----------
01001    ------------------------------------
01002 */
01003 /**
01004  * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
01005  */
01006 #ifndef LWIP_HAVE_LOOPIF
01007 #define LWIP_HAVE_LOOPIF                0
01008 #endif
01009 
01010 /*
01011    ------------------------------------
01012    ---------- SLIPIF options ----------
01013    ------------------------------------
01014 */
01015 /**
01016  * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
01017  */
01018 #ifndef LWIP_HAVE_SLIPIF
01019 #define LWIP_HAVE_SLIPIF                0
01020 #endif
01021 
01022 /*
01023    ------------------------------------
01024    ---------- Thread options ----------
01025    ------------------------------------
01026 */
01027 /**
01028  * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
01029  */
01030 #ifndef TCPIP_THREAD_NAME
01031 #define TCPIP_THREAD_NAME              "tcpip_thread"
01032 #endif
01033 
01034 /**
01035  * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
01036  * The stack size value itself is platform-dependent, but is passed to
01037  * sys_thread_new() when the thread is created.
01038  */
01039 #ifndef TCPIP_THREAD_STACKSIZE
01040 #define TCPIP_THREAD_STACKSIZE          0
01041 #endif
01042 
01043 /**
01044  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
01045  * The priority value itself is platform-dependent, but is passed to
01046  * sys_thread_new() when the thread is created.
01047  */
01048 #ifndef TCPIP_THREAD_PRIO
01049 #define TCPIP_THREAD_PRIO               1
01050 #endif
01051 
01052 /**
01053  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
01054  * The queue size value itself is platform-dependent, but is passed to
01055  * sys_mbox_new() when tcpip_init is called.
01056  */
01057 #ifndef TCPIP_MBOX_SIZE
01058 #define TCPIP_MBOX_SIZE                 0
01059 #endif
01060 
01061 /**
01062  * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
01063  */
01064 #ifndef SLIPIF_THREAD_NAME
01065 #define SLIPIF_THREAD_NAME             "slipif_loop"
01066 #endif
01067 
01068 /**
01069  * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
01070  * The stack size value itself is platform-dependent, but is passed to
01071  * sys_thread_new() when the thread is created.
01072  */
01073 #ifndef SLIPIF_THREAD_STACKSIZE
01074 #define SLIPIF_THREAD_STACKSIZE         0
01075 #endif
01076 
01077 /**
01078  * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
01079  * The priority value itself is platform-dependent, but is passed to
01080  * sys_thread_new() when the thread is created.
01081  */
01082 #ifndef SLIPIF_THREAD_PRIO
01083 #define SLIPIF_THREAD_PRIO              1
01084 #endif
01085 
01086 /**
01087  * PPP_THREAD_NAME: The name assigned to the pppMain thread.
01088  */
01089 #ifndef PPP_THREAD_NAME
01090 #define PPP_THREAD_NAME                "pppMain"
01091 #endif
01092 
01093 /**
01094  * PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.
01095  * The stack size value itself is platform-dependent, but is passed to
01096  * sys_thread_new() when the thread is created.
01097  */
01098 #ifndef PPP_THREAD_STACKSIZE
01099 #define PPP_THREAD_STACKSIZE            0
01100 #endif
01101 
01102 /**
01103  * PPP_THREAD_PRIO: The priority assigned to the pppMain thread.
01104  * The priority value itself is platform-dependent, but is passed to
01105  * sys_thread_new() when the thread is created.
01106  */
01107 #ifndef PPP_THREAD_PRIO
01108 #define PPP_THREAD_PRIO                 1
01109 #endif
01110 
01111 /**
01112  * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
01113  */
01114 #ifndef DEFAULT_THREAD_NAME
01115 #define DEFAULT_THREAD_NAME            "lwIP"
01116 #endif
01117 
01118 /**
01119  * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
01120  * The stack size value itself is platform-dependent, but is passed to
01121  * sys_thread_new() when the thread is created.
01122  */
01123 #ifndef DEFAULT_THREAD_STACKSIZE
01124 #define DEFAULT_THREAD_STACKSIZE        0
01125 #endif
01126 
01127 /**
01128  * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
01129  * The priority value itself is platform-dependent, but is passed to
01130  * sys_thread_new() when the thread is created.
01131  */
01132 #ifndef DEFAULT_THREAD_PRIO
01133 #define DEFAULT_THREAD_PRIO             1
01134 #endif
01135 
01136 /**
01137  * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01138  * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
01139  * to sys_mbox_new() when the recvmbox is created.
01140  */
01141 #ifndef DEFAULT_RAW_RECVMBOX_SIZE
01142 #define DEFAULT_RAW_RECVMBOX_SIZE       0
01143 #endif
01144 
01145 /**
01146  * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01147  * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
01148  * to sys_mbox_new() when the recvmbox is created.
01149  */
01150 #ifndef DEFAULT_UDP_RECVMBOX_SIZE
01151 #define DEFAULT_UDP_RECVMBOX_SIZE       0
01152 #endif
01153 
01154 /**
01155  * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
01156  * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
01157  * to sys_mbox_new() when the recvmbox is created.
01158  */
01159 #ifndef DEFAULT_TCP_RECVMBOX_SIZE
01160 #define DEFAULT_TCP_RECVMBOX_SIZE       0
01161 #endif
01162 
01163 /**
01164  * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
01165  * The queue size value itself is platform-dependent, but is passed to
01166  * sys_mbox_new() when the acceptmbox is created.
01167  */
01168 #ifndef DEFAULT_ACCEPTMBOX_SIZE
01169 #define DEFAULT_ACCEPTMBOX_SIZE         0
01170 #endif
01171 
01172 /*
01173    ----------------------------------------------
01174    ---------- Sequential layer options ----------
01175    ----------------------------------------------
01176 */
01177 /**
01178  * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
01179  * Don't use it if you're not an active lwIP project member
01180  */
01181 #ifndef LWIP_TCPIP_CORE_LOCKING
01182 #define LWIP_TCPIP_CORE_LOCKING         0
01183 #endif
01184 
01185 /**
01186  * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
01187  */
01188 #ifndef LWIP_NETCONN
01189 #define LWIP_NETCONN                    1
01190 #endif
01191 
01192 /*
01193    ------------------------------------
01194    ---------- Socket options ----------
01195    ------------------------------------
01196 */
01197 /**
01198  * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
01199  */
01200 #ifndef LWIP_SOCKET
01201 #define LWIP_SOCKET                     1
01202 #endif
01203 
01204 /**
01205  * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
01206  * (only used if you use sockets.c)
01207  */
01208 #ifndef LWIP_COMPAT_SOCKETS
01209 #define LWIP_COMPAT_SOCKETS             1
01210 #endif
01211 
01212 /**
01213  * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
01214  * Disable this option if you use a POSIX operating system that uses the same
01215  * names (read, write & close). (only used if you use sockets.c)
01216  */
01217 #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
01218 #define LWIP_POSIX_SOCKETS_IO_NAMES     1
01219 #endif
01220 
01221 /**
01222  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
01223  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
01224  * in seconds. (does not require sockets.c, and will affect tcp.c)
01225  */
01226 #ifndef LWIP_TCP_KEEPALIVE
01227 #define LWIP_TCP_KEEPALIVE              0
01228 #endif
01229 
01230 /**
01231  * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
01232  */
01233 #ifndef LWIP_SO_RCVTIMEO
01234 #define LWIP_SO_RCVTIMEO                0
01235 #endif
01236 
01237 /**
01238  * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
01239  */
01240 #ifndef LWIP_SO_RCVBUF
01241 #define LWIP_SO_RCVBUF                  0
01242 #endif
01243 
01244 /**
01245  * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
01246  */
01247 #ifndef RECV_BUFSIZE_DEFAULT
01248 #define RECV_BUFSIZE_DEFAULT            INT_MAX
01249 #endif
01250 
01251 /**
01252  * SO_REUSE==1: Enable SO_REUSEADDR and SO_REUSEPORT options. DO NOT USE!
01253  */
01254 #ifndef SO_REUSE
01255 #define SO_REUSE                        0
01256 #endif
01257 
01258 /*
01259    ----------------------------------------
01260    ---------- Statistics options ----------
01261    ----------------------------------------
01262 */
01263 /**
01264  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
01265  */
01266 #ifndef LWIP_STATS
01267 #define LWIP_STATS                      1
01268 #endif
01269 
01270 #if LWIP_STATS
01271 
01272 /**
01273  * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
01274  */
01275 #ifndef LWIP_STATS_DISPLAY
01276 #define LWIP_STATS_DISPLAY              0
01277 #endif
01278 
01279 /**
01280  * LINK_STATS==1: Enable link stats.
01281  */
01282 #ifndef LINK_STATS
01283 #define LINK_STATS                      1
01284 #endif
01285 
01286 /**
01287  * ETHARP_STATS==1: Enable etharp stats.
01288  */
01289 #ifndef ETHARP_STATS
01290 #define ETHARP_STATS                    (LWIP_ARP)
01291 #endif
01292 
01293 /**
01294  * IP_STATS==1: Enable IP stats.
01295  */
01296 #ifndef IP_STATS
01297 #define IP_STATS                        1
01298 #endif
01299 
01300 /**
01301  * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
01302  * on if using either frag or reass.
01303  */
01304 #ifndef IPFRAG_STATS
01305 #define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
01306 #endif
01307 
01308 /**
01309  * ICMP_STATS==1: Enable ICMP stats.
01310  */
01311 #ifndef ICMP_STATS
01312 #define ICMP_STATS                      1
01313 #endif
01314 
01315 /**
01316  * IGMP_STATS==1: Enable IGMP stats.
01317  */
01318 #ifndef IGMP_STATS
01319 #define IGMP_STATS                      (LWIP_IGMP)
01320 #endif
01321 
01322 /**
01323  * UDP_STATS==1: Enable UDP stats. Default is on if
01324  * UDP enabled, otherwise off.
01325  */
01326 #ifndef UDP_STATS
01327 #define UDP_STATS                       (LWIP_UDP)
01328 #endif
01329 
01330 /**
01331  * TCP_STATS==1: Enable TCP stats. Default is on if TCP
01332  * enabled, otherwise off.
01333  */
01334 #ifndef TCP_STATS
01335 #define TCP_STATS                       (LWIP_TCP)
01336 #endif
01337 
01338 /**
01339  * MEM_STATS==1: Enable mem.c stats.
01340  */
01341 #ifndef MEM_STATS
01342 #define MEM_STATS                       ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
01343 #endif
01344 
01345 /**
01346  * MEMP_STATS==1: Enable memp.c pool stats.
01347  */
01348 #ifndef MEMP_STATS
01349 #define MEMP_STATS                      (MEMP_MEM_MALLOC == 0)
01350 #endif
01351 
01352 /**
01353  * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
01354  */
01355 #ifndef SYS_STATS
01356 #define SYS_STATS                       (NO_SYS == 0)
01357 #endif
01358 
01359 #else
01360 
01361 #define LINK_STATS                      0
01362 #define IP_STATS                        0
01363 #define IPFRAG_STATS                    0
01364 #define ICMP_STATS                      0
01365 #define IGMP_STATS                      0
01366 #define UDP_STATS                       0
01367 #define TCP_STATS                       0
01368 #define MEM_STATS                       0
01369 #define MEMP_STATS                      0
01370 #define SYS_STATS                       0
01371 #define LWIP_STATS_DISPLAY              0
01372 
01373 #endif /* LWIP_STATS */
01374 
01375 /*
01376    ---------------------------------
01377    ---------- PPP options ----------
01378    ---------------------------------
01379 */
01380 /**
01381  * PPP_SUPPORT==1: Enable PPP.
01382  */
01383 #ifndef PPP_SUPPORT
01384 #define PPP_SUPPORT                     0
01385 #endif
01386 
01387 /**
01388  * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
01389  */
01390 #ifndef PPPOE_SUPPORT
01391 #define PPPOE_SUPPORT                   0
01392 #endif
01393 
01394 /**
01395  * PPPOS_SUPPORT==1: Enable PPP Over Serial
01396  */
01397 #ifndef PPPOS_SUPPORT
01398 #define PPPOS_SUPPORT                   PPP_SUPPORT
01399 #endif
01400 
01401 #if PPP_SUPPORT
01402 
01403 /**
01404  * NUM_PPP: Max PPP sessions.
01405  */
01406 #ifndef NUM_PPP
01407 #define NUM_PPP                         1
01408 #endif
01409 
01410 /**
01411  * PAP_SUPPORT==1: Support PAP.
01412  */
01413 #ifndef PAP_SUPPORT
01414 #define PAP_SUPPORT                     0
01415 #endif
01416 
01417 /**
01418  * CHAP_SUPPORT==1: Support CHAP.
01419  */
01420 #ifndef CHAP_SUPPORT
01421 #define CHAP_SUPPORT                    0
01422 #endif
01423 
01424 /**
01425  * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01426  */
01427 #ifndef MSCHAP_SUPPORT
01428 #define MSCHAP_SUPPORT                  0
01429 #endif
01430 
01431 /**
01432  * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01433  */
01434 #ifndef CBCP_SUPPORT
01435 #define CBCP_SUPPORT                    0
01436 #endif
01437 
01438 /**
01439  * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
01440  */
01441 #ifndef CCP_SUPPORT
01442 #define CCP_SUPPORT                     0
01443 #endif
01444 
01445 /**
01446  * VJ_SUPPORT==1: Support VJ header compression.
01447  */
01448 #ifndef VJ_SUPPORT
01449 #define VJ_SUPPORT                      0
01450 #endif
01451 
01452 /**
01453  * MD5_SUPPORT==1: Support MD5 (see also CHAP).
01454  */
01455 #ifndef MD5_SUPPORT
01456 #define MD5_SUPPORT                     0
01457 #endif
01458 
01459 /*
01460  * Timeouts
01461  */
01462 #ifndef FSM_DEFTIMEOUT
01463 #define FSM_DEFTIMEOUT                  6       /* Timeout time in seconds */
01464 #endif
01465 
01466 #ifndef FSM_DEFMAXTERMREQS
01467 #define FSM_DEFMAXTERMREQS              2       /* Maximum Terminate-Request transmissions */
01468 #endif
01469 
01470 #ifndef FSM_DEFMAXCONFREQS
01471 #define FSM_DEFMAXCONFREQS              10      /* Maximum Configure-Request transmissions */
01472 #endif
01473 
01474 #ifndef FSM_DEFMAXNAKLOOPS
01475 #define FSM_DEFMAXNAKLOOPS              5       /* Maximum number of nak loops */
01476 #endif
01477 
01478 #ifndef UPAP_DEFTIMEOUT
01479 #define UPAP_DEFTIMEOUT                 6       /* Timeout (seconds) for retransmitting req */
01480 #endif
01481 
01482 #ifndef UPAP_DEFREQTIME
01483 #define UPAP_DEFREQTIME                 30      /* Time to wait for auth-req from peer */
01484 #endif
01485 
01486 #ifndef CHAP_DEFTIMEOUT
01487 #define CHAP_DEFTIMEOUT                 6       /* Timeout time in seconds */
01488 #endif
01489 
01490 #ifndef CHAP_DEFTRANSMITS
01491 #define CHAP_DEFTRANSMITS               10      /* max # times to send challenge */
01492 #endif
01493 
01494 /* Interval in seconds between keepalive echo requests, 0 to disable. */
01495 #ifndef LCP_ECHOINTERVAL
01496 #define LCP_ECHOINTERVAL                0
01497 #endif
01498 
01499 /* Number of unanswered echo requests before failure. */
01500 #ifndef LCP_MAXECHOFAILS
01501 #define LCP_MAXECHOFAILS                3
01502 #endif
01503 
01504 /* Max Xmit idle time (in jiffies) before resend flag char. */
01505 #ifndef PPP_MAXIDLEFLAG
01506 #define PPP_MAXIDLEFLAG                 100
01507 #endif
01508 
01509 /*
01510  * Packet sizes
01511  *
01512  * Note - lcp shouldn't be allowed to negotiate stuff outside these
01513  *    limits.  See lcp.h in the pppd directory.
01514  * (XXX - these constants should simply be shared by lcp.c instead
01515  *    of living in lcp.h)
01516  */
01517 #define PPP_MTU                         1500     /* Default MTU (size of Info field) */
01518 #ifndef PPP_MAXMTU
01519 /* #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN) */
01520 #define PPP_MAXMTU                      1500 /* Largest MTU we allow */
01521 #endif
01522 #define PPP_MINMTU                      64
01523 #define PPP_MRU                         1500     /* default MRU = max length of info field */
01524 #define PPP_MAXMRU                      1500     /* Largest MRU we allow */
01525 #ifndef PPP_DEFMRU
01526 #define PPP_DEFMRU                      296             /* Try for this */
01527 #endif
01528 #define PPP_MINMRU                      128             /* No MRUs below this */
01529 
01530 #ifndef MAXNAMELEN
01531 #define MAXNAMELEN                      256     /* max length of hostname or name for auth */
01532 #endif
01533 #ifndef MAXSECRETLEN
01534 #define MAXSECRETLEN                    256     /* max length of password or secret */
01535 #endif
01536 
01537 #endif /* PPP_SUPPORT */
01538 
01539 /*
01540    --------------------------------------
01541    ---------- Checksum options ----------
01542    --------------------------------------
01543 */
01544 /**
01545  * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
01546  */
01547 #ifndef CHECKSUM_GEN_IP
01548 #define CHECKSUM_GEN_IP                 1
01549 #endif
01550  
01551 /**
01552  * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
01553  */
01554 #ifndef CHECKSUM_GEN_UDP
01555 #define CHECKSUM_GEN_UDP                1
01556 #endif
01557  
01558 /**
01559  * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
01560  */
01561 #ifndef CHECKSUM_GEN_TCP
01562 #define CHECKSUM_GEN_TCP                1
01563 #endif
01564  
01565 /**
01566  * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
01567  */
01568 #ifndef CHECKSUM_CHECK_IP
01569 #define CHECKSUM_CHECK_IP               1
01570 #endif
01571  
01572 /**
01573  * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
01574  */
01575 #ifndef CHECKSUM_CHECK_UDP
01576 #define CHECKSUM_CHECK_UDP              1
01577 #endif
01578 
01579 /**
01580  * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
01581  */
01582 #ifndef CHECKSUM_CHECK_TCP
01583 #define CHECKSUM_CHECK_TCP              1
01584 #endif
01585 
01586 /*
01587    ---------------------------------------
01588    ---------- Debugging options ----------
01589    ---------------------------------------
01590 */
01591 /**
01592  * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
01593  * compared against this value. If it is smaller, then debugging
01594  * messages are written.
01595  */
01596 #ifndef LWIP_DBG_MIN_LEVEL
01597 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
01598 #endif
01599 
01600 /**
01601  * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
01602  * debug messages of certain types.
01603  */
01604 #ifndef LWIP_DBG_TYPES_ON
01605 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
01606 #endif
01607 
01608 /**
01609  * ETHARP_DEBUG: Enable debugging in etharp.c.
01610  */
01611 #ifndef ETHARP_DEBUG
01612 #define ETHARP_DEBUG                    LWIP_DBG_OFF
01613 #endif
01614 
01615 /**
01616  * NETIF_DEBUG: Enable debugging in netif.c.
01617  */
01618 #ifndef NETIF_DEBUG
01619 #define NETIF_DEBUG                     LWIP_DBG_OFF
01620 #endif
01621 
01622 /**
01623  * PBUF_DEBUG: Enable debugging in pbuf.c.
01624  */
01625 #ifndef PBUF_DEBUG
01626 #define PBUF_DEBUG                      LWIP_DBG_OFF
01627 #endif
01628 
01629 /**
01630  * API_LIB_DEBUG: Enable debugging in api_lib.c.
01631  */
01632 #ifndef API_LIB_DEBUG
01633 #define API_LIB_DEBUG                   LWIP_DBG_OFF
01634 #endif
01635 
01636 /**
01637  * API_MSG_DEBUG: Enable debugging in api_msg.c.
01638  */
01639 #ifndef API_MSG_DEBUG
01640 #define API_MSG_DEBUG                   LWIP_DBG_OFF
01641 #endif
01642 
01643 /**
01644  * SOCKETS_DEBUG: Enable debugging in sockets.c.
01645  */
01646 #ifndef SOCKETS_DEBUG
01647 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
01648 #endif
01649 
01650 /**
01651  * ICMP_DEBUG: Enable debugging in icmp.c.
01652  */
01653 #ifndef ICMP_DEBUG
01654 #define ICMP_DEBUG                      LWIP_DBG_OFF
01655 #endif
01656 
01657 /**
01658  * IGMP_DEBUG: Enable debugging in igmp.c.
01659  */
01660 #ifndef IGMP_DEBUG
01661 #define IGMP_DEBUG                      LWIP_DBG_OFF
01662 #endif
01663 
01664 /**
01665  * INET_DEBUG: Enable debugging in inet.c.
01666  */
01667 #ifndef INET_DEBUG
01668 #define INET_DEBUG                      LWIP_DBG_OFF
01669 #endif
01670 
01671 /**
01672  * IP_DEBUG: Enable debugging for IP.
01673  */
01674 #ifndef IP_DEBUG
01675 #define IP_DEBUG                        LWIP_DBG_OFF
01676 #endif
01677 
01678 /**
01679  * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
01680  */
01681 #ifndef IP_REASS_DEBUG
01682 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
01683 #endif
01684 
01685 /**
01686  * RAW_DEBUG: Enable debugging in raw.c.
01687  */
01688 #ifndef RAW_DEBUG
01689 #define RAW_DEBUG                       LWIP_DBG_OFF
01690 #endif
01691 
01692 /**
01693  * MEM_DEBUG: Enable debugging in mem.c.
01694  */
01695 #ifndef MEM_DEBUG
01696 #define MEM_DEBUG                       LWIP_DBG_OFF
01697 #endif
01698 
01699 /**
01700  * MEMP_DEBUG: Enable debugging in memp.c.
01701  */
01702 #ifndef MEMP_DEBUG
01703 #define MEMP_DEBUG                      LWIP_DBG_OFF
01704 #endif
01705 
01706 /**
01707  * SYS_DEBUG: Enable debugging in sys.c.
01708  */
01709 #ifndef SYS_DEBUG
01710 #define SYS_DEBUG                       LWIP_DBG_OFF
01711 #endif
01712 
01713 /**
01714  * TCP_DEBUG: Enable debugging for TCP.
01715  */
01716 #ifndef TCP_DEBUG
01717 #define TCP_DEBUG                       LWIP_DBG_OFF
01718 #endif
01719 
01720 /**
01721  * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
01722  */
01723 #ifndef TCP_INPUT_DEBUG
01724 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
01725 #endif
01726 
01727 /**
01728  * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
01729  */
01730 #ifndef TCP_FR_DEBUG
01731 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
01732 #endif
01733 
01734 /**
01735  * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
01736  * timeout.
01737  */
01738 #ifndef TCP_RTO_DEBUG
01739 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
01740 #endif
01741 
01742 /**
01743  * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
01744  */
01745 #ifndef TCP_CWND_DEBUG
01746 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
01747 #endif
01748 
01749 /**
01750  * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
01751  */
01752 #ifndef TCP_WND_DEBUG
01753 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
01754 #endif
01755 
01756 /**
01757  * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
01758  */
01759 #ifndef TCP_OUTPUT_DEBUG
01760 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
01761 #endif
01762 
01763 /**
01764  * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
01765  */
01766 #ifndef TCP_RST_DEBUG
01767 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
01768 #endif
01769 
01770 /**
01771  * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
01772  */
01773 #ifndef TCP_QLEN_DEBUG
01774 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
01775 #endif
01776 
01777 /**
01778  * UDP_DEBUG: Enable debugging in UDP.
01779  */
01780 #ifndef UDP_DEBUG
01781 #define UDP_DEBUG                       LWIP_DBG_OFF
01782 #endif
01783 
01784 /**
01785  * TCPIP_DEBUG: Enable debugging in tcpip.c.
01786  */
01787 #ifndef TCPIP_DEBUG
01788 #define TCPIP_DEBUG                     LWIP_DBG_OFF
01789 #endif
01790 
01791 /**
01792  * PPP_DEBUG: Enable debugging for PPP.
01793  */
01794 #ifndef PPP_DEBUG
01795 #define PPP_DEBUG                       LWIP_DBG_OFF
01796 #endif
01797 
01798 /**
01799  * SLIP_DEBUG: Enable debugging in slipif.c.
01800  */
01801 #ifndef SLIP_DEBUG
01802 #define SLIP_DEBUG                      LWIP_DBG_OFF
01803 #endif
01804 
01805 /**
01806  * DHCP_DEBUG: Enable debugging in dhcp.c.
01807  */
01808 #ifndef DHCP_DEBUG
01809 #define DHCP_DEBUG                      LWIP_DBG_OFF
01810 #endif
01811 
01812 /**
01813  * AUTOIP_DEBUG: Enable debugging in autoip.c.
01814  */
01815 #ifndef AUTOIP_DEBUG
01816 #define AUTOIP_DEBUG                    LWIP_DBG_OFF
01817 #endif
01818 
01819 /**
01820  * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
01821  */
01822 #ifndef SNMP_MSG_DEBUG
01823 #define SNMP_MSG_DEBUG                  LWIP_DBG_OFF
01824 #endif
01825 
01826 /**
01827  * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
01828  */
01829 #ifndef SNMP_MIB_DEBUG
01830 #define SNMP_MIB_DEBUG                  LWIP_DBG_OFF
01831 #endif
01832 
01833 /**
01834  * DNS_DEBUG: Enable debugging for DNS.
01835  */
01836 #ifndef DNS_DEBUG
01837 #define DNS_DEBUG                       LWIP_DBG_OFF
01838 #endif
01839 
01840 #endif /* __LWIP_OPT_H__ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines