Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

opt.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
00003  * All rights reserved. 
00004  * 
00005  * Redistribution and use in source and binary forms, with or without modification, 
00006  * are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright notice,
00009  *    this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright notice,
00011  *    this list of conditions and the following disclaimer in the documentation
00012  *    and/or other materials provided with the distribution.
00013  * 3. The name of the author may not be used to endorse or promote products
00014  *    derived from this software without specific prior written permission. 
00015  *
00016  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
00017  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00018  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
00019  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00020  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
00021  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
00024  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
00025  * OF SUCH DAMAGE.
00026  *
00027  * This file is part of the lwIP TCP/IP stack.
00028  * 
00029  * Author: Adam Dunkels <adam@sics.se>
00030  *
00031  */
00032 #ifndef __LWIP_OPT_H__
00033 #define __LWIP_OPT_H__
00034 
00035 #include "lwip/debug.h"
00036 /* Include user defined options first */
00037 #include "rtl_lwipopts.h"
00038 
00039 /* Define default values for unconfigured parameters. */
00040 
00041 /* Platform specific locking */
00042 
00043 /*
00044  * enable SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
00045  * for certain critical regions during buffer allocation, deallocation and memory
00046  * allocation and deallocation.
00047  */
00048 #ifndef SYS_LIGHTWEIGHT_PROT
00049 #define SYS_LIGHTWEIGHT_PROT           0
00050 #endif
00051 
00052 #ifndef LWIP_PROVIDE_ERRNO
00053 #define LWIP_PROVIDE_ERRNO 1
00054 #endif
00055 
00056 #ifndef NO_SYS
00057 #define NO_SYS 0
00058 #endif
00059 /* ---------- Memory options ---------- */
00060 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
00061    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
00062    byte alignment -> define MEM_ALIGNMENT to 2. */
00063 
00064 #ifndef MEM_ALIGNMENT
00065 #define MEM_ALIGNMENT           1
00066 #endif
00067 
00068 /* MEM_SIZE: the size of the heap memory. If the application will send
00069 a lot of data that needs to be copied, this should be set high. */
00070 #ifndef MEM_SIZE
00071 #define MEM_SIZE                1600
00072 #endif
00073 
00074 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
00075    sends a lot of data out of ROM (or other static memory), this
00076    should be set high. */
00077 #ifndef MEMP_NUM_PBUF
00078 #define MEMP_NUM_PBUF           16
00079 #endif
00080 
00081 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00082    per active UDP "connection". */
00083 #ifndef MEMP_NUM_UDP_PCB
00084 #define MEMP_NUM_UDP_PCB        4
00085 #endif
00086 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
00087    connections. */
00088 #ifndef MEMP_NUM_TCP_PCB
00089 #define MEMP_NUM_TCP_PCB        5
00090 #endif
00091 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
00092    connections. */
00093 #ifndef MEMP_NUM_TCP_PCB_LISTEN
00094 #define MEMP_NUM_TCP_PCB_LISTEN 8
00095 #endif
00096 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
00097    segments. */
00098 #ifndef MEMP_NUM_TCP_SEG
00099 #define MEMP_NUM_TCP_SEG        16
00100 #endif
00101 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
00102    timeouts. */
00103 #ifndef MEMP_NUM_SYS_TIMEOUT
00104 #define MEMP_NUM_SYS_TIMEOUT    3
00105 #endif
00106 
00107 /* The following four are used only with the sequential API and can be
00108    set to 0 if the application only will use the raw API. */
00109 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
00110 #ifndef MEMP_NUM_NETBUF
00111 #define MEMP_NUM_NETBUF         2
00112 #endif
00113 /* MEMP_NUM_NETCONN: the number of struct netconns. */
00114 #ifndef MEMP_NUM_NETCONN
00115 #define MEMP_NUM_NETCONN        4
00116 #endif
00117 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for
00118    communication between the TCP/IP stack and the sequential
00119    programs. */
00120 #ifndef MEMP_NUM_API_MSG
00121 #define MEMP_NUM_API_MSG        8
00122 #endif
00123 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
00124    for sequential API communication and incoming packets. Used in
00125    src/api/tcpip.c. */
00126 #ifndef MEMP_NUM_TCPIP_MSG
00127 #define MEMP_NUM_TCPIP_MSG      8
00128 #endif
00129 
00130 /* ---------- Pbuf options ---------- */
00131 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
00132 
00133 #ifndef PBUF_POOL_SIZE
00134 #define PBUF_POOL_SIZE          16
00135 #endif
00136 
00137 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
00138 
00139 #ifndef PBUF_POOL_BUFSIZE
00140 #define PBUF_POOL_BUFSIZE       128
00141 #endif
00142 
00143 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00144    link level header. */
00145 
00146 #ifndef PBUF_LINK_HLEN
00147 #define PBUF_LINK_HLEN          0
00148 #endif
00149 
00150 
00151 
00152 /* ---------- ARP options ---------- */
00153 
00155 #ifndef ARP_TABLE_SIZE
00156 #define ARP_TABLE_SIZE 10
00157 #endif
00158 
00163 #ifndef ARP_QUEUEING
00164 #define ARP_QUEUEING 1
00165 #endif
00166 
00172 #ifndef ETHARP_ALWAYS_INSERT
00173 #define ETHARP_ALWAYS_INSERT 1
00174 #endif
00175 
00176 /* ---------- IP options ---------- */
00177 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
00178    IP packets across network interfaces. If you are going to run lwIP
00179    on a device with only one network interface, define this to 0. */
00180 #ifndef IP_FORWARD
00181 #define IP_FORWARD              0
00182 #endif
00183 
00184 /* If defined to 1, IP options are allowed (but not parsed). If
00185    defined to 0, all packets with IP options are dropped. */
00186 #ifndef IP_OPTIONS
00187 #define IP_OPTIONS              1
00188 #endif
00189 
00196 #ifndef IP_REASSEMBLY
00197 #define IP_REASSEMBLY     1
00198 #endif
00199 
00201 #ifndef IP_FRAG
00202 #define IP_FRAG           1
00203 #endif
00204 
00205 /* ---------- ICMP options ---------- */
00206 
00207 #ifndef ICMP_TTL
00208 #define ICMP_TTL                255
00209 #endif
00210 
00211 /* ---------- DHCP options ---------- */
00212 
00213 #ifndef LWIP_DHCP
00214 #define LWIP_DHCP               0
00215 #endif
00216 
00217 /* 1 if you want to do an ARP check on the offered address
00218    (recommended). */
00219 #ifndef DHCP_DOES_ARP_CHECK
00220 #define DHCP_DOES_ARP_CHECK     1
00221 #endif
00222 
00223 /* ---------- UDP options ---------- */
00224 #ifndef LWIP_UDP
00225 #define LWIP_UDP                1
00226 #endif
00227 
00228 #ifndef UDP_TTL
00229 #define UDP_TTL                 255
00230 #endif
00231 
00232 /* ---------- TCP options ---------- */
00233 #ifndef LWIP_TCP
00234 #define LWIP_TCP                1
00235 #endif
00236 
00237 #ifndef TCP_TTL
00238 #define TCP_TTL                 255
00239 #endif
00240 
00241 #ifndef TCP_WND
00242 #define TCP_WND                 2048
00243 #endif 
00244 
00245 #ifndef TCP_MAXRTX
00246 #define TCP_MAXRTX              12
00247 #endif
00248 
00249 #ifndef TCP_SYNMAXRTX
00250 #define TCP_SYNMAXRTX           6
00251 #endif
00252 
00253 
00254 /* Controls if TCP should queue segments that arrive out of
00255    order. Define to 0 if your device is low on memory. */
00256 #ifndef TCP_QUEUE_OOSEQ
00257 #define TCP_QUEUE_OOSEQ         1
00258 #endif
00259 
00260 /* TCP Maximum segment size. */
00261 #ifndef TCP_MSS
00262 #define TCP_MSS                 128 /* A *very* conservative default. */
00263 #endif
00264 
00265 /* TCP sender buffer space (bytes). */
00266 #ifndef TCP_SND_BUF
00267 #define TCP_SND_BUF             256
00268 #endif
00269 
00270 /* TCP sender buffer space (pbufs). This must be at least = 2 *
00271    TCP_SND_BUF/TCP_MSS for things to work. */
00272 #ifndef TCP_SND_QUEUELEN
00273 #define TCP_SND_QUEUELEN        4 * TCP_SND_BUF/TCP_MSS
00274 #endif
00275 
00276 
00277 /* Maximum number of retransmissions of data segments. */
00278 
00279 /* Maximum number of retransmissions of SYN segments. */
00280 
00281 /* TCP writable space (bytes). This must be less than or equal
00282    to TCP_SND_BUF. It is the amount of space which must be
00283    available in the tcp snd_buf for select to return writable */
00284 #ifndef TCP_SNDLOWAT
00285 #define TCP_SNDLOWAT            TCP_SND_BUF/2
00286 #endif
00287 
00288 
00289 
00290 
00291 #ifndef LWIP_EVENT_API
00292 #define LWIP_EVENT_API    0
00293 #define LWIP_CALLBACK_API 1
00294 #else 
00295 #define LWIP_EVENT_API    1
00296 #define LWIP_CALLBACK_API 0
00297 #endif 
00298 
00299 #ifndef LWIP_COMPAT_SOCKETS
00300 #define LWIP_COMPAT_SOCKETS     1
00301 #endif
00302 
00303 
00304 #ifndef TCPIP_THREAD_PRIO
00305 #define TCPIP_THREAD_PRIO 1
00306 #endif
00307 
00308 #ifndef SLIPIF_THREAD_PRIO
00309 #define SLIPIF_THREAD_PRIO 1
00310 #endif
00311 
00312 #ifndef PPP_THREAD_PRIO
00313 #define PPP_THREAD_PRIO 1
00314 #endif
00315 
00316 #ifndef DEFAULT_THREAD_PRIO
00317 #define DEFAULT_THREAD_PRIO 1
00318 #endif
00319 /* ---------- Statistics options ---------- */
00320 #ifndef LWIP_STATS
00321 #define LWIP_STATS      1
00322 #endif
00323 
00324 #if LWIP_STATS
00325 
00326 #define LINK_STATS
00327 #define IP_STATS
00328 #define ICMP_STATS
00329 #define UDP_STATS
00330 #define TCP_STATS
00331 #define MEM_STATS
00332 #define MEMP_STATS
00333 #define PBUF_STATS
00334 #define SYS_STATS
00335 
00336 #endif /* LWIP_STATS */
00337 
00338 /* ---------- PPP options ---------- */
00339 
00340 #ifndef PPP_SUPPORT
00341 #define PPP_SUPPORT      0      /* Set for PPP */
00342 #endif
00343 
00344 #if PPP_SUPPORT 
00345 
00346 #define NUM_PPP 1           /* Max PPP sessions. */
00347 
00348 
00349 
00350 #ifndef PAP_SUPPORT
00351 #define PAP_SUPPORT      0      /* Set for PAP. */
00352 #endif
00353 
00354 #ifndef CHAP_SUPPORT
00355 #define CHAP_SUPPORT     0      /* Set for CHAP. */
00356 #endif
00357 
00358 #define MSCHAP_SUPPORT   0      /* Set for MSCHAP (NOT FUNCTIONAL!) */
00359 #define CBCP_SUPPORT     0      /* Set for CBCP (NOT FUNCTIONAL!) */
00360 #define CCP_SUPPORT      0      /* Set for CCP (NOT FUNCTIONAL!) */
00361 
00362 #ifndef VJ_SUPPORT
00363 #define VJ_SUPPORT       0      /* Set for VJ header compression. */
00364 #endif
00365 
00366 #ifndef MD5_SUPPORT
00367 #define MD5_SUPPORT      0      /* Set for MD5 (see also CHAP) */
00368 #endif
00369 
00370 
00371 /*
00372  * Timeouts.
00373  */
00374 #define FSM_DEFTIMEOUT          6       /* Timeout time in seconds */
00375 #define FSM_DEFMAXTERMREQS      2       /* Maximum Terminate-Request transmissions */
00376 #define FSM_DEFMAXCONFREQS      10      /* Maximum Configure-Request transmissions */
00377 #define FSM_DEFMAXNAKLOOPS      5       /* Maximum number of nak loops */
00378 
00379 #define UPAP_DEFTIMEOUT         6       /* Timeout (seconds) for retransmitting req */
00380 #define UPAP_DEFREQTIME         30      /* Time to wait for auth-req from peer */
00381 
00382 #define CHAP_DEFTIMEOUT         6       /* Timeout time in seconds */
00383 #define CHAP_DEFTRANSMITS       10      /* max # times to send challenge */
00384 
00385 
00386 /* Interval in seconds between keepalive echo requests, 0 to disable. */
00387 #if 1
00388 #define LCP_ECHOINTERVAL 0
00389 #else
00390 #define LCP_ECHOINTERVAL 10
00391 #endif
00392 
00393 /* Number of unanswered echo requests before failure. */
00394 #define LCP_MAXECHOFAILS 3
00395 
00396 /* Max Xmit idle time (in jiffies) before resend flag char. */
00397 #define PPP_MAXIDLEFLAG 100
00398 
00399 /*
00400  * Packet sizes
00401  *
00402  * Note - lcp shouldn't be allowed to negotiate stuff outside these
00403  *    limits.  See lcp.h in the pppd directory.
00404  * (XXX - these constants should simply be shared by lcp.c instead
00405  *    of living in lcp.h)
00406  */
00407 #define PPP_MTU     1500     /* Default MTU (size of Info field) */
00408 #if 0
00409 #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN)
00410 #else
00411 #define PPP_MAXMTU  1500 /* Largest MTU we allow */
00412 #endif
00413 #define PPP_MINMTU  64
00414 #define PPP_MRU     1500     /* default MRU = max length of info field */
00415 #define PPP_MAXMRU  1500     /* Largest MRU we allow */
00416 #define PPP_DEFMRU      296             /* Try for this */
00417 #define PPP_MINMRU      128             /* No MRUs below this */
00418 
00419 
00420 #define MAXNAMELEN      256     /* max length of hostname or name for auth */
00421 #define MAXSECRETLEN    256     /* max length of password or secret */
00422 
00423 #endif /* PPP_SUPPORT */
00424 
00425 
00426 /* Debugging options all default to off */
00427 
00428 #ifndef DBG_TYPES_ON
00429 #define DBG_TYPES_ON 0
00430 #endif
00431 
00432 #ifndef DEMO_DEBUG
00433 #define DEMO_DEBUG      DBG_OFF
00434 #endif
00435 
00436 #ifndef ETHARP_DEBUG
00437 #define ETHARP_DEBUG     DBG_OFF
00438 #endif
00439 
00440 #ifndef NETIF_DEBUG
00441 #define NETIF_DEBUG      DBG_OFF
00442 #endif
00443 
00444 #ifndef PBUF_DEBUG
00445 #define PBUF_DEBUG       DBG_OFF
00446 #endif
00447 
00448 #ifndef API_LIB_DEBUG
00449 #define API_LIB_DEBUG    DBG_OFF
00450 #endif
00451 
00452 #ifndef API_MSG_DEBUG
00453 #define API_MSG_DEBUG    DBG_OFF
00454 #endif
00455 
00456 #ifndef SOCKETS_DEBUG
00457 #define SOCKETS_DEBUG    DBG_OFF
00458 #endif
00459 
00460 #ifndef ICMP_DEBUG
00461 #define ICMP_DEBUG       DBG_ON
00462 #endif
00463 
00464 #ifndef INET_DEBUG
00465 #define INET_DEBUG       DBG_OFF
00466 #endif
00467 
00468 #ifndef IP_DEBUG
00469 #define IP_DEBUG         DBG_OFF
00470 #endif
00471 
00472 #ifndef IP_REASS_DEBUG
00473 #define IP_REASS_DEBUG   DBG_OFF
00474 #endif
00475 
00476 #ifndef MEM_DEBUG
00477 #define MEM_DEBUG        DBG_OFF
00478 #endif
00479 
00480 #ifndef MEMP_DEBUG
00481 #define MEMP_DEBUG       DBG_OFF
00482 #endif
00483 
00484 #ifndef SYS_DEBUG
00485 #define SYS_DEBUG        DBG_OFF
00486 #endif
00487 
00488 #ifndef TCP_DEBUG
00489 #define TCP_DEBUG        DBG_OFF
00490 #endif
00491 
00492 #ifndef TCP_INPUT_DEBUG
00493 #define TCP_INPUT_DEBUG  DBG_OFF
00494 #endif
00495 
00496 #ifndef TCP_FR_DEBUG
00497 #define TCP_FR_DEBUG     DBG_OFF
00498 #endif
00499 
00500 #ifndef TCP_RTO_DEBUG
00501 #define TCP_RTO_DEBUG    DBG_OFF
00502 #endif
00503 
00504 #ifndef TCP_REXMIT_DEBUG
00505 #define TCP_REXMIT_DEBUG DBG_OFF
00506 #endif
00507 
00508 #ifndef TCP_CWND_DEBUG
00509 #define TCP_CWND_DEBUG   DBG_OFF
00510 #endif
00511 
00512 #ifndef TCP_WND_DEBUG
00513 #define TCP_WND_DEBUG    DBG_OFF
00514 #endif
00515 
00516 #ifndef TCP_OUTPUT_DEBUG
00517 #define TCP_OUTPUT_DEBUG DBG_OFF
00518 #endif
00519 
00520 #ifndef TCP_RST_DEBUG
00521 #define TCP_RST_DEBUG    DBG_OFF
00522 #endif
00523 
00524 #ifndef TCP_QLEN_DEBUG
00525 #define TCP_QLEN_DEBUG   DBG_OFF
00526 #endif
00527 
00528 #ifndef UDP_DEBUG
00529 #define UDP_DEBUG        DBG_OFF
00530 #endif
00531 
00532 #ifndef TCPIP_DEBUG
00533 #define TCPIP_DEBUG      DBG_OFF
00534 #endif
00535 
00536 #ifndef SLIP_DEBUG 
00537 #define SLIP_DEBUG       DBG_OFF
00538 #endif
00539 
00540 #ifndef DHCP_DEBUG 
00541 #define DHCP_DEBUG       DBG_OFF
00542 #endif
00543 
00544 
00545 #ifndef DBG_MIN_LEVEL
00546 #define DBG_MIN_LEVEL DBG_LEVEL_OFF
00547 #endif
00548 
00549 #endif /* __LWIP_OPT_H__ */
00550 
00551 
00552 

Generated on Wed Jan 14 12:58:56 2004 for RTL-lwIP-0.4 by doxygen 1.3.4