Dependents:   SimpleLCDClock readCard2Twitter_http AnalogClock_StepperMotor_NTP ServoCamV1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lwipopts.h Source File

lwipopts.h

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 __LWIPOPTS_H__
00033 #define __LWIPOPTS_H__
00034 
00035 #include "netCfg.h"
00036 #if NET_LWIP_STACK
00037 
00038 //#include "arch/sys_arch.h"
00039 
00040 /* <sys/time.h> is included in cc.h! */
00041 #define LWIP_TIMEVAL_PRIVATE 0
00042 
00043 //#define __LWIP_DEBUG
00044 #include "dbg/dbg.h"
00045 
00046 #ifdef __LWIP_DEBUG
00047 
00048 #define LWIP_DEBUG 1
00049 
00050 #define LWIP_DBG_MIN_LEVEL 0
00051 //#define LWIP_COMPAT_SOCKETS 1
00052 #define TAPIF_DEBUG LWIP_DBG_OFF
00053 #define TUNIF_DEBUG LWIP_DBG_OFF
00054 #define UNIXIF_DEBUG LWIP_DBG_OFF
00055 #define DELIF_DEBUG LWIP_DBG_OFF
00056 #define SIO_FIFO_DEBUG LWIP_DBG_OFF
00057 #define TCPDUMP_DEBUG LWIP_DBG_OFF
00058 
00059 #define PPP_DEBUG        LWIP_DBG_OFF
00060 #define MEM_DEBUG        LWIP_DBG_OFF
00061 #define MEMP_DEBUG       LWIP_DBG_OFF
00062 #define PBUF_DEBUG       LWIP_DBG_OFF
00063 #define API_LIB_DEBUG    LWIP_DBG_OFF
00064 #define API_MSG_DEBUG    LWIP_DBG_OFF
00065 #define TCPIP_DEBUG      LWIP_DBG_OFF
00066 #define NETIF_DEBUG      LWIP_DBG_OFF
00067 #define SOCKETS_DEBUG    LWIP_DBG_OFF
00068 #define DEMO_DEBUG       LWIP_DBG_OFF
00069 #define IP_DEBUG         LWIP_DBG_OFF
00070 #define IP_REASS_DEBUG   LWIP_DBG_OFF
00071 #define RAW_DEBUG        LWIP_DBG_OFF
00072 #define ICMP_DEBUG       LWIP_DBG_OFF
00073 #define UDP_DEBUG        LWIP_DBG_OFF
00074 #define TCP_DEBUG        LWIP_DBG_OFF
00075 #define TCP_INPUT_DEBUG  LWIP_DBG_OFF
00076 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
00077 #define TCP_RTO_DEBUG    LWIP_DBG_OFF
00078 #define TCP_CWND_DEBUG   LWIP_DBG_OFF
00079 #define TCP_WND_DEBUG    LWIP_DBG_OFF
00080 #define TCP_FR_DEBUG     LWIP_DBG_OFF
00081 #define TCP_QLEN_DEBUG   LWIP_DBG_OFF
00082 #define TCP_RST_DEBUG    LWIP_DBG_OFF
00083 
00084 #endif
00085 
00086 /*
00087 extern unsigned char debug_flags;
00088 #define LWIP_DBG_TYPES_ON debug_flags
00089 */
00090 #define NO_SYS                     1
00091 #define LWIP_SOCKET                (NO_SYS==0)
00092 #define LWIP_NETCONN               (NO_SYS==0)
00093 
00094 
00095 #define IP_FRAG_USES_STATIC_BUF         0
00096 
00097 
00098 
00099 /* ---------- Memory options ---------- */
00100 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
00101    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
00102    byte alignment -> define MEM_ALIGNMENT to 2. */
00103 /* MSVC port: intel processors don't need 4-byte alignment,
00104    but are faster that way! */
00105 #define MEM_ALIGNMENT           4
00106 
00107 /* MEM_SIZE: the size of the heap memory. If the application will send
00108 a lot of data that needs to be copied, this should be set high. */
00109 //#define MEM_SIZE               10240 
00110 #define MEM_SIZE               2000//5000 
00111 
00112 ///
00113 #define MEM_POSITION __attribute((section("AHBSRAM0")))
00114 
00115 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
00116    sends a lot of data out of ROM (or other static memory), this
00117    should be set high. */
00118 #define MEMP_NUM_PBUF           16
00119 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One
00120    per active RAW "connection". */
00121 //#define MEMP_NUM_RAW_PCB        3
00122 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00123    per active UDP "connection". */
00124 #define MEMP_NUM_UDP_PCB        4
00125 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
00126    connections. */
00127 #define MEMP_NUM_TCP_PCB        3
00128 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
00129    connections. */
00130 #define MEMP_NUM_TCP_PCB_LISTEN 2//4
00131 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
00132    segments. */
00133 #define MEMP_NUM_TCP_SEG        16
00134 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
00135    timeouts. */
00136 #define MEMP_NUM_SYS_TIMEOUT    12
00137 
00138 /* The following four are used only with the sequential API and can be
00139    set to 0 if the application only will use the raw API. */
00140 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
00141 #define MEMP_NUM_NETBUF         0
00142 /* MEMP_NUM_NETCONN: the number of struct netconns. */
00143 #define MEMP_NUM_NETCONN        0
00144 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
00145    for sequential API communication and incoming packets. Used in
00146    src/api/tcpip.c. */
00147 #define MEMP_NUM_TCPIP_MSG_API   0
00148 #define MEMP_NUM_TCPIP_MSG_INPKT 0
00149 
00150 /* ---------- Pbuf options ---------- */
00151 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
00152 #define PBUF_POOL_SIZE          8//16//100
00153 
00154 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
00155 #define PBUF_POOL_BUFSIZE       128
00156 
00157 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00158    link level header. */
00159 //#define PBUF_LINK_HLEN          16 
00160 
00161 /** SYS_LIGHTWEIGHT_PROT
00162  * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
00163  * for certain critical regions during buffer allocation, deallocation and memory
00164  * allocation and deallocation.
00165  */
00166 #define SYS_LIGHTWEIGHT_PROT           0 //No sys here
00167 
00168 /* ---------- TCP options ---------- */
00169 #define LWIP_TCP                1
00170 #define TCP_TTL                 255
00171 
00172 /* Controls if TCP should queue segments that arrive out of
00173    order. Define to 0 if your device is low on memory. */
00174 #define TCP_QUEUE_OOSEQ         0
00175 
00176 /* TCP Maximum segment size. */
00177 //#define TCP_MSS                 1024
00178 #define TCP_MSS                   0x276//536//0x276
00179 
00180 /* TCP sender buffer space (bytes). */
00181 #define TCP_SND_BUF             2048
00182 
00183 /* TCP sender buffer space (pbufs). This must be at least = 2 *
00184    TCP_SND_BUF/TCP_MSS for things to work. */
00185 #define TCP_SND_QUEUELEN        (4 * TCP_SND_BUF/TCP_MSS)
00186 
00187 /* TCP writable space (bytes). This must be less than or equal
00188    to TCP_SND_BUF. It is the amount of space which must be
00189    available in the tcp snd_buf for select to return writable */
00190 #define TCP_SNDLOWAT        (TCP_SND_BUF/2)
00191 
00192 /* TCP receive window. */
00193 #define TCP_WND        1024         //8096
00194 
00195 /* Maximum number of retransmissions of data segments. */
00196 //#define TCP_MAXRTX              12
00197 
00198 /* Maximum number of retransmissions of SYN segments. */
00199 //#define TCP_SYNMAXRTX           4
00200 
00201 /* ---------- ARP options ---------- */
00202 #define LWIP_ARP                (NET_ETH | NET_ZG2100)
00203 #define ARP_TABLE_SIZE          2//4//10
00204 #define ARP_QUEUEING            0//1
00205 #define ETHARP_TRUST_IP_MAC     1
00206 
00207 /* ---------- IP options ---------- */
00208 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
00209    IP packets across network interfaces. If you are going to run lwIP
00210    on a device with only one network interface, define this to 0. */
00211 #define IP_FORWARD              0
00212 
00213 
00214 /* IP reassembly and segmentation.These are orthogonal even
00215  * if they both deal with IP fragments */
00216  /*
00217 #define IP_REASSEMBLY     1
00218 #define IP_REASS_MAX_PBUFS      10
00219 #define MEMP_NUM_REASSDATA      10
00220 #define IP_FRAG           1
00221 */
00222 /* ---------- ICMP options ---------- */
00223 #define ICMP_TTL                255
00224 
00225 /* ---------- DHCP options ---------- */
00226 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
00227    interfaces. */
00228 #define LWIP_DHCP               (NET_ETH | NET_ZG2100)
00229 
00230 /* 1 if you want to do an ARP check on the offered address
00231    (recommended if using DHCP). */
00232 #define DHCP_DOES_ARP_CHECK     (LWIP_DHCP)
00233 
00234 /* ---------- AUTOIP options ------- */
00235 #define LWIP_AUTOIP             0
00236 
00237 /* ---------- SNMP options ---------- */
00238 /** @todo SNMP is experimental for now
00239     @note UDP must be available for SNMP transport */
00240 #ifndef LWIP_SNMP
00241 #define LWIP_SNMP               0
00242 #endif
00243 
00244 
00245 #ifndef SNMP_PRIVATE_MIB
00246 #define SNMP_PRIVATE_MIB        0
00247 #endif
00248 
00249 
00250 /* ---------- UDP options ---------- */
00251 #define LWIP_UDP                1
00252 #define UDP_TTL                 255
00253 
00254 /* ---------- DNS options ---------- */
00255 #define LWIP_DNS                1
00256 
00257 /* ---------- RAW options ---------- */
00258 #define LWIP_RAW                0
00259 #define RAW_TTL                 255
00260 
00261 /* ---------- Statistics options ---------- */
00262 /* individual STATS options can be turned off by defining them to 0 
00263  * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS
00264  * is 0
00265  * */
00266 
00267 #define LWIP_STATS    0
00268 
00269 /* ---------- PPP options ---------- */
00270 
00271 #define PPP_SUPPORT      NET_PPP      /* Set > 0 for PPP */
00272 
00273 #if PPP_SUPPORT > 0
00274 
00275 #define NUM_PPP 1           /* Max PPP sessions. */
00276 
00277 
00278 /* Select modules to enable.  Ideally these would be set in the makefile but
00279  * we're limited by the command line length so you need to modify the settings
00280  * in this file.
00281  */
00282 #define PAP_SUPPORT      1      /* Set > 0 for PAP. */
00283 #define CHAP_SUPPORT     1      /* Set > 0 for CHAP. */
00284 #define MSCHAP_SUPPORT   0      /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
00285 #define CBCP_SUPPORT     0      /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
00286 #define CCP_SUPPORT      0      /* Set > 0 for CCP (NOT FUNCTIONAL!) */
00287 #define VJ_SUPPORT       1      /* Set > 0 for VJ header compression. */
00288 #define MD5_SUPPORT      1      /* Set > 0 for MD5 (see also CHAP) */
00289 
00290 
00291 /*
00292  * Timeouts.
00293  */
00294 #define FSM_DEFTIMEOUT        6    /* Timeout time in seconds */
00295 #define FSM_DEFMAXTERMREQS    2    /* Maximum Terminate-Request transmissions */
00296 #define FSM_DEFMAXCONFREQS    10    /* Maximum Configure-Request transmissions */
00297 #define FSM_DEFMAXNAKLOOPS    5    /* Maximum number of nak loops */
00298 
00299 #define UPAP_DEFTIMEOUT        6    /* Timeout (seconds) for retransmitting req */
00300 #define UPAP_DEFREQTIME        30    /* Time to wait for auth-req from peer */
00301 
00302 #define CHAP_DEFTIMEOUT        6    /* Timeout time in seconds */
00303 #define CHAP_DEFTRANSMITS    10    /* max # times to send challenge */
00304 
00305 
00306 /* Interval in seconds between keepalive echo requests, 0 to disable. */
00307 #if 1
00308 #define LCP_ECHOINTERVAL 0
00309 #else
00310 
00311 #define LCP_ECHOINTERVAL 10
00312 #endif
00313 
00314 
00315 /* Number of unanswered echo requests before failure. */
00316 #define LCP_MAXECHOFAILS 3
00317 
00318 /* Max Xmit idle time (in jiffies) before resend flag char. */
00319 #define PPP_MAXIDLEFLAG 100
00320 
00321 /*
00322  * Packet sizes
00323  *
00324  * Note - lcp shouldn't be allowed to negotiate stuff outside these
00325  *    limits.  See lcp.h in the pppd directory.
00326  * (XXX - these constants should simply be shared by lcp.c instead
00327  *    of living in lcp.h)
00328  */
00329 #define PPP_MTU     1500     /* Default MTU (size of Info field) */
00330 #if 0
00331 #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN)
00332 #else
00333 
00334 #define PPP_MAXMTU  1500 /* Largest MTU we allow */
00335 #endif
00336 
00337 #define PPP_MINMTU  64
00338 #define PPP_MRU     1500     /* default MRU = max length of info field */
00339 #define PPP_MAXMRU  1500     /* Largest MRU we allow */
00340 #define PPP_DEFMRU    296        /* Try for this */
00341 #define PPP_MINMRU    128        /* No MRUs below this */
00342 
00343 
00344 #define MAXNAMELEN      64     /* max length of hostname or name for auth */
00345 #define MAXSECRETLEN    64     /* max length of password or secret */
00346 
00347 #endif /* PPP_SUPPORT > 0 */
00348 
00349 //C++ Compat
00350 #define try vTry
00351 
00352 #endif
00353 
00354 
00355 #endif /* __LWIPOPTS_H__ */