[27857] | 1 | /* $Id: NATEngineImpl.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
| 2 |
|
---|
| 3 | /** @file
|
---|
| 4 | *
|
---|
| 5 | * VirtualBox COM class implementation
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
[106061] | 9 | * Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
[27857] | 10 | *
|
---|
[96407] | 11 | * This file is part of VirtualBox base platform packages, as
|
---|
| 12 | * available from https://www.virtualbox.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
|
---|
[27857] | 28 | */
|
---|
| 29 |
|
---|
[76562] | 30 | #ifndef MAIN_INCLUDED_NATEngineImpl_h
|
---|
| 31 | #define MAIN_INCLUDED_NATEngineImpl_h
|
---|
[76487] | 32 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 33 | # pragma once
|
---|
| 34 | #endif
|
---|
[27857] | 35 |
|
---|
[49871] | 36 | #include "NATEngineWrap.h"
|
---|
[27857] | 37 |
|
---|
[30764] | 38 | namespace settings
|
---|
| 39 | {
|
---|
| 40 | struct NAT;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
[49871] | 43 |
|
---|
[27857] | 44 | class ATL_NO_VTABLE NATEngine :
|
---|
[49871] | 45 | public NATEngineWrap
|
---|
[27857] | 46 | {
|
---|
[57694] | 47 | public:
|
---|
[27857] | 48 |
|
---|
[90828] | 49 | DECLARE_COMMON_CLASS_METHODS(NATEngine)
|
---|
[27857] | 50 |
|
---|
| 51 | HRESULT FinalConstruct();
|
---|
[49871] | 52 | void FinalRelease();
|
---|
| 53 |
|
---|
[33825] | 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);
|
---|
[27857] | 57 | void uninit();
|
---|
| 58 |
|
---|
[49871] | 59 | bool i_isModified();
|
---|
[57694] | 60 | void i_rollback();
|
---|
[49871] | 61 | void i_commit();
|
---|
[57694] | 62 | void i_copyFrom(NATEngine *aThat);
|
---|
[66940] | 63 | void i_applyDefaults();
|
---|
| 64 | bool i_hasDefaults();
|
---|
[49871] | 65 | HRESULT i_loadSettings(const settings::NAT &data);
|
---|
| 66 | HRESULT i_saveSettings(settings::NAT &data);
|
---|
[27857] | 67 |
|
---|
[49871] | 68 | private:
|
---|
[27857] | 69 |
|
---|
[49871] | 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);
|
---|
[92133] | 75 | HRESULT setLocalhostReachable(BOOL fLocalhostReachable);
|
---|
| 76 | HRESULT getLocalhostReachable(BOOL *pfLocalhostReachable);
|
---|
[49871] | 77 | /* TFTP properties */
|
---|
| 78 | HRESULT setTFTPPrefix(const com::Utf8Str &aTFTPPrefix);
|
---|
| 79 | HRESULT getTFTPPrefix(com::Utf8Str &aTFTPPrefix);
|
---|
| 80 | HRESULT setTFTPBootFile(const com::Utf8Str &aTFTPBootFile);
|
---|
| 81 | HRESULT getTFTPBootFile(com::Utf8Str &aTFTPBootFile);
|
---|
| 82 | HRESULT setTFTPNextServer(const com::Utf8Str &aTFTPNextServer);
|
---|
| 83 | HRESULT getTFTPNextServer(com::Utf8Str &aTFTPNextServer);
|
---|
| 84 | /* DNS properties */
|
---|
| 85 | HRESULT setDNSPassDomain(BOOL aDNSPassDomain);
|
---|
| 86 | HRESULT getDNSPassDomain(BOOL *aDNSPassDomain);
|
---|
| 87 | HRESULT setDNSProxy(BOOL aDNSProxy);
|
---|
| 88 | HRESULT getDNSProxy(BOOL *aDNSProxy);
|
---|
| 89 | HRESULT getDNSUseHostResolver(BOOL *aDNSUseHostResolver);
|
---|
| 90 | HRESULT setDNSUseHostResolver(BOOL aDNSUseHostResolver);
|
---|
| 91 | /* Alias properties */
|
---|
| 92 | HRESULT setAliasMode(ULONG aAliasMode);
|
---|
| 93 | HRESULT getAliasMode(ULONG *aAliasMode);
|
---|
[27857] | 94 |
|
---|
[49871] | 95 | HRESULT getRedirects(std::vector<com::Utf8Str> &aRedirects);
|
---|
[27857] | 96 |
|
---|
[49871] | 97 | HRESULT setNetworkSettings(ULONG aMtu,
|
---|
| 98 | ULONG aSockSnd,
|
---|
| 99 | ULONG aSockRcv,
|
---|
| 100 | ULONG aTcpWndSnd,
|
---|
| 101 | ULONG aTcpWndRcv);
|
---|
| 102 |
|
---|
| 103 | HRESULT getNetworkSettings(ULONG *aMtu,
|
---|
| 104 | ULONG *aSockSnd,
|
---|
| 105 | ULONG *aSockRcv,
|
---|
| 106 | ULONG *aTcpWndSnd,
|
---|
| 107 | ULONG *aTcpWndRcv);
|
---|
| 108 |
|
---|
| 109 | HRESULT addRedirect(const com::Utf8Str &aName,
|
---|
| 110 | NATProtocol_T aProto,
|
---|
| 111 | const com::Utf8Str &aHostIP,
|
---|
| 112 | USHORT aHostPort,
|
---|
| 113 | const com::Utf8Str &aGuestIP,
|
---|
| 114 | USHORT aGuestPort);
|
---|
| 115 |
|
---|
| 116 | HRESULT removeRedirect(const com::Utf8Str &aName);
|
---|
| 117 |
|
---|
[49874] | 118 | struct Data;
|
---|
| 119 | Data *mData;
|
---|
[27857] | 120 | const ComObjPtr<NATEngine> mPeer;
|
---|
| 121 | Machine * const mParent;
|
---|
[33825] | 122 | INetworkAdapter * const mAdapter;
|
---|
[27857] | 123 | };
|
---|
[76562] | 124 | #endif /* !MAIN_INCLUDED_NATEngineImpl_h */
|
---|