1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * lwIP Options Configuration |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
---|
11 | * All rights reserved. |
---|
12 | * |
---|
13 | * Redistribution and use in source and binary forms, with or without modification, |
---|
14 | * are permitted provided that the following conditions are met: |
---|
15 | * |
---|
16 | * 1. Redistributions of source code must retain the above copyright notice, |
---|
17 | * this list of conditions and the following disclaimer. |
---|
18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
19 | * this list of conditions and the following disclaimer in the documentation |
---|
20 | * and/or other materials provided with the distribution. |
---|
21 | * 3. The name of the author may not be used to endorse or promote products |
---|
22 | * derived from this software without specific prior written permission. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
---|
27 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
---|
29 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
---|
32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
---|
33 | * OF SUCH DAMAGE. |
---|
34 | * |
---|
35 | * This file is part of the lwIP TCP/IP stack. |
---|
36 | * |
---|
37 | * Author: Adam Dunkels <adam@sics.se> |
---|
38 | * |
---|
39 | */ |
---|
40 | #ifndef __LWIPOPTS_H__ |
---|
41 | #define __LWIPOPTS_H__ |
---|
42 | |
---|
43 | #include "wl_api.h" |
---|
44 | |
---|
45 | /* |
---|
46 | ----------------------------------------------- |
---|
47 | ---------- Platform specific locking ---------- |
---|
48 | ----------------------------------------------- |
---|
49 | */ |
---|
50 | |
---|
51 | /** |
---|
52 | * NO_SYS==1: Provides VERY minimal functionality. Otherwise, |
---|
53 | * use lwIP facilities. |
---|
54 | */ |
---|
55 | #define NO_SYS 1 |
---|
56 | |
---|
57 | |
---|
58 | /* |
---|
59 | ------------------------------------ |
---|
60 | ---------- Memory options ---------- |
---|
61 | ------------------------------------ |
---|
62 | */ |
---|
63 | /** |
---|
64 | * MEM_ALIGNMENT: should be set to the alignment of the CPU |
---|
65 | * 4 byte alignment -> #define MEM_ALIGNMENT 4 |
---|
66 | * 2 byte alignment -> #define MEM_ALIGNMENT 2 |
---|
67 | */ |
---|
68 | #define MEM_ALIGNMENT 4 |
---|
69 | |
---|
70 | /** |
---|
71 | * MEM_SIZE: the size of the heap memory. If the application will send |
---|
72 | * a lot of data that needs to be copied, this should be set high. |
---|
73 | */ |
---|
74 | #define MEM_SIZE 16000 |
---|
75 | |
---|
76 | |
---|
77 | /* |
---|
78 | ------------------------------------------------ |
---|
79 | ---------- Internal Memory Pool Sizes ---------- |
---|
80 | ------------------------------------------------ |
---|
81 | */ |
---|
82 | /** |
---|
83 | * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). |
---|
84 | * If the application sends a lot of data out of ROM (or other static memory), |
---|
85 | * this should be set high. |
---|
86 | */ |
---|
87 | #define MEMP_NUM_PBUF 30 |
---|
88 | |
---|
89 | /** |
---|
90 | * MEMP_NUM_RAW_PCB: Number of raw connection PCBs |
---|
91 | * (requires the LWIP_RAW option) |
---|
92 | */ |
---|
93 | #define MEMP_NUM_RAW_PCB 4 |
---|
94 | |
---|
95 | /** |
---|
96 | * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One |
---|
97 | * per active UDP "connection". |
---|
98 | * (requires the LWIP_UDP option) |
---|
99 | */ |
---|
100 | #define MEMP_NUM_UDP_PCB 4 |
---|
101 | |
---|
102 | /** |
---|
103 | * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. |
---|
104 | * (requires the LWIP_TCP option) |
---|
105 | */ |
---|
106 | #define MEMP_NUM_TCP_PCB 2 |
---|
107 | |
---|
108 | /** |
---|
109 | * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. |
---|
110 | * (requires the LWIP_TCP option) |
---|
111 | */ |
---|
112 | #define MEMP_NUM_TCP_PCB_LISTEN 2 |
---|
113 | |
---|
114 | /** |
---|
115 | * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. |
---|
116 | * (requires the LWIP_TCP option) |
---|
117 | */ |
---|
118 | #define MEMP_NUM_TCP_SEG 32 |
---|
119 | |
---|
120 | /** |
---|
121 | * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing |
---|
122 | * packets (pbufs) that are waiting for an ARP request (to resolve |
---|
123 | * their destination address) to finish. |
---|
124 | * (requires the ARP_QUEUEING option) |
---|
125 | */ |
---|
126 | #define MEMP_NUM_ARP_QUEUE 2 |
---|
127 | |
---|
128 | /** |
---|
129 | * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. |
---|
130 | * (requires NO_SYS==0) |
---|
131 | */ |
---|
132 | #define MEMP_NUM_SYS_TIMEOUT 0 |
---|
133 | |
---|
134 | /** |
---|
135 | * MEMP_NUM_NETBUF: the number of struct netbufs. |
---|
136 | * (only needed if you use the sequential API, like api_lib.c) |
---|
137 | */ |
---|
138 | #define MEMP_NUM_NETBUF 0 |
---|
139 | |
---|
140 | /** |
---|
141 | * MEMP_NUM_NETCONN: the number of struct netconns. |
---|
142 | * (only needed if you use the sequential API, like api_lib.c) |
---|
143 | */ |
---|
144 | #define MEMP_NUM_NETCONN 0 |
---|
145 | |
---|
146 | /** |
---|
147 | * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used |
---|
148 | * for callback/timeout API communication. |
---|
149 | * (only needed if you use tcpip.c) |
---|
150 | */ |
---|
151 | #define MEMP_NUM_TCPIP_MSG_API 0 |
---|
152 | |
---|
153 | /** |
---|
154 | * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used |
---|
155 | * for incoming packets. |
---|
156 | * (only needed if you use tcpip.c) |
---|
157 | */ |
---|
158 | #define MEMP_NUM_TCPIP_MSG_INPKT 0 |
---|
159 | |
---|
160 | /** |
---|
161 | * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. |
---|
162 | */ |
---|
163 | #define PBUF_POOL_SIZE 32 |
---|
164 | |
---|
165 | /* |
---|
166 | --------------------------------- |
---|
167 | ---------- ARP options ---------- |
---|
168 | --------------------------------- |
---|
169 | */ |
---|
170 | /** |
---|
171 | * LWIP_ARP==1: Enable ARP functionality. |
---|
172 | */ |
---|
173 | #define LWIP_ARP 1 |
---|
174 | |
---|
175 | /* |
---|
176 | -------------------------------- |
---|
177 | ---------- IP options ---------- |
---|
178 | -------------------------------- |
---|
179 | */ |
---|
180 | /** |
---|
181 | * IP_FORWARD==1: Enables the ability to forward IP packets across network |
---|
182 | * interfaces. If you are going to run lwIP on a device with only one network |
---|
183 | * interface, define this to 0. |
---|
184 | */ |
---|
185 | #define IP_FORWARD 0 |
---|
186 | |
---|
187 | /** |
---|
188 | * IP_OPTIONS: Defines the behavior for IP options. |
---|
189 | * IP_OPTIONS==0_ALLOWED: All packets with IP options are dropped. |
---|
190 | * IP_OPTIONS==1_ALLOWED: IP options are allowed (but not parsed). |
---|
191 | */ |
---|
192 | #define IP_OPTIONS_ALLOWED 1 |
---|
193 | |
---|
194 | /** |
---|
195 | * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that |
---|
196 | * this option does not affect outgoing packet sizes, which can be controlled |
---|
197 | * via IP_FRAG. |
---|
198 | */ |
---|
199 | #define IP_REASSEMBLY 1 |
---|
200 | |
---|
201 | /** |
---|
202 | * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note |
---|
203 | * that this option does not affect incoming packet sizes, which can be |
---|
204 | * controlled via IP_REASSEMBLY. |
---|
205 | */ |
---|
206 | #define IP_FRAG 1 |
---|
207 | |
---|
208 | /** |
---|
209 | * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) |
---|
210 | * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived |
---|
211 | * in this time, the whole packet is discarded. |
---|
212 | */ |
---|
213 | #define IP_REASS_MAXAGE 3 |
---|
214 | |
---|
215 | /** |
---|
216 | * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. |
---|
217 | * Since the received pbufs are enqueued, be sure to configure |
---|
218 | * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive |
---|
219 | * packets even if the maximum amount of fragments is enqueued for reassembly! |
---|
220 | */ |
---|
221 | #define IP_REASS_MAX_PBUFS 10 |
---|
222 | |
---|
223 | /** |
---|
224 | * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP |
---|
225 | * fragmentation. Otherwise pbufs are allocated and reference the original |
---|
226 | * packet data to be fragmented. |
---|
227 | */ |
---|
228 | #define IP_FRAG_USES_STATIC_BUF 0 |
---|
229 | |
---|
230 | /** |
---|
231 | * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. |
---|
232 | */ |
---|
233 | #define IP_DEFAULT_TTL 255 |
---|
234 | |
---|
235 | /* |
---|
236 | ---------------------------------- |
---|
237 | ---------- ICMP options ---------- |
---|
238 | ---------------------------------- |
---|
239 | */ |
---|
240 | /** |
---|
241 | * LWIP_ICMP==1: Enable ICMP module inside the IP stack. |
---|
242 | * Be careful, disable that make your product non-compliant to RFC1122 |
---|
243 | */ |
---|
244 | #define LWIP_ICMP 1 |
---|
245 | |
---|
246 | /** |
---|
247 | * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. |
---|
248 | */ |
---|
249 | #define ICMP_TTL (IP_DEFAULT_TTL) |
---|
250 | |
---|
251 | /* |
---|
252 | --------------------------------- |
---|
253 | ---------- RAW options ---------- |
---|
254 | --------------------------------- |
---|
255 | */ |
---|
256 | /** |
---|
257 | * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. |
---|
258 | */ |
---|
259 | #define LWIP_RAW 1 |
---|
260 | |
---|
261 | /* |
---|
262 | ---------------------------------- |
---|
263 | ---------- DHCP options ---------- |
---|
264 | ---------------------------------- |
---|
265 | */ |
---|
266 | /** |
---|
267 | * LWIP_DHCP==1: Enable DHCP module. |
---|
268 | */ |
---|
269 | #define LWIP_DHCP 1 |
---|
270 | |
---|
271 | /* |
---|
272 | ------------------------------------ |
---|
273 | ---------- AUTOIP options ---------- |
---|
274 | ------------------------------------ |
---|
275 | */ |
---|
276 | /** |
---|
277 | * LWIP_AUTOIP==1: Enable AUTOIP module. |
---|
278 | */ |
---|
279 | #define LWIP_AUTOIP 0 |
---|
280 | |
---|
281 | /* |
---|
282 | ---------------------------------- |
---|
283 | ---------- SNMP options ---------- |
---|
284 | ---------------------------------- |
---|
285 | */ |
---|
286 | /** |
---|
287 | * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP |
---|
288 | * transport. |
---|
289 | */ |
---|
290 | #define LWIP_SNMP 0 |
---|
291 | #define SNMP_PRIVATE_MIB 0 |
---|
292 | |
---|
293 | /* |
---|
294 | ---------------------------------- |
---|
295 | ---------- IGMP options ---------- |
---|
296 | ---------------------------------- |
---|
297 | */ |
---|
298 | /** |
---|
299 | * LWIP_IGMP==1: Turn on IGMP module. |
---|
300 | */ |
---|
301 | #define LWIP_IGMP 1 |
---|
302 | |
---|
303 | /* |
---|
304 | ---------------------------------- |
---|
305 | ---------- DNS options ----------- |
---|
306 | ---------------------------------- |
---|
307 | */ |
---|
308 | /** |
---|
309 | * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS |
---|
310 | * transport. |
---|
311 | */ |
---|
312 | #define LWIP_DNS 1 |
---|
313 | |
---|
314 | /* |
---|
315 | --------------------------------- |
---|
316 | ---------- UDP options ---------- |
---|
317 | --------------------------------- |
---|
318 | */ |
---|
319 | /** |
---|
320 | * LWIP_UDP==1: Turn on UDP. |
---|
321 | */ |
---|
322 | #define LWIP_UDP 1 |
---|
323 | |
---|
324 | /** |
---|
325 | * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) |
---|
326 | */ |
---|
327 | #define LWIP_UDPLITE 0 |
---|
328 | |
---|
329 | /** |
---|
330 | * UDP_TTL: Default Time-To-Live value. |
---|
331 | */ |
---|
332 | #define UDP_TTL (IP_DEFAULT_TTL) |
---|
333 | |
---|
334 | /* |
---|
335 | --------------------------------- |
---|
336 | ---------- TCP options ---------- |
---|
337 | --------------------------------- |
---|
338 | */ |
---|
339 | /** |
---|
340 | * LWIP_TCP==1: Turn on TCP. |
---|
341 | */ |
---|
342 | #define LWIP_TCP 1 |
---|
343 | |
---|
344 | /* |
---|
345 | ---------------------------------- |
---|
346 | ---------- Pbuf options ---------- |
---|
347 | ---------------------------------- |
---|
348 | */ |
---|
349 | /** |
---|
350 | * PBUF_LINK_HLEN: the number of bytes that should be allocated for a |
---|
351 | * link level header. The default is 14, the standard value for |
---|
352 | * Ethernet. |
---|
353 | */ |
---|
354 | #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) |
---|
355 | |
---|
356 | /* |
---|
357 | ------------------------------------ |
---|
358 | ---------- LOOPIF options ---------- |
---|
359 | ------------------------------------ |
---|
360 | */ |
---|
361 | /** |
---|
362 | * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c |
---|
363 | */ |
---|
364 | #define LWIP_HAVE_LOOPIF 1 |
---|
365 | #define LWIP_LOOPIF_MULTITHREADING 0 |
---|
366 | |
---|
367 | /* |
---|
368 | ---------------------------------------------- |
---|
369 | ---------- Sequential layer options ---------- |
---|
370 | ---------------------------------------------- |
---|
371 | */ |
---|
372 | |
---|
373 | /** |
---|
374 | * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) |
---|
375 | */ |
---|
376 | #define LWIP_NETCONN 0 |
---|
377 | |
---|
378 | /* |
---|
379 | ------------------------------------ |
---|
380 | ---------- Socket options ---------- |
---|
381 | ------------------------------------ |
---|
382 | */ |
---|
383 | /** |
---|
384 | * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) |
---|
385 | */ |
---|
386 | #define LWIP_SOCKET 0 |
---|
387 | |
---|
388 | /* |
---|
389 | ---------------------------------------- |
---|
390 | ---------- Statistics options ---------- |
---|
391 | ---------------------------------------- |
---|
392 | */ |
---|
393 | /** |
---|
394 | * LWIP_STATS==1: Enable statistics collection in lwip_stats. |
---|
395 | */ |
---|
396 | #define LWIP_STATS 1 |
---|
397 | #define LINK_STATS 1 |
---|
398 | |
---|
399 | /* Misc */ |
---|
400 | #define LWIP_NETIF_LINK_CALLBACK 1 |
---|
401 | #define LWIP_NETIF_STATUS_CALLBACK 1 |
---|
402 | #define LWIP_TIMEVAL_PRIVATE 0 |
---|
403 | |
---|
404 | #undef DHCP_DOES_ARP_CHECK |
---|
405 | |
---|
406 | #if 0 |
---|
407 | #define LWIP_DEBUG 1 |
---|
408 | //#define NETIF_DEBUG LWIP_DBG_ON |
---|
409 | #define DHCP_DEBUG LWIP_DBG_ON |
---|
410 | //#define ICMP_DEBUG LWIP_DBG_ON |
---|
411 | //#define TCP_DEBUG LWIP_DBG_ON |
---|
412 | //#define TCP_RTO_DEBUG LWIP_DBG_ON |
---|
413 | //#define IP_DEBUG LWIP_DBG_ON |
---|
414 | //#define TCP_CWND_DEBUG LWIP_DBG_ON |
---|
415 | //#define ETHARP_DEBUG LWIP_DBG_ON |
---|
416 | //#define PBUF_DEBUG LWIP_DBG_ON |
---|
417 | #define TCP_INPUT_DEBUG LWIP_DBG_ON |
---|
418 | #define TCP_OUTPUT_DEBUG LWIP_DBG_ON |
---|
419 | #endif |
---|
420 | |
---|
421 | #define ETH_PAD_SIZE WL_HEADER_SIZE /* size of wifiengine header */ |
---|
422 | #define MEM_LIBC_MALLOC 1 |
---|
423 | |
---|
424 | #define TCP_MSS 512 |
---|
425 | #define TCP_SND_BUF 4096 |
---|
426 | #endif /* __LWIPOPTS_H__ */ |
---|