]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/lwipopts.h
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Demo / MicroBlaze_Kintex7_EthernetLite / 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 #include "xparameters.h"
37
38 /* Functions used to obtain and release exclusive access to the Tx buffer.  The
39 Get function will block if the Tx buffer is not available - use with care! */
40 signed char *pcLwipBlockingGetTxBuffer( void );
41 void vLwipAppsReleaseTxBuffer( void );
42
43 #define CONFIG_LINKSPEED_AUTODETECT 1
44 #define OS_IS_FREERTOS
45
46 /* SSI options. */
47 #define TCPIP_THREAD_NAME              "tcpip"
48 #define LWIP_HTTPD_MAX_TAG_NAME_LEN 20
49 #define LWIP_HTTPD_MAX_TAG_INSERT_LEN 1024
50 #define TCPIP_THREAD_PRIO configLWIP_TASK_PRIORITY
51 #define TCPIP_THREAD_STACKSIZE configMINIMAL_STACK_SIZE * 3
52
53 #define DEFAULT_TCP_RECVMBOX_SIZE 5
54 #define DEFAULT_ACCEPTMBOX_SIZE 5
55 #define TCPIP_MBOX_SIZE                                 10
56
57 #define NO_SYS                                                  0
58 #define LWIP_SOCKET                                             (NO_SYS==0)
59 #define LWIP_NETCONN                            1
60
61 #define LWIP_SNMP                                               0
62 #define LWIP_IGMP                                               0
63 #define LWIP_ICMP                                               1
64
65 /* DNS is not going to be used as this is a simple local example. */
66 #define LWIP_DNS                                                0
67
68 #define LWIP_HAVE_LOOPIF                                0
69 #define TCP_LISTEN_BACKLOG                              0
70 #define LWIP_SO_RCVTIMEO                                1
71 #define LWIP_SO_RCVBUF                                  1
72
73 //#define LWIP_DEBUG
74 #ifdef LWIP_DEBUG
75
76 #define LWIP_DBG_MIN_LEVEL        LWIP_DBG_LEVEL_ALL // LWIP_DBG_LEVEL_SERIOUS
77 #define PPP_DEBUG                  LWIP_DBG_OFF
78 #define MEM_DEBUG                  LWIP_DBG_OFF
79 #define MEMP_DEBUG                 LWIP_DBG_OFF
80 #define PBUF_DEBUG                 LWIP_DBG_OFF
81 #define API_LIB_DEBUG              LWIP_DBG_OFF
82 #define API_MSG_DEBUG              LWIP_DBG_OFF
83 #define TCPIP_DEBUG                LWIP_DBG_OFF
84 #define NETIF_DEBUG                LWIP_DBG_OFF
85 #define SOCKETS_DEBUG              LWIP_DBG_OFF
86 #define DNS_DEBUG                  LWIP_DBG_OFF
87 #define AUTOIP_DEBUG               LWIP_DBG_OFF
88 #define DHCP_DEBUG                 LWIP_DBG_ON
89 #define IP_DEBUG                   LWIP_DBG_OFF
90 #define IP_REASS_DEBUG             LWIP_DBG_OFF
91 #define ICMP_DEBUG                 LWIP_DBG_OFF
92 #define IGMP_DEBUG                 LWIP_DBG_OFF
93 #define UDP_DEBUG                  LWIP_DBG_OFF
94 #define TCP_DEBUG                  LWIP_DBG_OFF
95 #define TCP_INPUT_DEBUG            LWIP_DBG_OFF
96 #define TCP_OUTPUT_DEBUG           LWIP_DBG_OFF
97 #define TCP_RTO_DEBUG              LWIP_DBG_OFF
98 #define TCP_CWND_DEBUG             LWIP_DBG_OFF
99 #define TCP_WND_DEBUG              LWIP_DBG_OFF
100 #define TCP_FR_DEBUG               LWIP_DBG_OFF
101 #define TCP_QLEN_DEBUG             LWIP_DBG_OFF
102 #define TCP_RST_DEBUG              LWIP_DBG_OFF
103 #endif
104
105 #define LWIP_DBG_TYPES_ON         (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
106
107
108
109 /* ---------- Memory options ---------- */
110 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
111    lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
112    byte alignment -> define MEM_ALIGNMENT to 2. */
113 /* MSVC port: intel processors don't need 4-byte alignment,
114    but are faster that way! */
115 #define MEM_ALIGNMENT                   64
116
117 /* MEM_SIZE: the size of the heap memory. If the application will send
118 a lot of data that needs to be copied, this should be set high. */
119 #define MEM_SIZE                                20 * 1024
120
121 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
122    sends a lot of data out of ROM (or other static memory), this
123    should be set high. */
124 #define MEMP_NUM_PBUF                   10
125
126 /* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One
127    per active RAW "connection". */
128 #define LWIP_RAW                                0
129 #define MEMP_NUM_RAW_PCB                0
130
131 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
132    per active UDP "connection". */
133 #define MEMP_NUM_UDP_PCB                4
134
135 /* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP
136    connections. */
137 #define MEMP_NUM_TCP_PCB                5
138
139 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
140    connections. */
141 #define MEMP_NUM_TCP_PCB_LISTEN 4
142
143 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
144    segments. */
145 #define MEMP_NUM_TCP_SEG                20
146
147 /* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active
148    timeouts. */
149 #define MEMP_NUM_SYS_TIMEOUT    8
150
151 /* The following four are used only with the sequential API and can be
152    set to 0 if the application only will use the raw API. */
153 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
154 #define MEMP_NUM_NETBUF         0
155
156 /* MEMP_NUM_NETCONN: the number of struct netconns. */
157 #define MEMP_NUM_NETCONN        5
158
159 /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
160    for sequential API communication and incoming packets. Used in
161    src/api/tcpip.c. */
162 #define MEMP_NUM_TCPIP_MSG_API   4
163 #define MEMP_NUM_TCPIP_MSG_INPKT 4
164
165 #define MEMP_NUM_ARP_QUEUE              5
166
167 /* ---------- Pbuf options ---------- */
168 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
169 #define PBUF_POOL_SIZE                  10
170
171 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
172 #define PBUF_POOL_BUFSIZE               512
173
174 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
175    link level header. */
176 #define PBUF_LINK_HLEN                  16
177
178 /** SYS_LIGHTWEIGHT_PROT
179  * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
180  * for certain critical regions during buffer allocation, deallocation and memory
181  * allocation and deallocation.
182  */
183 #define SYS_LIGHTWEIGHT_PROT    (NO_SYS==0)
184
185
186 /* ---------- TCP options ---------- */
187 #define LWIP_TCP                                1
188 #define TCP_TTL                                 255
189
190 /* Controls if TCP should queue segments that arrive out of
191    order. Define to 0 if your device is low on memory. */
192 #define TCP_QUEUE_OOSEQ                 1
193
194 /* TCP Maximum segment size. */
195 #define TCP_MSS                                 1460
196
197 /* TCP sender buffer space (bytes). */
198 #define TCP_SND_BUF                             8129
199
200 /* TCP sender buffer space (pbufs). This must be at least = 2 *
201    TCP_SND_BUF/TCP_MSS for things to work. */
202 #define TCP_SND_QUEUELEN                (16 * TCP_SND_BUF/TCP_MSS)
203
204 /* TCP writable space (bytes). This must be less than or equal
205    to TCP_SND_BUF. It is the amount of space which must be
206    available in the tcp snd_buf for select to return writable */
207 #define TCP_SNDLOWAT                    (TCP_SND_BUF/2)
208
209 /* TCP receive window. */
210 #define TCP_WND                                 ( 2048 )
211
212 /* Maximum number of retransmissions of data segments. */
213 #define TCP_MAXRTX                              12
214
215 /* Maximum number of retransmissions of SYN segments. */
216 #define TCP_SYNMAXRTX                   4
217
218
219 /* ---------- ARP options ---------- */
220 #define LWIP_ARP                                1
221 #define ARP_TABLE_SIZE                  10
222 #define ARP_QUEUEING                    1
223
224 #define ICMP_TTL 255
225
226 #define IP_OPTIONS 0
227
228 /* ---------- IP options ---------- */
229 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
230    IP packets across network interfaces. If you are going to run lwIP
231    on a device with only one network interface, define this to 0. */
232 #define IP_FORWARD                              0
233
234 /* IP reassembly and segmentation.These are orthogonal even
235  * if they both deal with IP fragments */
236 #define IP_REASSEMBLY                   0
237 #define IP_REASS_MAX_PBUFS              10
238 #define MEMP_NUM_REASSDATA              10
239 #define IP_FRAG                                 0
240
241
242 /* ---------- ICMP options ---------- */
243 #define ICMP_TTL                                255
244
245
246 /* ---------- DHCP options ---------- */
247 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
248    interfaces. */
249 #define LWIP_DHCP                               0
250
251 /* 1 if you want to do an ARP check on the offered address
252    (recommended). */
253 #define DHCP_DOES_ARP_CHECK             (LWIP_DHCP)
254
255
256 /* ---------- AUTOIP options ------- */
257 #define LWIP_AUTOIP                             0
258 #define LWIP_DHCP_AUTOIP_COOP   (LWIP_DHCP && LWIP_AUTOIP)
259
260
261 /* ---------- UDP options ---------- */
262 #define LWIP_UDP                                1
263 #define LWIP_UDPLITE                    1
264 #define UDP_TTL                                 255
265
266
267 /* ---------- Statistics options ---------- */
268
269 #define LWIP_STATS                              1
270 #define LWIP_STATS_DISPLAY              0
271
272 #if LWIP_STATS
273         #define LINK_STATS                              1
274         #define IP_STATS                                1
275         #define ICMP_STATS                              0
276         #define IGMP_STATS                              0
277         #define IPFRAG_STATS                    0
278         #define UDP_STATS                               1
279         #define TCP_STATS                               1
280         #define MEM_STATS                               1
281         #define MEMP_STATS                              1
282         #define PBUF_STATS                              1
283         #define SYS_STATS                               1
284 #endif /* LWIP_STATS */
285
286
287 /* ---------- PPP options ---------- */
288
289 #define PPP_SUPPORT                      0        /* Set > 0 for PPP */
290
291 #if PPP_SUPPORT
292
293         #define NUM_PPP                                 1         /* Max PPP sessions. */
294
295         /* Select modules to enable.  Ideally these would be set in the makefile but
296          * we're limited by the command line length so you need to modify the settings
297          * in this file.
298          */
299         #define PPPOE_SUPPORT                   1
300         #define PPPOS_SUPPORT                   1
301         #define PAP_SUPPORT                             1         /* Set > 0 for PAP. */
302         #define CHAP_SUPPORT                    1         /* Set > 0 for CHAP. */
303         #define MSCHAP_SUPPORT                  0         /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
304         #define CBCP_SUPPORT                    0         /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
305         #define CCP_SUPPORT                             0         /* Set > 0 for CCP (NOT FUNCTIONAL!) */
306         #define VJ_SUPPORT                              1         /* Set > 0 for VJ header compression. */
307         #define MD5_SUPPORT                             1         /* Set > 0 for MD5 (see also CHAP) */
308
309 #endif /* PPP_SUPPORT */
310
311 #define LWIP_NETIF_STATUS_CALLBACK 1
312 #define LWIP_PLATFORM_BYTESWAP 0
313 #define LWIP_PROVIDE_ERRNO 1
314
315 /* Define platform endianness (might already be defined) */
316 #ifndef BYTE_ORDER
317         #if XPAR_MICROBLAZE_0_ENDIANNESS == 1
318                 #define BYTE_ORDER LITTLE_ENDIAN
319         #else
320                 #define BYTE_ORDER BIG_ENDIAN
321         #endif
322 #endif /* BYTE_ORDER */
323
324
325 /*#ifndef PORTABLE_H
326         #include <stdlib.h>
327         void vPortFree( void *pv );
328         void *pvPortMalloc( size_t xSize );
329 #endif
330 #define MEMP_MEM_MALLOC 1
331 #define MEM_LIBC_MALLOC 1
332 #define mem_free vPortFree
333 #define mem_malloc pvPortMalloc*/
334
335 #endif /* __LWIPOPTS_H__ */