VirtualBox

source: vbox/trunk/src/VBox/Main/include/NetworkAdapterImpl.h@ 78352

Last change on this file since 78352 was 76562, checked in by vboxsync, 6 years ago

Main: Use MAIN_INCLUDED_ and MAIN_INCLUDED_SRC_ as header guard prefixes with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1/* $Id: NetworkAdapterImpl.h 76562 2019-01-01 03:22:50Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_NetworkAdapterImpl_h
19#define MAIN_INCLUDED_NetworkAdapterImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "NetworkAdapterWrap.h"
25
26class GuestOSType;
27class BandwidthControl;
28class BandwidthGroup;
29class NATEngine;
30
31namespace settings
32{
33 struct NetworkAdapter;
34}
35
36class ATL_NO_VTABLE NetworkAdapter :
37 public NetworkAdapterWrap
38{
39public:
40
41 DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
42
43 HRESULT FinalConstruct();
44 void FinalRelease();
45
46 // public initializer/uninitializer for internal purposes only
47 HRESULT init(Machine *aParent, ULONG aSlot);
48 HRESULT init(Machine *aParent, NetworkAdapter *aThat, bool aReshare = false);
49 HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
50 void uninit();
51
52 // public methods only for internal purposes
53 HRESULT i_loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
54 HRESULT i_saveSettings(settings::NetworkAdapter &data);
55
56 bool i_isModified();
57 void i_rollback();
58 void i_commit();
59 void i_copyFrom(NetworkAdapter *aThat);
60 void i_applyDefaults(GuestOSType *aOsType);
61 bool i_hasDefaults();
62
63 ComObjPtr<NetworkAdapter> i_getPeer();
64
65private:
66
67 // wrapped INetworkAdapter properties
68 HRESULT getAdapterType(NetworkAdapterType_T *aAdapterType);
69 HRESULT setAdapterType(NetworkAdapterType_T aAdapterType);
70 HRESULT getSlot(ULONG *aSlot);
71 HRESULT getEnabled(BOOL *aEnabled);
72 HRESULT setEnabled(BOOL aEnabled);
73 HRESULT getMACAddress(com::Utf8Str &aMACAddress);
74 HRESULT setMACAddress(const com::Utf8Str &aMACAddress);
75 HRESULT getAttachmentType(NetworkAttachmentType_T *aAttachmentType);
76 HRESULT setAttachmentType(NetworkAttachmentType_T aAttachmentType);
77 HRESULT getBridgedInterface(com::Utf8Str &aBridgedInterface);
78 HRESULT setBridgedInterface(const com::Utf8Str &aBridgedInterface);
79 HRESULT getHostOnlyInterface(com::Utf8Str &aHostOnlyInterface);
80 HRESULT setHostOnlyInterface(const com::Utf8Str &aHostOnlyInterface);
81 HRESULT getInternalNetwork(com::Utf8Str &aInternalNetwork);
82 HRESULT setInternalNetwork(const com::Utf8Str &aInternalNetwork);
83 HRESULT getNATNetwork(com::Utf8Str &aNATNetwork);
84 HRESULT setNATNetwork(const com::Utf8Str &aNATNetwork);
85 HRESULT getGenericDriver(com::Utf8Str &aGenericDriver);
86 HRESULT setGenericDriver(const com::Utf8Str &aGenericDriver);
87 HRESULT getCableConnected(BOOL *aCableConnected);
88 HRESULT setCableConnected(BOOL aCableConnected);
89 HRESULT getLineSpeed(ULONG *aLineSpeed);
90 HRESULT setLineSpeed(ULONG aLineSpeed);
91 HRESULT getPromiscModePolicy(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
92 HRESULT setPromiscModePolicy(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
93 HRESULT getTraceEnabled(BOOL *aTraceEnabled);
94 HRESULT setTraceEnabled(BOOL aTraceEnabled);
95 HRESULT getTraceFile(com::Utf8Str &aTraceFile);
96 HRESULT setTraceFile(const com::Utf8Str &aTraceFile);
97 HRESULT getNATEngine(ComPtr<INATEngine> &aNATEngine);
98 HRESULT getBootPriority(ULONG *aBootPriority);
99 HRESULT setBootPriority(ULONG aBootPriority);
100 HRESULT getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup);
101 HRESULT setBandwidthGroup(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
102
103 // wrapped INetworkAdapter methods
104 HRESULT getProperty(const com::Utf8Str &aKey,
105 com::Utf8Str &aValue);
106 HRESULT setProperty(const com::Utf8Str &aKey,
107 const com::Utf8Str &aValue);
108 HRESULT getProperties(const com::Utf8Str &aNames,
109 std::vector<com::Utf8Str> &aReturnNames,
110 std::vector<com::Utf8Str> &aReturnValues);
111 // Misc.
112 void i_generateMACAddress();
113 HRESULT i_updateMacAddress(Utf8Str aMacAddress);
114 void i_updateBandwidthGroup(BandwidthGroup *aBwGroup);
115 HRESULT i_switchFromNatNetworking(const com::Utf8Str &aNatnetworkName);
116 HRESULT i_switchToNatNetworking(const com::Utf8Str &aNatNetworkName);
117
118
119 Machine * const mParent;
120 const ComObjPtr<NetworkAdapter> mPeer;
121 const ComObjPtr<NATEngine> mNATEngine;
122
123 Backupable<settings::NetworkAdapter> mData;
124};
125
126#endif /* !MAIN_INCLUDED_NetworkAdapterImpl_h */
127/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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