]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/lwipopts.h
Update version numbers in preparation for new release.
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo / src / lwipopts.h
1 /*
2  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
3  * All rights reserved. 
4  * 
5  * Redistribution and use in source and binary forms, with or without modification, 
6  * are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  *    derived from this software without specific prior written permission. 
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
25  * OF SUCH DAMAGE.
26  *
27  * This file is part of the lwIP TCP/IP stack.
28  * 
29  * Author: Adam Dunkels <adam@sics.se>
30  *
31  */
32 #ifndef __LWIPOPTS_H__
33 #define __LWIPOPTS_H__
34
35 #include <limits.h>
36
37 /* Functions used to obtain and release exclusive access to the Tx buffer.  The
38 Get function will block if the Tx buffer is not available - use with care! */
39 signed char *pcLwipBlockingGetTxBuffer( void );
40 void vLwipAppsReleaseTxBuffer( void );
41
42 #define CONFIG_LINKSPEED_AUTODETECT 1
43 #define OS_IS_FREERTOS
44
45 /* SSI options. */
46 #define TCPIP_THREAD_NAME              "tcpip"
47 #define LWIP_HTTPD_MAX_TAG_NAME_LEN 20
48 #define LWIP_HTTPD_MAX_TAG_INSERT_LEN 1024
49 #define TCPIP_THREAD_PRIO configLWIP_TASK_PRIORITY
50 #define TCPIP_THREAD_STACKSIZE configMINIMAL_STACK_SIZE * 3
51
52 #define DEFAULT_TCP_RECVMBOX_SIZE 5
53 #define DEFAULT_ACCEPTMBOX_SIZE 5
54 #define TCPIP_MBOX_SIZE                                 10
55
56 #define NO_SYS                                                  0
57 #define LWIP_SOCKET                                             (NO_SYS==0)
58 #define LWIP_NETCONN                            1
59
60 #define LWIP_SNMP                                               0
61 #define LWIP_IGMP                                               0
62 #define LWIP_ICMP                                               1
63
64 /* DNS is not going to be used as this is a simple local example. */
65 #define LWIP_DNS                                                0
66
67 #define LWIP_HAVE_LOOPIF                                0
68 #define TCP_LISTEN_BACKLOG                              0
69 #define LWIP_SO_RCVTIMEO                                1
70 #define LWIP_SO_RCVBUF                                  1
71
72 //#define LWIP_DEBUG
73 #ifdef LWIP_DEBUG
74
75 #define LWIP_DBG_MIN_LEVEL        LWIP_DBG_LEVEL_ALL // LWIP_DBG_LEVEL_SERIOUS
76 #define PPP_DEBUG                  LWIP_DBG_OFF
77 #define MEM_DEBUG                  LWIP_DBG_OFF
78 #define MEMP_DEBUG                 LWIP_DBG_OFF
79 #define PBUF_DEBUG                 LWIP_DBG_OFF
80 #define API_LIB_DEBUG              LWIP_DBG_OFF
81 #define API_MSG_DEBUG              LWIP_DBG_OFF
82 #define TCPIP_DEBUG                LWIP_DBG_OFF
83 #define NETIF_DEBUG                LWIP_DBG_OFF
84 #define SOCKETS_DEBUG              LWIP_DBG_OFF
85 #define DNS_DEBUG                  LWIP_DBG_OFF
86 #define AUTOIP_DEBUG               LWIP_DBG_OFF
87 #define DHCP_DEBUG                 LWIP_DBG_ON
88 #define IP_DEBUG                   LWIP_DBG_OFF
89 #define IP_REASS_DEBUG             LWIP_DBG_OFF
90 #define ICMP_DEBUG                 LWIP_DBG_OFF
91 #define IGMP_DEBUG                 LWIP_DBG_OFF
92 #define UDP_DEBUG                  LWIP_DBG_OFF
93 #define TCP_DEBUG                  LWIP_DBG_OFF
94 #define TCP_INPUT_DEBUG            LWIP_DBG_OFF
95 #define TCP_OUTPUT_DEBUG           LWIP_DBG_OFF
96 #define TCP_RTO_DEBUG              LWIP_DBG_OFF
97 #define TCP_CWND_DEBUG             LWIP_DBG_OFF
98 #define TCP_WND_DEBUG              LWIP_DBG_OFF
99 #define TCP_FR_DEBUG               LWIP_DBG_OFF
100 #define TCP_QLEN_DEBUG             LWIP_DBG_OFF
101 #define TCP_RST_DEBUG              LWIP_DBG_OFF
102 #endif
103
104 #define LWIP_DBG_TYPES_ON         (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
105
106
107
108 /* ---------- Memory options ---------- */
109 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
110    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
111    byte alignment -> define MEM_ALIGNMENT to 2. */
112 /* MSVC port: intel processors don't need 4-byte alignment,
113    but are faster that way! */
114 #define MEM_ALIGNMENT                   64
115
116 /* MEM_SIZE: the size of the heap memory. If the application will send
117 a lot of data that needs to be copied, this should be set high. */
118 #define MEM_SIZE                                0x20000
119
120 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
121    sends a lot of data out of ROM (or other static memory), this
122    should be set high. */
123 #define MEMP_NUM_PBUF                   16
124
125 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One
126    per active RAW "connection". */
127 #define LWIP_RAW                                0
128 #define MEMP_NUM_RAW_PCB                0
129
130 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
131    per active UDP "connection". */
132 #define MEMP_NUM_UDP_PCB                4
133
134 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
135    connections. */
136 #define MEMP_NUM_TCP_PCB                32
137
138 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
139    connections. */
140 #define MEMP_NUM_TCP_PCB_LISTEN 8
141
142 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
143    segments. */
144 #define MEMP_NUM_TCP_SEG                256
145
146 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
147    timeouts. */
148 #define MEMP_NUM_SYS_TIMEOUT    8
149
150 /* The following four are used only with the sequential API and can be
151    set to 0 if the application only will use the raw API. */
152 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
153 #define MEMP_NUM_NETBUF         0
154
155 /* MEMP_NUM_NETCONN: the number of struct netconns. */
156 #define MEMP_NUM_NETCONN        10
157
158 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
159    for sequential API communication and incoming packets. Used in
160    src/api/tcpip.c. */
161 #define MEMP_NUM_TCPIP_MSG_API   4
162 #define MEMP_NUM_TCPIP_MSG_INPKT 4
163
164 #define MEMP_NUM_ARP_QUEUE              5
165
166 /* ---------- Pbuf options ---------- */
167 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
168 #define PBUF_POOL_SIZE                  256
169
170 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
171 #define PBUF_POOL_BUFSIZE               1700
172
173 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
174    link level header. */
175 #define PBUF_LINK_HLEN                  16
176
177 /** SYS_LIGHTWEIGHT_PROT
178  * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
179  * for certain critical regions during buffer allocation, deallocation and memory
180  * allocation and deallocation.
181  */
182 #define SYS_LIGHTWEIGHT_PROT    (NO_SYS==0)
183
184
185 /* ---------- TCP options ---------- */
186 #define LWIP_TCP                                1
187 #define TCP_TTL                                 255
188
189 /* Controls if TCP should queue segments that arrive out of
190    order. Define to 0 if your device is low on memory. */
191 #define TCP_QUEUE_OOSEQ                 1
192
193 /* TCP Maximum segment size. */
194 #define TCP_MSS                                 1460
195
196 /* TCP sender buffer space (bytes). */
197 #define TCP_SND_BUF                             8129
198
199 /* TCP sender buffer space (pbufs). This must be at least = 2 *
200    TCP_SND_BUF/TCP_MSS for things to work. */
201 #define TCP_SND_QUEUELEN                ( ( 16 * TCP_SND_BUF ) / TCP_MSS )
202
203 /* TCP writable space (bytes). This must be less than or equal
204    to TCP_SND_BUF. It is the amount of space which must be
205    available in the tcp snd_buf for select to return writable */
206 #define TCP_SNDLOWAT                    (TCP_SND_BUF/2)
207
208 /* TCP receive window. */
209 #define TCP_WND                                 ( 8 * TCP_MSS )
210
211 /* Maximum number of retransmissions of data segments. */
212 #define TCP_MAXRTX                              12
213
214 /* Maximum number of retransmissions of SYN segments. */
215 #define TCP_SYNMAXRTX                   4
216
217
218 /* ---------- ARP options ---------- */
219 #define LWIP_ARP                                1
220 #define ARP_TABLE_SIZE                  10
221 #define ARP_QUEUEING                    1
222
223 #define ICMP_TTL 255
224
225 #define IP_OPTIONS 0
226
227 /* ---------- IP options ---------- */
228 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
229    IP packets across network interfaces. If you are going to run lwIP
230    on a device with only one network interface, define this to 0. */
231 #define IP_FORWARD                              0
232
233 /* IP reassembly and segmentation.These are orthogonal even
234  * if they both deal with IP fragments */
235 #define IP_REASSEMBLY                   0
236 #define IP_REASS_MAX_PBUFS              10
237 #define MEMP_NUM_REASSDATA              10
238 #define IP_FRAG                                 0
239
240
241 /* ---------- ICMP options ---------- */
242 #define ICMP_TTL                                255
243
244
245 /* ---------- DHCP options ---------- */
246 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
247    interfaces. */
248 #define LWIP_DHCP                               1
249
250 /* 1 if you want to do an ARP check on the offered address
251    (recommended). */
252 #define DHCP_DOES_ARP_CHECK             (LWIP_DHCP)
253
254
255 /* ---------- AUTOIP options ------- */
256 #define LWIP_AUTOIP                             0
257 #define LWIP_DHCP_AUTOIP_COOP   (LWIP_DHCP && LWIP_AUTOIP)
258
259
260 /* ---------- UDP options ---------- */
261 #define LWIP_UDP                                1
262 #define LWIP_UDPLITE                    1
263 #define UDP_TTL                                 255
264
265
266 /* ---------- Statistics options ---------- */
267
268 #define LWIP_STATS                              1
269 #define LWIP_STATS_DISPLAY              0
270
271 #if LWIP_STATS
272         #define LINK_STATS                              1
273         #define IP_STATS                                1
274         #define ICMP_STATS                              0
275         #define IGMP_STATS                              0
276         #define IPFRAG_STATS                    0
277         #define UDP_STATS                               1
278         #define TCP_STATS                               1
279         #define MEM_STATS                               1
280         #define MEMP_STATS                              1
281         #define PBUF_STATS                              1
282         #define SYS_STATS                               1
283 #endif /* LWIP_STATS */
284
285
286 /* ---------- PPP options ---------- */
287
288 #define PPP_SUPPORT                      0        /* Set > 0 for PPP */
289
290 #if PPP_SUPPORT
291
292         #define NUM_PPP                                 1         /* Max PPP sessions. */
293
294         /* Select modules to enable.  Ideally these would be set in the makefile but
295          * we're limited by the command line length so you need to modify the settings
296          * in this file.
297          */
298         #define PPPOE_SUPPORT                   1
299         #define PPPOS_SUPPORT                   1
300         #define PAP_SUPPORT                             1         /* Set > 0 for PAP. */
301         #define CHAP_SUPPORT                    1         /* Set > 0 for CHAP. */
302         #define MSCHAP_SUPPORT                  0         /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
303         #define CBCP_SUPPORT                    0         /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
304         #define CCP_SUPPORT                             0         /* Set > 0 for CCP (NOT FUNCTIONAL!) */
305         #define VJ_SUPPORT                              1         /* Set > 0 for VJ header compression. */
306         #define MD5_SUPPORT                             1         /* Set > 0 for MD5 (see also CHAP) */
307
308 #endif /* PPP_SUPPORT */
309
310 #define LWIP_NETIF_STATUS_CALLBACK 1
311
312 #endif /* __LWIPOPTS_H__ */