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