summaryrefslogtreecommitdiff
path: root/src/VBox/Main/include/NetworkAdapterImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/include/NetworkAdapterImpl.h')
-rw-r--r--src/VBox/Main/include/NetworkAdapterImpl.h114
1 files changed, 59 insertions, 55 deletions
diff --git a/src/VBox/Main/include/NetworkAdapterImpl.h b/src/VBox/Main/include/NetworkAdapterImpl.h
index 579e91e71..12d45486f 100644
--- a/src/VBox/Main/include/NetworkAdapterImpl.h
+++ b/src/VBox/Main/include/NetworkAdapterImpl.h
@@ -1,4 +1,4 @@
-/* $Id: NetworkAdapterImpl.h $ */
+/* $Id: NetworkAdapterImpl.h 37200 2011-05-24 15:34:06Z vboxsync $ */
/** @file
*
@@ -6,7 +6,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -22,6 +22,7 @@
#include "VirtualBoxBase.h"
#include "NATEngineImpl.h"
+#include "BandwidthGroupImpl.h"
class GuestOSType;
@@ -43,11 +44,10 @@ public:
mAttachmentType(NetworkAttachmentType_Null),
mCableConnected(TRUE),
mLineSpeed(0),
+ mPromiscModePolicy(NetworkAdapterPromiscModePolicy_Deny),
mTraceEnabled(FALSE),
- mHostInterface("") /* cannot be null */,
-#ifdef VBOX_WITH_VDE
- mVDENetwork("") /* can be null */,
-#endif
+ mBridgedInterface("") /* cannot be null */,
+ mHostOnlyInterface("") /* cannot be null */,
mNATNetwork("") /* cannot be null */,
mBootPriority(0)
{}
@@ -59,16 +59,17 @@ public:
NetworkAttachmentType_T mAttachmentType;
BOOL mCableConnected;
ULONG mLineSpeed;
+ NetworkAdapterPromiscModePolicy_T mPromiscModePolicy;
BOOL mTraceEnabled;
Bstr mTraceFile;
- Bstr mHostInterface;
+ Bstr mBridgedInterface;
+ Bstr mHostOnlyInterface;
Bstr mInternalNetwork;
-#ifdef VBOX_WITH_VDE
- Bstr mVDENetwork;
-#endif
Bstr mNATNetwork;
+ Bstr mGenericDriver;
+ settings::StringsMap mGenericProperties;
ULONG mBootPriority;
- ULONG mBandwidthLimit;
+ ComObjPtr<BandwidthGroup> mBandwidthGroup;
};
VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(NetworkAdapter, INetworkAdapter)
@@ -78,76 +79,79 @@ public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(NetworkAdapter)
- COM_INTERFACE_ENTRY (ISupportErrorInfo)
- COM_INTERFACE_ENTRY (INetworkAdapter)
- COM_INTERFACE_ENTRY2 (IDispatch, INetworkAdapter)
+ VBOX_DEFAULT_INTERFACE_ENTRIES(INetworkAdapter)
END_COM_MAP()
- DECLARE_EMPTY_CTOR_DTOR (NetworkAdapter)
+ DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
HRESULT FinalConstruct();
void FinalRelease();
// public initializer/uninitializer for internal purposes only
- HRESULT init (Machine *aParent, ULONG aSlot);
- HRESULT init (Machine *aParent, NetworkAdapter *aThat);
- HRESULT initCopy (Machine *aParent, NetworkAdapter *aThat);
+ HRESULT init(Machine *aParent, ULONG aSlot);
+ HRESULT init(Machine *aParent, NetworkAdapter *aThat);
+ HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
void uninit();
// INetworkAdapter properties
STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aAdapterType);
STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T aAdapterType);
- STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
- STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
- STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
- STDMETHOD(COMGETTER(MACAddress)) (BSTR *aMACAddress);
- STDMETHOD(COMSETTER(MACAddress)) (IN_BSTR aMACAddress);
- STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType);
- STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface);
- STDMETHOD(COMSETTER(HostInterface)) (IN_BSTR aHostInterface);
- STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork);
- STDMETHOD(COMSETTER(InternalNetwork)) (IN_BSTR aInternalNetwork);
- STDMETHOD(COMGETTER(NATNetwork)) (BSTR *aNATNetwork);
- STDMETHOD(COMSETTER(NATNetwork)) (IN_BSTR aNATNetwork);
- STDMETHOD(COMGETTER(VDENetwork)) (BSTR *aVDENetwork);
- STDMETHOD(COMSETTER(VDENetwork)) (IN_BSTR aVDENetwork);
- STDMETHOD(COMGETTER(CableConnected)) (BOOL *aConnected);
- STDMETHOD(COMSETTER(CableConnected)) (BOOL aConnected);
- STDMETHOD(COMGETTER(TraceEnabled)) (BOOL *aEnabled);
- STDMETHOD(COMSETTER(TraceEnabled)) (BOOL aEnabled);
- STDMETHOD(COMGETTER(LineSpeed)) (ULONG *aSpeed);
- STDMETHOD(COMSETTER(LineSpeed)) (ULONG aSpeed);
- STDMETHOD(COMGETTER(TraceFile)) (BSTR *aTraceFile);
- STDMETHOD(COMSETTER(TraceFile)) (IN_BSTR aTraceFile);
- STDMETHOD(COMGETTER(NatDriver)) (INATEngine **aNatDriver);
- STDMETHOD(COMGETTER(BootPriority)) (ULONG *aBootPriority);
- STDMETHOD(COMSETTER(BootPriority)) (ULONG aBootPriority);
- STDMETHOD(COMGETTER(BandwidthLimit)) (ULONG *aLimit);
- STDMETHOD(COMSETTER(BandwidthLimit)) (ULONG aLimit);
+ STDMETHOD(COMGETTER(Slot))(ULONG *aSlot);
+ STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
+ STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
+ STDMETHOD(COMGETTER(MACAddress))(BSTR *aMACAddress);
+ STDMETHOD(COMSETTER(MACAddress))(IN_BSTR aMACAddress);
+ STDMETHOD(COMGETTER(AttachmentType))(NetworkAttachmentType_T *aAttachmentType);
+ STDMETHOD(COMSETTER(AttachmentType))(NetworkAttachmentType_T aAttachmentType);
+ STDMETHOD(COMGETTER(BridgedInterface))(BSTR *aBridgedInterface);
+ STDMETHOD(COMSETTER(BridgedInterface))(IN_BSTR aBridgedInterface);
+ STDMETHOD(COMGETTER(HostOnlyInterface))(BSTR *aHostOnlyInterface);
+ STDMETHOD(COMSETTER(HostOnlyInterface))(IN_BSTR aHostOnlyInterface);
+ STDMETHOD(COMGETTER(InternalNetwork))(BSTR *aInternalNetwork);
+ STDMETHOD(COMSETTER(InternalNetwork))(IN_BSTR aInternalNetwork);
+ STDMETHOD(COMGETTER(NATNetwork))(BSTR *aNATNetwork);
+ STDMETHOD(COMSETTER(NATNetwork))(IN_BSTR aNATNetwork);
+ STDMETHOD(COMGETTER(GenericDriver))(BSTR *aGenericDriver);
+ STDMETHOD(COMSETTER(GenericDriver))(IN_BSTR aGenericDriver);
+ STDMETHOD(COMGETTER(CableConnected))(BOOL *aConnected);
+ STDMETHOD(COMSETTER(CableConnected))(BOOL aConnected);
+ STDMETHOD(COMGETTER(TraceEnabled))(BOOL *aEnabled);
+ STDMETHOD(COMSETTER(TraceEnabled))(BOOL aEnabled);
+ STDMETHOD(COMGETTER(LineSpeed))(ULONG *aSpeed);
+ STDMETHOD(COMSETTER(LineSpeed))(ULONG aSpeed);
+ STDMETHOD(COMGETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
+ STDMETHOD(COMSETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
+ STDMETHOD(COMGETTER(TraceFile))(BSTR *aTraceFile);
+ STDMETHOD(COMSETTER(TraceFile))(IN_BSTR aTraceFile);
+ STDMETHOD(COMGETTER(NatDriver))(INATEngine **aNatDriver);
+ STDMETHOD(COMGETTER(BootPriority))(ULONG *aBootPriority);
+ STDMETHOD(COMSETTER(BootPriority))(ULONG aBootPriority);
+ STDMETHOD(COMGETTER(BandwidthGroup))(IBandwidthGroup **aBwGroup);
+ STDMETHOD(COMSETTER(BandwidthGroup))(IBandwidthGroup *aBwGroup);
// INetworkAdapter methods
- STDMETHOD(AttachToNAT)();
- STDMETHOD(AttachToBridgedInterface)();
- STDMETHOD(AttachToInternalNetwork)();
- STDMETHOD(AttachToHostOnlyInterface)();
- STDMETHOD(AttachToVDE)();
- STDMETHOD(Detach)();
+ STDMETHOD(GetProperty)(IN_BSTR aName, BSTR *aValue);
+ STDMETHOD(SetProperty)(IN_BSTR aName, IN_BSTR aValue);
+ STDMETHOD(GetProperties)(IN_BSTR aNames,
+ ComSafeArrayOut(BSTR, aReturnNames),
+ ComSafeArrayOut(BSTR, aReturnValues));
// public methods only for internal purposes
- HRESULT loadSettings(const settings::NetworkAdapter &data);
+ HRESULT loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
HRESULT saveSettings(settings::NetworkAdapter &data);
bool isModified();
void rollback();
void commit();
- void copyFrom (NetworkAdapter *aThat);
- void applyDefaults (GuestOSType *aOsType);
+ void copyFrom(NetworkAdapter *aThat);
+ void applyDefaults(GuestOSType *aOsType);
private:
- void detach();
void generateMACAddress();
+ HRESULT updateMacAddress(Utf8Str aMacAddress);
+ void updateBandwidthGroup(BandwidthGroup *aBwGroup);
Machine * const mParent;
const ComObjPtr<NetworkAdapter> mPeer;