VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/NAT/portfwd.h@ 48403

最後變更 在這個檔案從48403是 48001,由 vboxsync 提交於 11 年 前

Move proxy sources from Devices/Network/lwip-new/vbox
to NetworkServices/NAT where they belong.

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.4 KB
 
1/* -*- indent-tabs-mode: nil; -*- */
2#ifndef _portfwd_h_
3#define _portfwd_h_
4
5#ifndef RT_OS_WINDOWS
6#include <sys/types.h>
7#include <sys/socket.h>
8#include <netinet/in.h>
9#else
10# include <ws2ipdef.h>
11#endif
12
13#include "lwip/ip_addr.h"
14
15
16struct fwspec {
17 int sdom; /* PF_INET, PF_INET6 */
18 int stype; /* SOCK_STREAM, SOCK_DGRAM */
19
20 /* listen on */
21 union {
22 struct sockaddr sa;
23 struct sockaddr_in sin; /* sdom == PF_INET */
24 struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
25 } src;
26
27 /* forward to */
28 union {
29 struct sockaddr sa;
30 struct sockaddr_in sin; /* sdom == PF_INET */
31 struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
32 } dst;
33};
34
35
36void portfwd_init(void);
37int portfwd_rule_add(struct fwspec *);
38int portfwd_rule_del(struct fwspec *);
39
40
41int fwspec_set(struct fwspec *, int, int,
42 const char *, uint16_t,
43 const char *, uint16_t);
44
45int fwspec_equal(struct fwspec *, struct fwspec *);
46
47void fwtcp_init(void);
48void fwudp_init(void);
49
50void fwtcp_add(struct fwspec *);
51void fwtcp_del(struct fwspec *);
52void fwudp_add(struct fwspec *);
53void fwudp_del(struct fwspec *);
54
55int fwany_ipX_addr_set_src(ipX_addr_t *, const struct sockaddr *);
56
57/* XXX: for testing */
58#ifdef VBOX
59#define PROXY_GUEST_IPV4 "10.0.2.15"
60#else
61#define PROXY_GUEST_IPV4 "192.168.2.11"
62#endif
63
64#endif /* _portfwd_h_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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