VirtualBox

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

Last change on this file since 78125 was 76565, checked in by vboxsync, 6 years ago

Devices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

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