1 | /**
|
---|
2 | * @file
|
---|
3 | *
|
---|
4 | * lwIP Options Configuration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
---|
9 | * All rights reserved.
|
---|
10 | *
|
---|
11 | * Redistribution and use in source and binary forms, with or without modification,
|
---|
12 | * are permitted provided that the following conditions are met:
|
---|
13 | *
|
---|
14 | * 1. Redistributions of source code must retain the above copyright notice,
|
---|
15 | * this list of conditions and the following disclaimer.
|
---|
16 | * 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
17 | * this list of conditions and the following disclaimer in the documentation
|
---|
18 | * and/or other materials provided with the distribution.
|
---|
19 | * 3. The name of the author may not be used to endorse or promote products
|
---|
20 | * derived from this software without specific prior written permission.
|
---|
21 | *
|
---|
22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
---|
23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
---|
24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
---|
25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
---|
26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
---|
27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
---|
30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
---|
31 | * OF SUCH DAMAGE.
|
---|
32 | *
|
---|
33 | * This file is part of the lwIP TCP/IP stack.
|
---|
34 | *
|
---|
35 | * Author: Adam Dunkels <adam@sics.se>
|
---|
36 | *
|
---|
37 | */
|
---|
38 |
|
---|
39 | /*
|
---|
40 | * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug -
|
---|
41 | * without this, doxygen does not see the actual #define
|
---|
42 | */
|
---|
43 |
|
---|
44 | #if !defined LWIP_HDR_OPT_H
|
---|
45 | #define LWIP_HDR_OPT_H
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * Include user defined options first. Anything not defined in these files
|
---|
49 | * will be set to standard values. Override anything you don't like!
|
---|
50 | */
|
---|
51 | #include "lwipopts.h"
|
---|
52 | #include "lwip/debug.h"
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * @defgroup lwip_opts Options (lwipopts.h)
|
---|
56 | * @ingroup lwip
|
---|
57 | *
|
---|
58 | * @defgroup lwip_opts_debug Debugging
|
---|
59 | * @ingroup lwip_opts
|
---|
60 | *
|
---|
61 | * @defgroup lwip_opts_infrastructure Infrastructure
|
---|
62 | * @ingroup lwip_opts
|
---|
63 | *
|
---|
64 | * @defgroup lwip_opts_callback Callback-style APIs
|
---|
65 | * @ingroup lwip_opts
|
---|
66 | *
|
---|
67 | * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs
|
---|
68 | * @ingroup lwip_opts
|
---|
69 | */
|
---|
70 |
|
---|
71 | /*
|
---|
72 | ------------------------------------
|
---|
73 | -------------- NO SYS --------------
|
---|
74 | ------------------------------------
|
---|
75 | */
|
---|
76 | /**
|
---|
77 | * @defgroup lwip_opts_nosys NO_SYS
|
---|
78 | * @ingroup lwip_opts_infrastructure
|
---|
79 | * @{
|
---|
80 | */
|
---|
81 | /**
|
---|
82 | * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or
|
---|
83 | * mboxes). This means threaded APIs cannot be used (socket, netconn,
|
---|
84 | * i.e. everything in the 'api' folder), only the callback-style raw API is
|
---|
85 | * available (and you have to watch out for yourself that you don't access
|
---|
86 | * lwIP functions/structures from more than one context at a time!)
|
---|
87 | */
|
---|
88 | #if !defined NO_SYS || defined __DOXYGEN__
|
---|
89 | #define NO_SYS 0
|
---|
90 | #endif
|
---|
91 | /**
|
---|
92 | * @}
|
---|
93 | */
|
---|
94 |
|
---|
95 | /**
|
---|
96 | * @defgroup lwip_opts_timers Timers
|
---|
97 | * @ingroup lwip_opts_infrastructure
|
---|
98 | * @{
|
---|
99 | */
|
---|
100 | /**
|
---|
101 | * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers.
|
---|
102 | * (the array of lwip-internal cyclic timers is still provided)
|
---|
103 | * (check NO_SYS_NO_TIMERS for compatibility to old versions)
|
---|
104 | */
|
---|
105 | #if !defined LWIP_TIMERS || defined __DOXYGEN__
|
---|
106 | #ifdef NO_SYS_NO_TIMERS
|
---|
107 | #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
|
---|
108 | #else
|
---|
109 | #define LWIP_TIMERS 1
|
---|
110 | #endif
|
---|
111 | #endif
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation.
|
---|
115 | * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers
|
---|
116 | * are still included, but the implementation is not. The following functions
|
---|
117 | * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(),
|
---|
118 | * sys_timeouts_mbox_fetch()
|
---|
119 | */
|
---|
120 | #if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__
|
---|
121 | #define LWIP_TIMERS_CUSTOM 0
|
---|
122 | #endif
|
---|
123 | /**
|
---|
124 | * @}
|
---|
125 | */
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * @defgroup lwip_opts_memcpy memcpy
|
---|
129 | * @ingroup lwip_opts_infrastructure
|
---|
130 | * @{
|
---|
131 | */
|
---|
132 | /**
|
---|
133 | * MEMCPY: override this if you have a faster implementation at hand than the
|
---|
134 | * one included in your C library
|
---|
135 | */
|
---|
136 | #if !defined MEMCPY || defined __DOXYGEN__
|
---|
137 | #define MEMCPY(dst,src,len) memcpy(dst,src,len)
|
---|
138 | #endif
|
---|
139 |
|
---|
140 | /**
|
---|
141 | * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
|
---|
142 | * call to memcpy() if the length is known at compile time and is small.
|
---|
143 | */
|
---|
144 | #if !defined SMEMCPY || defined __DOXYGEN__
|
---|
145 | #define SMEMCPY(dst,src,len) memcpy(dst,src,len)
|
---|
146 | #endif
|
---|
147 |
|
---|
148 | /**
|
---|
149 | * MEMMOVE: override this if you have a faster implementation at hand than the
|
---|
150 | * one included in your C library. lwIP currently uses MEMMOVE only when IPv6
|
---|
151 | * fragmentation support is enabled.
|
---|
152 | */
|
---|
153 | #if !defined MEMMOVE || defined __DOXYGEN__
|
---|
154 | #define MEMMOVE(dst,src,len) memmove(dst,src,len)
|
---|
155 | #endif
|
---|
156 | /**
|
---|
157 | * @}
|
---|
158 | */
|
---|
159 |
|
---|
160 | /*
|
---|
161 | ------------------------------------
|
---|
162 | ----------- Core locking -----------
|
---|
163 | ------------------------------------
|
---|
164 | */
|
---|
165 | /**
|
---|
166 | * @defgroup lwip_opts_lock Core locking and MPU
|
---|
167 | * @ingroup lwip_opts_infrastructure
|
---|
168 | * @{
|
---|
169 | */
|
---|
170 | /**
|
---|
171 | * LWIP_MPU_COMPATIBLE: enables special memory management mechanism
|
---|
172 | * which makes lwip able to work on MPU (Memory Protection Unit) system
|
---|
173 | * by not passing stack-pointers to other threads
|
---|
174 | * (this decreases performance as memory is allocated from pools instead
|
---|
175 | * of keeping it on the stack)
|
---|
176 | */
|
---|
177 | #if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__
|
---|
178 | #define LWIP_MPU_COMPATIBLE 0
|
---|
179 | #endif
|
---|
180 |
|
---|
181 | /**
|
---|
182 | * LWIP_TCPIP_CORE_LOCKING
|
---|
183 | * Creates a global mutex that is held during TCPIP thread operations.
|
---|
184 | * Can be locked by client code to perform lwIP operations without changing
|
---|
185 | * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and
|
---|
186 | * UNLOCK_TCPIP_CORE().
|
---|
187 | * Your system should provide mutexes supporting priority inversion to use this.
|
---|
188 | */
|
---|
189 | #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__
|
---|
190 | #define LWIP_TCPIP_CORE_LOCKING 1
|
---|
191 | #endif
|
---|
192 |
|
---|
193 | /**
|
---|
194 | * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled,
|
---|
195 | * this lets tcpip_input() grab the mutex for input packets as well,
|
---|
196 | * instead of allocating a message and passing it to tcpip_thread.
|
---|
197 | *
|
---|
198 | * ATTENTION: this does not work when tcpip_input() is called from
|
---|
199 | * interrupt context!
|
---|
200 | */
|
---|
201 | #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__
|
---|
202 | #define LWIP_TCPIP_CORE_LOCKING_INPUT 0
|
---|
203 | #endif
|
---|
204 |
|
---|
205 | /**
|
---|
206 | * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt
|
---|
207 | * protection) for certain critical regions during buffer allocation, deallocation
|
---|
208 | * and memory allocation and deallocation.
|
---|
209 | * ATTENTION: This is required when using lwIP from more than one context! If
|
---|
210 | * you disable this, you must be sure what you are doing!
|
---|
211 | */
|
---|
212 | #if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__
|
---|
213 | #define SYS_LIGHTWEIGHT_PROT 1
|
---|
214 | #endif
|
---|
215 |
|
---|
216 | /**
|
---|
217 | * Macro/function to check whether lwIP's threading/locking
|
---|
218 | * requirements are satisfied during current function call.
|
---|
219 | * This macro usually calls a function that is implemented in the OS-dependent
|
---|
220 | * sys layer and performs the following checks:
|
---|
221 | * - Not in ISR (this should be checked for NO_SYS==1, too!)
|
---|
222 | * - If @ref LWIP_TCPIP_CORE_LOCKING = 1: TCPIP core lock is held
|
---|
223 | * - If @ref LWIP_TCPIP_CORE_LOCKING = 0: function is called from TCPIP thread
|
---|
224 | * @see @ref multithreading
|
---|
225 | */
|
---|
226 | #if !defined LWIP_ASSERT_CORE_LOCKED || defined __DOXYGEN__
|
---|
227 | #define LWIP_ASSERT_CORE_LOCKED()
|
---|
228 | #endif
|
---|
229 |
|
---|
230 | /**
|
---|
231 | * Called as first thing in the lwIP TCPIP thread. Can be used in conjunction
|
---|
232 | * with @ref LWIP_ASSERT_CORE_LOCKED to check core locking.
|
---|
233 | * @see @ref multithreading
|
---|
234 | */
|
---|
235 | #if !defined LWIP_MARK_TCPIP_THREAD || defined __DOXYGEN__
|
---|
236 | #define LWIP_MARK_TCPIP_THREAD()
|
---|
237 | #endif
|
---|
238 | /**
|
---|
239 | * @}
|
---|
240 | */
|
---|
241 |
|
---|
242 | /*
|
---|
243 | ------------------------------------
|
---|
244 | ---------- Memory options ----------
|
---|
245 | ------------------------------------
|
---|
246 | */
|
---|
247 | /**
|
---|
248 | * @defgroup lwip_opts_mem Heap and memory pools
|
---|
249 | * @ingroup lwip_opts_infrastructure
|
---|
250 | * @{
|
---|
251 | */
|
---|
252 | /**
|
---|
253 | * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
|
---|
254 | * instead of the lwip internal allocator. Can save code size if you
|
---|
255 | * already use it.
|
---|
256 | */
|
---|
257 | #if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__
|
---|
258 | #define MEM_LIBC_MALLOC 0
|
---|
259 | #endif
|
---|
260 |
|
---|
261 | /**
|
---|
262 | * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
|
---|
263 | * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
|
---|
264 | * speed (heap alloc can be much slower than pool alloc) and usage from interrupts
|
---|
265 | * (especially if your netif driver allocates PBUF_POOL pbufs for received frames
|
---|
266 | * from interrupt)!
|
---|
267 | * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools,
|
---|
268 | * not only for internal pools defined in memp_std.h)!
|
---|
269 | */
|
---|
270 | #if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__
|
---|
271 | #define MEMP_MEM_MALLOC 0
|
---|
272 | #endif
|
---|
273 |
|
---|
274 | /**
|
---|
275 | * MEMP_MEM_INIT==1: Force use of memset to initialize pool memory.
|
---|
276 | * Useful if pool are moved in uninitialized section of memory. This will ensure
|
---|
277 | * default values in pcbs struct are well initialized in all conditions.
|
---|
278 | */
|
---|
279 | #if !defined MEMP_MEM_INIT || defined __DOXYGEN__
|
---|
280 | #define MEMP_MEM_INIT 0
|
---|
281 | #endif
|
---|
282 |
|
---|
283 | /**
|
---|
284 | * MEM_ALIGNMENT: should be set to the alignment of the CPU
|
---|
285 | * 4 byte alignment -> \#define MEM_ALIGNMENT 4
|
---|
286 | * 2 byte alignment -> \#define MEM_ALIGNMENT 2
|
---|
287 | */
|
---|
288 | #if !defined MEM_ALIGNMENT || defined __DOXYGEN__
|
---|
289 | #define MEM_ALIGNMENT 1
|
---|
290 | #endif
|
---|
291 |
|
---|
292 | /**
|
---|
293 | * MEM_SIZE: the size of the heap memory. If the application will send
|
---|
294 | * a lot of data that needs to be copied, this should be set high.
|
---|
295 | */
|
---|
296 | #if !defined MEM_SIZE || defined __DOXYGEN__
|
---|
297 | #define MEM_SIZE (10 * 1024)
|
---|
298 | #endif
|
---|
299 |
|
---|
300 | /**
|
---|
301 | * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
|
---|
302 | * amount of bytes before and after each memp element in every pool and fills
|
---|
303 | * it with a prominent default value.
|
---|
304 | * MEMP_OVERFLOW_CHECK == 0 no checking
|
---|
305 | * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
|
---|
306 | * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
|
---|
307 | * memp_malloc() or memp_free() is called (useful but slow!)
|
---|
308 | */
|
---|
309 | #if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__
|
---|
310 | #define MEMP_OVERFLOW_CHECK 0
|
---|
311 | #endif
|
---|
312 |
|
---|
313 | /**
|
---|
314 | * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
|
---|
315 | * sure that there are no cycles in the linked lists.
|
---|
316 | */
|
---|
317 | #if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__
|
---|
318 | #define MEMP_SANITY_CHECK 0
|
---|
319 | #endif
|
---|
320 |
|
---|
321 | /**
|
---|
322 | * MEM_OVERFLOW_CHECK: mem overflow protection reserves a configurable
|
---|
323 | * amount of bytes before and after each heap allocation chunk and fills
|
---|
324 | * it with a prominent default value.
|
---|
325 | * MEM_OVERFLOW_CHECK == 0 no checking
|
---|
326 | * MEM_OVERFLOW_CHECK == 1 checks each element when it is freed
|
---|
327 | * MEM_OVERFLOW_CHECK >= 2 checks all heap elements every time
|
---|
328 | * mem_malloc() or mem_free() is called (useful but slow!)
|
---|
329 | */
|
---|
330 | #if !defined MEM_OVERFLOW_CHECK || defined __DOXYGEN__
|
---|
331 | #define MEM_OVERFLOW_CHECK 0
|
---|
332 | #endif
|
---|
333 |
|
---|
334 | /**
|
---|
335 | * MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make
|
---|
336 | * sure that the linked list of heap elements is not corrupted.
|
---|
337 | */
|
---|
338 | #if !defined MEM_SANITY_CHECK || defined __DOXYGEN__
|
---|
339 | #define MEM_SANITY_CHECK 0
|
---|
340 | #endif
|
---|
341 |
|
---|
342 | /**
|
---|
343 | * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
|
---|
344 | * of memory pools of various sizes. When mem_malloc is called, an element of
|
---|
345 | * the smallest pool that can provide the length needed is returned.
|
---|
346 | * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
|
---|
347 | */
|
---|
348 | #if !defined MEM_USE_POOLS || defined __DOXYGEN__
|
---|
349 | #define MEM_USE_POOLS 0
|
---|
350 | #endif
|
---|
351 |
|
---|
352 | /**
|
---|
353 | * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
|
---|
354 | * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
|
---|
355 | * reliable. */
|
---|
356 | #if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__
|
---|
357 | #define MEM_USE_POOLS_TRY_BIGGER_POOL 0
|
---|
358 | #endif
|
---|
359 |
|
---|
360 | /**
|
---|
361 | * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
|
---|
362 | * that defines additional pools beyond the "standard" ones required
|
---|
363 | * by lwIP. If you set this to 1, you must have lwippools.h in your
|
---|
364 | * include path somewhere.
|
---|
365 | */
|
---|
366 | #if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__
|
---|
367 | #define MEMP_USE_CUSTOM_POOLS 0
|
---|
368 | #endif
|
---|
369 |
|
---|
370 | /**
|
---|
371 | * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
|
---|
372 | * interrupt context (or another context that doesn't allow waiting for a
|
---|
373 | * semaphore).
|
---|
374 | * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
|
---|
375 | * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
|
---|
376 | * with each loop so that mem_free can run.
|
---|
377 | *
|
---|
378 | * ATTENTION: As you can see from the above description, this leads to dis-/
|
---|
379 | * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
|
---|
380 | * can need longer.
|
---|
381 | *
|
---|
382 | * If you don't want that, at least for NO_SYS=0, you can still use the following
|
---|
383 | * functions to enqueue a deallocation call which then runs in the tcpip_thread
|
---|
384 | * context:
|
---|
385 | * - pbuf_free_callback(p);
|
---|
386 | * - mem_free_callback(m);
|
---|
387 | */
|
---|
388 | #if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__
|
---|
389 | #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
|
---|
390 | #endif
|
---|
391 | /**
|
---|
392 | * @}
|
---|
393 | */
|
---|
394 |
|
---|
395 | /*
|
---|
396 | ------------------------------------------------
|
---|
397 | ---------- Internal Memory Pool Sizes ----------
|
---|
398 | ------------------------------------------------
|
---|
399 | */
|
---|
400 | /**
|
---|
401 | * @defgroup lwip_opts_memp Internal memory pools
|
---|
402 | * @ingroup lwip_opts_infrastructure
|
---|
403 | * @{
|
---|
404 | */
|
---|
405 | /**
|
---|
406 | * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
|
---|
407 | * If the application sends a lot of data out of ROM (or other static memory),
|
---|
408 | * this should be set high.
|
---|
409 | */
|
---|
410 | #if !defined MEMP_NUM_PBUF || defined __DOXYGEN__
|
---|
411 | #define MEMP_NUM_PBUF 16
|
---|
412 | #endif
|
---|
413 |
|
---|
414 | /**
|
---|
415 | * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
|
---|
416 | * (requires the LWIP_RAW option)
|
---|
417 | */
|
---|
418 | #if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__
|
---|
419 | #define MEMP_NUM_RAW_PCB 4
|
---|
420 | #endif
|
---|
421 |
|
---|
422 | /**
|
---|
423 | * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
|
---|
424 | * per active UDP "connection".
|
---|
425 | * (requires the LWIP_UDP option)
|
---|
426 | */
|
---|
427 | #if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__
|
---|
428 | #define MEMP_NUM_UDP_PCB 4
|
---|
429 | #endif
|
---|
430 |
|
---|
431 | /**
|
---|
432 | * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections.
|
---|
433 | * (requires the LWIP_TCP option)
|
---|
434 | */
|
---|
435 | #if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__
|
---|
436 | #define MEMP_NUM_TCP_PCB 4
|
---|
437 | #endif
|
---|
438 |
|
---|
439 | /**
|
---|
440 | * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
|
---|
441 | * (requires the LWIP_TCP option)
|
---|
442 | */
|
---|
443 | #if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__
|
---|
444 | #define MEMP_NUM_TCP_PCB_LISTEN 4
|
---|
445 | #endif
|
---|
446 |
|
---|
447 | /**
|
---|
448 | * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
|
---|
449 | * (requires the LWIP_TCP option)
|
---|
450 | */
|
---|
451 | #if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__
|
---|
452 | #define MEMP_NUM_TCP_SEG 16
|
---|
453 | #endif
|
---|
454 |
|
---|
455 | /**
|
---|
456 | * MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs.
|
---|
457 | * (requires the LWIP_ALTCP option)
|
---|
458 | * Connections with multiple layers require more than one altcp_pcb (e.g. TLS
|
---|
459 | * over TCP requires 2 altcp_pcbs, one for TLS and one for TCP).
|
---|
460 | */
|
---|
461 | #if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__
|
---|
462 | #define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB
|
---|
463 | #endif
|
---|
464 |
|
---|
465 | /**
|
---|
466 | * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
|
---|
467 | * reassembly (whole packets, not fragments!)
|
---|
468 | */
|
---|
469 | #if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__
|
---|
470 | #define MEMP_NUM_REASSDATA 5
|
---|
471 | #endif
|
---|
472 |
|
---|
473 | /**
|
---|
474 | * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
|
---|
475 | * (fragments, not whole packets!).
|
---|
476 | * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1
|
---|
477 | * with DMA-enabled MACs where the packet is not yet sent when netif->output
|
---|
478 | * returns.
|
---|
479 | */
|
---|
480 | #if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__
|
---|
481 | #define MEMP_NUM_FRAG_PBUF 15
|
---|
482 | #endif
|
---|
483 |
|
---|
484 | /**
|
---|
485 | * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing
|
---|
486 | * packets (pbufs) that are waiting for an ARP request (to resolve
|
---|
487 | * their destination address) to finish.
|
---|
488 | * (requires the ARP_QUEUEING option)
|
---|
489 | */
|
---|
490 | #if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__
|
---|
491 | #define MEMP_NUM_ARP_QUEUE 30
|
---|
492 | #endif
|
---|
493 |
|
---|
494 | /**
|
---|
495 | * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
|
---|
496 | * can be members at the same time (one per netif - allsystems group -, plus one
|
---|
497 | * per netif membership).
|
---|
498 | * (requires the LWIP_IGMP option)
|
---|
499 | */
|
---|
500 | #if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__
|
---|
501 | #define MEMP_NUM_IGMP_GROUP 8
|
---|
502 | #endif
|
---|
503 |
|
---|
504 | /**
|
---|
505 | * The number of sys timeouts used by the core stack (not apps)
|
---|
506 | * The default number of timeouts is calculated here for all enabled modules.
|
---|
507 | */
|
---|
508 | #define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))
|
---|
509 |
|
---|
510 | /**
|
---|
511 | * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts.
|
---|
512 | * The default number of timeouts is calculated here for all enabled modules.
|
---|
513 | * The formula expects settings to be either '0' or '1'.
|
---|
514 | */
|
---|
515 | #if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__
|
---|
516 | #define MEMP_NUM_SYS_TIMEOUT LWIP_NUM_SYS_TIMEOUT_INTERNAL + 4
|
---|
517 | #endif
|
---|
518 |
|
---|
519 | /**
|
---|
520 | * MEMP_NUM_NETBUF: the number of struct netbufs.
|
---|
521 | * (only needed if you use the sequential API, like api_lib.c)
|
---|
522 | */
|
---|
523 | #if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__
|
---|
524 | #define MEMP_NUM_NETBUF 4
|
---|
525 | #endif
|
---|
526 |
|
---|
527 | /**
|
---|
528 | * MEMP_NUM_NETCONN: the number of struct netconns.
|
---|
529 | * (only needed if you use the sequential API, like api_lib.c)
|
---|
530 | */
|
---|
531 | #if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__
|
---|
532 | #define MEMP_NUM_NETCONN 8
|
---|
533 | #endif
|
---|
534 |
|
---|
535 | /**
|
---|
536 | * MEMP_NUM_SELECT_CB: the number of struct lwip_select_cb.
|
---|
537 | * (Only needed if you have LWIP_MPU_COMPATIBLE==1 and use the socket API.
|
---|
538 | * In that case, you need one per thread calling lwip_select.)
|
---|
539 | */
|
---|
540 | #if !defined MEMP_NUM_SELECT_CB || defined __DOXYGEN__
|
---|
541 | #define MEMP_NUM_SELECT_CB 4
|
---|
542 | #endif
|
---|
543 |
|
---|
544 | /**
|
---|
545 | * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
|
---|
546 | * for callback/timeout API communication.
|
---|
547 | * (only needed if you use tcpip.c)
|
---|
548 | */
|
---|
549 | #if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__
|
---|
550 | #define MEMP_NUM_TCPIP_MSG_API 16
|
---|
551 | #endif
|
---|
552 |
|
---|
553 | /**
|
---|
554 | * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
|
---|
555 | * for incoming packets.
|
---|
556 | * (only needed if you use tcpip.c)
|
---|
557 | */
|
---|
558 | #if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__
|
---|
559 | #define MEMP_NUM_TCPIP_MSG_INPKT 8
|
---|
560 | #endif
|
---|
561 |
|
---|
562 | /**
|
---|
563 | * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
|
---|
564 | * (before freeing the corresponding memory using lwip_freeaddrinfo()).
|
---|
565 | */
|
---|
566 | #if !defined MEMP_NUM_NETDB || defined __DOXYGEN__
|
---|
567 | #define MEMP_NUM_NETDB 1
|
---|
568 | #endif
|
---|
569 |
|
---|
570 | /**
|
---|
571 | * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
|
---|
572 | * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
|
---|
573 | */
|
---|
574 | #if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__
|
---|
575 | #define MEMP_NUM_LOCALHOSTLIST 1
|
---|
576 | #endif
|
---|
577 |
|
---|
578 | /**
|
---|
579 | * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
|
---|
580 | */
|
---|
581 | #if !defined PBUF_POOL_SIZE || defined __DOXYGEN__
|
---|
582 | #define PBUF_POOL_SIZE 16
|
---|
583 | #endif
|
---|
584 |
|
---|
585 | /** MEMP_NUM_API_MSG: the number of concurrently active calls to various
|
---|
586 | * socket, netconn, and tcpip functions
|
---|
587 | */
|
---|
588 | #if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__
|
---|
589 | #define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API
|
---|
590 | #endif
|
---|
591 |
|
---|
592 | /** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname
|
---|
593 | */
|
---|
594 | #if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__
|
---|
595 | #define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API
|
---|
596 | #endif
|
---|
597 |
|
---|
598 | /** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls
|
---|
599 | * to getsockopt/setsockopt
|
---|
600 | */
|
---|
601 | #if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__
|
---|
602 | #define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API
|
---|
603 | #endif
|
---|
604 |
|
---|
605 | /** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the
|
---|
606 | * netifapi functions
|
---|
607 | */
|
---|
608 | #if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__
|
---|
609 | #define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API
|
---|
610 | #endif
|
---|
611 | /**
|
---|
612 | * @}
|
---|
613 | */
|
---|
614 |
|
---|
615 | /*
|
---|
616 | ---------------------------------
|
---|
617 | ---------- ARP options ----------
|
---|
618 | ---------------------------------
|
---|
619 | */
|
---|
620 | /**
|
---|
621 | * @defgroup lwip_opts_arp ARP
|
---|
622 | * @ingroup lwip_opts_ipv4
|
---|
623 | * @{
|
---|
624 | */
|
---|
625 | /**
|
---|
626 | * LWIP_ARP==1: Enable ARP functionality.
|
---|
627 | */
|
---|
628 | #if !defined LWIP_ARP || defined __DOXYGEN__
|
---|
629 | #define LWIP_ARP 1
|
---|
630 | #endif
|
---|
631 |
|
---|
632 | /**
|
---|
633 | * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
|
---|
634 | */
|
---|
635 | #if !defined ARP_TABLE_SIZE || defined __DOXYGEN__
|
---|
636 | #define ARP_TABLE_SIZE 10
|
---|
637 | #endif
|
---|
638 |
|
---|
639 | /** the time an ARP entry stays valid after its last update,
|
---|
640 | * for ARP_TMR_INTERVAL = 1000, this is
|
---|
641 | * (60 * 5) seconds = 5 minutes.
|
---|
642 | */
|
---|
643 | #if !defined ARP_MAXAGE || defined __DOXYGEN__
|
---|
644 | #define ARP_MAXAGE 300
|
---|
645 | #endif
|
---|
646 |
|
---|
647 | /**
|
---|
648 | * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
|
---|
649 | * resolution. By default, only the most recent packet is queued per IP address.
|
---|
650 | * This is sufficient for most protocols and mainly reduces TCP connection
|
---|
651 | * startup time. Set this to 1 if you know your application sends more than one
|
---|
652 | * packet in a row to an IP address that is not in the ARP cache.
|
---|
653 | */
|
---|
654 | #if !defined ARP_QUEUEING || defined __DOXYGEN__
|
---|
655 | #define ARP_QUEUEING 0
|
---|
656 | #endif
|
---|
657 |
|
---|
658 | /** The maximum number of packets which may be queued for each
|
---|
659 | * unresolved address by other network layers. Defaults to 3, 0 means disabled.
|
---|
660 | * Old packets are dropped, new packets are queued.
|
---|
661 | */
|
---|
662 | #if !defined ARP_QUEUE_LEN || defined __DOXYGEN__
|
---|
663 | #define ARP_QUEUE_LEN 3
|
---|
664 | #endif
|
---|
665 |
|
---|
666 | /**
|
---|
667 | * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with
|
---|
668 | * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and
|
---|
669 | * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers.
|
---|
670 | * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
|
---|
671 | * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
|
---|
672 | * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
|
---|
673 | * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan)
|
---|
674 | * that returns 1 to accept a packet or 0 to drop a packet.
|
---|
675 | */
|
---|
676 | #if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__
|
---|
677 | #define ETHARP_SUPPORT_VLAN 0
|
---|
678 | #endif
|
---|
679 |
|
---|
680 | /** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled
|
---|
681 | */
|
---|
682 | #if !defined LWIP_ETHERNET || defined __DOXYGEN__
|
---|
683 | #define LWIP_ETHERNET LWIP_ARP
|
---|
684 | #endif
|
---|
685 |
|
---|
686 | /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
|
---|
687 | * alignment of payload after that header. Since the header is 14 bytes long,
|
---|
688 | * without this padding e.g. addresses in the IP header will not be aligned
|
---|
689 | * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
|
---|
690 | */
|
---|
691 | #if !defined ETH_PAD_SIZE || defined __DOXYGEN__
|
---|
692 | #define ETH_PAD_SIZE 0
|
---|
693 | #endif
|
---|
694 |
|
---|
695 | /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
|
---|
696 | * entries (using etharp_add_static_entry/etharp_remove_static_entry).
|
---|
697 | */
|
---|
698 | #if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__
|
---|
699 | #define ETHARP_SUPPORT_STATIC_ENTRIES 0
|
---|
700 | #endif
|
---|
701 |
|
---|
702 | /** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries.
|
---|
703 | * If disabled, duplicate IP address on multiple netifs are not supported
|
---|
704 | * (but this should only occur for AutoIP).
|
---|
705 | */
|
---|
706 | #if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__
|
---|
707 | #define ETHARP_TABLE_MATCH_NETIF !LWIP_SINGLE_NETIF
|
---|
708 | #endif
|
---|
709 | /**
|
---|
710 | * @}
|
---|
711 | */
|
---|
712 |
|
---|
713 | /*
|
---|
714 | --------------------------------
|
---|
715 | ---------- IP options ----------
|
---|
716 | --------------------------------
|
---|
717 | */
|
---|
718 | /**
|
---|
719 | * @defgroup lwip_opts_ipv4 IPv4
|
---|
720 | * @ingroup lwip_opts
|
---|
721 | * @{
|
---|
722 | */
|
---|
723 | /**
|
---|
724 | * LWIP_IPV4==1: Enable IPv4
|
---|
725 | */
|
---|
726 | #if !defined LWIP_IPV4 || defined __DOXYGEN__
|
---|
727 | #define LWIP_IPV4 1
|
---|
728 | #endif
|
---|
729 |
|
---|
730 | /**
|
---|
731 | * IP_FORWARD==1: Enables the ability to forward IP packets across network
|
---|
732 | * interfaces. If you are going to run lwIP on a device with only one network
|
---|
733 | * interface, define this to 0.
|
---|
734 | */
|
---|
735 | #if !defined IP_FORWARD || defined __DOXYGEN__
|
---|
736 | #define IP_FORWARD 0
|
---|
737 | #endif
|
---|
738 |
|
---|
739 | /**
|
---|
740 | * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
|
---|
741 | * this option does not affect outgoing packet sizes, which can be controlled
|
---|
742 | * via IP_FRAG.
|
---|
743 | */
|
---|
744 | #if !defined IP_REASSEMBLY || defined __DOXYGEN__
|
---|
745 | #define IP_REASSEMBLY 1
|
---|
746 | #endif
|
---|
747 |
|
---|
748 | /**
|
---|
749 | * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
|
---|
750 | * that this option does not affect incoming packet sizes, which can be
|
---|
751 | * controlled via IP_REASSEMBLY.
|
---|
752 | */
|
---|
753 | #if !defined IP_FRAG || defined __DOXYGEN__
|
---|
754 | #define IP_FRAG 1
|
---|
755 | #endif
|
---|
756 |
|
---|
757 | #if !LWIP_IPV4
|
---|
758 | /* disable IPv4 extensions when IPv4 is disabled */
|
---|
759 | #undef IP_FORWARD
|
---|
760 | #define IP_FORWARD 0
|
---|
761 | #undef IP_REASSEMBLY
|
---|
762 | #define IP_REASSEMBLY 0
|
---|
763 | #undef IP_FRAG
|
---|
764 | #define IP_FRAG 0
|
---|
765 | #endif /* !LWIP_IPV4 */
|
---|
766 |
|
---|
767 | /**
|
---|
768 | * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
|
---|
769 | * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
|
---|
770 | * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
|
---|
771 | */
|
---|
772 | #if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__
|
---|
773 | #define IP_OPTIONS_ALLOWED 1
|
---|
774 | #endif
|
---|
775 |
|
---|
776 | /**
|
---|
777 | * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
|
---|
778 | * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
|
---|
779 | * in this time, the whole packet is discarded.
|
---|
780 | */
|
---|
781 | #if !defined IP_REASS_MAXAGE || defined __DOXYGEN__
|
---|
782 | #define IP_REASS_MAXAGE 15
|
---|
783 | #endif
|
---|
784 |
|
---|
785 | /**
|
---|
786 | * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
|
---|
787 | * Since the received pbufs are enqueued, be sure to configure
|
---|
788 | * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
|
---|
789 | * packets even if the maximum amount of fragments is enqueued for reassembly!
|
---|
790 | * When IPv4 *and* IPv6 are enabled, this even changes to
|
---|
791 | * (PBUF_POOL_SIZE > 2 * IP_REASS_MAX_PBUFS)!
|
---|
792 | */
|
---|
793 | #if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__
|
---|
794 | #define IP_REASS_MAX_PBUFS 10
|
---|
795 | #endif
|
---|
796 |
|
---|
797 | /**
|
---|
798 | * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
|
---|
799 | */
|
---|
800 | #if !defined IP_DEFAULT_TTL || defined __DOXYGEN__
|
---|
801 | #define IP_DEFAULT_TTL 255
|
---|
802 | #endif
|
---|
803 |
|
---|
804 | /**
|
---|
805 | * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
|
---|
806 | * filter per pcb on udp and raw send operations. To enable broadcast filter
|
---|
807 | * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
|
---|
808 | */
|
---|
809 | #if !defined IP_SOF_BROADCAST || defined __DOXYGEN__
|
---|
810 | #define IP_SOF_BROADCAST 0
|
---|
811 | #endif
|
---|
812 |
|
---|
813 | /**
|
---|
814 | * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
|
---|
815 | * filter on recv operations.
|
---|
816 | */
|
---|
817 | #if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__
|
---|
818 | #define IP_SOF_BROADCAST_RECV 0
|
---|
819 | #endif
|
---|
820 |
|
---|
821 | /**
|
---|
822 | * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back
|
---|
823 | * out on the netif where it was received. This should only be used for
|
---|
824 | * wireless networks.
|
---|
825 | * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming
|
---|
826 | * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags!
|
---|
827 | */
|
---|
828 | #if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__
|
---|
829 | #define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0
|
---|
830 | #endif
|
---|
831 | /**
|
---|
832 | * @}
|
---|
833 | */
|
---|
834 |
|
---|
835 | /*
|
---|
836 | ----------------------------------
|
---|
837 | ---------- ICMP options ----------
|
---|
838 | ----------------------------------
|
---|
839 | */
|
---|
840 | /**
|
---|
841 | * @defgroup lwip_opts_icmp ICMP
|
---|
842 | * @ingroup lwip_opts_ipv4
|
---|
843 | * @{
|
---|
844 | */
|
---|
845 | /**
|
---|
846 | * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
|
---|
847 | * Be careful, disable that make your product non-compliant to RFC1122
|
---|
848 | */
|
---|
849 | #if !defined LWIP_ICMP || defined __DOXYGEN__
|
---|
850 | #define LWIP_ICMP 1
|
---|
851 | #endif
|
---|
852 |
|
---|
853 | /**
|
---|
854 | * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
|
---|
855 | */
|
---|
856 | #if !defined ICMP_TTL || defined __DOXYGEN__
|
---|
857 | #define ICMP_TTL IP_DEFAULT_TTL
|
---|
858 | #endif
|
---|
859 |
|
---|
860 | /**
|
---|
861 | * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
|
---|
862 | */
|
---|
863 | #if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__
|
---|
864 | #define LWIP_BROADCAST_PING 0
|
---|
865 | #endif
|
---|
866 |
|
---|
867 | /**
|
---|
868 | * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
|
---|
869 | */
|
---|
870 | #if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__
|
---|
871 | #define LWIP_MULTICAST_PING 0
|
---|
872 | #endif
|
---|
873 | /**
|
---|
874 | * @}
|
---|
875 | */
|
---|
876 |
|
---|
877 | /*
|
---|
878 | ---------------------------------
|
---|
879 | ---------- RAW options ----------
|
---|
880 | ---------------------------------
|
---|
881 | */
|
---|
882 | /**
|
---|
883 | * @defgroup lwip_opts_raw RAW
|
---|
884 | * @ingroup lwip_opts_callback
|
---|
885 | * @{
|
---|
886 | */
|
---|
887 | /**
|
---|
888 | * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
|
---|
889 | */
|
---|
890 | #if !defined LWIP_RAW || defined __DOXYGEN__
|
---|
891 | #define LWIP_RAW 0
|
---|
892 | #endif
|
---|
893 |
|
---|
894 | /**
|
---|
895 | * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
|
---|
896 | */
|
---|
897 | #if !defined RAW_TTL || defined __DOXYGEN__
|
---|
898 | #define RAW_TTL IP_DEFAULT_TTL
|
---|
899 | #endif
|
---|
900 | /**
|
---|
901 | * @}
|
---|
902 | */
|
---|
903 |
|
---|
904 | /*
|
---|
905 | ----------------------------------
|
---|
906 | ---------- DHCP options ----------
|
---|
907 | ----------------------------------
|
---|
908 | */
|
---|
909 | /**
|
---|
910 | * @defgroup lwip_opts_dhcp DHCP
|
---|
911 | * @ingroup lwip_opts_ipv4
|
---|
912 | * @{
|
---|
913 | */
|
---|
914 | /**
|
---|
915 | * LWIP_DHCP==1: Enable DHCP module.
|
---|
916 | */
|
---|
917 | #if !defined LWIP_DHCP || defined __DOXYGEN__
|
---|
918 | #define LWIP_DHCP 0
|
---|
919 | #endif
|
---|
920 | #if !LWIP_IPV4
|
---|
921 | /* disable DHCP when IPv4 is disabled */
|
---|
922 | #undef LWIP_DHCP
|
---|
923 | #define LWIP_DHCP 0
|
---|
924 | #endif /* !LWIP_IPV4 */
|
---|
925 |
|
---|
926 | /**
|
---|
927 | * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
|
---|
928 | */
|
---|
929 | #if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__
|
---|
930 | #define DHCP_DOES_ARP_CHECK (LWIP_DHCP && LWIP_ARP)
|
---|
931 | #endif
|
---|
932 |
|
---|
933 | /**
|
---|
934 | * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
|
---|
935 | */
|
---|
936 | #if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__
|
---|
937 | #define LWIP_DHCP_BOOTP_FILE 0
|
---|
938 | #endif
|
---|
939 |
|
---|
940 | /**
|
---|
941 | * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each
|
---|
942 | * response packet, an callback is called, which has to be provided by the port:
|
---|
943 | * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
|
---|
944 | */
|
---|
945 | #if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__
|
---|
946 | #define LWIP_DHCP_GET_NTP_SRV 0
|
---|
947 | #endif
|
---|
948 |
|
---|
949 | /**
|
---|
950 | * The maximum of NTP servers requested
|
---|
951 | */
|
---|
952 | #if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__
|
---|
953 | #define LWIP_DHCP_MAX_NTP_SERVERS 1
|
---|
954 | #endif
|
---|
955 |
|
---|
956 | /**
|
---|
957 | * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select.
|
---|
958 | * DNS servers received in the response are passed to DNS via @ref dns_setserver()
|
---|
959 | * (up to the maximum limit defined here).
|
---|
960 | */
|
---|
961 | #if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__
|
---|
962 | #define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS
|
---|
963 | #endif
|
---|
964 | /**
|
---|
965 | * @}
|
---|
966 | */
|
---|
967 |
|
---|
968 | /*
|
---|
969 | ------------------------------------
|
---|
970 | ---------- AUTOIP options ----------
|
---|
971 | ------------------------------------
|
---|
972 | */
|
---|
973 | /**
|
---|
974 | * @defgroup lwip_opts_autoip AUTOIP
|
---|
975 | * @ingroup lwip_opts_ipv4
|
---|
976 | * @{
|
---|
977 | */
|
---|
978 | /**
|
---|
979 | * LWIP_AUTOIP==1: Enable AUTOIP module.
|
---|
980 | */
|
---|
981 | #if !defined LWIP_AUTOIP || defined __DOXYGEN__
|
---|
982 | #define LWIP_AUTOIP 0
|
---|
983 | #endif
|
---|
984 | #if !LWIP_IPV4
|
---|
985 | /* disable AUTOIP when IPv4 is disabled */
|
---|
986 | #undef LWIP_AUTOIP
|
---|
987 | #define LWIP_AUTOIP 0
|
---|
988 | #endif /* !LWIP_IPV4 */
|
---|
989 |
|
---|
990 | /**
|
---|
991 | * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
|
---|
992 | * the same interface at the same time.
|
---|
993 | */
|
---|
994 | #if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__
|
---|
995 | #define LWIP_DHCP_AUTOIP_COOP 0
|
---|
996 | #endif
|
---|
997 |
|
---|
998 | /**
|
---|
999 | * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
|
---|
1000 | * that should be sent before falling back on AUTOIP (the DHCP client keeps
|
---|
1001 | * running in this case). This can be set as low as 1 to get an AutoIP address
|
---|
1002 | * very quickly, but you should be prepared to handle a changing IP address
|
---|
1003 | * when DHCP overrides AutoIP.
|
---|
1004 | */
|
---|
1005 | #if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__
|
---|
1006 | #define LWIP_DHCP_AUTOIP_COOP_TRIES 9
|
---|
1007 | #endif
|
---|
1008 | /**
|
---|
1009 | * @}
|
---|
1010 | */
|
---|
1011 |
|
---|
1012 | /*
|
---|
1013 | ----------------------------------
|
---|
1014 | ----- SNMP MIB2 support -----
|
---|
1015 | ----------------------------------
|
---|
1016 | */
|
---|
1017 | /**
|
---|
1018 | * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks
|
---|
1019 | * @ingroup lwip_opts_infrastructure
|
---|
1020 | * @{
|
---|
1021 | */
|
---|
1022 | /**
|
---|
1023 | * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks.
|
---|
1024 | * Turn this on to get callbacks needed to implement MIB2.
|
---|
1025 | * Usually MIB2_STATS should be enabled, too.
|
---|
1026 | */
|
---|
1027 | #if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__
|
---|
1028 | #define LWIP_MIB2_CALLBACKS 0
|
---|
1029 | #endif
|
---|
1030 | /**
|
---|
1031 | * @}
|
---|
1032 | */
|
---|
1033 |
|
---|
1034 | /*
|
---|
1035 | ----------------------------------
|
---|
1036 | -------- Multicast options -------
|
---|
1037 | ----------------------------------
|
---|
1038 | */
|
---|
1039 | /**
|
---|
1040 | * @defgroup lwip_opts_multicast Multicast
|
---|
1041 | * @ingroup lwip_opts_infrastructure
|
---|
1042 | * @{
|
---|
1043 | */
|
---|
1044 | /**
|
---|
1045 | * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options
|
---|
1046 | * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP, as well as (currently only)
|
---|
1047 | * core support for the corresponding IPv6 options.
|
---|
1048 | */
|
---|
1049 | #if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__
|
---|
1050 | #define LWIP_MULTICAST_TX_OPTIONS ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW))
|
---|
1051 | #endif
|
---|
1052 | /**
|
---|
1053 | * @}
|
---|
1054 | */
|
---|
1055 |
|
---|
1056 | /*
|
---|
1057 | ----------------------------------
|
---|
1058 | ---------- IGMP options ----------
|
---|
1059 | ----------------------------------
|
---|
1060 | */
|
---|
1061 | /**
|
---|
1062 | * @defgroup lwip_opts_igmp IGMP
|
---|
1063 | * @ingroup lwip_opts_ipv4
|
---|
1064 | * @{
|
---|
1065 | */
|
---|
1066 | /**
|
---|
1067 | * LWIP_IGMP==1: Turn on IGMP module.
|
---|
1068 | */
|
---|
1069 | #if !defined LWIP_IGMP || defined __DOXYGEN__
|
---|
1070 | #define LWIP_IGMP 0
|
---|
1071 | #endif
|
---|
1072 | #if !LWIP_IPV4
|
---|
1073 | #undef LWIP_IGMP
|
---|
1074 | #define LWIP_IGMP 0
|
---|
1075 | #endif
|
---|
1076 | /**
|
---|
1077 | * @}
|
---|
1078 | */
|
---|
1079 |
|
---|
1080 | /*
|
---|
1081 | ----------------------------------
|
---|
1082 | ---------- DNS options -----------
|
---|
1083 | ----------------------------------
|
---|
1084 | */
|
---|
1085 | /**
|
---|
1086 | * @defgroup lwip_opts_dns DNS
|
---|
1087 | * @ingroup lwip_opts_callback
|
---|
1088 | * @{
|
---|
1089 | */
|
---|
1090 | /**
|
---|
1091 | * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
|
---|
1092 | * transport.
|
---|
1093 | */
|
---|
1094 | #if !defined LWIP_DNS || defined __DOXYGEN__
|
---|
1095 | #define LWIP_DNS 0
|
---|
1096 | #endif
|
---|
1097 |
|
---|
1098 | /** DNS maximum number of entries to maintain locally. */
|
---|
1099 | #if !defined DNS_TABLE_SIZE || defined __DOXYGEN__
|
---|
1100 | #define DNS_TABLE_SIZE 4
|
---|
1101 | #endif
|
---|
1102 |
|
---|
1103 | /** DNS maximum host name length supported in the name table. */
|
---|
1104 | #if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__
|
---|
1105 | #define DNS_MAX_NAME_LENGTH 256
|
---|
1106 | #endif
|
---|
1107 |
|
---|
1108 | /** The maximum of DNS servers
|
---|
1109 | * The first server can be initialized automatically by defining
|
---|
1110 | * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*'
|
---|
1111 | */
|
---|
1112 | #if !defined DNS_MAX_SERVERS || defined __DOXYGEN__
|
---|
1113 | #define DNS_MAX_SERVERS 2
|
---|
1114 | #endif
|
---|
1115 |
|
---|
1116 | /** DNS maximum number of retries when asking for a name, before "timeout". */
|
---|
1117 | #if !defined DNS_MAX_RETRIES || defined __DOXYGEN__
|
---|
1118 | #define DNS_MAX_RETRIES 4
|
---|
1119 | #endif
|
---|
1120 |
|
---|
1121 | /** DNS do a name checking between the query and the response. */
|
---|
1122 | #if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__
|
---|
1123 | #define DNS_DOES_NAME_CHECK 1
|
---|
1124 | #endif
|
---|
1125 |
|
---|
1126 | /** LWIP_DNS_SECURE: controls the security level of the DNS implementation
|
---|
1127 | * Use all DNS security features by default.
|
---|
1128 | * This is overridable but should only be needed by very small targets
|
---|
1129 | * or when using against non standard DNS servers. */
|
---|
1130 | #if !defined LWIP_DNS_SECURE || defined __DOXYGEN__
|
---|
1131 | #define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)
|
---|
1132 | #endif
|
---|
1133 |
|
---|
1134 | /* A list of DNS security features follows */
|
---|
1135 | #define LWIP_DNS_SECURE_RAND_XID 1
|
---|
1136 | #define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2
|
---|
1137 | #define LWIP_DNS_SECURE_RAND_SRC_PORT 4
|
---|
1138 |
|
---|
1139 | /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer:
|
---|
1140 | * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \
|
---|
1141 | * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)}
|
---|
1142 | *
|
---|
1143 | * Instead, you can also use an external function:
|
---|
1144 | * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype)
|
---|
1145 | * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype).
|
---|
1146 | */
|
---|
1147 | #if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__
|
---|
1148 | #define DNS_LOCAL_HOSTLIST 0
|
---|
1149 | #endif /* DNS_LOCAL_HOSTLIST */
|
---|
1150 |
|
---|
1151 | /** If this is turned on, the local host-list can be dynamically changed
|
---|
1152 | * at runtime. */
|
---|
1153 | #if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__
|
---|
1154 | #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0
|
---|
1155 | #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
---|
1156 |
|
---|
1157 | /** Set this to 1 to enable querying ".local" names via mDNS
|
---|
1158 | * using a One-Shot Multicast DNS Query */
|
---|
1159 | #if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__
|
---|
1160 | #define LWIP_DNS_SUPPORT_MDNS_QUERIES 0
|
---|
1161 | #endif
|
---|
1162 | /**
|
---|
1163 | * @}
|
---|
1164 | */
|
---|
1165 |
|
---|
1166 | /*
|
---|
1167 | ---------------------------------
|
---|
1168 | ---------- UDP options ----------
|
---|
1169 | ---------------------------------
|
---|
1170 | */
|
---|
1171 | /**
|
---|
1172 | * @defgroup lwip_opts_udp UDP
|
---|
1173 | * @ingroup lwip_opts_callback
|
---|
1174 | * @{
|
---|
1175 | */
|
---|
1176 | /**
|
---|
1177 | * LWIP_UDP==1: Turn on UDP.
|
---|
1178 | */
|
---|
1179 | #if !defined LWIP_UDP || defined __DOXYGEN__
|
---|
1180 | #define LWIP_UDP 1
|
---|
1181 | #endif
|
---|
1182 |
|
---|
1183 | /**
|
---|
1184 | * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
|
---|
1185 | */
|
---|
1186 | #if !defined LWIP_UDPLITE || defined __DOXYGEN__
|
---|
1187 | #define LWIP_UDPLITE 0
|
---|
1188 | #endif
|
---|
1189 |
|
---|
1190 | /**
|
---|
1191 | * UDP_TTL: Default Time-To-Live value.
|
---|
1192 | */
|
---|
1193 | #if !defined UDP_TTL || defined __DOXYGEN__
|
---|
1194 | #define UDP_TTL IP_DEFAULT_TTL
|
---|
1195 | #endif
|
---|
1196 |
|
---|
1197 | /**
|
---|
1198 | * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
|
---|
1199 | */
|
---|
1200 | #if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__
|
---|
1201 | #define LWIP_NETBUF_RECVINFO 0
|
---|
1202 | #endif
|
---|
1203 | /**
|
---|
1204 | * @}
|
---|
1205 | */
|
---|
1206 |
|
---|
1207 | /*
|
---|
1208 | ---------------------------------
|
---|
1209 | ---------- TCP options ----------
|
---|
1210 | ---------------------------------
|
---|
1211 | */
|
---|
1212 | /**
|
---|
1213 | * @defgroup lwip_opts_tcp TCP
|
---|
1214 | * @ingroup lwip_opts_callback
|
---|
1215 | * @{
|
---|
1216 | */
|
---|
1217 | /**
|
---|
1218 | * LWIP_TCP==1: Turn on TCP.
|
---|
1219 | */
|
---|
1220 | #if !defined LWIP_TCP || defined __DOXYGEN__
|
---|
1221 | #define LWIP_TCP 1
|
---|
1222 | #endif
|
---|
1223 |
|
---|
1224 | /**
|
---|
1225 | * TCP_TTL: Default Time-To-Live value.
|
---|
1226 | */
|
---|
1227 | #if !defined TCP_TTL || defined __DOXYGEN__
|
---|
1228 | #define TCP_TTL IP_DEFAULT_TTL
|
---|
1229 | #endif
|
---|
1230 |
|
---|
1231 | /**
|
---|
1232 | * TCP_WND: The size of a TCP window. This must be at least
|
---|
1233 | * (2 * TCP_MSS) for things to work well.
|
---|
1234 | * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size
|
---|
1235 | * with scaling applied. Maximum window value in the TCP header
|
---|
1236 | * will be TCP_WND >> TCP_RCV_SCALE
|
---|
1237 | */
|
---|
1238 | #if !defined TCP_WND || defined __DOXYGEN__
|
---|
1239 | #define TCP_WND (4 * TCP_MSS)
|
---|
1240 | #endif
|
---|
1241 |
|
---|
1242 | /**
|
---|
1243 | * TCP_MAXRTX: Maximum number of retransmissions of data segments.
|
---|
1244 | */
|
---|
1245 | #if !defined TCP_MAXRTX || defined __DOXYGEN__
|
---|
1246 | #define TCP_MAXRTX 12
|
---|
1247 | #endif
|
---|
1248 |
|
---|
1249 | /**
|
---|
1250 | * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
|
---|
1251 | */
|
---|
1252 | #if !defined TCP_SYNMAXRTX || defined __DOXYGEN__
|
---|
1253 | #define TCP_SYNMAXRTX 6
|
---|
1254 | #endif
|
---|
1255 |
|
---|
1256 | /**
|
---|
1257 | * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
|
---|
1258 | * Define to 0 if your device is low on memory.
|
---|
1259 | */
|
---|
1260 | #if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__
|
---|
1261 | #define TCP_QUEUE_OOSEQ LWIP_TCP
|
---|
1262 | #endif
|
---|
1263 |
|
---|
1264 | /**
|
---|
1265 | * LWIP_TCP_SACK_OUT==1: TCP will support sending selective acknowledgements (SACKs).
|
---|
1266 | */
|
---|
1267 | #if !defined LWIP_TCP_SACK_OUT || defined __DOXYGEN__
|
---|
1268 | #define LWIP_TCP_SACK_OUT 0
|
---|
1269 | #endif
|
---|
1270 |
|
---|
1271 | /**
|
---|
1272 | * LWIP_TCP_MAX_SACK_NUM: The maximum number of SACK values to include in TCP segments.
|
---|
1273 | * Must be at least 1, but is only used if LWIP_TCP_SACK_OUT is enabled.
|
---|
1274 | * NOTE: Even though we never send more than 3 or 4 SACK ranges in a single segment
|
---|
1275 | * (depending on other options), setting this option to values greater than 4 is not pointless.
|
---|
1276 | * This is basically the max number of SACK ranges we want to keep track of.
|
---|
1277 | * As new data is delivered, some of the SACK ranges may be removed or merged.
|
---|
1278 | * In that case some of those older SACK ranges may be used again.
|
---|
1279 | * The amount of memory used to store SACK ranges is LWIP_TCP_MAX_SACK_NUM * 8 bytes for each TCP PCB.
|
---|
1280 | */
|
---|
1281 | #if !defined LWIP_TCP_MAX_SACK_NUM || defined __DOXYGEN__
|
---|
1282 | #define LWIP_TCP_MAX_SACK_NUM 4
|
---|
1283 | #endif
|
---|
1284 |
|
---|
1285 | /**
|
---|
1286 | * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
|
---|
1287 | * you might want to increase this.)
|
---|
1288 | * For the receive side, this MSS is advertised to the remote side
|
---|
1289 | * when opening a connection. For the transmit size, this MSS sets
|
---|
1290 | * an upper limit on the MSS advertised by the remote host.
|
---|
1291 | */
|
---|
1292 | #if !defined TCP_MSS || defined __DOXYGEN__
|
---|
1293 | #define TCP_MSS 536
|
---|
1294 | #endif
|
---|
1295 |
|
---|
1296 | /**
|
---|
1297 | * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
|
---|
1298 | * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
|
---|
1299 | * reflects the available reassembly buffer size at the remote host) and the
|
---|
1300 | * largest size permitted by the IP layer" (RFC 1122)
|
---|
1301 | * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
|
---|
1302 | * netif used for a connection and limits the MSS if it would be too big otherwise.
|
---|
1303 | */
|
---|
1304 | #if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__
|
---|
1305 | #define TCP_CALCULATE_EFF_SEND_MSS 1
|
---|
1306 | #endif
|
---|
1307 |
|
---|
1308 |
|
---|
1309 | /**
|
---|
1310 | * TCP_SND_BUF: TCP sender buffer space (bytes).
|
---|
1311 | * To achieve good performance, this should be at least 2 * TCP_MSS.
|
---|
1312 | */
|
---|
1313 | #if !defined TCP_SND_BUF || defined __DOXYGEN__
|
---|
1314 | #define TCP_SND_BUF (2 * TCP_MSS)
|
---|
1315 | #endif
|
---|
1316 |
|
---|
1317 | /**
|
---|
1318 | * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
|
---|
1319 | * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
|
---|
1320 | */
|
---|
1321 | #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__
|
---|
1322 | #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
|
---|
1323 | #endif
|
---|
1324 |
|
---|
1325 | /**
|
---|
1326 | * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
|
---|
1327 | * TCP_SND_BUF. It is the amount of space which must be available in the
|
---|
1328 | * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
|
---|
1329 | */
|
---|
1330 | #if !defined TCP_SNDLOWAT || defined __DOXYGEN__
|
---|
1331 | #define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
|
---|
1332 | #endif
|
---|
1333 |
|
---|
1334 | /**
|
---|
1335 | * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less
|
---|
1336 | * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
|
---|
1337 | * this number, select returns writable (combined with TCP_SNDLOWAT).
|
---|
1338 | */
|
---|
1339 | #if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__
|
---|
1340 | #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
|
---|
1341 | #endif
|
---|
1342 |
|
---|
1343 | /**
|
---|
1344 | * TCP_OOSEQ_MAX_BYTES: The default maximum number of bytes queued on ooseq per
|
---|
1345 | * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit).
|
---|
1346 | * Only valid for TCP_QUEUE_OOSEQ==1.
|
---|
1347 | */
|
---|
1348 | #if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__
|
---|
1349 | #define TCP_OOSEQ_MAX_BYTES 0
|
---|
1350 | #endif
|
---|
1351 |
|
---|
1352 | /**
|
---|
1353 | * TCP_OOSEQ_BYTES_LIMIT(pcb): Return the maximum number of bytes to be queued
|
---|
1354 | * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 &&
|
---|
1355 | * TCP_OOSEQ_MAX_BYTES==1.
|
---|
1356 | * Use this to override TCP_OOSEQ_MAX_BYTES to a dynamic value per pcb.
|
---|
1357 | */
|
---|
1358 | #if !defined TCP_OOSEQ_BYTES_LIMIT
|
---|
1359 | #if TCP_OOSEQ_MAX_BYTES
|
---|
1360 | #define TCP_OOSEQ_BYTES_LIMIT(pcb) TCP_OOSEQ_MAX_BYTES
|
---|
1361 | #elif defined __DOXYGEN__
|
---|
1362 | #define TCP_OOSEQ_BYTES_LIMIT(pcb)
|
---|
1363 | #endif
|
---|
1364 | #endif
|
---|
1365 |
|
---|
1366 | /**
|
---|
1367 | * TCP_OOSEQ_MAX_PBUFS: The default maximum number of pbufs queued on ooseq per
|
---|
1368 | * pcb if TCP_OOSEQ_BYTES_LIMIT is not defined. Default is 0 (no limit).
|
---|
1369 | * Only valid for TCP_QUEUE_OOSEQ==1.
|
---|
1370 | */
|
---|
1371 | #if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__
|
---|
1372 | #define TCP_OOSEQ_MAX_PBUFS 0
|
---|
1373 | #endif
|
---|
1374 |
|
---|
1375 | /**
|
---|
1376 | * TCP_OOSEQ_PBUFS_LIMIT(pcb): Return the maximum number of pbufs to be queued
|
---|
1377 | * on ooseq per pcb, given the pcb. Only valid for TCP_QUEUE_OOSEQ==1 &&
|
---|
1378 | * TCP_OOSEQ_MAX_PBUFS==1.
|
---|
1379 | * Use this to override TCP_OOSEQ_MAX_PBUFS to a dynamic value per pcb.
|
---|
1380 | */
|
---|
1381 | #if !defined TCP_OOSEQ_PBUFS_LIMIT
|
---|
1382 | #if TCP_OOSEQ_MAX_PBUFS
|
---|
1383 | #define TCP_OOSEQ_PBUFS_LIMIT(pcb) TCP_OOSEQ_MAX_PBUFS
|
---|
1384 | #elif defined __DOXYGEN__
|
---|
1385 | #define TCP_OOSEQ_PBUFS_LIMIT(pcb)
|
---|
1386 | #endif
|
---|
1387 | #endif
|
---|
1388 |
|
---|
1389 | /**
|
---|
1390 | * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
|
---|
1391 | */
|
---|
1392 | #if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__
|
---|
1393 | #define TCP_LISTEN_BACKLOG 0
|
---|
1394 | #endif
|
---|
1395 |
|
---|
1396 | /**
|
---|
1397 | * The maximum allowed backlog for TCP listen netconns.
|
---|
1398 | * This backlog is used unless another is explicitly specified.
|
---|
1399 | * 0xff is the maximum (u8_t).
|
---|
1400 | */
|
---|
1401 | #if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__
|
---|
1402 | #define TCP_DEFAULT_LISTEN_BACKLOG 0xff
|
---|
1403 | #endif
|
---|
1404 |
|
---|
1405 | /**
|
---|
1406 | * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
|
---|
1407 | * allocate ahead of time in an attempt to create shorter pbuf chains
|
---|
1408 | * for transmission. The meaningful range is 0 to TCP_MSS. Some
|
---|
1409 | * suggested values are:
|
---|
1410 | *
|
---|
1411 | * 0: Disable oversized allocation. Each tcp_write() allocates a new
|
---|
1412 | pbuf (old behaviour).
|
---|
1413 | * 1: Allocate size-aligned pbufs with minimal excess. Use this if your
|
---|
1414 | * scatter-gather DMA requires aligned fragments.
|
---|
1415 | * 128: Limit the pbuf/memory overhead to 20%.
|
---|
1416 | * TCP_MSS: Try to create unfragmented TCP packets.
|
---|
1417 | * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
|
---|
1418 | */
|
---|
1419 | #if !defined TCP_OVERSIZE || defined __DOXYGEN__
|
---|
1420 | #define TCP_OVERSIZE TCP_MSS
|
---|
1421 | #endif
|
---|
1422 |
|
---|
1423 | /**
|
---|
1424 | * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
|
---|
1425 | * The timestamp option is currently only used to help remote hosts, it is not
|
---|
1426 | * really used locally. Therefore, it is only enabled when a TS option is
|
---|
1427 | * received in the initial SYN packet from a remote host.
|
---|
1428 | */
|
---|
1429 | #if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__
|
---|
1430 | #define LWIP_TCP_TIMESTAMPS 0
|
---|
1431 | #endif
|
---|
1432 |
|
---|
1433 | /**
|
---|
1434 | * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
|
---|
1435 | * explicit window update
|
---|
1436 | */
|
---|
1437 | #if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__
|
---|
1438 | #define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))
|
---|
1439 | #endif
|
---|
1440 |
|
---|
1441 | /**
|
---|
1442 | * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
|
---|
1443 | * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
|
---|
1444 | * events (accept, sent, etc) that happen in the system.
|
---|
1445 | * LWIP_CALLBACK_API==1: The PCB callback function is called directly
|
---|
1446 | * for the event. This is the default.
|
---|
1447 | */
|
---|
1448 | #if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__
|
---|
1449 | #define LWIP_EVENT_API 0
|
---|
1450 | #define LWIP_CALLBACK_API 1
|
---|
1451 | #else
|
---|
1452 | #ifndef LWIP_EVENT_API
|
---|
1453 | #define LWIP_EVENT_API 0
|
---|
1454 | #endif
|
---|
1455 | #ifndef LWIP_CALLBACK_API
|
---|
1456 | #define LWIP_CALLBACK_API 0
|
---|
1457 | #endif
|
---|
1458 | #endif
|
---|
1459 |
|
---|
1460 | /**
|
---|
1461 | * LWIP_WND_SCALE and TCP_RCV_SCALE:
|
---|
1462 | * Set LWIP_WND_SCALE to 1 to enable window scaling.
|
---|
1463 | * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the
|
---|
1464 | * range of [0..14]).
|
---|
1465 | * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large
|
---|
1466 | * send window while having a small receive window only.
|
---|
1467 | */
|
---|
1468 | #if !defined LWIP_WND_SCALE || defined __DOXYGEN__
|
---|
1469 | #define LWIP_WND_SCALE 0
|
---|
1470 | #define TCP_RCV_SCALE 0
|
---|
1471 | #endif
|
---|
1472 |
|
---|
1473 | /**
|
---|
1474 | * LWIP_TCP_PCB_NUM_EXT_ARGS:
|
---|
1475 | * When this is > 0, every tcp pcb (including listen pcb) includes a number of
|
---|
1476 | * additional argument entries in an array (see tcp_ext_arg_alloc_id)
|
---|
1477 | */
|
---|
1478 | #if !defined LWIP_TCP_PCB_NUM_EXT_ARGS || defined __DOXYGEN__
|
---|
1479 | #define LWIP_TCP_PCB_NUM_EXT_ARGS 0
|
---|
1480 | #endif
|
---|
1481 |
|
---|
1482 | /** LWIP_ALTCP==1: enable the altcp API.
|
---|
1483 | * altcp is an abstraction layer that prevents applications linking against the
|
---|
1484 | * tcp.h functions but provides the same functionality. It is used to e.g. add
|
---|
1485 | * SSL/TLS or proxy-connect support to an application written for the tcp callback
|
---|
1486 | * API without that application knowing the protocol details.
|
---|
1487 | *
|
---|
1488 | * With LWIP_ALTCP==0, applications written against the altcp API can still be
|
---|
1489 | * compiled but are directly linked against the tcp.h callback API and then
|
---|
1490 | * cannot use layered protocols.
|
---|
1491 | *
|
---|
1492 | * See @ref altcp_api
|
---|
1493 | */
|
---|
1494 | #if !defined LWIP_ALTCP || defined __DOXYGEN__
|
---|
1495 | #define LWIP_ALTCP 0
|
---|
1496 | #endif
|
---|
1497 |
|
---|
1498 | /** LWIP_ALTCP_TLS==1: enable TLS support for altcp API.
|
---|
1499 | * This needs a port of the functions in altcp_tls.h to a TLS library.
|
---|
1500 | * A port to ARM mbedtls is provided with lwIP, see apps/altcp_tls/ directory
|
---|
1501 | * and LWIP_ALTCP_TLS_MBEDTLS option.
|
---|
1502 | */
|
---|
1503 | #if !defined LWIP_ALTCP_TLS || defined __DOXYGEN__
|
---|
1504 | #define LWIP_ALTCP_TLS 0
|
---|
1505 | #endif
|
---|
1506 |
|
---|
1507 | /**
|
---|
1508 | * @}
|
---|
1509 | */
|
---|
1510 |
|
---|
1511 | /*
|
---|
1512 | ----------------------------------
|
---|
1513 | ---------- Pbuf options ----------
|
---|
1514 | ----------------------------------
|
---|
1515 | */
|
---|
1516 | /**
|
---|
1517 | * @defgroup lwip_opts_pbuf PBUF
|
---|
1518 | * @ingroup lwip_opts
|
---|
1519 | * @{
|
---|
1520 | */
|
---|
1521 | /**
|
---|
1522 | * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
|
---|
1523 | * link level header. The default is 14, the standard value for
|
---|
1524 | * Ethernet.
|
---|
1525 | */
|
---|
1526 | #if !defined PBUF_LINK_HLEN || defined __DOXYGEN__
|
---|
1527 | #if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__
|
---|
1528 | #define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE)
|
---|
1529 | #else /* LWIP_HOOK_VLAN_SET */
|
---|
1530 | #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE)
|
---|
1531 | #endif /* LWIP_HOOK_VLAN_SET */
|
---|
1532 | #endif
|
---|
1533 |
|
---|
1534 | /**
|
---|
1535 | * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated
|
---|
1536 | * for an additional encapsulation header before ethernet headers (e.g. 802.11)
|
---|
1537 | */
|
---|
1538 | #if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__
|
---|
1539 | #define PBUF_LINK_ENCAPSULATION_HLEN 0
|
---|
1540 | #endif
|
---|
1541 |
|
---|
1542 | /**
|
---|
1543 | * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
|
---|
1544 | * designed to accommodate single full size TCP frame in one pbuf, including
|
---|
1545 | * TCP_MSS, IP header, and link header.
|
---|
1546 | */
|
---|
1547 | #if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__
|
---|
1548 | #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
---|
1549 | #endif
|
---|
1550 |
|
---|
1551 | /**
|
---|
1552 | * LWIP_PBUF_REF_T: Refcount type in pbuf.
|
---|
1553 | * Default width of u8_t can be increased if 255 refs are not enough for you.
|
---|
1554 | */
|
---|
1555 | #if !defined LWIP_PBUF_REF_T || defined __DOXYGEN__
|
---|
1556 | #define LWIP_PBUF_REF_T u8_t
|
---|
1557 | #endif
|
---|
1558 | /**
|
---|
1559 | * @}
|
---|
1560 | */
|
---|
1561 |
|
---|
1562 | /*
|
---|
1563 | ------------------------------------------------
|
---|
1564 | ---------- Network Interfaces options ----------
|
---|
1565 | ------------------------------------------------
|
---|
1566 | */
|
---|
1567 | /**
|
---|
1568 | * @defgroup lwip_opts_netif NETIF
|
---|
1569 | * @ingroup lwip_opts
|
---|
1570 | * @{
|
---|
1571 | */
|
---|
1572 | /**
|
---|
1573 | * LWIP_SINGLE_NETIF==1: use a single netif only. This is the common case for
|
---|
1574 | * small real-life targets. Some code like routing etc. can be left out.
|
---|
1575 | */
|
---|
1576 | #if !defined LWIP_SINGLE_NETIF || defined __DOXYGEN__
|
---|
1577 | #define LWIP_SINGLE_NETIF 0
|
---|
1578 | #endif
|
---|
1579 |
|
---|
1580 | /**
|
---|
1581 | * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
|
---|
1582 | * field.
|
---|
1583 | */
|
---|
1584 | #if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__
|
---|
1585 | #define LWIP_NETIF_HOSTNAME 0
|
---|
1586 | #endif
|
---|
1587 |
|
---|
1588 | /**
|
---|
1589 | * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
|
---|
1590 | */
|
---|
1591 | #if !defined LWIP_NETIF_API || defined __DOXYGEN__
|
---|
1592 | #define LWIP_NETIF_API 0
|
---|
1593 | #endif
|
---|
1594 |
|
---|
1595 | /**
|
---|
1596 | * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
|
---|
1597 | * changes its up/down status (i.e., due to DHCP IP acquisition)
|
---|
1598 | */
|
---|
1599 | #if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__
|
---|
1600 | #define LWIP_NETIF_STATUS_CALLBACK 0
|
---|
1601 | #endif
|
---|
1602 |
|
---|
1603 | /**
|
---|
1604 | * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function
|
---|
1605 | * for several netif related event that supports multiple subscribers.
|
---|
1606 | * @see netif_ext_status_callback
|
---|
1607 | */
|
---|
1608 | #if !defined LWIP_NETIF_EXT_STATUS_CALLBACK || defined __DOXYGEN__
|
---|
1609 | #define LWIP_NETIF_EXT_STATUS_CALLBACK 0
|
---|
1610 | #endif
|
---|
1611 |
|
---|
1612 | /**
|
---|
1613 | * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
|
---|
1614 | * whenever the link changes (i.e., link down)
|
---|
1615 | */
|
---|
1616 | #if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__
|
---|
1617 | #define LWIP_NETIF_LINK_CALLBACK 0
|
---|
1618 | #endif
|
---|
1619 |
|
---|
1620 | /**
|
---|
1621 | * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called
|
---|
1622 | * when a netif has been removed
|
---|
1623 | */
|
---|
1624 | #if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__
|
---|
1625 | #define LWIP_NETIF_REMOVE_CALLBACK 0
|
---|
1626 | #endif
|
---|
1627 |
|
---|
1628 | /**
|
---|
1629 | * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
|
---|
1630 | * indices) in struct netif. TCP and UDP can make use of this to prevent
|
---|
1631 | * scanning the ARP table for every sent packet. While this is faster for big
|
---|
1632 | * ARP tables or many concurrent connections, it might be counterproductive
|
---|
1633 | * if you have a tiny ARP table or if there never are concurrent connections.
|
---|
1634 | */
|
---|
1635 | #if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__
|
---|
1636 | #define LWIP_NETIF_HWADDRHINT 0
|
---|
1637 | #endif
|
---|
1638 |
|
---|
1639 | /**
|
---|
1640 | * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data
|
---|
1641 | * to be sent into one single pbuf. This is for compatibility with DMA-enabled
|
---|
1642 | * MACs that do not support scatter-gather.
|
---|
1643 | * Beware that this might involve CPU-memcpy before transmitting that would not
|
---|
1644 | * be needed without this flag! Use this only if you need to!
|
---|
1645 | *
|
---|
1646 | * ATTENTION: a driver should *NOT* rely on getting single pbufs but check TX
|
---|
1647 | * pbufs for being in one piece. If not, @ref pbuf_clone can be used to get
|
---|
1648 | * a single pbuf:
|
---|
1649 | * if (p->next != NULL) {
|
---|
1650 | * struct pbuf *q = pbuf_clone(PBUF_RAW, PBUF_RAM, p);
|
---|
1651 | * if (q == NULL) {
|
---|
1652 | * return ERR_MEM;
|
---|
1653 | * }
|
---|
1654 | * p = q; ATTENTION: do NOT free the old 'p' as the ref belongs to the caller!
|
---|
1655 | * }
|
---|
1656 | */
|
---|
1657 | #if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__
|
---|
1658 | #define LWIP_NETIF_TX_SINGLE_PBUF 0
|
---|
1659 | #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
|
---|
1660 |
|
---|
1661 | /**
|
---|
1662 | * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store
|
---|
1663 | * data in client_data member array of struct netif (max. 256).
|
---|
1664 | */
|
---|
1665 | #if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__
|
---|
1666 | #define LWIP_NUM_NETIF_CLIENT_DATA 0
|
---|
1667 | #endif
|
---|
1668 | /**
|
---|
1669 | * @}
|
---|
1670 | */
|
---|
1671 |
|
---|
1672 | /*
|
---|
1673 | ------------------------------------
|
---|
1674 | ---------- LOOPIF options ----------
|
---|
1675 | ------------------------------------
|
---|
1676 | */
|
---|
1677 | /**
|
---|
1678 | * @defgroup lwip_opts_loop Loopback interface
|
---|
1679 | * @ingroup lwip_opts_netif
|
---|
1680 | * @{
|
---|
1681 | */
|
---|
1682 | /**
|
---|
1683 | * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1).
|
---|
1684 | * This is only needed when no real netifs are available. If at least one other
|
---|
1685 | * netif is available, loopback traffic uses this netif.
|
---|
1686 | */
|
---|
1687 | #if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__
|
---|
1688 | #define LWIP_HAVE_LOOPIF (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF)
|
---|
1689 | #endif
|
---|
1690 |
|
---|
1691 | /**
|
---|
1692 | * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1).
|
---|
1693 | */
|
---|
1694 | #if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__
|
---|
1695 | #define LWIP_LOOPIF_MULTICAST 0
|
---|
1696 | #endif
|
---|
1697 |
|
---|
1698 | /**
|
---|
1699 | * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
|
---|
1700 | * address equal to the netif IP address, looping them back up the stack.
|
---|
1701 | */
|
---|
1702 | #if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__
|
---|
1703 | #define LWIP_NETIF_LOOPBACK 0
|
---|
1704 | #endif
|
---|
1705 |
|
---|
1706 | /**
|
---|
1707 | * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
|
---|
1708 | * sending for each netif (0 = disabled)
|
---|
1709 | */
|
---|
1710 | #if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__
|
---|
1711 | #define LWIP_LOOPBACK_MAX_PBUFS 0
|
---|
1712 | #endif
|
---|
1713 |
|
---|
1714 | /**
|
---|
1715 | * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
|
---|
1716 | * the system, as netifs must change how they behave depending on this setting
|
---|
1717 | * for the LWIP_NETIF_LOOPBACK option to work.
|
---|
1718 | * Setting this is needed to avoid reentering non-reentrant functions like
|
---|
1719 | * tcp_input().
|
---|
1720 | * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
|
---|
1721 | * multithreaded environment like tcpip.c. In this case, netif->input()
|
---|
1722 | * is called directly.
|
---|
1723 | * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
|
---|
1724 | * The packets are put on a list and netif_poll() must be called in
|
---|
1725 | * the main application loop.
|
---|
1726 | */
|
---|
1727 | #if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__
|
---|
1728 | #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS)
|
---|
1729 | #endif
|
---|
1730 | /**
|
---|
1731 | * @}
|
---|
1732 | */
|
---|
1733 |
|
---|
1734 | /*
|
---|
1735 | ------------------------------------
|
---|
1736 | ---------- Thread options ----------
|
---|
1737 | ------------------------------------
|
---|
1738 | */
|
---|
1739 | /**
|
---|
1740 | * @defgroup lwip_opts_thread Threading
|
---|
1741 | * @ingroup lwip_opts_infrastructure
|
---|
1742 | * @{
|
---|
1743 | */
|
---|
1744 | /**
|
---|
1745 | * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
|
---|
1746 | */
|
---|
1747 | #if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__
|
---|
1748 | #define TCPIP_THREAD_NAME "tcpip_thread"
|
---|
1749 | #endif
|
---|
1750 |
|
---|
1751 | /**
|
---|
1752 | * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
|
---|
1753 | * The stack size value itself is platform-dependent, but is passed to
|
---|
1754 | * sys_thread_new() when the thread is created.
|
---|
1755 | */
|
---|
1756 | #if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__
|
---|
1757 | #define TCPIP_THREAD_STACKSIZE 0
|
---|
1758 | #endif
|
---|
1759 |
|
---|
1760 | /**
|
---|
1761 | * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
|
---|
1762 | * The priority value itself is platform-dependent, but is passed to
|
---|
1763 | * sys_thread_new() when the thread is created.
|
---|
1764 | */
|
---|
1765 | #if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__
|
---|
1766 | #define TCPIP_THREAD_PRIO 1
|
---|
1767 | #endif
|
---|
1768 |
|
---|
1769 | /**
|
---|
1770 | * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
|
---|
1771 | * The queue size value itself is platform-dependent, but is passed to
|
---|
1772 | * sys_mbox_new() when tcpip_init is called.
|
---|
1773 | */
|
---|
1774 | #if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__
|
---|
1775 | #define TCPIP_MBOX_SIZE 0
|
---|
1776 | #endif
|
---|
1777 |
|
---|
1778 | /**
|
---|
1779 | * Define this to something that triggers a watchdog. This is called from
|
---|
1780 | * tcpip_thread after processing a message.
|
---|
1781 | */
|
---|
1782 | #if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__
|
---|
1783 | #define LWIP_TCPIP_THREAD_ALIVE()
|
---|
1784 | #endif
|
---|
1785 |
|
---|
1786 | /**
|
---|
1787 | * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
|
---|
1788 | */
|
---|
1789 | #if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__
|
---|
1790 | #define SLIPIF_THREAD_NAME "slipif_loop"
|
---|
1791 | #endif
|
---|
1792 |
|
---|
1793 | /**
|
---|
1794 | * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
|
---|
1795 | * The stack size value itself is platform-dependent, but is passed to
|
---|
1796 | * sys_thread_new() when the thread is created.
|
---|
1797 | */
|
---|
1798 | #if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__
|
---|
1799 | #define SLIPIF_THREAD_STACKSIZE 0
|
---|
1800 | #endif
|
---|
1801 |
|
---|
1802 | /**
|
---|
1803 | * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
|
---|
1804 | * The priority value itself is platform-dependent, but is passed to
|
---|
1805 | * sys_thread_new() when the thread is created.
|
---|
1806 | */
|
---|
1807 | #if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__
|
---|
1808 | #define SLIPIF_THREAD_PRIO 1
|
---|
1809 | #endif
|
---|
1810 |
|
---|
1811 | /**
|
---|
1812 | * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
|
---|
1813 | */
|
---|
1814 | #if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__
|
---|
1815 | #define DEFAULT_THREAD_NAME "lwIP"
|
---|
1816 | #endif
|
---|
1817 |
|
---|
1818 | /**
|
---|
1819 | * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
|
---|
1820 | * The stack size value itself is platform-dependent, but is passed to
|
---|
1821 | * sys_thread_new() when the thread is created.
|
---|
1822 | */
|
---|
1823 | #if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__
|
---|
1824 | #define DEFAULT_THREAD_STACKSIZE 0
|
---|
1825 | #endif
|
---|
1826 |
|
---|
1827 | /**
|
---|
1828 | * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
|
---|
1829 | * The priority value itself is platform-dependent, but is passed to
|
---|
1830 | * sys_thread_new() when the thread is created.
|
---|
1831 | */
|
---|
1832 | #if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__
|
---|
1833 | #define DEFAULT_THREAD_PRIO 1
|
---|
1834 | #endif
|
---|
1835 |
|
---|
1836 | /**
|
---|
1837 | * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
|
---|
1838 | * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
|
---|
1839 | * to sys_mbox_new() when the recvmbox is created.
|
---|
1840 | */
|
---|
1841 | #if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__
|
---|
1842 | #define DEFAULT_RAW_RECVMBOX_SIZE 0
|
---|
1843 | #endif
|
---|
1844 |
|
---|
1845 | /**
|
---|
1846 | * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
|
---|
1847 | * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
|
---|
1848 | * to sys_mbox_new() when the recvmbox is created.
|
---|
1849 | */
|
---|
1850 | #if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__
|
---|
1851 | #define DEFAULT_UDP_RECVMBOX_SIZE 0
|
---|
1852 | #endif
|
---|
1853 |
|
---|
1854 | /**
|
---|
1855 | * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
|
---|
1856 | * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
|
---|
1857 | * to sys_mbox_new() when the recvmbox is created.
|
---|
1858 | */
|
---|
1859 | #if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__
|
---|
1860 | #define DEFAULT_TCP_RECVMBOX_SIZE 0
|
---|
1861 | #endif
|
---|
1862 |
|
---|
1863 | /**
|
---|
1864 | * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
|
---|
1865 | * The queue size value itself is platform-dependent, but is passed to
|
---|
1866 | * sys_mbox_new() when the acceptmbox is created.
|
---|
1867 | */
|
---|
1868 | #if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__
|
---|
1869 | #define DEFAULT_ACCEPTMBOX_SIZE 0
|
---|
1870 | #endif
|
---|
1871 | /**
|
---|
1872 | * @}
|
---|
1873 | */
|
---|
1874 |
|
---|
1875 | /*
|
---|
1876 | ----------------------------------------------
|
---|
1877 | ---------- Sequential layer options ----------
|
---|
1878 | ----------------------------------------------
|
---|
1879 | */
|
---|
1880 | /**
|
---|
1881 | * @defgroup lwip_opts_netconn Netconn
|
---|
1882 | * @ingroup lwip_opts_threadsafe_apis
|
---|
1883 | * @{
|
---|
1884 | */
|
---|
1885 | /**
|
---|
1886 | * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
|
---|
1887 | */
|
---|
1888 | #if !defined LWIP_NETCONN || defined __DOXYGEN__
|
---|
1889 | #define LWIP_NETCONN 1
|
---|
1890 | #endif
|
---|
1891 |
|
---|
1892 | /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create
|
---|
1893 | * timers running in tcpip_thread from another thread.
|
---|
1894 | */
|
---|
1895 | #if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__
|
---|
1896 | #define LWIP_TCPIP_TIMEOUT 0
|
---|
1897 | #endif
|
---|
1898 |
|
---|
1899 | /** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per
|
---|
1900 | * thread calling socket/netconn functions instead of allocating one
|
---|
1901 | * semaphore per netconn (and per select etc.)
|
---|
1902 | * ATTENTION: a thread-local semaphore for API calls is needed:
|
---|
1903 | * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t*
|
---|
1904 | * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore
|
---|
1905 | * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore
|
---|
1906 | * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup().
|
---|
1907 | * Ports may call these for threads created with sys_thread_new().
|
---|
1908 | */
|
---|
1909 | #if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__
|
---|
1910 | #define LWIP_NETCONN_SEM_PER_THREAD 0
|
---|
1911 | #endif
|
---|
1912 |
|
---|
1913 | /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread,
|
---|
1914 | * writing from a 2nd thread and closing from a 3rd thread at the same time.
|
---|
1915 | * ATTENTION: This is currently really alpha! Some requirements:
|
---|
1916 | * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from
|
---|
1917 | * multiple threads at once
|
---|
1918 | * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox
|
---|
1919 | * and prevent a task pending on this during/after deletion
|
---|
1920 | */
|
---|
1921 | #if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__
|
---|
1922 | #define LWIP_NETCONN_FULLDUPLEX 0
|
---|
1923 | #endif
|
---|
1924 | /**
|
---|
1925 | * @}
|
---|
1926 | */
|
---|
1927 |
|
---|
1928 | /*
|
---|
1929 | ------------------------------------
|
---|
1930 | ---------- Socket options ----------
|
---|
1931 | ------------------------------------
|
---|
1932 | */
|
---|
1933 | /**
|
---|
1934 | * @defgroup lwip_opts_socket Sockets
|
---|
1935 | * @ingroup lwip_opts_threadsafe_apis
|
---|
1936 | * @{
|
---|
1937 | */
|
---|
1938 | /**
|
---|
1939 | * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
|
---|
1940 | */
|
---|
1941 | #if !defined LWIP_SOCKET || defined __DOXYGEN__
|
---|
1942 | #define LWIP_SOCKET 1
|
---|
1943 | #endif
|
---|
1944 |
|
---|
1945 | /**
|
---|
1946 | * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines.
|
---|
1947 | * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created.
|
---|
1948 | * While this helps code completion, it might conflict with existing libraries.
|
---|
1949 | * (only used if you use sockets.c)
|
---|
1950 | */
|
---|
1951 | #if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__
|
---|
1952 | #define LWIP_COMPAT_SOCKETS 1
|
---|
1953 | #endif
|
---|
1954 |
|
---|
1955 | /**
|
---|
1956 | * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
|
---|
1957 | * Disable this option if you use a POSIX operating system that uses the same
|
---|
1958 | * names (read, write & close). (only used if you use sockets.c)
|
---|
1959 | */
|
---|
1960 | #if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__
|
---|
1961 | #define LWIP_POSIX_SOCKETS_IO_NAMES 1
|
---|
1962 | #endif
|
---|
1963 |
|
---|
1964 | /**
|
---|
1965 | * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.
|
---|
1966 | * This can be useful when there are multiple APIs which create file descriptors.
|
---|
1967 | * When they all start with a different offset and you won't make them overlap you can
|
---|
1968 | * re implement read/write/close/ioctl/fnctl to send the requested action to the right
|
---|
1969 | * library (sharing select will need more work though).
|
---|
1970 | */
|
---|
1971 | #if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__
|
---|
1972 | #define LWIP_SOCKET_OFFSET 0
|
---|
1973 | #endif
|
---|
1974 |
|
---|
1975 | /**
|
---|
1976 | * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
|
---|
1977 | * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
|
---|
1978 | * in seconds. (does not require sockets.c, and will affect tcp.c)
|
---|
1979 | */
|
---|
1980 | #if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__
|
---|
1981 | #define LWIP_TCP_KEEPALIVE 1
|
---|
1982 | #endif
|
---|
1983 |
|
---|
1984 | /**
|
---|
1985 | * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
|
---|
1986 | * SO_SNDTIMEO processing.
|
---|
1987 | */
|
---|
1988 | #if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__
|
---|
1989 | #define LWIP_SO_SNDTIMEO 0
|
---|
1990 | #endif
|
---|
1991 |
|
---|
1992 | /**
|
---|
1993 | * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
|
---|
1994 | * SO_RCVTIMEO processing.
|
---|
1995 | */
|
---|
1996 | #if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__
|
---|
1997 | #define LWIP_SO_RCVTIMEO 1
|
---|
1998 | #endif
|
---|
1999 |
|
---|
2000 | /**
|
---|
2001 | * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int
|
---|
2002 | * (milliseconds, much like winsock does) instead of a struct timeval (default).
|
---|
2003 | */
|
---|
2004 | #if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__
|
---|
2005 | #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0
|
---|
2006 | #endif
|
---|
2007 |
|
---|
2008 | /**
|
---|
2009 | * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
|
---|
2010 | */
|
---|
2011 | #if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__
|
---|
2012 | #define LWIP_SO_RCVBUF 0
|
---|
2013 | #endif
|
---|
2014 |
|
---|
2015 | /**
|
---|
2016 | * LWIP_SO_LINGER==1: Enable SO_LINGER processing.
|
---|
2017 | */
|
---|
2018 | #if !defined LWIP_SO_LINGER || defined __DOXYGEN__
|
---|
2019 | #define LWIP_SO_LINGER 0
|
---|
2020 | #endif
|
---|
2021 |
|
---|
2022 | /**
|
---|
2023 | * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
|
---|
2024 | */
|
---|
2025 | #if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__
|
---|
2026 | #define RECV_BUFSIZE_DEFAULT INT_MAX
|
---|
2027 | #endif
|
---|
2028 |
|
---|
2029 | /**
|
---|
2030 | * By default, TCP socket/netconn close waits 20 seconds max to send the FIN
|
---|
2031 | */
|
---|
2032 | #if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__
|
---|
2033 | #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000
|
---|
2034 | #endif
|
---|
2035 |
|
---|
2036 | /**
|
---|
2037 | * SO_REUSE==1: Enable SO_REUSEADDR option.
|
---|
2038 | */
|
---|
2039 | #if !defined SO_REUSE || defined __DOXYGEN__
|
---|
2040 | #define SO_REUSE 0
|
---|
2041 | #endif
|
---|
2042 |
|
---|
2043 | /**
|
---|
2044 | * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
|
---|
2045 | * to all local matches if SO_REUSEADDR is turned on.
|
---|
2046 | * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
|
---|
2047 | */
|
---|
2048 | #if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__
|
---|
2049 | #define SO_REUSE_RXTOALL 0
|
---|
2050 | #endif
|
---|
2051 |
|
---|
2052 | /**
|
---|
2053 | * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of
|
---|
2054 | * pending data in the network buffer. This is the way windows does it. It's
|
---|
2055 | * the default for lwIP since it is smaller.
|
---|
2056 | * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next
|
---|
2057 | * pending datagram in bytes. This is the way linux does it. This code is only
|
---|
2058 | * here for compatibility.
|
---|
2059 | */
|
---|
2060 | #if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__
|
---|
2061 | #define LWIP_FIONREAD_LINUXMODE 0
|
---|
2062 | #endif
|
---|
2063 |
|
---|
2064 | /**
|
---|
2065 | * LWIP_SOCKET_SELECT==1 (default): enable select() for sockets (uses a netconn
|
---|
2066 | * callback to keep track of events).
|
---|
2067 | * This saves RAM (counters per socket) and code (netconn event callback), which
|
---|
2068 | * should improve performance a bit).
|
---|
2069 | */
|
---|
2070 | #if !defined LWIP_SOCKET_SELECT || defined __DOXYGEN__
|
---|
2071 | #define LWIP_SOCKET_SELECT 1
|
---|
2072 | #endif
|
---|
2073 |
|
---|
2074 | /**
|
---|
2075 | * LWIP_SOCKET_POLL==1 (default): enable poll() for sockets (including
|
---|
2076 | * struct pollfd, nfds_t, and constants)
|
---|
2077 | */
|
---|
2078 | #if !defined LWIP_SOCKET_POLL || defined __DOXYGEN__
|
---|
2079 | #define LWIP_SOCKET_POLL 1
|
---|
2080 | #endif
|
---|
2081 | /**
|
---|
2082 | * @}
|
---|
2083 | */
|
---|
2084 |
|
---|
2085 | /*
|
---|
2086 | ----------------------------------------
|
---|
2087 | ---------- Statistics options ----------
|
---|
2088 | ----------------------------------------
|
---|
2089 | */
|
---|
2090 | /**
|
---|
2091 | * @defgroup lwip_opts_stats Statistics
|
---|
2092 | * @ingroup lwip_opts_debug
|
---|
2093 | * @{
|
---|
2094 | */
|
---|
2095 | /**
|
---|
2096 | * LWIP_STATS==1: Enable statistics collection in lwip_stats.
|
---|
2097 | */
|
---|
2098 | #if !defined LWIP_STATS || defined __DOXYGEN__
|
---|
2099 | #define LWIP_STATS 1
|
---|
2100 | #endif
|
---|
2101 |
|
---|
2102 | #if LWIP_STATS
|
---|
2103 |
|
---|
2104 | /**
|
---|
2105 | * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
|
---|
2106 | */
|
---|
2107 | #if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__
|
---|
2108 | #define LWIP_STATS_DISPLAY 0
|
---|
2109 | #endif
|
---|
2110 |
|
---|
2111 | /**
|
---|
2112 | * LINK_STATS==1: Enable link stats.
|
---|
2113 | */
|
---|
2114 | #if !defined LINK_STATS || defined __DOXYGEN__
|
---|
2115 | #define LINK_STATS 1
|
---|
2116 | #endif
|
---|
2117 |
|
---|
2118 | /**
|
---|
2119 | * ETHARP_STATS==1: Enable etharp stats.
|
---|
2120 | */
|
---|
2121 | #if !defined ETHARP_STATS || defined __DOXYGEN__
|
---|
2122 | #define ETHARP_STATS (LWIP_ARP)
|
---|
2123 | #endif
|
---|
2124 |
|
---|
2125 | /**
|
---|
2126 | * IP_STATS==1: Enable IP stats.
|
---|
2127 | */
|
---|
2128 | #if !defined IP_STATS || defined __DOXYGEN__
|
---|
2129 | #define IP_STATS 1
|
---|
2130 | #endif
|
---|
2131 |
|
---|
2132 | /**
|
---|
2133 | * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
|
---|
2134 | * on if using either frag or reass.
|
---|
2135 | */
|
---|
2136 | #if !defined IPFRAG_STATS || defined __DOXYGEN__
|
---|
2137 | #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG)
|
---|
2138 | #endif
|
---|
2139 |
|
---|
2140 | /**
|
---|
2141 | * ICMP_STATS==1: Enable ICMP stats.
|
---|
2142 | */
|
---|
2143 | #if !defined ICMP_STATS || defined __DOXYGEN__
|
---|
2144 | #define ICMP_STATS 1
|
---|
2145 | #endif
|
---|
2146 |
|
---|
2147 | /**
|
---|
2148 | * IGMP_STATS==1: Enable IGMP stats.
|
---|
2149 | */
|
---|
2150 | #if !defined IGMP_STATS || defined __DOXYGEN__
|
---|
2151 | #define IGMP_STATS (LWIP_IGMP)
|
---|
2152 | #endif
|
---|
2153 |
|
---|
2154 | /**
|
---|
2155 | * UDP_STATS==1: Enable UDP stats. Default is on if
|
---|
2156 | * UDP enabled, otherwise off.
|
---|
2157 | */
|
---|
2158 | #if !defined UDP_STATS || defined __DOXYGEN__
|
---|
2159 | #define UDP_STATS (LWIP_UDP)
|
---|
2160 | #endif
|
---|
2161 |
|
---|
2162 | /**
|
---|
2163 | * TCP_STATS==1: Enable TCP stats. Default is on if TCP
|
---|
2164 | * enabled, otherwise off.
|
---|
2165 | */
|
---|
2166 | #if !defined TCP_STATS || defined __DOXYGEN__
|
---|
2167 | #define TCP_STATS (LWIP_TCP)
|
---|
2168 | #endif
|
---|
2169 |
|
---|
2170 | /**
|
---|
2171 | * MEM_STATS==1: Enable mem.c stats.
|
---|
2172 | */
|
---|
2173 | #if !defined MEM_STATS || defined __DOXYGEN__
|
---|
2174 | #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
|
---|
2175 | #endif
|
---|
2176 |
|
---|
2177 | /**
|
---|
2178 | * MEMP_STATS==1: Enable memp.c pool stats.
|
---|
2179 | */
|
---|
2180 | #if !defined MEMP_STATS || defined __DOXYGEN__
|
---|
2181 | #define MEMP_STATS (MEMP_MEM_MALLOC == 0)
|
---|
2182 | #endif
|
---|
2183 |
|
---|
2184 | /**
|
---|
2185 | * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
|
---|
2186 | */
|
---|
2187 | #if !defined SYS_STATS || defined __DOXYGEN__
|
---|
2188 | #define SYS_STATS (NO_SYS == 0)
|
---|
2189 | #endif
|
---|
2190 |
|
---|
2191 | /**
|
---|
2192 | * IP6_STATS==1: Enable IPv6 stats.
|
---|
2193 | */
|
---|
2194 | #if !defined IP6_STATS || defined __DOXYGEN__
|
---|
2195 | #define IP6_STATS (LWIP_IPV6)
|
---|
2196 | #endif
|
---|
2197 |
|
---|
2198 | /**
|
---|
2199 | * ICMP6_STATS==1: Enable ICMP for IPv6 stats.
|
---|
2200 | */
|
---|
2201 | #if !defined ICMP6_STATS || defined __DOXYGEN__
|
---|
2202 | #define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6)
|
---|
2203 | #endif
|
---|
2204 |
|
---|
2205 | /**
|
---|
2206 | * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats.
|
---|
2207 | */
|
---|
2208 | #if !defined IP6_FRAG_STATS || defined __DOXYGEN__
|
---|
2209 | #define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS))
|
---|
2210 | #endif
|
---|
2211 |
|
---|
2212 | /**
|
---|
2213 | * MLD6_STATS==1: Enable MLD for IPv6 stats.
|
---|
2214 | */
|
---|
2215 | #if !defined MLD6_STATS || defined __DOXYGEN__
|
---|
2216 | #define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD)
|
---|
2217 | #endif
|
---|
2218 |
|
---|
2219 | /**
|
---|
2220 | * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats.
|
---|
2221 | */
|
---|
2222 | #if !defined ND6_STATS || defined __DOXYGEN__
|
---|
2223 | #define ND6_STATS (LWIP_IPV6)
|
---|
2224 | #endif
|
---|
2225 |
|
---|
2226 | /**
|
---|
2227 | * MIB2_STATS==1: Stats for SNMP MIB2.
|
---|
2228 | */
|
---|
2229 | #if !defined MIB2_STATS || defined __DOXYGEN__
|
---|
2230 | #define MIB2_STATS 0
|
---|
2231 | #endif
|
---|
2232 |
|
---|
2233 | #else
|
---|
2234 |
|
---|
2235 | #define LINK_STATS 0
|
---|
2236 | #define ETHARP_STATS 0
|
---|
2237 | #define IP_STATS 0
|
---|
2238 | #define IPFRAG_STATS 0
|
---|
2239 | #define ICMP_STATS 0
|
---|
2240 | #define IGMP_STATS 0
|
---|
2241 | #define UDP_STATS 0
|
---|
2242 | #define TCP_STATS 0
|
---|
2243 | #define MEM_STATS 0
|
---|
2244 | #define MEMP_STATS 0
|
---|
2245 | #define SYS_STATS 0
|
---|
2246 | #define LWIP_STATS_DISPLAY 0
|
---|
2247 | #define IP6_STATS 0
|
---|
2248 | #define ICMP6_STATS 0
|
---|
2249 | #define IP6_FRAG_STATS 0
|
---|
2250 | #define MLD6_STATS 0
|
---|
2251 | #define ND6_STATS 0
|
---|
2252 | #define MIB2_STATS 0
|
---|
2253 |
|
---|
2254 | #endif /* LWIP_STATS */
|
---|
2255 | /**
|
---|
2256 | * @}
|
---|
2257 | */
|
---|
2258 |
|
---|
2259 | /*
|
---|
2260 | --------------------------------------
|
---|
2261 | ---------- Checksum options ----------
|
---|
2262 | --------------------------------------
|
---|
2263 | */
|
---|
2264 | /**
|
---|
2265 | * @defgroup lwip_opts_checksum Checksum
|
---|
2266 | * @ingroup lwip_opts_infrastructure
|
---|
2267 | * @{
|
---|
2268 | */
|
---|
2269 | /**
|
---|
2270 | * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled
|
---|
2271 | * per netif.
|
---|
2272 | * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled!
|
---|
2273 | */
|
---|
2274 | #if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__
|
---|
2275 | #define LWIP_CHECKSUM_CTRL_PER_NETIF 0
|
---|
2276 | #endif
|
---|
2277 |
|
---|
2278 | /**
|
---|
2279 | * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
|
---|
2280 | */
|
---|
2281 | #if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__
|
---|
2282 | #define CHECKSUM_GEN_IP 1
|
---|
2283 | #endif
|
---|
2284 |
|
---|
2285 | /**
|
---|
2286 | * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
|
---|
2287 | */
|
---|
2288 | #if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__
|
---|
2289 | #define CHECKSUM_GEN_UDP 1
|
---|
2290 | #endif
|
---|
2291 |
|
---|
2292 | /**
|
---|
2293 | * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
|
---|
2294 | */
|
---|
2295 | #if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__
|
---|
2296 | #define CHECKSUM_GEN_TCP 1
|
---|
2297 | #endif
|
---|
2298 |
|
---|
2299 | /**
|
---|
2300 | * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.
|
---|
2301 | */
|
---|
2302 | #if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__
|
---|
2303 | #define CHECKSUM_GEN_ICMP 1
|
---|
2304 | #endif
|
---|
2305 |
|
---|
2306 | /**
|
---|
2307 | * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
|
---|
2308 | */
|
---|
2309 | #if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__
|
---|
2310 | #define CHECKSUM_GEN_ICMP6 1
|
---|
2311 | #endif
|
---|
2312 |
|
---|
2313 | /**
|
---|
2314 | * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
|
---|
2315 | */
|
---|
2316 | #if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__
|
---|
2317 | #define CHECKSUM_CHECK_IP 1
|
---|
2318 | #endif
|
---|
2319 |
|
---|
2320 | /**
|
---|
2321 | * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
|
---|
2322 | */
|
---|
2323 | #if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__
|
---|
2324 | #define CHECKSUM_CHECK_UDP 1
|
---|
2325 | #endif
|
---|
2326 |
|
---|
2327 | /**
|
---|
2328 | * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
|
---|
2329 | */
|
---|
2330 | #if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__
|
---|
2331 | #define CHECKSUM_CHECK_TCP 1
|
---|
2332 | #endif
|
---|
2333 |
|
---|
2334 | /**
|
---|
2335 | * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
|
---|
2336 | */
|
---|
2337 | #if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__
|
---|
2338 | #define CHECKSUM_CHECK_ICMP 1
|
---|
2339 | #endif
|
---|
2340 |
|
---|
2341 | /**
|
---|
2342 | * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
|
---|
2343 | */
|
---|
2344 | #if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__
|
---|
2345 | #define CHECKSUM_CHECK_ICMP6 1
|
---|
2346 | #endif
|
---|
2347 |
|
---|
2348 | /**
|
---|
2349 | * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
|
---|
2350 | * application buffers to pbufs.
|
---|
2351 | */
|
---|
2352 | #if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__
|
---|
2353 | #define LWIP_CHECKSUM_ON_COPY 0
|
---|
2354 | #endif
|
---|
2355 | /**
|
---|
2356 | * @}
|
---|
2357 | */
|
---|
2358 |
|
---|
2359 | /*
|
---|
2360 | ---------------------------------------
|
---|
2361 | ---------- IPv6 options ---------------
|
---|
2362 | ---------------------------------------
|
---|
2363 | */
|
---|
2364 | /**
|
---|
2365 | * @defgroup lwip_opts_ipv6 IPv6
|
---|
2366 | * @ingroup lwip_opts
|
---|
2367 | * @{
|
---|
2368 | */
|
---|
2369 | /**
|
---|
2370 | * LWIP_IPV6==1: Enable IPv6
|
---|
2371 | */
|
---|
2372 | #if !defined LWIP_IPV6 || defined __DOXYGEN__
|
---|
2373 | #define LWIP_IPV6 0
|
---|
2374 | #endif
|
---|
2375 |
|
---|
2376 | /**
|
---|
2377 | * IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally)
|
---|
2378 | * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
|
---|
2379 | * in this time, the whole packet is discarded.
|
---|
2380 | */
|
---|
2381 | #if !defined IPV6_REASS_MAXAGE || defined __DOXYGEN__
|
---|
2382 | #define IPV6_REASS_MAXAGE 60
|
---|
2383 | #endif
|
---|
2384 |
|
---|
2385 | /**
|
---|
2386 | * LWIP_IPV6_SCOPES==1: Enable support for IPv6 address scopes, ensuring that
|
---|
2387 | * e.g. link-local addresses are really treated as link-local. Disable this
|
---|
2388 | * setting only for single-interface configurations.
|
---|
2389 | * All addresses that have a scope according to the default policy (link-local
|
---|
2390 | * unicast addresses, interface-local and link-local multicast addresses) should
|
---|
2391 | * now have a zone set on them before being passed to the core API, although
|
---|
2392 | * lwIP will currently attempt to select a zone on the caller's behalf when
|
---|
2393 | * necessary. Applications that directly assign IPv6 addresses to interfaces
|
---|
2394 | * (which is NOT recommended) must now ensure that link-local addresses carry
|
---|
2395 | * the netif's zone. See the new ip6_zone.h header file for more information and
|
---|
2396 | * relevant macros. For now it is still possible to turn off scopes support
|
---|
2397 | * through the new LWIP_IPV6_SCOPES option. When upgrading an implementation that
|
---|
2398 | * uses the core API directly, it is highly recommended to enable
|
---|
2399 | * LWIP_IPV6_SCOPES_DEBUG at least for a while, to ensure e.g. proper address
|
---|
2400 | * initialization.
|
---|
2401 | */
|
---|
2402 | #if !defined LWIP_IPV6_SCOPES || defined __DOXYGEN__
|
---|
2403 | #define LWIP_IPV6_SCOPES (LWIP_IPV6 && !LWIP_SINGLE_NETIF)
|
---|
2404 | #endif
|
---|
2405 |
|
---|
2406 | /**
|
---|
2407 | * LWIP_IPV6_SCOPES_DEBUG==1: Perform run-time checks to verify that addresses
|
---|
2408 | * are properly zoned (see ip6_zone.h on what that means) where it matters.
|
---|
2409 | * Enabling this setting is highly recommended when upgrading from an existing
|
---|
2410 | * installation that is not yet scope-aware; otherwise it may be too expensive.
|
---|
2411 | */
|
---|
2412 | #if !defined LWIP_IPV6_SCOPES_DEBUG || defined __DOXYGEN__
|
---|
2413 | #define LWIP_IPV6_SCOPES_DEBUG 0
|
---|
2414 | #endif
|
---|
2415 |
|
---|
2416 | /**
|
---|
2417 | * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif.
|
---|
2418 | */
|
---|
2419 | #if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__
|
---|
2420 | #define LWIP_IPV6_NUM_ADDRESSES 3
|
---|
2421 | #endif
|
---|
2422 |
|
---|
2423 | /**
|
---|
2424 | * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs
|
---|
2425 | */
|
---|
2426 | #if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__
|
---|
2427 | #define LWIP_IPV6_FORWARD 0
|
---|
2428 | #endif
|
---|
2429 |
|
---|
2430 | /**
|
---|
2431 | * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big.
|
---|
2432 | */
|
---|
2433 | #if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__
|
---|
2434 | #define LWIP_IPV6_FRAG 1
|
---|
2435 | #endif
|
---|
2436 |
|
---|
2437 | /**
|
---|
2438 | * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented
|
---|
2439 | */
|
---|
2440 | #if !defined LWIP_IPV6_REASS || defined __DOXYGEN__
|
---|
2441 | #define LWIP_IPV6_REASS LWIP_IPV6
|
---|
2442 | #endif
|
---|
2443 |
|
---|
2444 | /**
|
---|
2445 | * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during
|
---|
2446 | * network startup.
|
---|
2447 | */
|
---|
2448 | #if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__
|
---|
2449 | #define LWIP_IPV6_SEND_ROUTER_SOLICIT 1
|
---|
2450 | #endif
|
---|
2451 |
|
---|
2452 | /**
|
---|
2453 | * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862.
|
---|
2454 | */
|
---|
2455 | #if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__
|
---|
2456 | #define LWIP_IPV6_AUTOCONFIG LWIP_IPV6
|
---|
2457 | #endif
|
---|
2458 |
|
---|
2459 | /**
|
---|
2460 | * LWIP_IPV6_ADDRESS_LIFETIMES==1: Keep valid and preferred lifetimes for each
|
---|
2461 | * IPv6 address. Required for LWIP_IPV6_AUTOCONFIG. May still be enabled
|
---|
2462 | * otherwise, in which case the application may assign address lifetimes with
|
---|
2463 | * the appropriate macros. Addresses with no lifetime are assumed to be static.
|
---|
2464 | * If this option is disabled, all addresses are assumed to be static.
|
---|
2465 | */
|
---|
2466 | #if !defined LWIP_IPV6_ADDRESS_LIFETIMES || defined __DOXYGEN__
|
---|
2467 | #define LWIP_IPV6_ADDRESS_LIFETIMES LWIP_IPV6_AUTOCONFIG
|
---|
2468 | #endif
|
---|
2469 |
|
---|
2470 | /**
|
---|
2471 | * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts.
|
---|
2472 | */
|
---|
2473 | #if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__
|
---|
2474 | #define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1
|
---|
2475 | #endif
|
---|
2476 | /**
|
---|
2477 | * @}
|
---|
2478 | */
|
---|
2479 |
|
---|
2480 | /**
|
---|
2481 | * @defgroup lwip_opts_icmp6 ICMP6
|
---|
2482 | * @ingroup lwip_opts_ipv6
|
---|
2483 | * @{
|
---|
2484 | */
|
---|
2485 | /**
|
---|
2486 | * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC)
|
---|
2487 | */
|
---|
2488 | #if !defined LWIP_ICMP6 || defined __DOXYGEN__
|
---|
2489 | #define LWIP_ICMP6 LWIP_IPV6
|
---|
2490 | #endif
|
---|
2491 |
|
---|
2492 | /**
|
---|
2493 | * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in
|
---|
2494 | * ICMPv6 error messages.
|
---|
2495 | */
|
---|
2496 | #if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__
|
---|
2497 | #define LWIP_ICMP6_DATASIZE 8
|
---|
2498 | #endif
|
---|
2499 |
|
---|
2500 | /**
|
---|
2501 | * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages
|
---|
2502 | */
|
---|
2503 | #if !defined LWIP_ICMP6_HL || defined __DOXYGEN__
|
---|
2504 | #define LWIP_ICMP6_HL 255
|
---|
2505 | #endif
|
---|
2506 | /**
|
---|
2507 | * @}
|
---|
2508 | */
|
---|
2509 |
|
---|
2510 | /**
|
---|
2511 | * @defgroup lwip_opts_mld6 Multicast listener discovery
|
---|
2512 | * @ingroup lwip_opts_ipv6
|
---|
2513 | * @{
|
---|
2514 | */
|
---|
2515 | /**
|
---|
2516 | * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol.
|
---|
2517 | * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must
|
---|
2518 | * indiscriminately pass all inbound IPv6 multicast traffic to lwIP.
|
---|
2519 | */
|
---|
2520 | #if !defined LWIP_IPV6_MLD || defined __DOXYGEN__
|
---|
2521 | #define LWIP_IPV6_MLD LWIP_IPV6
|
---|
2522 | #endif
|
---|
2523 |
|
---|
2524 | /**
|
---|
2525 | * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined.
|
---|
2526 | * There must be enough groups so that each netif can join the solicited-node
|
---|
2527 | * multicast group for each of its local addresses, plus one for MDNS if
|
---|
2528 | * applicable, plus any number of groups to be joined on UDP sockets.
|
---|
2529 | */
|
---|
2530 | #if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__
|
---|
2531 | #define MEMP_NUM_MLD6_GROUP 4
|
---|
2532 | #endif
|
---|
2533 | /**
|
---|
2534 | * @}
|
---|
2535 | */
|
---|
2536 |
|
---|
2537 | /**
|
---|
2538 | * @defgroup lwip_opts_nd6 Neighbor discovery
|
---|
2539 | * @ingroup lwip_opts_ipv6
|
---|
2540 | * @{
|
---|
2541 | */
|
---|
2542 | /**
|
---|
2543 | * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address
|
---|
2544 | * is being resolved.
|
---|
2545 | */
|
---|
2546 | #if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__
|
---|
2547 | #define LWIP_ND6_QUEUEING LWIP_IPV6
|
---|
2548 | #endif
|
---|
2549 |
|
---|
2550 | /**
|
---|
2551 | * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution.
|
---|
2552 | */
|
---|
2553 | #if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__
|
---|
2554 | #define MEMP_NUM_ND6_QUEUE 20
|
---|
2555 | #endif
|
---|
2556 |
|
---|
2557 | /**
|
---|
2558 | * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache
|
---|
2559 | */
|
---|
2560 | #if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__
|
---|
2561 | #define LWIP_ND6_NUM_NEIGHBORS 10
|
---|
2562 | #endif
|
---|
2563 |
|
---|
2564 | /**
|
---|
2565 | * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache
|
---|
2566 | */
|
---|
2567 | #if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__
|
---|
2568 | #define LWIP_ND6_NUM_DESTINATIONS 10
|
---|
2569 | #endif
|
---|
2570 |
|
---|
2571 | /**
|
---|
2572 | * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache
|
---|
2573 | */
|
---|
2574 | #if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__
|
---|
2575 | #define LWIP_ND6_NUM_PREFIXES 5
|
---|
2576 | #endif
|
---|
2577 |
|
---|
2578 | /**
|
---|
2579 | * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache
|
---|
2580 | */
|
---|
2581 | #if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__
|
---|
2582 | #define LWIP_ND6_NUM_ROUTERS 3
|
---|
2583 | #endif
|
---|
2584 |
|
---|
2585 | /**
|
---|
2586 | * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send
|
---|
2587 | * (neighbor solicit and router solicit)
|
---|
2588 | */
|
---|
2589 | #if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__
|
---|
2590 | #define LWIP_ND6_MAX_MULTICAST_SOLICIT 3
|
---|
2591 | #endif
|
---|
2592 |
|
---|
2593 | /**
|
---|
2594 | * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages
|
---|
2595 | * to send during neighbor reachability detection.
|
---|
2596 | */
|
---|
2597 | #if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__
|
---|
2598 | #define LWIP_ND6_MAX_UNICAST_SOLICIT 3
|
---|
2599 | #endif
|
---|
2600 |
|
---|
2601 | /**
|
---|
2602 | * Unused: See ND RFC (time in milliseconds).
|
---|
2603 | */
|
---|
2604 | #if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__
|
---|
2605 | #define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000
|
---|
2606 | #endif
|
---|
2607 |
|
---|
2608 | /**
|
---|
2609 | * Unused: See ND RFC
|
---|
2610 | */
|
---|
2611 | #if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__
|
---|
2612 | #define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3
|
---|
2613 | #endif
|
---|
2614 |
|
---|
2615 | /**
|
---|
2616 | * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds).
|
---|
2617 | * May be updated by router advertisement messages.
|
---|
2618 | */
|
---|
2619 | #if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__
|
---|
2620 | #define LWIP_ND6_REACHABLE_TIME 30000
|
---|
2621 | #endif
|
---|
2622 |
|
---|
2623 | /**
|
---|
2624 | * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages
|
---|
2625 | */
|
---|
2626 | #if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__
|
---|
2627 | #define LWIP_ND6_RETRANS_TIMER 1000
|
---|
2628 | #endif
|
---|
2629 |
|
---|
2630 | /**
|
---|
2631 | * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation
|
---|
2632 | * message is sent, during neighbor reachability detection.
|
---|
2633 | */
|
---|
2634 | #if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__
|
---|
2635 | #define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000
|
---|
2636 | #endif
|
---|
2637 |
|
---|
2638 | /**
|
---|
2639 | * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update
|
---|
2640 | * Reachable time and retransmission timers, and netif MTU.
|
---|
2641 | */
|
---|
2642 | #if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__
|
---|
2643 | #define LWIP_ND6_ALLOW_RA_UPDATES 1
|
---|
2644 | #endif
|
---|
2645 |
|
---|
2646 | /**
|
---|
2647 | * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery
|
---|
2648 | * with reachability hints for connected destinations. This helps avoid sending
|
---|
2649 | * unicast neighbor solicitation messages.
|
---|
2650 | */
|
---|
2651 | #if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__
|
---|
2652 | #define LWIP_ND6_TCP_REACHABILITY_HINTS 1
|
---|
2653 | #endif
|
---|
2654 |
|
---|
2655 | /**
|
---|
2656 | * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive
|
---|
2657 | * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS
|
---|
2658 | * servers to the DNS module.
|
---|
2659 | */
|
---|
2660 | #if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__
|
---|
2661 | #define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0
|
---|
2662 | #endif
|
---|
2663 | /**
|
---|
2664 | * @}
|
---|
2665 | */
|
---|
2666 |
|
---|
2667 | /**
|
---|
2668 | * @defgroup lwip_opts_dhcpv6 DHCPv6
|
---|
2669 | * @ingroup lwip_opts_ipv6
|
---|
2670 | * @{
|
---|
2671 | */
|
---|
2672 | /**
|
---|
2673 | * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful/stateless address autoconfiguration.
|
---|
2674 | */
|
---|
2675 | #if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__
|
---|
2676 | #define LWIP_IPV6_DHCP6 0
|
---|
2677 | #endif
|
---|
2678 |
|
---|
2679 | /**
|
---|
2680 | * LWIP_IPV6_DHCP6_STATEFUL==1: enable DHCPv6 stateful address autoconfiguration.
|
---|
2681 | * (not supported, yet!)
|
---|
2682 | */
|
---|
2683 | #if !defined LWIP_IPV6_DHCP6_STATEFUL || defined __DOXYGEN__
|
---|
2684 | #define LWIP_IPV6_DHCP6_STATEFUL 0
|
---|
2685 | #endif
|
---|
2686 |
|
---|
2687 | /**
|
---|
2688 | * LWIP_IPV6_DHCP6_STATELESS==1: enable DHCPv6 stateless address autoconfiguration.
|
---|
2689 | */
|
---|
2690 | #if !defined LWIP_IPV6_DHCP6_STATELESS || defined __DOXYGEN__
|
---|
2691 | #define LWIP_IPV6_DHCP6_STATELESS LWIP_IPV6_DHCP6
|
---|
2692 | #endif
|
---|
2693 |
|
---|
2694 | /**
|
---|
2695 | * LWIP_DHCP6_GETS_NTP==1: Request NTP servers via DHCPv6. For each
|
---|
2696 | * response packet, a callback is called, which has to be provided by the port:
|
---|
2697 | * void dhcp6_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs);
|
---|
2698 | */
|
---|
2699 | #if !defined LWIP_DHCP6_GET_NTP_SRV || defined __DOXYGEN__
|
---|
2700 | #define LWIP_DHCP6_GET_NTP_SRV 0
|
---|
2701 | #endif
|
---|
2702 |
|
---|
2703 | /**
|
---|
2704 | * The maximum of NTP servers requested
|
---|
2705 | */
|
---|
2706 | #if !defined LWIP_DHCP6_MAX_NTP_SERVERS || defined __DOXYGEN__
|
---|
2707 | #define LWIP_DHCP6_MAX_NTP_SERVERS 1
|
---|
2708 | #endif
|
---|
2709 |
|
---|
2710 | /**
|
---|
2711 | * LWIP_DHCP6_MAX_DNS_SERVERS > 0: Request DNS servers via DHCPv6.
|
---|
2712 | * DNS servers received in the response are passed to DNS via @ref dns_setserver()
|
---|
2713 | * (up to the maximum limit defined here).
|
---|
2714 | */
|
---|
2715 | #if !defined LWIP_DHCP6_MAX_DNS_SERVERS || defined __DOXYGEN__
|
---|
2716 | #define LWIP_DHCP6_MAX_DNS_SERVERS DNS_MAX_SERVERS
|
---|
2717 | #endif
|
---|
2718 | /**
|
---|
2719 | * @}
|
---|
2720 | */
|
---|
2721 |
|
---|
2722 | /*
|
---|
2723 | ---------------------------------------
|
---|
2724 | ---------- Hook options ---------------
|
---|
2725 | ---------------------------------------
|
---|
2726 | */
|
---|
2727 |
|
---|
2728 | /**
|
---|
2729 | * @defgroup lwip_opts_hooks Hooks
|
---|
2730 | * @ingroup lwip_opts_infrastructure
|
---|
2731 | * Hooks are undefined by default, define them to a function if you need them.
|
---|
2732 | * @{
|
---|
2733 | */
|
---|
2734 |
|
---|
2735 | /**
|
---|
2736 | * LWIP_HOOK_FILENAME: Custom filename to \#include in files that provide hooks.
|
---|
2737 | * Declare your hook function prototypes in there, you may also \#include all headers
|
---|
2738 | * providing data types that are need in this file.
|
---|
2739 | */
|
---|
2740 | #ifdef __DOXYGEN__
|
---|
2741 | #define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h"
|
---|
2742 | #endif
|
---|
2743 |
|
---|
2744 | /**
|
---|
2745 | * LWIP_HOOK_TCP_ISN:
|
---|
2746 | * Hook for generation of the Initial Sequence Number (ISN) for a new TCP
|
---|
2747 | * connection. The default lwIP ISN generation algorithm is very basic and may
|
---|
2748 | * allow for TCP spoofing attacks. This hook provides the means to implement
|
---|
2749 | * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn),
|
---|
2750 | * or any other desired algorithm as a replacement.
|
---|
2751 | * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for
|
---|
2752 | * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n
|
---|
2753 | * Signature:\code{.c}
|
---|
2754 | * u32_t my_hook_tcp_isn(const ip_addr_t* local_ip, u16_t local_port, const ip_addr_t* remote_ip, u16_t remote_port);
|
---|
2755 | * \endcode
|
---|
2756 | * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n
|
---|
2757 | * Arguments:
|
---|
2758 | * - local_ip: pointer to the local IP address of the connection
|
---|
2759 | * - local_port: local port number of the connection (host-byte order)
|
---|
2760 | * - remote_ip: pointer to the remote IP address of the connection
|
---|
2761 | * - remote_port: remote port number of the connection (host-byte order)\n
|
---|
2762 | * Return value:
|
---|
2763 | * - the 32-bit Initial Sequence Number to use for the new TCP connection.
|
---|
2764 | */
|
---|
2765 | #ifdef __DOXYGEN__
|
---|
2766 | #define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port)
|
---|
2767 | #endif
|
---|
2768 |
|
---|
2769 | /**
|
---|
2770 | * LWIP_HOOK_TCP_INPACKET_PCB:
|
---|
2771 | * Hook for intercepting incoming packets before they are passed to a pcb. This
|
---|
2772 | * allows updating some state or even dropping a packet.
|
---|
2773 | * Signature:\code{.c}
|
---|
2774 | * err_t my_hook_tcp_inpkt(struct tcp_pcb *pcb, struct tcp_hdr *hdr, u16_t optlen, u16_t opt1len, u8_t *opt2, struct pbuf *p);
|
---|
2775 | * \endcode
|
---|
2776 | * Arguments:
|
---|
2777 | * - pcb: tcp_pcb selected for input of this packet (ATTENTION: this may be
|
---|
2778 | * struct tcp_pcb_listen if pcb->state == LISTEN)
|
---|
2779 | * - hdr: pointer to tcp header (ATTENTION: tcp options may not be in one piece!)
|
---|
2780 | * - optlen: tcp option length
|
---|
2781 | * - opt1len: tcp option length 1st part
|
---|
2782 | * - opt2: if this is != NULL, tcp options are split among 2 pbufs. In that case,
|
---|
2783 | * options start at right after the tcp header ('(u8_t*)(hdr + 1)') for
|
---|
2784 | * the first 'opt1len' bytes and the rest starts at 'opt2'. opt2len can
|
---|
2785 | * be simply calculated: 'opt2len = optlen - opt1len;'
|
---|
2786 | * - p: input packet, p->payload points to application data (that's why tcp hdr
|
---|
2787 | * and options are passed in seperately)
|
---|
2788 | * Return value:
|
---|
2789 | * - ERR_OK: continue input of this packet as normal
|
---|
2790 | * - != ERR_OK: drop this packet for input (don't continue input processing)
|
---|
2791 | *
|
---|
2792 | * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
|
---|
2793 | * state or any pcb lists) from this callback!
|
---|
2794 | */
|
---|
2795 | #ifdef __DOXYGEN__
|
---|
2796 | #define LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p)
|
---|
2797 | #endif
|
---|
2798 |
|
---|
2799 | /**
|
---|
2800 | * LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH:
|
---|
2801 | * Hook for increasing the size of the options allocated with a tcp header.
|
---|
2802 | * Together with LWIP_HOOK_TCP_OUT_ADD_TCPOPTS, this can be used to add custom
|
---|
2803 | * options to outgoing tcp segments.
|
---|
2804 | * Signature:\code{.c}
|
---|
2805 | * u8_t my_hook_tcp_out_tcpopt_length(const struct tcp_pcb *pcb, u8_t internal_option_length);
|
---|
2806 | * \endcode
|
---|
2807 | * Arguments:
|
---|
2808 | * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or
|
---|
2809 | * struct tcp_pcb_listen if pcb->state == LISTEN)
|
---|
2810 | * - internal_option_length: tcp option length used by the stack internally
|
---|
2811 | * Return value:
|
---|
2812 | * - a number of bytes to allocate for tcp options (internal_option_length <= ret <= 40)
|
---|
2813 | *
|
---|
2814 | * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
|
---|
2815 | * state or any pcb lists) from this callback!
|
---|
2816 | */
|
---|
2817 | #ifdef __DOXYGEN__
|
---|
2818 | #define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len)
|
---|
2819 | #endif
|
---|
2820 |
|
---|
2821 | /**
|
---|
2822 | * LWIP_HOOK_TCP_OUT_ADD_TCPOPTS:
|
---|
2823 | * Hook for adding custom options to outgoing tcp segments.
|
---|
2824 | * Space for these custom options has to be reserved via LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH.
|
---|
2825 | * Signature:\code{.c}
|
---|
2826 | * u32_t *my_hook_tcp_out_add_tcpopts(struct pbuf *p, struct tcp_hdr *hdr, const struct tcp_pcb *pcb, u32_t *opts);
|
---|
2827 | * \endcode
|
---|
2828 | * Arguments:
|
---|
2829 | * - p: output packet, p->payload pointing to tcp header, data follows
|
---|
2830 | * - hdr: tcp header
|
---|
2831 | * - pcb: tcp_pcb that transmits (ATTENTION: this may be NULL or
|
---|
2832 | * struct tcp_pcb_listen if pcb->state == LISTEN)
|
---|
2833 | * - opts: pointer where to add the custom options (there may already be options
|
---|
2834 | * between the header and these)
|
---|
2835 | * Return value:
|
---|
2836 | * - pointer pointing directly after the inserted options
|
---|
2837 | *
|
---|
2838 | * ATTENTION: don't call any tcp api functions that might change tcp state (pcb
|
---|
2839 | * state or any pcb lists) from this callback!
|
---|
2840 | */
|
---|
2841 | #ifdef __DOXYGEN__
|
---|
2842 | #define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts)
|
---|
2843 | #endif
|
---|
2844 |
|
---|
2845 | /**
|
---|
2846 | * LWIP_HOOK_IP4_INPUT(pbuf, input_netif):
|
---|
2847 | * Called from ip_input() (IPv4)
|
---|
2848 | * Signature:\code{.c}
|
---|
2849 | * int my_hook(struct pbuf *pbuf, struct netif *input_netif);
|
---|
2850 | * \endcode
|
---|
2851 | * Arguments:
|
---|
2852 | * - pbuf: received struct pbuf passed to ip_input()
|
---|
2853 | * - input_netif: struct netif on which the packet has been received
|
---|
2854 | * Return values:
|
---|
2855 | * - 0: Hook has not consumed the packet, packet is processed as normal
|
---|
2856 | * - != 0: Hook has consumed the packet.
|
---|
2857 | * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
|
---|
2858 | * (i.e. free it when done).
|
---|
2859 | */
|
---|
2860 | #ifdef __DOXYGEN__
|
---|
2861 | #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif)
|
---|
2862 | #endif
|
---|
2863 |
|
---|
2864 | /**
|
---|
2865 | * LWIP_HOOK_IP4_ROUTE(dest):
|
---|
2866 | * Called from ip_route() (IPv4)
|
---|
2867 | * Signature:\code{.c}
|
---|
2868 | * struct netif *my_hook(const ip4_addr_t *dest);
|
---|
2869 | * \endcode
|
---|
2870 | * Arguments:
|
---|
2871 | * - dest: destination IPv4 address
|
---|
2872 | * Returns values:
|
---|
2873 | * - the destination netif
|
---|
2874 | * - NULL if no destination netif is found. In that case, ip_route() continues as normal.
|
---|
2875 | */
|
---|
2876 | #ifdef __DOXYGEN__
|
---|
2877 | #define LWIP_HOOK_IP4_ROUTE()
|
---|
2878 | #endif
|
---|
2879 |
|
---|
2880 | /**
|
---|
2881 | * LWIP_HOOK_IP4_ROUTE_SRC(src, dest):
|
---|
2882 | * Source-based routing for IPv4 - called from ip_route() (IPv4)
|
---|
2883 | * Signature:\code{.c}
|
---|
2884 | * struct netif *my_hook(const ip4_addr_t *src, const ip4_addr_t *dest);
|
---|
2885 | * \endcode
|
---|
2886 | * Arguments:
|
---|
2887 | * - src: local/source IPv4 address
|
---|
2888 | * - dest: destination IPv4 address
|
---|
2889 | * Returns values:
|
---|
2890 | * - the destination netif
|
---|
2891 | * - NULL if no destination netif is found. In that case, ip_route() continues as normal.
|
---|
2892 | */
|
---|
2893 | #ifdef __DOXYGEN__
|
---|
2894 | #define LWIP_HOOK_IP4_ROUTE_SRC(src, dest)
|
---|
2895 | #endif
|
---|
2896 |
|
---|
2897 | /**
|
---|
2898 | * LWIP_HOOK_IP4_CANFORWARD(src, dest):
|
---|
2899 | * Check if an IPv4 can be forwarded - called from:
|
---|
2900 | * ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4)
|
---|
2901 | * - source address is available via ip4_current_src_addr()
|
---|
2902 | * - calling an output function in this context (e.g. multicast router) is allowed
|
---|
2903 | * Signature:\code{.c}
|
---|
2904 | * int my_hook(struct pbuf *p, u32_t dest_addr_hostorder);
|
---|
2905 | * \endcode
|
---|
2906 | * Arguments:
|
---|
2907 | * - p: packet to forward
|
---|
2908 | * - dest: destination IPv4 address
|
---|
2909 | * Returns values:
|
---|
2910 | * - 1: forward
|
---|
2911 | * - 0: don't forward
|
---|
2912 | * - -1: no decision. In that case, ip4_canforward() continues as normal.
|
---|
2913 | */
|
---|
2914 | #ifdef __DOXYGEN__
|
---|
2915 | #define LWIP_HOOK_IP4_CANFORWARD(src, dest)
|
---|
2916 | #endif
|
---|
2917 |
|
---|
2918 | /**
|
---|
2919 | * LWIP_HOOK_ETHARP_GET_GW(netif, dest):
|
---|
2920 | * Called from etharp_output() (IPv4)
|
---|
2921 | * Signature:\code{.c}
|
---|
2922 | * const ip4_addr_t *my_hook(struct netif *netif, const ip4_addr_t *dest);
|
---|
2923 | * \endcode
|
---|
2924 | * Arguments:
|
---|
2925 | * - netif: the netif used for sending
|
---|
2926 | * - dest: the destination IPv4 address
|
---|
2927 | * Return values:
|
---|
2928 | * - the IPv4 address of the gateway to handle the specified destination IPv4 address
|
---|
2929 | * - NULL, in which case the netif's default gateway is used
|
---|
2930 | *
|
---|
2931 | * The returned address MUST be directly reachable on the specified netif!
|
---|
2932 | * This function is meant to implement advanced IPv4 routing together with
|
---|
2933 | * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is
|
---|
2934 | * not part of lwIP but can e.g. be hidden in the netif's state argument.
|
---|
2935 | */
|
---|
2936 | #ifdef __DOXYGEN__
|
---|
2937 | #define LWIP_HOOK_ETHARP_GET_GW(netif, dest)
|
---|
2938 | #endif
|
---|
2939 |
|
---|
2940 | /**
|
---|
2941 | * LWIP_HOOK_IP6_INPUT(pbuf, input_netif):
|
---|
2942 | * Called from ip6_input() (IPv6)
|
---|
2943 | * Signature:\code{.c}
|
---|
2944 | * int my_hook(struct pbuf *pbuf, struct netif *input_netif);
|
---|
2945 | * \endcode
|
---|
2946 | * Arguments:
|
---|
2947 | * - pbuf: received struct pbuf passed to ip6_input()
|
---|
2948 | * - input_netif: struct netif on which the packet has been received
|
---|
2949 | * Return values:
|
---|
2950 | * - 0: Hook has not consumed the packet, packet is processed as normal
|
---|
2951 | * - != 0: Hook has consumed the packet.
|
---|
2952 | * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook
|
---|
2953 | * (i.e. free it when done).
|
---|
2954 | */
|
---|
2955 | #ifdef __DOXYGEN__
|
---|
2956 | #define LWIP_HOOK_IP6_INPUT(pbuf, input_netif)
|
---|
2957 | #endif
|
---|
2958 |
|
---|
2959 | /**
|
---|
2960 | * LWIP_HOOK_IP6_ROUTE(src, dest):
|
---|
2961 | * Called from ip_route() (IPv6)
|
---|
2962 | * Signature:\code{.c}
|
---|
2963 | * struct netif *my_hook(const ip6_addr_t *dest, const ip6_addr_t *src);
|
---|
2964 | * \endcode
|
---|
2965 | * Arguments:
|
---|
2966 | * - src: source IPv6 address
|
---|
2967 | * - dest: destination IPv6 address
|
---|
2968 | * Return values:
|
---|
2969 | * - the destination netif
|
---|
2970 | * - NULL if no destination netif is found. In that case, ip6_route() continues as normal.
|
---|
2971 | */
|
---|
2972 | #ifdef __DOXYGEN__
|
---|
2973 | #define LWIP_HOOK_IP6_ROUTE(src, dest)
|
---|
2974 | #endif
|
---|
2975 |
|
---|
2976 | /**
|
---|
2977 | * LWIP_HOOK_ND6_GET_GW(netif, dest):
|
---|
2978 | * Called from nd6_get_next_hop_entry() (IPv6)
|
---|
2979 | * Signature:\code{.c}
|
---|
2980 | * const ip6_addr_t *my_hook(struct netif *netif, const ip6_addr_t *dest);
|
---|
2981 | * \endcode
|
---|
2982 | * Arguments:
|
---|
2983 | * - netif: the netif used for sending
|
---|
2984 | * - dest: the destination IPv6 address
|
---|
2985 | * Return values:
|
---|
2986 | * - the IPv6 address of the next hop to handle the specified destination IPv6 address
|
---|
2987 | * - NULL, in which case a NDP-discovered router is used instead
|
---|
2988 | *
|
---|
2989 | * The returned address MUST be directly reachable on the specified netif!
|
---|
2990 | * This function is meant to implement advanced IPv6 routing together with
|
---|
2991 | * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is
|
---|
2992 | * not part of lwIP but can e.g. be hidden in the netif's state argument.
|
---|
2993 | */
|
---|
2994 | #ifdef __DOXYGEN__
|
---|
2995 | #define LWIP_HOOK_ND6_GET_GW(netif, dest)
|
---|
2996 | #endif
|
---|
2997 |
|
---|
2998 | /**
|
---|
2999 | * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr):
|
---|
3000 | * Called from ethernet_input() if VLAN support is enabled
|
---|
3001 | * Signature:\code{.c}
|
---|
3002 | * int my_hook(struct netif *netif, struct eth_hdr *eth_hdr, struct eth_vlan_hdr *vlan_hdr);
|
---|
3003 | * \endcode
|
---|
3004 | * Arguments:
|
---|
3005 | * - netif: struct netif on which the packet has been received
|
---|
3006 | * - eth_hdr: struct eth_hdr of the packet
|
---|
3007 | * - vlan_hdr: struct eth_vlan_hdr of the packet
|
---|
3008 | * Return values:
|
---|
3009 | * - 0: Packet must be dropped.
|
---|
3010 | * - != 0: Packet must be accepted.
|
---|
3011 | */
|
---|
3012 | #ifdef __DOXYGEN__
|
---|
3013 | #define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr)
|
---|
3014 | #endif
|
---|
3015 |
|
---|
3016 | /**
|
---|
3017 | * LWIP_HOOK_VLAN_SET:
|
---|
3018 | * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data
|
---|
3019 | * on per-netif basis to implement this callback, see @ref netif_cd.
|
---|
3020 | * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n
|
---|
3021 | * Signature:\code{.c}
|
---|
3022 | * s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n
|
---|
3023 | * \endcode
|
---|
3024 | * Arguments:
|
---|
3025 | * - netif: struct netif that the packet will be sent through
|
---|
3026 | * - p: struct pbuf packet to be sent
|
---|
3027 | * - src: source eth address
|
---|
3028 | * - dst: destination eth address
|
---|
3029 | * - eth_type: ethernet type to packet to be sent\n
|
---|
3030 | *
|
---|
3031 | *
|
---|
3032 | * Return values:
|
---|
3033 | * - <0: Packet shall not contain VLAN header.
|
---|
3034 | * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order.
|
---|
3035 | */
|
---|
3036 | #ifdef __DOXYGEN__
|
---|
3037 | #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type)
|
---|
3038 | #endif
|
---|
3039 |
|
---|
3040 | /**
|
---|
3041 | * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type):
|
---|
3042 | * Called from memp_free() when a memp pool was empty and an item is now available
|
---|
3043 | * Signature:\code{.c}
|
---|
3044 | * void my_hook(memp_t type);
|
---|
3045 | * \endcode
|
---|
3046 | */
|
---|
3047 | #ifdef __DOXYGEN__
|
---|
3048 | #define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
|
---|
3049 | #endif
|
---|
3050 |
|
---|
3051 | /**
|
---|
3052 | * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif):
|
---|
3053 | * Called from ethernet_input() when an unknown eth type is encountered.
|
---|
3054 | * Signature:\code{.c}
|
---|
3055 | * err_t my_hook(struct pbuf* pbuf, struct netif* netif);
|
---|
3056 | * \endcode
|
---|
3057 | * Arguments:
|
---|
3058 | * - p: rx packet with unknown eth type
|
---|
3059 | * - netif: netif on which the packet has been received
|
---|
3060 | * Return values:
|
---|
3061 | * - ERR_OK if packet is accepted (hook function now owns the pbuf)
|
---|
3062 | * - any error code otherwise (pbuf is freed)
|
---|
3063 | *
|
---|
3064 | * Payload points to ethernet header!
|
---|
3065 | */
|
---|
3066 | #ifdef __DOXYGEN__
|
---|
3067 | #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif)
|
---|
3068 | #endif
|
---|
3069 |
|
---|
3070 | /**
|
---|
3071 | * LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr):
|
---|
3072 | * Called from various dhcp functions when sending a DHCP message.
|
---|
3073 | * This hook is called just before the DHCP message trailer is added, so the
|
---|
3074 | * options are at the end of a DHCP message.
|
---|
3075 | * Signature:\code{.c}
|
---|
3076 | * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg,
|
---|
3077 | * u8_t msg_type, u16_t *options_len_ptr);
|
---|
3078 | * \endcode
|
---|
3079 | * Arguments:
|
---|
3080 | * - netif: struct netif that the packet will be sent through
|
---|
3081 | * - dhcp: struct dhcp on that netif
|
---|
3082 | * - state: current dhcp state (dhcp_state_enum_t as an u8_t)
|
---|
3083 | * - msg: struct dhcp_msg that will be sent
|
---|
3084 | * - msg_type: dhcp message type to be sent (u8_t)
|
---|
3085 | * - options_len_ptr: pointer to the current length of options in the dhcp_msg "msg"
|
---|
3086 | * (must be increased when options are added!)
|
---|
3087 | *
|
---|
3088 | * Options need to appended like this:
|
---|
3089 | * LWIP_ASSERT("dhcp option overflow", *options_len_ptr + option_len + 2 <= DHCP_OPTIONS_LEN);
|
---|
3090 | * msg->options[(*options_len_ptr)++] = <option_number>;
|
---|
3091 | * msg->options[(*options_len_ptr)++] = <option_len>;
|
---|
3092 | * msg->options[(*options_len_ptr)++] = <option_bytes>;
|
---|
3093 | * [...]
|
---|
3094 | */
|
---|
3095 | #ifdef __DOXYGEN__
|
---|
3096 | #define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr)
|
---|
3097 | #endif
|
---|
3098 |
|
---|
3099 | /**
|
---|
3100 | * LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset):
|
---|
3101 | * Called from dhcp_parse_reply when receiving a DHCP message.
|
---|
3102 | * This hook is called for every option in the received message that is not handled internally.
|
---|
3103 | * Signature:\code{.c}
|
---|
3104 | * void my_hook(struct netif *netif, struct dhcp *dhcp, u8_t state, struct dhcp_msg *msg,
|
---|
3105 | * u8_t msg_type, u8_t option, u8_t option_len, struct pbuf *pbuf, u16_t option_value_offset);
|
---|
3106 | * \endcode
|
---|
3107 | * Arguments:
|
---|
3108 | * - netif: struct netif that the packet will be sent through
|
---|
3109 | * - dhcp: struct dhcp on that netif
|
---|
3110 | * - state: current dhcp state (dhcp_state_enum_t as an u8_t)
|
---|
3111 | * - msg: struct dhcp_msg that was received
|
---|
3112 | * - msg_type: dhcp message type received (u8_t, ATTENTION: only valid after
|
---|
3113 | * the message type option has been parsed!)
|
---|
3114 | * - option: option value (u8_t)
|
---|
3115 | * - len: option data length (u8_t)
|
---|
3116 | * - pbuf: pbuf where option data is contained
|
---|
3117 | * - option_value_offset: offset in pbuf where option data begins
|
---|
3118 | *
|
---|
3119 | * A nice way to get the option contents is pbuf_get_contiguous():
|
---|
3120 | * u8_t buf[32];
|
---|
3121 | * u8_t *ptr = (u8_t*)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset);
|
---|
3122 | */
|
---|
3123 | #ifdef __DOXYGEN__
|
---|
3124 | #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset)
|
---|
3125 | #endif
|
---|
3126 |
|
---|
3127 | /**
|
---|
3128 | * LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len):
|
---|
3129 | * Called from various dhcp6 functions when sending a DHCP6 message.
|
---|
3130 | * This hook is called just before the DHCP6 message is sent, so the
|
---|
3131 | * options are at the end of a DHCP6 message.
|
---|
3132 | * Signature:\code{.c}
|
---|
3133 | * void my_hook(struct netif *netif, struct dhcp6 *dhcp, u8_t state, struct dhcp6_msg *msg,
|
---|
3134 | * u8_t msg_type, u16_t *options_len_ptr);
|
---|
3135 | * \endcode
|
---|
3136 | * Arguments:
|
---|
3137 | * - netif: struct netif that the packet will be sent through
|
---|
3138 | * - dhcp6: struct dhcp6 on that netif
|
---|
3139 | * - state: current dhcp6 state (dhcp6_state_enum_t as an u8_t)
|
---|
3140 | * - msg: struct dhcp6_msg that will be sent
|
---|
3141 | * - msg_type: dhcp6 message type to be sent (u8_t)
|
---|
3142 | * - options_len_ptr: pointer to the current length of options in the dhcp6_msg "msg"
|
---|
3143 | * (must be increased when options are added!)
|
---|
3144 | *
|
---|
3145 | * Options need to appended like this:
|
---|
3146 | * u8_t *options = (u8_t *)(msg + 1);
|
---|
3147 | * LWIP_ASSERT("dhcp option overflow", sizeof(struct dhcp6_msg) + *options_len_ptr + newoptlen <= max_len);
|
---|
3148 | * options[(*options_len_ptr)++] = <option_data>;
|
---|
3149 | * [...]
|
---|
3150 | */
|
---|
3151 | #ifdef __DOXYGEN__
|
---|
3152 | #define LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len)
|
---|
3153 | #endif
|
---|
3154 |
|
---|
3155 | /**
|
---|
3156 | * LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err)
|
---|
3157 | * Called from socket API to implement setsockopt() for options not provided by lwIP.
|
---|
3158 | * Core lock is held when this hook is called.
|
---|
3159 | * Signature:\code{.c}
|
---|
3160 | * int my_hook(int s, struct lwip_sock *sock, int level, int optname, const void *optval, socklen_t optlen, int *err)
|
---|
3161 | * \endcode
|
---|
3162 | * Arguments:
|
---|
3163 | * - s: socket file descriptor
|
---|
3164 | * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h)
|
---|
3165 | * - level: protocol level at which the option resides
|
---|
3166 | * - optname: option to set
|
---|
3167 | * - optval: value to set
|
---|
3168 | * - optlen: size of optval
|
---|
3169 | * - err: output error
|
---|
3170 | * Return values:
|
---|
3171 | * - 0: Hook has not consumed the option, code continues as normal (to internal options)
|
---|
3172 | * - != 0: Hook has consumed the option, 'err' is returned
|
---|
3173 | */
|
---|
3174 | #ifdef __DOXYGEN__
|
---|
3175 | #define LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err)
|
---|
3176 | #endif
|
---|
3177 |
|
---|
3178 | /**
|
---|
3179 | * LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err)
|
---|
3180 | * Called from socket API to implement getsockopt() for options not provided by lwIP.
|
---|
3181 | * Core lock is held when this hook is called.
|
---|
3182 | * Signature:\code{.c}
|
---|
3183 | * int my_hook(int s, struct lwip_sock *sock, int level, int optname, void *optval, socklen_t *optlen, int *err)
|
---|
3184 | * \endcode
|
---|
3185 | * Arguments:
|
---|
3186 | * - s: socket file descriptor
|
---|
3187 | * - sock: internal socket descriptor (see lwip/priv/sockets_priv.h)
|
---|
3188 | * - level: protocol level at which the option resides
|
---|
3189 | * - optname: option to get
|
---|
3190 | * - optval: value to get
|
---|
3191 | * - optlen: size of optval
|
---|
3192 | * - err: output error
|
---|
3193 | * Return values:
|
---|
3194 | * - 0: Hook has not consumed the option, code continues as normal (to internal options)
|
---|
3195 | * - != 0: Hook has consumed the option, 'err' is returned
|
---|
3196 | */
|
---|
3197 | #ifdef __DOXYGEN__
|
---|
3198 | #define LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err)
|
---|
3199 | #endif
|
---|
3200 |
|
---|
3201 | /**
|
---|
3202 | * LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
|
---|
3203 | * Called from netconn APIs (not usable with callback apps) allowing an
|
---|
3204 | * external DNS resolver (which uses sequential API) to handle the query.
|
---|
3205 | * Signature:\code{.c}
|
---|
3206 | * int my_hook(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err)
|
---|
3207 | * \endcode
|
---|
3208 | * Arguments:
|
---|
3209 | * - name: hostname to resolve
|
---|
3210 | * - addr: output host address
|
---|
3211 | * - addrtype: type of address to query
|
---|
3212 | * - err: output error
|
---|
3213 | * Return values:
|
---|
3214 | * - 0: Hook has not consumed hostname query, query continues into DNS module
|
---|
3215 | * - != 0: Hook has consumed the query
|
---|
3216 | *
|
---|
3217 | * err must also be checked to determine if the hook consumed the query, but
|
---|
3218 | * the query failed
|
---|
3219 | */
|
---|
3220 | #ifdef __DOXYGEN__
|
---|
3221 | #define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
|
---|
3222 | #endif
|
---|
3223 | /**
|
---|
3224 | * @}
|
---|
3225 | */
|
---|
3226 |
|
---|
3227 | /*
|
---|
3228 | ---------------------------------------
|
---|
3229 | ---------- Debugging options ----------
|
---|
3230 | ---------------------------------------
|
---|
3231 | */
|
---|
3232 | /**
|
---|
3233 | * @defgroup lwip_opts_debugmsg Debug messages
|
---|
3234 | * @ingroup lwip_opts_debug
|
---|
3235 | * @{
|
---|
3236 | */
|
---|
3237 | /**
|
---|
3238 | * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
|
---|
3239 | * compared against this value. If it is smaller, then debugging
|
---|
3240 | * messages are written.
|
---|
3241 | * @see debugging_levels
|
---|
3242 | */
|
---|
3243 | #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__
|
---|
3244 | #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
---|
3245 | #endif
|
---|
3246 |
|
---|
3247 | /**
|
---|
3248 | * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
|
---|
3249 | * debug messages of certain types.
|
---|
3250 | * @see debugging_levels
|
---|
3251 | */
|
---|
3252 | #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
|
---|
3253 | #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
|
---|
3254 | #endif
|
---|
3255 |
|
---|
3256 | /**
|
---|
3257 | * ETHARP_DEBUG: Enable debugging in etharp.c.
|
---|
3258 | */
|
---|
3259 | #if !defined ETHARP_DEBUG || defined __DOXYGEN__
|
---|
3260 | #define ETHARP_DEBUG LWIP_DBG_OFF
|
---|
3261 | #endif
|
---|
3262 |
|
---|
3263 | /**
|
---|
3264 | * NETIF_DEBUG: Enable debugging in netif.c.
|
---|
3265 | */
|
---|
3266 | #if !defined NETIF_DEBUG || defined __DOXYGEN__
|
---|
3267 | #define NETIF_DEBUG LWIP_DBG_OFF
|
---|
3268 | #endif
|
---|
3269 |
|
---|
3270 | /**
|
---|
3271 | * PBUF_DEBUG: Enable debugging in pbuf.c.
|
---|
3272 | */
|
---|
3273 | #if !defined PBUF_DEBUG || defined __DOXYGEN__
|
---|
3274 | #define PBUF_DEBUG LWIP_DBG_OFF
|
---|
3275 | #endif
|
---|
3276 |
|
---|
3277 | /**
|
---|
3278 | * API_LIB_DEBUG: Enable debugging in api_lib.c.
|
---|
3279 | */
|
---|
3280 | #if !defined API_LIB_DEBUG || defined __DOXYGEN__
|
---|
3281 | #define API_LIB_DEBUG LWIP_DBG_OFF
|
---|
3282 | #endif
|
---|
3283 |
|
---|
3284 | /**
|
---|
3285 | * API_MSG_DEBUG: Enable debugging in api_msg.c.
|
---|
3286 | */
|
---|
3287 | #if !defined API_MSG_DEBUG || defined __DOXYGEN__
|
---|
3288 | #define API_MSG_DEBUG LWIP_DBG_OFF
|
---|
3289 | #endif
|
---|
3290 |
|
---|
3291 | /**
|
---|
3292 | * SOCKETS_DEBUG: Enable debugging in sockets.c.
|
---|
3293 | */
|
---|
3294 | #if !defined SOCKETS_DEBUG || defined __DOXYGEN__
|
---|
3295 | #define SOCKETS_DEBUG LWIP_DBG_OFF
|
---|
3296 | #endif
|
---|
3297 |
|
---|
3298 | /**
|
---|
3299 | * ICMP_DEBUG: Enable debugging in icmp.c.
|
---|
3300 | */
|
---|
3301 | #if !defined ICMP_DEBUG || defined __DOXYGEN__
|
---|
3302 | #define ICMP_DEBUG LWIP_DBG_OFF
|
---|
3303 | #endif
|
---|
3304 |
|
---|
3305 | /**
|
---|
3306 | * IGMP_DEBUG: Enable debugging in igmp.c.
|
---|
3307 | */
|
---|
3308 | #if !defined IGMP_DEBUG || defined __DOXYGEN__
|
---|
3309 | #define IGMP_DEBUG LWIP_DBG_OFF
|
---|
3310 | #endif
|
---|
3311 |
|
---|
3312 | /**
|
---|
3313 | * INET_DEBUG: Enable debugging in inet.c.
|
---|
3314 | */
|
---|
3315 | #if !defined INET_DEBUG || defined __DOXYGEN__
|
---|
3316 | #define INET_DEBUG LWIP_DBG_OFF
|
---|
3317 | #endif
|
---|
3318 |
|
---|
3319 | /**
|
---|
3320 | * IP_DEBUG: Enable debugging for IP.
|
---|
3321 | */
|
---|
3322 | #if !defined IP_DEBUG || defined __DOXYGEN__
|
---|
3323 | #define IP_DEBUG LWIP_DBG_OFF
|
---|
3324 | #endif
|
---|
3325 |
|
---|
3326 | /**
|
---|
3327 | * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
|
---|
3328 | */
|
---|
3329 | #if !defined IP_REASS_DEBUG || defined __DOXYGEN__
|
---|
3330 | #define IP_REASS_DEBUG LWIP_DBG_OFF
|
---|
3331 | #endif
|
---|
3332 |
|
---|
3333 | /**
|
---|
3334 | * RAW_DEBUG: Enable debugging in raw.c.
|
---|
3335 | */
|
---|
3336 | #if !defined RAW_DEBUG || defined __DOXYGEN__
|
---|
3337 | #define RAW_DEBUG LWIP_DBG_OFF
|
---|
3338 | #endif
|
---|
3339 |
|
---|
3340 | /**
|
---|
3341 | * MEM_DEBUG: Enable debugging in mem.c.
|
---|
3342 | */
|
---|
3343 | #if !defined MEM_DEBUG || defined __DOXYGEN__
|
---|
3344 | #define MEM_DEBUG LWIP_DBG_OFF
|
---|
3345 | #endif
|
---|
3346 |
|
---|
3347 | /**
|
---|
3348 | * MEMP_DEBUG: Enable debugging in memp.c.
|
---|
3349 | */
|
---|
3350 | #if !defined MEMP_DEBUG || defined __DOXYGEN__
|
---|
3351 | #define MEMP_DEBUG LWIP_DBG_OFF
|
---|
3352 | #endif
|
---|
3353 |
|
---|
3354 | /**
|
---|
3355 | * SYS_DEBUG: Enable debugging in sys.c.
|
---|
3356 | */
|
---|
3357 | #if !defined SYS_DEBUG || defined __DOXYGEN__
|
---|
3358 | #define SYS_DEBUG LWIP_DBG_OFF
|
---|
3359 | #endif
|
---|
3360 |
|
---|
3361 | /**
|
---|
3362 | * TIMERS_DEBUG: Enable debugging in timers.c.
|
---|
3363 | */
|
---|
3364 | #if !defined TIMERS_DEBUG || defined __DOXYGEN__
|
---|
3365 | #define TIMERS_DEBUG LWIP_DBG_OFF
|
---|
3366 | #endif
|
---|
3367 |
|
---|
3368 | /**
|
---|
3369 | * TCP_DEBUG: Enable debugging for TCP.
|
---|
3370 | */
|
---|
3371 | #if !defined TCP_DEBUG || defined __DOXYGEN__
|
---|
3372 | #define TCP_DEBUG LWIP_DBG_OFF
|
---|
3373 | #endif
|
---|
3374 |
|
---|
3375 | /**
|
---|
3376 | * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
|
---|
3377 | */
|
---|
3378 | #if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__
|
---|
3379 | #define TCP_INPUT_DEBUG LWIP_DBG_OFF
|
---|
3380 | #endif
|
---|
3381 |
|
---|
3382 | /**
|
---|
3383 | * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
|
---|
3384 | */
|
---|
3385 | #if !defined TCP_FR_DEBUG || defined __DOXYGEN__
|
---|
3386 | #define TCP_FR_DEBUG LWIP_DBG_OFF
|
---|
3387 | #endif
|
---|
3388 |
|
---|
3389 | /**
|
---|
3390 | * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
|
---|
3391 | * timeout.
|
---|
3392 | */
|
---|
3393 | #if !defined TCP_RTO_DEBUG || defined __DOXYGEN__
|
---|
3394 | #define TCP_RTO_DEBUG LWIP_DBG_OFF
|
---|
3395 | #endif
|
---|
3396 |
|
---|
3397 | /**
|
---|
3398 | * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
|
---|
3399 | */
|
---|
3400 | #if !defined TCP_CWND_DEBUG || defined __DOXYGEN__
|
---|
3401 | #define TCP_CWND_DEBUG LWIP_DBG_OFF
|
---|
3402 | #endif
|
---|
3403 |
|
---|
3404 | /**
|
---|
3405 | * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
|
---|
3406 | */
|
---|
3407 | #if !defined TCP_WND_DEBUG || defined __DOXYGEN__
|
---|
3408 | #define TCP_WND_DEBUG LWIP_DBG_OFF
|
---|
3409 | #endif
|
---|
3410 |
|
---|
3411 | /**
|
---|
3412 | * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
|
---|
3413 | */
|
---|
3414 | #if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__
|
---|
3415 | #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
|
---|
3416 | #endif
|
---|
3417 |
|
---|
3418 | /**
|
---|
3419 | * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
|
---|
3420 | */
|
---|
3421 | #if !defined TCP_RST_DEBUG || defined __DOXYGEN__
|
---|
3422 | #define TCP_RST_DEBUG LWIP_DBG_OFF
|
---|
3423 | #endif
|
---|
3424 |
|
---|
3425 | /**
|
---|
3426 | * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
|
---|
3427 | */
|
---|
3428 | #if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__
|
---|
3429 | #define TCP_QLEN_DEBUG LWIP_DBG_OFF
|
---|
3430 | #endif
|
---|
3431 |
|
---|
3432 | /**
|
---|
3433 | * UDP_DEBUG: Enable debugging in UDP.
|
---|
3434 | */
|
---|
3435 | #if !defined UDP_DEBUG || defined __DOXYGEN__
|
---|
3436 | #define UDP_DEBUG LWIP_DBG_OFF
|
---|
3437 | #endif
|
---|
3438 |
|
---|
3439 | /**
|
---|
3440 | * TCPIP_DEBUG: Enable debugging in tcpip.c.
|
---|
3441 | */
|
---|
3442 | #if !defined TCPIP_DEBUG || defined __DOXYGEN__
|
---|
3443 | #define TCPIP_DEBUG LWIP_DBG_OFF
|
---|
3444 | #endif
|
---|
3445 |
|
---|
3446 | /**
|
---|
3447 | * SLIP_DEBUG: Enable debugging in slipif.c.
|
---|
3448 | */
|
---|
3449 | #if !defined SLIP_DEBUG || defined __DOXYGEN__
|
---|
3450 | #define SLIP_DEBUG LWIP_DBG_OFF
|
---|
3451 | #endif
|
---|
3452 |
|
---|
3453 | /**
|
---|
3454 | * DHCP_DEBUG: Enable debugging in dhcp.c.
|
---|
3455 | */
|
---|
3456 | #if !defined DHCP_DEBUG || defined __DOXYGEN__
|
---|
3457 | #define DHCP_DEBUG LWIP_DBG_OFF
|
---|
3458 | #endif
|
---|
3459 |
|
---|
3460 | /**
|
---|
3461 | * AUTOIP_DEBUG: Enable debugging in autoip.c.
|
---|
3462 | */
|
---|
3463 | #if !defined AUTOIP_DEBUG || defined __DOXYGEN__
|
---|
3464 | #define AUTOIP_DEBUG LWIP_DBG_OFF
|
---|
3465 | #endif
|
---|
3466 |
|
---|
3467 | /**
|
---|
3468 | * DNS_DEBUG: Enable debugging for DNS.
|
---|
3469 | */
|
---|
3470 | #if !defined DNS_DEBUG || defined __DOXYGEN__
|
---|
3471 | #define DNS_DEBUG LWIP_DBG_OFF
|
---|
3472 | #endif
|
---|
3473 |
|
---|
3474 | /**
|
---|
3475 | * IP6_DEBUG: Enable debugging for IPv6.
|
---|
3476 | */
|
---|
3477 | #if !defined IP6_DEBUG || defined __DOXYGEN__
|
---|
3478 | #define IP6_DEBUG LWIP_DBG_OFF
|
---|
3479 | #endif
|
---|
3480 |
|
---|
3481 | /**
|
---|
3482 | * DHCP6_DEBUG: Enable debugging in dhcp6.c.
|
---|
3483 | */
|
---|
3484 | #if !defined DHCP6_DEBUG || defined __DOXYGEN__
|
---|
3485 | #define DHCP6_DEBUG LWIP_DBG_OFF
|
---|
3486 | #endif
|
---|
3487 | /**
|
---|
3488 | * @}
|
---|
3489 | */
|
---|
3490 |
|
---|
3491 | /**
|
---|
3492 | * LWIP_TESTMODE: Changes to make unit test possible
|
---|
3493 | */
|
---|
3494 | #if !defined LWIP_TESTMODE
|
---|
3495 | #define LWIP_TESTMODE 0
|
---|
3496 | #endif
|
---|
3497 |
|
---|
3498 | /*
|
---|
3499 | --------------------------------------------------
|
---|
3500 | ---------- Performance tracking options ----------
|
---|
3501 | --------------------------------------------------
|
---|
3502 | */
|
---|
3503 | /**
|
---|
3504 | * @defgroup lwip_opts_perf Performance
|
---|
3505 | * @ingroup lwip_opts_debug
|
---|
3506 | * @{
|
---|
3507 | */
|
---|
3508 | /**
|
---|
3509 | * LWIP_PERF: Enable performance testing for lwIP
|
---|
3510 | * (if enabled, arch/perf.h is included)
|
---|
3511 | */
|
---|
3512 | #if !defined LWIP_PERF || defined __DOXYGEN__
|
---|
3513 | #define LWIP_PERF 0
|
---|
3514 | #endif
|
---|
3515 | /**
|
---|
3516 | * @}
|
---|
3517 | */
|
---|
3518 |
|
---|
3519 | #endif /* LWIP_HDR_OPT_H */
|
---|