2 * Copyright (c) 2001, Swedish Institute of Computer Science.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the Institute nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * This file is part of the lwIP TCP/IP stack.
31 * Author: Jani Monoses <jani@iv.ro>
34 #ifndef __LWIPOPTS_H__
35 #define __LWIPOPTS_H__
36 /*include the configuration made with configtool*/
37 #include <pkgconf/net_lwip.h>
38 /* ---------- Memory options ---------- */
39 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
40 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
41 byte alignment -> define MEM_ALIGNMENT to 2. */
42 #define MEM_ALIGNMENT CYGNUM_LWIP_MEM_ALIGNMENT
44 /* MEM_SIZE: the size of the heap memory. If the application will send
45 a lot of data that needs to be copied, this should be set high. */
46 #define MEM_SIZE CYGNUM_LWIP_MEM_SIZE
48 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
49 sends a lot of data out of ROM (or other static memory), this
50 should be set high. */
51 #define MEMP_NUM_PBUF CYGNUM_LWIP_MEMP_NUM_PBUF
52 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
53 per active UDP "connection". */
54 #define MEMP_NUM_UDP_PCB CYGNUM_LWIP_MEMP_NUM_UDP_PCB
55 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
57 #define MEMP_NUM_TCP_PCB CYGNUM_LWIP_MEMP_NUM_TCP_PCB
58 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
60 #define MEMP_NUM_TCP_PCB_LISTEN CYGNUM_LWIP_MEMP_NUM_TCP_PCB_LISTEN
61 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
63 #define MEMP_NUM_TCP_SEG CYGNUM_LWIP_MEMP_NUM_TCP_SEG
64 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
66 #define MEMP_NUM_SYS_TIMEOUT CYGNUM_LWIP_MEMP_NUM_SYS_TIMEOUT
69 /* The following four are used only with the sequential API and can be
70 set to 0 if the application only will use the raw API. */
71 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
72 #define MEMP_NUM_NETBUF CYGNUM_LWIP_MEMP_NUM_NETBUF
73 /* MEMP_NUM_NETCONN: the number of struct netconns. */
74 #define MEMP_NUM_NETCONN CYGNUM_LWIP_MEMP_NUM_NETCONN
75 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for
76 communication between the TCP/IP stack and the sequential
78 #define MEMP_NUM_API_MSG CYGNUM_LWIP_MEMP_NUM_APIMSG
79 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
80 for sequential API communication and incoming packets. Used in
82 #define MEMP_NUM_TCPIP_MSG CYGNUM_LWIP_MEMP_NUM_TCPIP_MSG
84 /* ---------- Pbuf options ---------- */
85 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
86 #define PBUF_POOL_SIZE CYGNUM_LWIP_PBUF_POOL_SIZE
88 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
89 #define PBUF_POOL_BUFSIZE CYGNUM_LWIP_PBUF_POOL_BUFSIZE
91 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
93 #define PBUF_LINK_HLEN CYGNUM_LWIP_PBUF_LINK_HLEN
95 /* ---------- TCP options ---------- */
96 #define LWIP_TCP defined(CYGPKG_LWIP_TCP)
97 #define TCP_TTL CYGNUM_LWIP_TCP_TTL
99 /* Controls if TCP should queue segments that arrive out of
100 order. Define to 0 if your device is low on memory. */
101 #define TCP_QUEUE_OOSEQ defined(CYGIMP_LWIP_TCP_QUEUE_OOSEQ)
103 /* TCP Maximum segment size. */
104 #define TCP_MSS CYGNUM_LWIP_TCP_MSS
106 /* TCP sender buffer space (bytes). */
107 #define TCP_SND_BUF CYGNUM_LWIP_TCP_SND_BUF
108 #define TCP_SNDLOWAT TCP_SND_BUF/2
110 /* TCP sender buffer space (pbufs). This must be at least = 2 *
111 TCP_SND_BUF/TCP_MSS for things to work. */
112 #define TCP_SND_QUEUELEN CYGNUM_LWIP_TCP_SND_QUEUELEN
114 /* TCP receive window. */
115 #define TCP_WND CYGNUM_LWIP_TCP_WND
117 /* Maximum number of retransmissions of data segments. */
118 #define TCP_MAXRTX CYGNUM_LWIP_TCP_MAXRTX
120 /* Maximum number of retransmissions of SYN segments. */
121 #define TCP_SYNMAXRTX CYGNUM_LWIP_TCP_SYNMAXRTX
123 /* ---------- ARP options ---------- */
124 #define ARP_TABLE_SIZE CYGNUM_LWIP_ARP_TABLE_SIZE
126 /* ---------- IP options ---------- */
127 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
128 IP packets across network interfaces. If you are going to run lwIP
129 on a device with only one network interface, define this to 0. */
130 #define IP_FORWARD defined(CYGFUN_LWIP_IP_FORWARD)
133 /* If defined to 1, IP options are allowed (but not parsed). If
134 defined to 0, all packets with IP options are dropped. */
135 #define IP_OPTIONS defined(CYGFUN_LWIP_IP_OPTIONS)
138 /* ---------- ICMP options ---------- */
139 #define ICMP_TTL CYGNUM_LWIP_ICMP_TTL
142 /* ---------- DHCP options ---------- */
143 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
145 #define LWIP_DHCP defined(CYGPKG_LWIP_DHCP)
146 #define DHCP_DOES_ARP_CHECK defined(CYGOPT_LWIP_DHCP_DOES_ARP_CHECK)
149 /* ---------- UDP options ---------- */
150 #define LWIP_UDP defined(CYGPKG_LWIP_UDP)
151 #define UDP_TTL CYGNUM_LWIP_UDP_TTL
153 /* ---------- RAW socket support ---------- */
154 #define LWIP_RAW defined(CYGFUN_LWIP_RAW)
156 /* ---------- SLIP options --------- */
157 #define LWIP_SLIP defined(CYGPKG_LWIP_SLIP)
158 #define SLIP_DEV CYGDAT_LWIP_SLIP_DEV
160 /* ---------- LOOPIF options --------- */
161 #define LWIP_HAVE_LOOPIF defined(CYGFUN_LWIP_LOOPIF)
163 /* ---------- PPP options --------- */
164 #define PPP_SUPPORT defined(CYGPKG_LWIP_PPP)
165 #define PPP_DEV CYGDAT_LWIP_PPP_DEV
166 #define MD5_SUPPORT 1
167 #ifdef CYGIMP_LWIP_PPP_PAP_AUTH
168 #define PAP_SUPPORT 1
170 #define PAP_SUPPORT 0
172 #ifdef CYGIMP_LWIP_PPP_CHAP_AUTH
173 #define CHAP_SUPPORT 1
175 #define CHAP_SUPPORT 0
179 /* ------- Thread priorities ---------------*/
180 #define TCPIP_THREAD_PRIO CYGNUM_LWIP_NETWORK_THREAD_PRIORITY
181 #define SLIPIF_THREAD_PRIO CYGNUM_LWIP_SLIPIF_THREAD_PRIORITY
182 #define PPP_THREAD_PRIO CYGNUM_LWIP_PPP_THREAD_PRIORITY
185 /* ---------- Statistics options ---------- */
186 #define LWIP_STATS defined(CYGDBG_LWIP_STATS)
189 // --------- Sockets options --------------
190 #define LWIP_COMPAT_SOCKETS defined(CYGFUN_LWIP_COMPAT_SOCKETS)
193 /* ---------- Debug options ---------- */
194 #if !defined(CYGDBG_LWIP_ASSERTS)
195 #define LWIP_NOASSERT
198 #if defined(CYGDBG_LWIP_DEBUG)
200 #define MEM_DEBUG DBG_ON
201 #define MEMP_DEBUG DBG_ON
202 #define PBUF_DEBUG DBG_ON
203 #define API_LIB_DEBUG DBG_ON
204 #define API_MSG_DEBUG DBG_ON
205 #define TCPIP_DEBUG DBG_ON
206 #define NETIF_DEBUG DBG_ON
207 #define SOCKETS_DEBUG DBG_ON
208 #define DEMO_DEBUG DBG_ON
209 #define IP_DEBUG DBG_ON
210 #define IP_REASS_DEBUG DBG_ON
211 #define RAW_DEBUG DBG_ON
212 #define ICMP_DEBUG DBG_ON
213 #define UDP_DEBUG DBG_ON
214 #define TCP_DEBUG DBG_ON
215 #define TCP_INPUT_DEBUG DBG_ON
216 #define TCP_OUTPUT_DEBUG DBG_ON
217 #define TCP_RTO_DEBUG DBG_ON
218 #define TCP_CWND_DEBUG DBG_ON
219 #define TCP_WND_DEBUG DBG_ON
220 #define TCP_FR_DEBUG DBG_ON
221 #define TCP_QLEN_DEBUG DBG_ON
222 #define TCP_RST_DEBUG DBG_ON
223 #define PPP_DEBUG DBG_ON
225 #define DBG_TYPES_ON (DBG_ON|DBG_TRACE|DBG_STATE|DBG_FRESH|DBG_HALT)
230 #endif /* __LWIPOPTS_H__ */