VirtualBox

source: vbox/trunk/src/VBox/Main/include/NATEngineImpl.h@ 108371

最後變更 在這個檔案從108371是 107548,由 vboxsync 提交於 2 月 前

Devices/Network: Fixed and added configuration for packets broadcast to NAT adapter's network. Propagated additional parameters from CFGM. Simplified port forwarding a bit and added additional release logging. bugref:10268

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.1 KB
 
1/* $Id: NATEngineImpl.h 107548 2025-01-08 19:54:13Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.alldomusa.eu.org.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * SPDX-License-Identifier: GPL-3.0-only
28 */
29
30#ifndef MAIN_INCLUDED_NATEngineImpl_h
31#define MAIN_INCLUDED_NATEngineImpl_h
32#ifndef RT_WITHOUT_PRAGMA_ONCE
33# pragma once
34#endif
35
36#include "NATEngineWrap.h"
37
38namespace settings
39{
40 struct NAT;
41}
42
43
44class ATL_NO_VTABLE NATEngine :
45 public NATEngineWrap
46{
47public:
48
49 DECLARE_COMMON_CLASS_METHODS(NATEngine)
50
51 HRESULT FinalConstruct();
52 void FinalRelease();
53
54 HRESULT init(Machine *aParent, INetworkAdapter *aAdapter);
55 HRESULT init(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
56 HRESULT initCopy(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
57 void uninit();
58
59 bool i_isModified();
60 void i_rollback();
61 void i_commit();
62 void i_copyFrom(NATEngine *aThat);
63 void i_applyDefaults();
64 bool i_hasDefaults();
65 HRESULT i_loadSettings(const settings::NAT &data);
66 HRESULT i_saveSettings(settings::NAT &data);
67
68private:
69
70 // wrapped INATEngine properties
71 HRESULT setNetwork(const com::Utf8Str &aNetwork);
72 HRESULT getNetwork(com::Utf8Str &aNetwork);
73 HRESULT setHostIP(const com::Utf8Str &aHostIP);
74 HRESULT getHostIP(com::Utf8Str &aBindIP);
75 HRESULT setLocalhostReachable(BOOL fLocalhostReachable);
76 HRESULT getLocalhostReachable(BOOL *pfLocalhostReachable);
77 HRESULT setForwardBroadcast(BOOL fForwardBroadcast);
78 HRESULT getForwardBroadcast(BOOL *pfForwardBroadcast);
79 /* TFTP properties */
80 HRESULT setTFTPPrefix(const com::Utf8Str &aTFTPPrefix);
81 HRESULT getTFTPPrefix(com::Utf8Str &aTFTPPrefix);
82 HRESULT setTFTPBootFile(const com::Utf8Str &aTFTPBootFile);
83 HRESULT getTFTPBootFile(com::Utf8Str &aTFTPBootFile);
84 HRESULT setTFTPNextServer(const com::Utf8Str &aTFTPNextServer);
85 HRESULT getTFTPNextServer(com::Utf8Str &aTFTPNextServer);
86 /* DNS properties */
87 HRESULT setDNSPassDomain(BOOL aDNSPassDomain);
88 HRESULT getDNSPassDomain(BOOL *aDNSPassDomain);
89 HRESULT setDNSProxy(BOOL aDNSProxy);
90 HRESULT getDNSProxy(BOOL *aDNSProxy);
91 HRESULT getDNSUseHostResolver(BOOL *aDNSUseHostResolver);
92 HRESULT setDNSUseHostResolver(BOOL aDNSUseHostResolver);
93 /* Alias properties */
94 HRESULT setAliasMode(ULONG aAliasMode);
95 HRESULT getAliasMode(ULONG *aAliasMode);
96
97 HRESULT getRedirects(std::vector<com::Utf8Str> &aRedirects);
98
99 HRESULT setNetworkSettings(ULONG aMtu,
100 ULONG aSockSnd,
101 ULONG aSockRcv,
102 ULONG aTcpWndSnd,
103 ULONG aTcpWndRcv);
104
105 HRESULT getNetworkSettings(ULONG *aMtu,
106 ULONG *aSockSnd,
107 ULONG *aSockRcv,
108 ULONG *aTcpWndSnd,
109 ULONG *aTcpWndRcv);
110
111 HRESULT addRedirect(const com::Utf8Str &aName,
112 NATProtocol_T aProto,
113 const com::Utf8Str &aHostIP,
114 USHORT aHostPort,
115 const com::Utf8Str &aGuestIP,
116 USHORT aGuestPort);
117
118 HRESULT removeRedirect(const com::Utf8Str &aName);
119
120 struct Data;
121 Data *mData;
122 const ComObjPtr<NATEngine> mPeer;
123 Machine * const mParent;
124 INetworkAdapter * const mAdapter;
125};
126#endif /* !MAIN_INCLUDED_NATEngineImpl_h */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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