VirtualBox

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

Last change on this file since 69496 was 69496, checked in by vboxsync, 7 years ago

*: scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.7 KB
Line 
1/* $Id: proxy.h 69496 2017-10-28 14:55:58Z vboxsync $ */
2/** @file
3 * NAT Network - common definitions and declarations.
4 */
5
6/*
7 * Copyright (C) 2013-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___nat_proxy_h___
19#define ___nat_proxy_h___
20
21#if !defined(VBOX)
22#include "vbox-compat.h"
23#endif
24
25#include "lwip/err.h"
26#include "lwip/ip_addr.h"
27#include "winutils.h"
28
29/* forward */
30struct netif;
31struct tcpip_msg;
32struct pbuf;
33struct sockaddr;
34struct sockaddr_in;
35struct sockaddr_in6;
36
37struct ip4_lomap
38{
39 ip_addr_t loaddr;
40 uint32_t off;
41};
42
43struct ip4_lomap_desc
44{
45 const struct ip4_lomap *lomap;
46 unsigned int num_lomap;
47};
48
49struct proxy_options {
50 int ipv6_enabled;
51 int ipv6_defroute;
52 SOCKET icmpsock4;
53 SOCKET icmpsock6;
54 const char *tftp_root;
55 const struct sockaddr_in *src4;
56 const struct sockaddr_in6 *src6;
57 const struct ip4_lomap_desc *lomap_desc;
58 const char **nameservers;
59};
60
61extern volatile struct proxy_options *g_proxy_options;
62extern struct netif *g_proxy_netif;
63
64void proxy_init(struct netif *, struct proxy_options *);
65SOCKET proxy_connected_socket(int, int, ipX_addr_t *, u16_t);
66SOCKET proxy_bound_socket(int, int, struct sockaddr *);
67void proxy_reset_socket(SOCKET);
68int proxy_sendto(SOCKET, struct pbuf *, void *, size_t);
69void proxy_lwip_post(struct tcpip_msg *);
70const char *proxy_lwip_strerr(err_t);
71
72/* proxy_rtadvd.c */
73void proxy_rtadvd_start(struct netif *);
74void proxy_rtadvd_do_quick(void *);
75
76/* rtmon_*.c */
77int rtmon_get_defaults(void);
78
79/* proxy_dhcp6ds.c */
80err_t dhcp6ds_init(struct netif *);
81
82/* proxy_tftpd.c */
83err_t tftpd_init(struct netif *, const char *);
84
85/* pxtcp.c */
86void pxtcp_init(void);
87
88/* pxudp.c */
89void pxudp_init(void);
90
91/* pxdns.c */
92err_t pxdns_init(struct netif *);
93void pxdns_set_nameservers(void *);
94
95/* pxping.c */
96err_t pxping_init(struct netif *, SOCKET, SOCKET);
97
98
99#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
100# define HAVE_SA_LEN 0
101#else
102# define HAVE_SA_LEN 1
103#endif
104
105#define LWIP_ASSERT1(condition) LWIP_ASSERT(#condition, condition)
106
107/*
108 * TODO: DPRINTF0 should probably become LogRel but its usage needs to
109 * be cleaned up a bit before.
110 */
111#define DPRINTF0(a) Log(a)
112
113#define DPRINTF(a) DPRINTF1(a)
114#define DPRINTF1(a) Log2(a)
115#define DPRINTF2(a) Log3(a)
116
117#endif /* !___nat_proxy_h___ */
118
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