VirtualBox

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

Last change on this file since 58786 was 57694, checked in by vboxsync, 9 years ago

Main/NATEngine+NetworkAdapter: NetworkAdapter::i_copyFrom didn't update the NATEngine settings, which lacked the corresponding logic entirely and had totally incorrect commit/rollback handling for the settings. The NATEngine commit method was called from the wrong place and rollback was never called. The NATEngine code for updating the port forwarding rules was done ignoring the commit/rollback handling for no good reason, which was covered up by a number of hacks. Eliminated the error prone separate m_fModified flags.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: NATEngineImpl.h 57694 2015-09-10 16:35:59Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2015 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
24#include <VBox/settings.h>
25#include "NATEngineWrap.h"
26
27namespace settings
28{
29 struct NAT;
30}
31
32
33class ATL_NO_VTABLE NATEngine :
34 public NATEngineWrap
35{
36public:
37
38 DECLARE_EMPTY_CTOR_DTOR(NATEngine)
39
40 HRESULT FinalConstruct();
41 void FinalRelease();
42
43 HRESULT init(Machine *aParent, INetworkAdapter *aAdapter);
44 HRESULT init(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
45 HRESULT initCopy(Machine *aParent, INetworkAdapter *aAdapter, NATEngine *aThat);
46 void uninit();
47
48 bool i_isModified();
49 void i_rollback();
50 void i_commit();
51 void i_copyFrom(NATEngine *aThat);
52 HRESULT i_loadSettings(const settings::NAT &data);
53 HRESULT i_saveSettings(settings::NAT &data);
54
55private:
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
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