VirtualBox

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

Last change on this file since 49249 was 49249, checked in by vboxsync, 11 years ago

Finish DNS proxy code and hook it in.

  • Property svn:eol-style set to native
File size: 2.2 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 const char **nameservers;
40};
41
42extern volatile struct proxy_options *g_proxy_options;
43extern struct netif *g_proxy_netif;
44
45void proxy_init(struct netif *, struct proxy_options *);
46SOCKET proxy_connected_socket(int, int, ipX_addr_t *, u16_t);
47SOCKET proxy_bound_socket(int, int, struct sockaddr *);
48void proxy_reset_socket(SOCKET);
49void proxy_sendto(SOCKET, struct pbuf *, void *, size_t);
50void proxy_lwip_post(struct tcpip_msg *);
51const char *proxy_lwip_strerr(err_t);
52
53/* proxy_rtadvd.c */
54void proxy_rtadvd_start(struct netif *);
55void proxy_rtadvd_do_quick(void *);
56
57/* rtmon_*.c */
58int rtmon_get_defaults(void);
59
60/* proxy_dhcp6ds.c */
61err_t dhcp6ds_init(struct netif *);
62
63/* proxy_tftpd.c */
64err_t tftpd_init(struct netif *, const char *);
65
66/* pxtcp.c */
67void pxtcp_init(void);
68
69/* pxudp.c */
70void pxudp_init(void);
71
72/* pxdns.c */
73err_t pxdns_init(struct netif *);
74void pxdns_set_nameservers(void *);
75
76
77#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
78# define HAVE_SA_LEN 0
79#else
80# define HAVE_SA_LEN 1
81#endif
82
83#define LWIP_ASSERT1(condition) LWIP_ASSERT(#condition, condition)
84/* TODO: review debug levels and types */
85#if !LWIP_PROXY_DEBUG
86# define DPRINTF_LEVEL(y, x) do {} while (0)
87#else
88# define DPRINTF_LEVEL(level, x) do { LWIP_DEBUGF(LWIP_PROXY_DEBUG | (level), x); } while (0)
89#endif
90
91#define DPRINTF(x) DPRINTF_LEVEL(0, x)
92#define DPRINTF0(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_WARNING, x)
93#define DPRINTF1(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_SERIOUS, x)
94#define DPRINTF2(x) DPRINTF_LEVEL(LWIP_DBG_LEVEL_SEVERE, x)
95
96#endif /* _nat_proxy_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