VirtualBox

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

Last change on this file since 76576 was 76576, checked in by vboxsync, 6 years ago

NetworkServices: scm header guard alignment.

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