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