VirtualBox

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

Last change on this file since 69474 was 62481, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.8 KB
Line 
1/* $Id: portfwd.h 62481 2016-07-22 18:30:21Z vboxsync $ */
2/** @file
3 * NAT Network - port-forwarding rules, definitions and declarations.
4 */
5
6/*
7 * Copyright (C) 2013-2016 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 _portfwd_h_
19#define _portfwd_h_
20
21#ifndef RT_OS_WINDOWS
22#include <sys/types.h>
23#include <sys/socket.h>
24#include <netinet/in.h>
25#endif
26
27#include "lwip/ip_addr.h"
28
29
30struct fwspec {
31 int sdom; /* PF_INET, PF_INET6 */
32 int stype; /* SOCK_STREAM, SOCK_DGRAM */
33
34 /* listen on */
35 union {
36 struct sockaddr sa;
37 struct sockaddr_in sin; /* sdom == PF_INET */
38 struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
39 } src;
40
41 /* forward to */
42 union {
43 struct sockaddr sa;
44 struct sockaddr_in sin; /* sdom == PF_INET */
45 struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
46 } dst;
47};
48
49
50void portfwd_init(void);
51int portfwd_rule_add(struct fwspec *);
52int portfwd_rule_del(struct fwspec *);
53
54
55int fwspec_set(struct fwspec *, int, int,
56 const char *, uint16_t,
57 const char *, uint16_t);
58
59int fwspec_equal(struct fwspec *, struct fwspec *);
60
61void fwtcp_init(void);
62void fwudp_init(void);
63
64void fwtcp_add(struct fwspec *);
65void fwtcp_del(struct fwspec *);
66void fwudp_add(struct fwspec *);
67void fwudp_del(struct fwspec *);
68
69int fwany_ipX_addr_set_src(ipX_addr_t *, const struct sockaddr *);
70
71#endif /* _portfwd_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