diff options
Diffstat (limited to 'src/VBox/Main/include/VirtualBoxImpl.h')
-rw-r--r-- | src/VBox/Main/include/VirtualBoxImpl.h | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/src/VBox/Main/include/VirtualBoxImpl.h b/src/VBox/Main/include/VirtualBoxImpl.h index 3bf748a9..0ba8a3f1 100644 --- a/src/VBox/Main/include/VirtualBoxImpl.h +++ b/src/VBox/Main/include/VirtualBoxImpl.h @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2006-2012 Oracle Corporation + * Copyright (C) 2006-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -19,6 +19,7 @@ #define ____H_VIRTUALBOXIMPL #include "VirtualBoxBase.h" +#include "objectslist.h" #ifdef RT_OS_WINDOWS # include "win/resource.h" @@ -32,17 +33,17 @@ namespace com class SessionMachine; class GuestOSType; -class SharedFolder; class Progress; class Host; class SystemProperties; class DHCPServer; class PerformanceCollector; -class VirtualBoxCallbackRegistration; /* see VirtualBoxImpl.cpp */ #ifdef VBOX_WITH_EXTPACK class ExtPackManager; #endif class AutostartDb; +class NATNetwork; + typedef std::list<ComObjPtr<SessionMachine> > SessionMachinesList; @@ -50,8 +51,6 @@ typedef std::list<ComObjPtr<SessionMachine> > SessionMachinesList; class SVCHlpClient; #endif -struct VMClientWatcherData; - namespace settings { class MainConfigFile; @@ -68,6 +67,7 @@ class ATL_NO_VTABLE VirtualBox : public: typedef std::list<ComPtr<IInternalSessionControl> > InternalControlList; + typedef ObjectsList<Machine> MachinesOList; class CallbackEvent; friend class CallbackEvent; @@ -120,6 +120,7 @@ public: STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders)); STDMETHOD(COMGETTER(PerformanceCollector))(IPerformanceCollector **aPerformanceCollector); STDMETHOD(COMGETTER(DHCPServers))(ComSafeArrayOut(IDHCPServer *, aDHCPServers)); + STDMETHOD(COMGETTER(NATNetworks))(ComSafeArrayOut(INATNetwork *, aNATNetworks)); STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource); STDMETHOD(COMGETTER(ExtensionPackManager))(IExtPackManager **aExtPackManager); STDMETHOD(COMGETTER(InternalNetworks))(ComSafeArrayOut(BSTR, aInternalNetworks)); @@ -160,6 +161,11 @@ public: STDMETHOD(CreateDHCPServer)(IN_BSTR aName, IDHCPServer ** aServer); STDMETHOD(FindDHCPServerByNetworkName)(IN_BSTR aName, IDHCPServer ** aServer); STDMETHOD(RemoveDHCPServer)(IDHCPServer * aServer); + + STDMETHOD(CreateNATNetwork)(IN_BSTR aName, INATNetwork ** aNATNetworks); + STDMETHOD(FindNATNetworkByName)(IN_BSTR aName, INATNetwork ** aNATNetworks); + STDMETHOD(RemoveNATNetwork)(INATNetwork * aNATNetwork); + STDMETHOD(CheckFirmwarePresent)(FirmwareType_T aFirmwareType, IN_BSTR aVersion, BSTR * aUrl, BSTR * aFile, BOOL * aResult); @@ -207,15 +213,28 @@ public: void onSnapshotChange(const Guid &aMachineId, const Guid &aSnapshotId); void onGuestPropertyChange(const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags); - void onMachineUninit(Machine *aMachine); void onNatRedirectChange(const Guid &aMachineId, ULONG ulSlot, bool fRemove, IN_BSTR aName, NATProtocol_T aProto, IN_BSTR aHostIp, uint16_t aHostPort, IN_BSTR aGuestIp, uint16_t aGuestPort); + void onNATNetworkChange(IN_BSTR aNetworkName); + void onNATNetworkStartStop(IN_BSTR aNetworkName, BOOL aStart); + void onNATNetworkSetting(IN_BSTR aNetworkName, BOOL aEnabled, IN_BSTR aNetwork, + IN_BSTR aGateway, BOOL aAdvertiseDefaultIpv6RouteEnabled, + BOOL fNeedDhcpServer); + void onNATNetworkPortForward(IN_BSTR aNetworkName, BOOL create, BOOL fIpv6, + IN_BSTR aRuleName, NATProtocol_T proto, + IN_BSTR aHostIp, LONG aHostPort, + IN_BSTR aGuestIp, LONG aGuestPort); + void onHostNameResolutionConfigurationChange(); + + int natNetworkRefInc(IN_BSTR aNetworkName); + int natNetworkRefDec(IN_BSTR aNetworkName); ComObjPtr<GuestOSType> getUnknownOSType(); void getOpenedMachines(SessionMachinesList &aMachines, InternalControlList *aControls = NULL); + MachinesOList &getMachinesList(); HRESULT findMachine(const Guid &aId, bool fPermitInaccessible, @@ -295,13 +314,17 @@ public: AutostartDb* getAutostartDb() const; + RWLockHandle& getMachinesListLockHandle(); RWLockHandle& getMediaTreeLockHandle(); int encryptSetting(const Utf8Str &aPlaintext, Utf8Str *aCiphertext); int decryptSetting(Utf8Str *aPlaintext, const Utf8Str &aCiphertext); void storeSettingsKey(const Utf8Str &aKey); + bool isMediaUuidInUse(const Guid &aId, DeviceType_T deviceType); + private: + class ClientWatcher; static HRESULT setErrorStatic(HRESULT aResultCode, const Utf8Str &aText) @@ -309,17 +332,20 @@ private: return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true); } - HRESULT checkMediaForConflicts(const Guid &aId, - const Utf8Str &aLocation, - Utf8Str &aConflictType, - ComObjPtr<Medium> *pDupMedium); - HRESULT registerMachine(Machine *aMachine); HRESULT registerDHCPServer(DHCPServer *aDHCPServer, bool aSaveRegistry = true); HRESULT unregisterDHCPServer(DHCPServer *aDHCPServer, bool aSaveRegistry = true); + HRESULT registerNATNetwork(NATNetwork *aNATNetwork, + bool aSaveRegistry = true); + HRESULT unregisterNATNetwork(NATNetwork *aNATNetwork, + bool aSaveRegistry = true); + HRESULT checkMediaForConflicts(const Guid &aId, + const Utf8Str &aLocation, + Utf8Str &aConflictType, + ComObjPtr<Medium> *pDupMedium); int decryptSettings(); int decryptMediumSettings(Medium *pMedium); @@ -337,8 +363,9 @@ private: static ULONG sRevision; static Bstr sPackageType; static Bstr sAPIVersion; + static std::map<Bstr, int> sNatNetworkNameToRefCount; + static RWLockHandle* spMtxNatNetworkNameToRefCountLock; - static DECLCALLBACK(int) ClientWatcher(RTTHREAD thread, void *pvUser); static DECLCALLBACK(int) AsyncEventHandler(RTTHREAD thread, void *pvUser); #ifdef RT_OS_WINDOWS |