VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/NAT/proxy.h@ 49112

Last change on this file since 49112 was 49042, checked in by vboxsync, 12 years ago

Do not configure IPv6 addresses and netif::output_ip6 method on the
proxy netif if IPv6 is disabled for this NAT network.

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1#ifndef _nat_proxy_h_
2#define _nat_proxy_h_
3
4#if !defined(VBOX)
5#include "vbox-compat.h"
6#endif
7
8#include "lwip/err.h"
9#include "lwip/ip_addr.h"
10#include "winutils.h"
11
12/* forward */
13struct netif;
14struct tcpip_msg;
15struct pbuf;
16struct sockaddr;
17struct sockaddr_in;
18struct sockaddr_in6;
19
20struct ip4_lomap
21{
22 ip_addr_t loaddr;
23 uint32_t off;
24};
25
26struct ip4_lomap_desc
27{
28 const struct ip4_lomap *lomap;
29 unsigned int num_lomap;
30};
31
32struct proxy_options {
33 int ipv6_enabled;
34 int ipv6_defroute;
35 const char *tftp_root;
36 const struct sockaddr_in *src4;
37 const struct sockaddr_in6 *src6;
38 const struct ip4_lomap_desc *lomap_desc;
39};
40
41extern volatile const struct proxy_options *g_proxy_options;
42extern struct netif *g_proxy_netif;
43
44void proxy_init(struct netif *, const struct proxy_options *);
45SOCKET proxy_connected_socket(int, int, ipX_addr_t *, u16_t);
46SOCKET proxy_bound_socket(int, int, struct sockaddr *);
47void proxy_reset_socket(SOCKET);
48void proxy_sendto(SOCKET, struct pbuf *, void *, size_t);
49void proxy_lwip_post(struct tcpip_msg *);
50const char *proxy_lwip_strerr(err_t);
51
52/* proxy_rtadvd.c */
53void proxy_rtadvd_start(struct netif *);
54
55/* rtmon_*.c */
56int rtmon_get_defaults(void);
57
58/* proxy_dhcp6ds.c */
59err_t dhcp6ds_init(struct netif *);
60
61/* proxy_tftpd.c */
62err_t tftpd_init(struct netif *, const char *);
63
64/* pxtcp.c */
65void pxtcp_init(void);
66
67/* pxudp.c */
68void pxudp_init(void);
69
70
71#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
72# define HAVE_SA_LEN 0
73#else
74# define HAVE_SA_LEN 1
75#endif
76
77#define LWIP_ASSERT1(condition) LWIP_ASSERT(#condition, condition)
78/* TODO: review debug levels and types */
79#if !LWIP_PROXY_DEBUG
80# define DPRINTF_LEVEL(y, x) do {} while (0)
81#else
82# define DPRINTF_LEVEL(level, x) do { LWIP_DEBUGF(LWIP_PROXY_DEBUG | (level), x); } while (0)
83#endif
84
85#define DPRINTF(x) DPRINTF_LEVEL(0, x)
86#define DPRINTF0(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_WARNING, x)
87#define DPRINTF1(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_SERIOUS, x)
88#define DPRINTF2(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_SEVERE, x)
89
90#endif /* _nat_proxy_h_ */
Note: See TracBrowser for help on using the repository browser.

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