casiotone 401 / Bonjour

Dependents:   OSCtoCVConverter

Fork of Bonjour by Dirk-Willem van Gulik (NXP/mbed)

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 0
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 #define ETHARP_DEBUG     LWIP_DBG_OFF
00084 #define DNS_DEBUG        LWIP_DBG_OFF
00085 
00086 #endif
00087 
00088 /*
00089 extern unsigned char debug_flags;
00090 #define LWIP_DBG_TYPES_ON debug_flags
00091 */
00092 #define NO_SYS                     1
00093 
00094 #define LWIP_SOCKET                (NO_SYS==0)
00095 #define LWIP_NETCONN               (NO_SYS==0)
00096 
00097 
00098 /* ---------- Memory options ---------- */
00099 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
00100    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
00101    byte alignment -> define MEM_ALIGNMENT to 2. */
00102 /* MSVC port: intel processors don't need 4-byte alignment,
00103    but are faster that way! */
00104 #define MEM_ALIGNMENT           4
00105 
00106 /* MEM_SIZE: the size of the heap memory. If the application will send
00107 a lot of data that needs to be copied, this should be set high. */
00108 //#define MEM_SIZE               10240 
00109 
00110 #if TARGET_LPC1768
00111 
00112 
00113 #define MEM_SIZE                13876 //2000
00114 
00115 #define CHECKSUM_GEN_UDP        0
00116 #define CHECKSUM_GEN_TCP        0
00117 #define CHECKSUM_CHECK_IP       0
00118 #define CHECKSUM_CHECK_UDP      0
00119 #define CHECKSUM_CHECK_TCP      0
00120 
00121 #define LWIP_RAW                0
00122 #define LWIP_ARP                1
00123 #define LWIP_CALLBACK_API       1
00124 #define MEM_LIBC_MALLOC         1 //had to set this to avoid malloc issues
00125 #define MEMP_MEM_MALLOC         1
00126 #define ARP_QUEUEING            0
00127 #define ARP_TABLE_SIZE          4
00128 #define IP_FRAG_USES_STATIC_BUF 1
00129 
00130 
00131 #define LWIP_NETIF_HWADDRHINT        1
00132 #define LWIP_USE_HEAP_FROM_INTERRUPT 0
00133 ///
00134 
00135 #define MEM_POSITION __attribute((section("AHBSRAM1"),aligned))
00136 
00137 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
00138    sends a lot of data out of ROM (or other static memory), this
00139    should be set high. */
00140 #define MEMP_NUM_PBUF           32
00141 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One
00142    per active RAW "connection". */
00143 //#define MEMP_NUM_RAW_PCB        3
00144 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00145    per active UDP "connection". */
00146 #define MEMP_NUM_UDP_PCB        5
00147 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
00148    connections. */
00149 #define MEMP_NUM_TCP_PCB        3
00150 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
00151    connections. */
00152 #define MEMP_NUM_TCP_PCB_LISTEN 2//4
00153 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
00154    segments. */
00155 #define MEMP_NUM_TCP_SEG        16
00156 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
00157    timeouts. */
00158 #define MEMP_NUM_SYS_TIMEOUT    12
00159 
00160 /* The following four are used only with the sequential API and can be
00161    set to 0 if the application only will use the raw API. */
00162 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
00163 #define MEMP_NUM_NETBUF         0
00164 /* MEMP_NUM_NETCONN: the number of struct netconns. */
00165 #define MEMP_NUM_NETCONN        6
00166 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
00167    for sequential API communication and incoming packets. Used in
00168    src/api/tcpip.c. */
00169 #define MEMP_NUM_TCPIP_MSG_API   0
00170 #define MEMP_NUM_TCPIP_MSG_INPKT 4
00171 
00172 /* ---------- Pbuf options ---------- */
00173 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
00174 //#define PBUF_POOL_SIZE          60//100
00175 
00176 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
00177 #define PBUF_POOL_BUFSIZE       768
00178 
00179 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00180    link level header. */
00181 #define PBUF_LINK_HLEN          (14 + ETH_PAD_SIZE)
00182 
00183 /** SYS_LIGHTWEIGHT_PROT
00184  * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
00185  * for certain critical regions during buffer allocation, deallocation and memory
00186  * allocation and deallocation.
00187  */
00188 #define SYS_LIGHTWEIGHT_PROT           0 //No sys here
00189 
00190 /* ---------- TCP options ---------- */
00191 #define LWIP_TCP                1
00192 #define TCP_TTL                 255
00193 
00194 /* Controls if TCP should queue segments that arrive out of
00195    order. Define to 0 if your device is low on memory. */
00196 #define TCP_QUEUE_OOSEQ         0
00197 
00198 /* TCP Maximum segment size. */
00199 //#define TCP_MSS                 1024
00200 #define TCP_MSS                   256//1024//536//0x276
00201 
00202 /* TCP sender buffer space (bytes). */
00203 #define TCP_SND_BUF             1024
00204 
00205 /* TCP sender buffer space (pbufs). This must be at least = 2 *
00206    TCP_SND_BUF/TCP_MSS for things to work. */
00207 #define TCP_SND_QUEUELEN        (2 * TCP_SND_BUF/TCP_MSS)
00208 
00209 /* TCP writable space (bytes). This must be less than or equal
00210    to TCP_SND_BUF. It is the amount of space which must be
00211    available in the tcp snd_buf for select to return writable */
00212 #define TCP_SNDLOWAT        (TCP_SND_BUF/2)
00213 
00214 /* TCP receive window. */
00215 #define TCP_WND        1024         //8096
00216 
00217 /* Maximum number of retransmissions of data segments. */
00218 //#define TCP_MAXRTX              12
00219 
00220 /* Maximum number of retransmissions of SYN segments. */
00221 //#define TCP_SYNMAXRTX           4
00222 /* Max Xmit idle time (in jiffies) before resend flag char. */
00223 #define PPP_MAXIDLEFLAG 0//Send it every time//100
00224 
00225 /*
00226  * Packet sizes
00227  *
00228  * Note - lcp shouldn't be allowed to negotiate stuff outside these
00229  *    limits.  See lcp.h in the pppd directory.
00230  * (XXX - these constants should simply be shared by lcp.c instead
00231  *    of living in lcp.h)
00232  */
00233 #define PPP_MTU     1500     /* Default MTU (size of Info field) */
00234 #if 0
00235 #define PPP_MAXMTU  65535 - (PPP_HDRLEN + PPP_FCSLEN)
00236 #else
00237 
00238 #define PPP_MAXMTU  1500 /* Largest MTU we allow */
00239 #endif
00240 
00241 #define PPP_MINMTU  64
00242 #define PPP_MRU     1500     /* default MRU = max length of info field */
00243 #define PPP_MAXMRU  1500     /* Largest MRU we allow */
00244 #define PPP_DEFMRU    296        /* Try for this */
00245 #define PPP_MINMRU    128        /* No MRUs below this */
00246 
00247 
00248 #define MAXNAMELEN      256     /* max length of hostname or name for auth */
00249 #define MAXSECRETLEN    256     /* max length of password or secret */
00250 
00251 #endif /* PPP_SUPPORT > 0 */
00252 
00253 #elif TARGET_LPC2368
00254 
00255 #define MEM_POSITION __attribute((section("AHBSRAM1")))
00256 
00257 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
00258    sends a lot of data out of ROM (or other static memory), this
00259    should be set high. */
00260 #define MEMP_NUM_PBUF           64
00261 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One
00262    per active RAW "connection". */
00263 //#define MEMP_NUM_RAW_PCB        3
00264 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
00265    per active UDP "connection". */
00266 #define MEMP_NUM_UDP_PCB        2
00267 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
00268    connections. */
00269 #define MEMP_NUM_TCP_PCB        2
00270 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
00271    connections. */
00272 #define MEMP_NUM_TCP_PCB_LISTEN 2//4
00273 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
00274    segments. */
00275 #define MEMP_NUM_TCP_SEG        8
00276 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
00277    timeouts. */
00278 #define MEMP_NUM_SYS_TIMEOUT    12
00279 
00280 /* The following four are used only with the sequential API and can be
00281    set to 0 if the application only will use the raw API. */
00282 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
00283 #define MEMP_NUM_NETBUF         0
00284 /* MEMP_NUM_NETCONN: the number of struct netconns. */
00285 #define MEMP_NUM_NETCONN        0
00286 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
00287    for sequential API communication and incoming packets. Used in
00288    src/api/tcpip.c. */
00289 #define MEMP_NUM_TCPIP_MSG_API   0
00290 #define MEMP_NUM_TCPIP_MSG_INPKT 0
00291 
00292 /* ---------- Pbuf options ---------- */
00293 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
00294 #define PBUF_POOL_SIZE          8//16//100
00295 
00296 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
00297 //#define PBUF_POOL_BUFSIZE       128
00298 
00299 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
00300    link level header. */
00301 //#define PBUF_LINK_HLEN          16 
00302 
00303 /** SYS_LIGHTWEIGHT_PROT
00304  * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
00305  * for certain critical regions during buffer allocation, deallocation and memory
00306  * allocation and deallocation.
00307  */
00308 #define SYS_LIGHTWEIGHT_PROT           0 //No sys here
00309 
00310 /* ---------- TCP options ---------- */
00311 #define LWIP_TCP                1
00312 #define TCP_TTL                 255
00313 
00314 /* Controls if TCP should queue segments that arrive out of
00315    order. Define to 0 if your device is low on memory. */
00316 #define TCP_QUEUE_OOSEQ         0
00317 
00318 /* TCP Maximum segment size. */
00319 //#define TCP_MSS                 1024
00320 #define TCP_MSS                   512//0x276//536//0x276
00321 
00322 /* TCP sender buffer space (bytes). */
00323 #define TCP_SND_BUF             1024//2048
00324 
00325 /* TCP sender buffer space (pbufs). This must be at least = 2 *
00326    TCP_SND_BUF/TCP_MSS for things to work. */
00327 #define TCP_SND_QUEUELEN        (4 * TCP_SND_BUF/TCP_MSS)//(4 * TCP_SND_BUF/TCP_MSS)
00328 
00329 /* TCP writable space (bytes). This must be less than or equal
00330    to TCP_SND_BUF. It is the amount of space which must be
00331    available in the tcp snd_buf for select to return writable */
00332 #define TCP_SNDLOWAT        (TCP_SND_BUF/2)
00333 
00334 /* TCP receive window. */
00335 #define TCP_WND        512         //8096
00336 
00337 /* Maximum number of retransmissions of data segments. */
00338 //#define TCP_MAXRTX              12
00339 
00340 /* Maximum number of retransmissions of SYN segments. */
00341 //#define TCP_SYNMAXRTX           4
00342 
00343 #endif
00344 
00345 /* ---------- IP options ---------- */
00346 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
00347    IP packets across network interfaces. If you are going to run lwIP
00348    on a device with only one network interface, define this to 0. */
00349 #define IP_FORWARD              0
00350 
00351 
00352 /* IP reassembly and segmentation.These are orthogonal even
00353  * if they both deal with IP fragments */
00354 
00355 #define IP_REASSEMBLY     1
00356 #define IP_REASS_MAX_PBUFS      10
00357 #define MEMP_NUM_REASSDATA      10
00358 #define IP_FRAG           1
00359 
00360 /* ---------- ICMP options ---------- */
00361 #define ICMP_TTL                255
00362 
00363 /* ---------- DHCP options ---------- */
00364 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
00365    interfaces. */
00366 #define LWIP_DHCP               (NET_ETH | NET_ZG2100)
00367 
00368 /* 1 if you want to do an ARP check on the offered address
00369    (recommended if using DHCP). */
00370 #define DHCP_DOES_ARP_CHECK     (LWIP_DHCP)
00371 
00372 /* ---------- AUTOIP options ------- */
00373 #define LWIP_AUTOIP             (LWIP_DHCP)
00374 #define LWIP_DHCP_AUTOIP_COOP   (LWIP_AUTOIP)
00375 #define LWIP_DHCP_AUTOIP_COOP_TRIES 3
00376 
00377 /* ---------- SNMP options ---------- */
00378 /** @todo SNMP is experimental for now
00379     @note UDP must be available for SNMP transport */
00380 #ifndef LWIP_SNMP
00381 #define LWIP_SNMP               0
00382 #endif
00383 
00384 
00385 #ifndef SNMP_PRIVATE_MIB
00386 #define SNMP_PRIVATE_MIB        0
00387 #endif
00388 
00389 
00390 /* ---------- UDP options ---------- */
00391 #define LWIP_UDP                1
00392 #define UDP_TTL                 255
00393 
00394 /* ---------- DNS options ---------- */
00395 #define LWIP_DNS                1
00396 
00397 /* ---------- RAW options ---------- */
00398 #define LWIP_RAW                0
00399 #define RAW_TTL                 255
00400 
00401 /* ---------- Statistics options ---------- */
00402 /* individual STATS options can be turned off by defining them to 0 
00403  * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS
00404  * is 0
00405  * */
00406 
00407 #define LWIP_STATS    0
00408 
00409 /* ---------- PPP options ---------- */
00410 
00411 #define PPP_SUPPORT      NET_PPP      /* Set > 0 for PPP */
00412 
00413 #if PPP_SUPPORT > 0
00414 
00415 #define NUM_PPP 1           /* Max PPP sessions. */
00416 
00417 
00418 /* Select modules to enable.  Ideally these would be set in the makefile but
00419  * we're limited by the command line length so you need to modify the settings
00420  * in this file.
00421  */
00422 #define PAP_SUPPORT      1      /* Set > 0 for PAP. */
00423 #define CHAP_SUPPORT     1      /* Set > 0 for CHAP. */
00424 #define MSCHAP_SUPPORT   0      /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
00425 #define CBCP_SUPPORT     0      /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
00426 #define CCP_SUPPORT      0      /* Set > 0 for CCP (NOT FUNCTIONAL!) */
00427 #define VJ_SUPPORT       1      /* Set > 0 for VJ header compression. */
00428 #define MD5_SUPPORT      1      /* Set > 0 for MD5 (see also CHAP) */
00429 
00430 
00431 /*
00432  * Timeouts.
00433  */
00434 #define FSM_DEFTIMEOUT        6    /* Timeout time in seconds */
00435 #define FSM_DEFMAXTERMREQS    2    /* Maximum Terminate-Request transmissions */
00436 #define FSM_DEFMAXCONFREQS    10    /* Maximum Configure-Request transmissions */
00437 #define FSM_DEFMAXNAKLOOPS    5    /* Maximum number of nak loops */
00438 
00439 #define UPAP_DEFTIMEOUT        6    /* Timeout (seconds) for retransmitting req */
00440 #define UPAP_DEFREQTIME        30    /* Time to wait for auth-req from peer */
00441 
00442 #define CHAP_DEFTIMEOUT        6    /* Timeout time in seconds */
00443 #define CHAP_DEFTRANSMITS    10    /* max # times to send challenge */
00444 
00445 
00446 /* Interval in seconds between keepalive echo requests, 0 to disable. */
00447 #if 1
00448 #define LCP_ECHOINTERVAL 0
00449 #else
00450 
00451 #define LCP_ECHOINTERVAL 10
00452 #endif
00453 
00454 
00455 /* Number of unanswered echo requests before failure. */
00456 #define LCP_MAXECHOFAILS 3
00457 
00458 
00459 //C++ Compat
00460 #define try vTry
00461 
00462 #endif
00463 
00464 
00465 #endif /* __LWIPOPTS_H__ */