VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/lwipopts.h@ 63429

Last change on this file since 63429 was 63005, checked in by vboxsync, 8 years ago

lwip,nat: Try figure LWIP_NOASSERT in the two lwipopts.h files, linking it to VBOX_ASSERT.

  • Property svn:eol-style set to native
File size: 5.4 KB
Line 
1#ifndef VBOX_LWIP_OPTS_H_
2#define VBOX_LWIP_OPTS_H_
3
4#include <VBox/cdefs.h> /* For VBOX_STRICT. */
5#include <iprt/mem.h>
6#include <iprt/alloca.h> /* This may include malloc.h (msc), which is something that has
7 * to be done before redefining any of the functions therein. */
8#include <iprt/rand.h> /* see LWIP_RAND() definition */
9
10/* lwip/sockets.h assumes that if FD_SET is defined (in case of Innotek GCC
11 * its definition is dragged through iprt/types.h) then struct timeval is
12 * defined as well, but it's not the case. So include it manually. */
13#ifdef RT_OS_OS2
14# include <sys/time.h>
15#endif
16
17/** Make lwIP use the libc malloc, or more precisely (see below) the IPRT
18 * memory allocation functions. */
19#define MEM_LIBC_MALLOC 1
20
21/** Set proper memory alignment. */
22#if HC_ARCH_BITS == 64
23# define MEM_ALIGNMENT 8
24#else
25#define MEM_ALIGNMENT 4
26#endif
27
28/* IP */
29#define IP_REASSEMBLY 1
30#define IP_REASS_MAX_PBUFS 128
31
32
33
34/** Increase maximum TCP window size. */
35#define TCP_WND 32768
36
37/** Increase TCP maximum segment size. */
38#define TCP_MSS 1460
39
40/** Enable queueing of out-of-order segments. */
41#define TCP_QUEUE_OOSEQ 1
42
43/** TCP sender buffer space (bytes). */
44#define TCP_SND_BUF (32 * TCP_MSS)
45
46/* TCP sender buffer space (pbufs). This must be at least = 2 *
47 TCP_SND_BUF/TCP_MSS for things to work. */
48#define TCP_SND_QUEUELEN 64
49
50/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
51 sends a lot of data out of ROM (or other static memory), this
52 should be set high.
53
54 NB: This is for PBUF_ROM and PBUF_REF pbufs only!
55
56 Number of PBUF_POOL pbufs is controlled by PBUF_POOL_SIZE that,
57 somewhat confusingly, breaks MEMP_NUM_* pattern.
58
59 PBUF_RAM pbufs are allocated with mem_malloc (with MEM_LIBC_MALLOC
60 set to 1 this is just system malloc), not memp_malloc. */
61#define MEMP_NUM_PBUF (1024 * 4)
62
63
64/* MEMP_NUM_MLD6_GROUP: Maximum number of IPv6 multicast groups that
65 can be joined.
66
67 We need to be able to join solicited node multicast for each
68 address (potentially different) and two groups for DHCP6. All
69 routers multicast is hardcoded in ip6.c and does not require
70 explicit joining. Provide also for a few extra groups just in
71 case. */
72#define MEMP_NUM_MLD6_GROUP (LWIP_IPV6_NUM_ADDRESSES + /* dhcp6 */ 2 + /* extra */ 8)
73
74
75/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
76 segments. */
77#define MEMP_NUM_TCP_SEG (MEMP_NUM_TCP_PCB * TCP_SND_QUEUELEN / 2)
78
79/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
80 connections. */
81#define MEMP_NUM_TCP_PCB 128
82
83/* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
84 for sequential API communication and incoming packets. Used in
85 src/api/tcpip.c. */
86#define MEMP_NUM_TCPIP_MSG_API 128
87#define MEMP_NUM_TCPIP_MSG_INPKT 1024
88
89/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
90 per active UDP "connection". */
91#define MEMP_NUM_UDP_PCB 32
92
93/* Pbuf options */
94/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
95 This is only for PBUF_POOL pbufs, primarily used by netif drivers.
96
97 This should have been named with the MEMP_NUM_ prefix (cf.
98 MEMP_NUM_PBUF for PBUF_ROM and PBUF_REF) as it controls the size of
99 yet another memp_malloc() pool. */
100#define PBUF_POOL_SIZE (1024 * 4)
101
102/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool.
103 Use default that is based on TCP_MSS and PBUF_LINK_HLEN. */
104#undef PBUF_POOL_BUFSIZE
105
106/** Turn on support for lightweight critical region protection. Leaving this
107 * off uses synchronization code in pbuf.c which is totally polluted with
108 * races. All the other lwip source files would fall back to semaphore-based
109 * synchronization, but pbuf.c is just broken, leading to incorrect allocation
110 * and as a result to assertions due to buffers being double freed. */
111#define SYS_LIGHTWEIGHT_PROT 1
112
113/** Attempt to get rid of htons etc. macro issues. */
114#undef LWIP_PREFIX_BYTEORDER_FUNCS
115
116#define LWIP_TCPIP_CORE_LOCKING_INPUT 0
117#define LWIP_TCPIP_CORE_LOCKING 0
118#define LWIP_TCP 1
119#define LWIP_SOCKET 1
120#define LWIP_ARP 1
121#define ARP_PROXY 0
122#define LWIP_ETHERNET 1
123#define LWIP_COMPAT_SOCKETS 0
124#define LWIP_COMPAT_MUTEX 1
125
126#define LWIP_IPV6 1
127#define LWIP_IPV6_FORWARD 0
128#define LWIP_ND6_PROXY 0
129
130#define LWIP_ND6_ALLOW_RA_UPDATES (!LWIP_IPV6_FORWARD)
131#define LWIP_IPV6_SEND_ROUTER_SOLICIT (!LWIP_IPV6_FORWARD)
132/* IPv6 autoconfig we don't need in proxy, but it required for very seldom cases
133 * iSCSI over intnet with IPv6
134 */
135#define LWIP_IPV6_AUTOCONFIG 1
136#if LWIP_IPV6_FORWARD /* otherwise use the default from lwip/opt.h */
137#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
138#endif
139
140#define LWIP_IPV6_FRAG 1
141
142/**
143 * aka Slirp mode.
144 */
145#define LWIP_CONNECTION_PROXY 0
146#define IP_FORWARD 0
147
148/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active
149 timeouts. */
150#define MEMP_NUM_SYS_TIMEOUT 16
151
152
153/* this is required for IPv6 and IGMP needs */
154#define LWIP_RAND() RTRandU32()
155
156/* Debugging stuff. */
157#ifdef DEBUG
158# define LWIP_DEBUG
159# include "lwip-log.h"
160#endif /* DEBUG */
161
162/* printf formatter definitions */
163#define U16_F "hu"
164#define S16_F "hd"
165#define X16_F "hx"
166#define U32_F "u"
167#define S32_F "d"
168#define X32_F "x"
169
170/* Redirect libc memory alloc functions to IPRT. */
171#define malloc(x) RTMemAlloc(x)
172#define realloc(x,y) RTMemRealloc((x), (y))
173#define free(x) RTMemFree(x)
174
175/* Align VBOX_STRICT and LWIP_NOASSERT. */
176#ifndef VBOX_STRICT
177# define LWIP_NOASSERT 1
178#endif
179
180#include "lwip-namespace.h"
181
182#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette