1 | /* $Id: NATEngineImpl.h 69500 2017-10-28 15:14:05Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2017 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 ____H_NATENGINE
|
---|
21 | #define ____H_NATENGINE
|
---|
22 |
|
---|
23 | #include "NATEngineWrap.h"
|
---|
24 |
|
---|
25 | namespace settings
|
---|
26 | {
|
---|
27 | struct NAT;
|
---|
28 | }
|
---|
29 |
|
---|
30 |
|
---|
31 | class ATL_NO_VTABLE NATEngine :
|
---|
32 | public NATEngineWrap
|
---|
33 | {
|
---|
34 | public:
|
---|
35 |
|
---|
36 | DECLARE_EMPTY_CTOR_DTOR(NATEngine)
|
---|
37 |
|
---|
38 | HRESULT FinalConstruct();
|
---|
39 | void FinalRelease();
|
---|
40 |
|
---|
41 | HRESULT init(Machine *aParent, INetworkAdapter *aAdapter);
|
---|
42 | HRESULT init(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
|
---|
43 | HRESULT initCopy(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
|
---|
44 | void uninit();
|
---|
45 |
|
---|
46 | bool i_isModified();
|
---|
47 | void i_rollback();
|
---|
48 | void i_commit();
|
---|
49 | void i_copyFrom(NATEngine *aThat);
|
---|
50 | void i_applyDefaults();
|
---|
51 | bool i_hasDefaults();
|
---|
52 | HRESULT i_loadSettings(const settings::NAT &data);
|
---|
53 | HRESULT i_saveSettings(settings::NAT &data);
|
---|
54 |
|
---|
55 | private:
|
---|
56 |
|
---|
57 | // wrapped INATEngine properties
|
---|
58 | HRESULT setNetwork(const com::Utf8Str &aNetwork);
|
---|
59 | HRESULT getNetwork(com::Utf8Str &aNetwork);
|
---|
60 | HRESULT setHostIP(const com::Utf8Str &aHostIP);
|
---|
61 | HRESULT getHostIP(com::Utf8Str &aBindIP);
|
---|
62 | /* TFTP properties */
|
---|
63 | HRESULT setTFTPPrefix(const com::Utf8Str &aTFTPPrefix);
|
---|
64 | HRESULT getTFTPPrefix(com::Utf8Str &aTFTPPrefix);
|
---|
65 | HRESULT setTFTPBootFile(const com::Utf8Str &aTFTPBootFile);
|
---|
66 | HRESULT getTFTPBootFile(com::Utf8Str &aTFTPBootFile);
|
---|
67 | HRESULT setTFTPNextServer(const com::Utf8Str &aTFTPNextServer);
|
---|
68 | HRESULT getTFTPNextServer(com::Utf8Str &aTFTPNextServer);
|
---|
69 | /* DNS properties */
|
---|
70 | HRESULT setDNSPassDomain(BOOL aDNSPassDomain);
|
---|
71 | HRESULT getDNSPassDomain(BOOL *aDNSPassDomain);
|
---|
72 | HRESULT setDNSProxy(BOOL aDNSProxy);
|
---|
73 | HRESULT getDNSProxy(BOOL *aDNSProxy);
|
---|
74 | HRESULT getDNSUseHostResolver(BOOL *aDNSUseHostResolver);
|
---|
75 | HRESULT setDNSUseHostResolver(BOOL aDNSUseHostResolver);
|
---|
76 | /* Alias properties */
|
---|
77 | HRESULT setAliasMode(ULONG aAliasMode);
|
---|
78 | HRESULT getAliasMode(ULONG *aAliasMode);
|
---|
79 |
|
---|
80 | HRESULT getRedirects(std::vector<com::Utf8Str> &aRedirects);
|
---|
81 |
|
---|
82 | HRESULT setNetworkSettings(ULONG aMtu,
|
---|
83 | ULONG aSockSnd,
|
---|
84 | ULONG aSockRcv,
|
---|
85 | ULONG aTcpWndSnd,
|
---|
86 | ULONG aTcpWndRcv);
|
---|
87 |
|
---|
88 | HRESULT getNetworkSettings(ULONG *aMtu,
|
---|
89 | ULONG *aSockSnd,
|
---|
90 | ULONG *aSockRcv,
|
---|
91 | ULONG *aTcpWndSnd,
|
---|
92 | ULONG *aTcpWndRcv);
|
---|
93 |
|
---|
94 | HRESULT addRedirect(const com::Utf8Str &aName,
|
---|
95 | NATProtocol_T aProto,
|
---|
96 | const com::Utf8Str &aHostIP,
|
---|
97 | USHORT aHostPort,
|
---|
98 | const com::Utf8Str &aGuestIP,
|
---|
99 | USHORT aGuestPort);
|
---|
100 |
|
---|
101 | HRESULT removeRedirect(const com::Utf8Str &aName);
|
---|
102 |
|
---|
103 | struct Data;
|
---|
104 | Data *mData;
|
---|
105 | const ComObjPtr<NATEngine> mPeer;
|
---|
106 | Machine * const mParent;
|
---|
107 | INetworkAdapter * const mAdapter;
|
---|
108 | };
|
---|
109 | #endif
|
---|