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 */
|
---|
13 | struct netif;
|
---|
14 | struct tcpip_msg;
|
---|
15 | struct pbuf;
|
---|
16 | struct sockaddr;
|
---|
17 | struct sockaddr_in;
|
---|
18 | struct sockaddr_in6;
|
---|
19 |
|
---|
20 | struct ip4_lomap
|
---|
21 | {
|
---|
22 | ip_addr_t loaddr;
|
---|
23 | uint32_t off;
|
---|
24 | };
|
---|
25 |
|
---|
26 | struct ip4_lomap_desc
|
---|
27 | {
|
---|
28 | const struct ip4_lomap *lomap;
|
---|
29 | unsigned int num_lomap;
|
---|
30 | };
|
---|
31 |
|
---|
32 | struct proxy_options {
|
---|
33 | int ipv6_enabled;
|
---|
34 | int ipv6_defroute;
|
---|
35 | SOCKET icmpsock4;
|
---|
36 | SOCKET icmpsock6;
|
---|
37 | const char *tftp_root;
|
---|
38 | const struct sockaddr_in *src4;
|
---|
39 | const struct sockaddr_in6 *src6;
|
---|
40 | const struct ip4_lomap_desc *lomap_desc;
|
---|
41 | const char **nameservers;
|
---|
42 | };
|
---|
43 |
|
---|
44 | extern volatile struct proxy_options *g_proxy_options;
|
---|
45 | extern struct netif *g_proxy_netif;
|
---|
46 |
|
---|
47 | void proxy_init(struct netif *, struct proxy_options *);
|
---|
48 | SOCKET proxy_connected_socket(int, int, ipX_addr_t *, u16_t);
|
---|
49 | SOCKET proxy_bound_socket(int, int, struct sockaddr *);
|
---|
50 | void proxy_reset_socket(SOCKET);
|
---|
51 | int proxy_sendto(SOCKET, struct pbuf *, void *, size_t);
|
---|
52 | void proxy_lwip_post(struct tcpip_msg *);
|
---|
53 | const char *proxy_lwip_strerr(err_t);
|
---|
54 |
|
---|
55 | /* proxy_rtadvd.c */
|
---|
56 | void proxy_rtadvd_start(struct netif *);
|
---|
57 | void proxy_rtadvd_do_quick(void *);
|
---|
58 |
|
---|
59 | /* rtmon_*.c */
|
---|
60 | int rtmon_get_defaults(void);
|
---|
61 |
|
---|
62 | /* proxy_dhcp6ds.c */
|
---|
63 | err_t dhcp6ds_init(struct netif *);
|
---|
64 |
|
---|
65 | /* proxy_tftpd.c */
|
---|
66 | err_t tftpd_init(struct netif *, const char *);
|
---|
67 |
|
---|
68 | /* pxtcp.c */
|
---|
69 | void pxtcp_init(void);
|
---|
70 |
|
---|
71 | /* pxudp.c */
|
---|
72 | void pxudp_init(void);
|
---|
73 |
|
---|
74 | /* pxdns.c */
|
---|
75 | err_t pxdns_init(struct netif *);
|
---|
76 | void pxdns_set_nameservers(void *);
|
---|
77 |
|
---|
78 | /* pxping.c */
|
---|
79 | err_t pxping_init(struct netif *, SOCKET, SOCKET);
|
---|
80 |
|
---|
81 |
|
---|
82 | #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
|
---|
83 | # define HAVE_SA_LEN 0
|
---|
84 | #else
|
---|
85 | # define HAVE_SA_LEN 1
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #define LWIP_ASSERT1(condition) LWIP_ASSERT(#condition, condition)
|
---|
89 |
|
---|
90 | /*
|
---|
91 | * TODO: DPRINTF0 should probably become LogRel but its usage needs to
|
---|
92 | * be cleaned up a bit before.
|
---|
93 | */
|
---|
94 | #define DPRINTF0(a) Log(a)
|
---|
95 |
|
---|
96 | #define DPRINTF(a) DPRINTF1(a)
|
---|
97 | #define DPRINTF1(a) Log2(a)
|
---|
98 | #define DPRINTF2(a) Log3(a)
|
---|
99 |
|
---|
100 | #endif /* _nat_proxy_h_ */
|
---|