1 | /* $Id: NATEngineImpl.h 92133 2021-10-28 10:43:36Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2020 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef MAIN_INCLUDED_NATEngineImpl_h
|
---|
21 | #define MAIN_INCLUDED_NATEngineImpl_h
|
---|
22 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
23 | # pragma once
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #include "NATEngineWrap.h"
|
---|
27 |
|
---|
28 | namespace settings
|
---|
29 | {
|
---|
30 | struct NAT;
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | class ATL_NO_VTABLE NATEngine :
|
---|
35 | public NATEngineWrap
|
---|
36 | {
|
---|
37 | public:
|
---|
38 |
|
---|
39 | DECLARE_COMMON_CLASS_METHODS(NATEngine)
|
---|
40 |
|
---|
41 | HRESULT FinalConstruct();
|
---|
42 | void FinalRelease();
|
---|
43 |
|
---|
44 | HRESULT init(Machine *aParent, INetworkAdapter *aAdapter);
|
---|
45 | HRESULT init(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
|
---|
46 | HRESULT initCopy(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
|
---|
47 | void uninit();
|
---|
48 |
|
---|
49 | bool i_isModified();
|
---|
50 | void i_rollback();
|
---|
51 | void i_commit();
|
---|
52 | void i_copyFrom(NATEngine *aThat);
|
---|
53 | void i_applyDefaults();
|
---|
54 | bool i_hasDefaults();
|
---|
55 | HRESULT i_loadSettings(const settings::NAT &data);
|
---|
56 | HRESULT i_saveSettings(settings::NAT &data);
|
---|
57 |
|
---|
58 | private:
|
---|
59 |
|
---|
60 | // wrapped INATEngine properties
|
---|
61 | HRESULT setNetwork(const com::Utf8Str &aNetwork);
|
---|
62 | HRESULT getNetwork(com::Utf8Str &aNetwork);
|
---|
63 | HRESULT setHostIP(const com::Utf8Str &aHostIP);
|
---|
64 | HRESULT getHostIP(com::Utf8Str &aBindIP);
|
---|
65 | HRESULT setLocalhostReachable(BOOL fLocalhostReachable);
|
---|
66 | HRESULT getLocalhostReachable(BOOL *pfLocalhostReachable);
|
---|
67 | /* TFTP properties */
|
---|
68 | HRESULT setTFTPPrefix(const com::Utf8Str &aTFTPPrefix);
|
---|
69 | HRESULT getTFTPPrefix(com::Utf8Str &aTFTPPrefix);
|
---|
70 | HRESULT setTFTPBootFile(const com::Utf8Str &aTFTPBootFile);
|
---|
71 | HRESULT getTFTPBootFile(com::Utf8Str &aTFTPBootFile);
|
---|
72 | HRESULT setTFTPNextServer(const com::Utf8Str &aTFTPNextServer);
|
---|
73 | HRESULT getTFTPNextServer(com::Utf8Str &aTFTPNextServer);
|
---|
74 | /* DNS properties */
|
---|
75 | HRESULT setDNSPassDomain(BOOL aDNSPassDomain);
|
---|
76 | HRESULT getDNSPassDomain(BOOL *aDNSPassDomain);
|
---|
77 | HRESULT setDNSProxy(BOOL aDNSProxy);
|
---|
78 | HRESULT getDNSProxy(BOOL *aDNSProxy);
|
---|
79 | HRESULT getDNSUseHostResolver(BOOL *aDNSUseHostResolver);
|
---|
80 | HRESULT setDNSUseHostResolver(BOOL aDNSUseHostResolver);
|
---|
81 | /* Alias properties */
|
---|
82 | HRESULT setAliasMode(ULONG aAliasMode);
|
---|
83 | HRESULT getAliasMode(ULONG *aAliasMode);
|
---|
84 |
|
---|
85 | HRESULT getRedirects(std::vector<com::Utf8Str> &aRedirects);
|
---|
86 |
|
---|
87 | HRESULT setNetworkSettings(ULONG aMtu,
|
---|
88 | ULONG aSockSnd,
|
---|
89 | ULONG aSockRcv,
|
---|
90 | ULONG aTcpWndSnd,
|
---|
91 | ULONG aTcpWndRcv);
|
---|
92 |
|
---|
93 | HRESULT getNetworkSettings(ULONG *aMtu,
|
---|
94 | ULONG *aSockSnd,
|
---|
95 | ULONG *aSockRcv,
|
---|
96 | ULONG *aTcpWndSnd,
|
---|
97 | ULONG *aTcpWndRcv);
|
---|
98 |
|
---|
99 | HRESULT addRedirect(const com::Utf8Str &aName,
|
---|
100 | NATProtocol_T aProto,
|
---|
101 | const com::Utf8Str &aHostIP,
|
---|
102 | USHORT aHostPort,
|
---|
103 | const com::Utf8Str &aGuestIP,
|
---|
104 | USHORT aGuestPort);
|
---|
105 |
|
---|
106 | HRESULT removeRedirect(const com::Utf8Str &aName);
|
---|
107 |
|
---|
108 | struct Data;
|
---|
109 | Data *mData;
|
---|
110 | const ComObjPtr<NATEngine> mPeer;
|
---|
111 | Machine * const mParent;
|
---|
112 | INetworkAdapter * const mAdapter;
|
---|
113 | };
|
---|
114 | #endif /* !MAIN_INCLUDED_NATEngineImpl_h */
|
---|