2014-08-11 10:06:04 +00:00
|
|
|
/*
|
2014-10-24 01:46:35 +00:00
|
|
|
* Copyright (C) 2014, Taowei Luo (uaedante@gmail.com)
|
2014-08-11 10:06:04 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:09 +00:00
|
|
|
#pragma once
|
2014-08-11 10:06:04 +00:00
|
|
|
|
2019-06-18 16:13:09 +00:00
|
|
|
#include "internal.h"
|
2014-08-11 10:06:04 +00:00
|
|
|
|
|
|
|
/* This file may be used in three place. That is vbox_tmpl.c,
|
|
|
|
* vbox_common.c and vbox_driver.c. The vboxUniformedAPI and some
|
|
|
|
* types used for vboxUniformedAPI is defined here.
|
|
|
|
*
|
|
|
|
* The vbox_tmpl.c is the only place where the driver knows the inside
|
|
|
|
* architecture of those vbox structs(vboxObj, vboxSession,
|
2016-12-29 20:34:28 +00:00
|
|
|
* pFuncs, and vboxCallback). The file should be included
|
2014-08-11 10:06:04 +00:00
|
|
|
* after the currect vbox_CAPI_v*.h, then we can use the vbox structs
|
|
|
|
* in vboxGlobalData. The vbox_tmpl.c should implement functions
|
|
|
|
* defined in vboxUniformedAPI.
|
|
|
|
*
|
|
|
|
* In vbox_driver.c, it is used to define the struct vboxUniformedAPI.
|
|
|
|
* The vbox_driver.c collects vboxUniformedAPI for all versions.
|
|
|
|
* Then vboxRegister calls the vboxRegisterUniformedAPI to register.
|
|
|
|
* Note: In vbox_driver.c, the vbox structs in vboxGlobalData is
|
2016-12-29 20:34:28 +00:00
|
|
|
* defined by vbox_CAPI_v4_0.h.
|
2014-08-11 10:06:04 +00:00
|
|
|
*
|
|
|
|
* The vbox_common.c, it is used to generate common codes for all vbox
|
2018-12-04 17:08:14 +00:00
|
|
|
* versions. Because the same member variable's offset in a vbox struct
|
2014-08-11 10:06:04 +00:00
|
|
|
* may change between different vbox versions. The vbox_common.c
|
2018-12-04 17:08:14 +00:00
|
|
|
* shouldn't directly use struct's member variables defined in
|
2014-08-11 10:06:04 +00:00
|
|
|
* vbox_CAPI_v*.h. To make things safety, we include the
|
|
|
|
* vbox_common.h in vbox_common.c. In this case, we treat structs
|
|
|
|
* defined by vbox as a void*. The common codes don't concern about
|
|
|
|
* the inside of this structs(actually, we can't, in the common level).
|
|
|
|
* With the help of vboxUniformed API, we call VirtualBox's API and
|
|
|
|
* implement the vbox driver in a high level.
|
|
|
|
*
|
|
|
|
* In conclusion:
|
|
|
|
* * In vbox_tmpl.c, this file is included after vbox_CAPI_v*.h
|
|
|
|
* * In vbox_driver.c, this file is included after vbox_glue.h
|
|
|
|
* * In vbox_common.c, this file is included after vbox_common.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-08-11 10:06:06 +00:00
|
|
|
/* Extracted define from vbox_tmpl.c */
|
|
|
|
|
2016-12-29 20:34:32 +00:00
|
|
|
struct _vboxIID {
|
2014-08-11 10:06:06 +00:00
|
|
|
/* IID is represented by a UTF-16 encoded UUID in string form. */
|
|
|
|
PRUnichar *value;
|
|
|
|
|
|
|
|
/* owner indicates if we own the value and need to free it. */
|
|
|
|
bool owner;
|
|
|
|
};
|
|
|
|
|
2016-12-29 20:34:32 +00:00
|
|
|
typedef struct _vboxIID vboxIID;
|
2014-08-11 10:06:06 +00:00
|
|
|
|
|
|
|
typedef union {
|
|
|
|
nsresult uResultCode;
|
|
|
|
PRInt32 resultCode;
|
|
|
|
} resultCodeUnion;
|
|
|
|
|
2014-08-11 10:06:04 +00:00
|
|
|
|
2016-11-23 19:01:10 +00:00
|
|
|
struct _vboxDriver {
|
|
|
|
virObjectLockable parent;
|
|
|
|
|
|
|
|
virCapsPtr caps;
|
|
|
|
virDomainXMLOptionPtr xmlopt;
|
|
|
|
virObjectEventStatePtr domainEventState;
|
|
|
|
|
|
|
|
/* vbox API initialization members */
|
|
|
|
PCVBOXXPCOM pFuncs;
|
|
|
|
IVirtualBox *vboxObj;
|
|
|
|
ISession *vboxSession;
|
2019-06-18 16:13:09 +00:00
|
|
|
#ifdef VBOX_API_VERSION
|
2016-11-23 19:01:10 +00:00
|
|
|
IVirtualBoxClient *vboxClient;
|
2019-06-18 16:13:09 +00:00
|
|
|
#endif
|
2016-11-23 19:01:10 +00:00
|
|
|
|
|
|
|
unsigned long version;
|
|
|
|
|
|
|
|
/* reference counting of vbox connections */
|
|
|
|
int volatile connectionCount;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _vboxDriver vboxDriver;
|
|
|
|
typedef struct _vboxDriver *vboxDriverPtr;
|
|
|
|
|
2014-08-11 10:06:04 +00:00
|
|
|
/* vboxUniformedAPI gives vbox_common.c a uniformed layer to see
|
|
|
|
* vbox API.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Functions for pFuncs */
|
|
|
|
typedef struct {
|
2016-11-23 19:01:10 +00:00
|
|
|
int (*Initialize)(vboxDriverPtr driver);
|
|
|
|
void (*Uninitialize)(vboxDriverPtr driver);
|
2014-08-11 10:06:04 +00:00
|
|
|
void (*ComUnallocMem)(PCVBOXXPCOM pFuncs, void *pv);
|
|
|
|
void (*Utf16Free)(PCVBOXXPCOM pFuncs, PRUnichar *pwszString);
|
|
|
|
void (*Utf8Free)(PCVBOXXPCOM pFuncs, char *pszString);
|
|
|
|
int (*Utf16ToUtf8)(PCVBOXXPCOM pFuncs, const PRUnichar *pwszString, char **ppszString);
|
|
|
|
int (*Utf8ToUtf16)(PCVBOXXPCOM pFuncs, const char *pszString, PRUnichar **ppwszString);
|
|
|
|
} vboxUniformedPFN;
|
|
|
|
|
2014-08-11 10:06:06 +00:00
|
|
|
/* Functions for vboxIID */
|
|
|
|
typedef struct {
|
2016-12-29 20:34:32 +00:00
|
|
|
void (*vboxIIDInitialize)(vboxIID *iid);
|
|
|
|
void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIID *iid);
|
|
|
|
void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIID *iid, unsigned char *uuid);
|
|
|
|
void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIID *iid, const unsigned char *uuid);
|
|
|
|
bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIID *iid1, vboxIID *iid2);
|
|
|
|
void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIID *iid, vboxArray *array, int idx);
|
|
|
|
void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIID *iid, char **utf8);
|
|
|
|
void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIID *iid);
|
2014-08-11 10:06:06 +00:00
|
|
|
} vboxUniformedIID;
|
|
|
|
|
2014-08-11 10:06:14 +00:00
|
|
|
/* Functions for vboxArray */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*vboxArrayGet)(vboxArray *array, void *self, void *getter);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*vboxArrayGetWithIIDArg)(vboxArray *array, void *self, void *getter, vboxIID *iid);
|
2014-08-11 10:06:14 +00:00
|
|
|
void (*vboxArrayRelease)(vboxArray *array);
|
2014-10-24 01:46:48 +00:00
|
|
|
void (*vboxArrayUnalloc)(vboxArray *array);
|
2014-08-11 10:06:14 +00:00
|
|
|
/* Generate function pointers for vboxArrayGet */
|
|
|
|
void* (*handleGetMachines)(IVirtualBox *vboxObj);
|
vbox: Rewrite vboxStoragePoolNumOfVolumes
We use typedef IMedium IHardDisk to make IHardDisk hierachy from
IMedium (Actually it did on vbox 2.2 and 3.0's C++ API).
So when calling
VBOX_MEDIUM_FUNC_ARG*(IHardDisk, func, args)
we can directly replace it to
gVBoxAPI.UIMedium.func(IHardDisk, args)
When dealing with this two types, we get some rules from it's
hierachy relationship.
When using IHardDisk and IMedium as input, we can't transfer a
IMedium to IHardDisk. Like:
gVBoxAPI.UIHardDisk.func(IHardDisk *hardDisk, args)
Here, we can't put a *IMedium as a argument.
When using IHardDisk and IMedium as output, we can't transfer a
IHardDisk to IMedium. Like:
gVBoxAPI.UIMachine.GetMedium(IMedium **out)
Here, we can't put a **IHardDisk as a argument. If this case
do happen, we either change the API to GetHardDisk or write a
new one.
2014-10-24 01:46:39 +00:00
|
|
|
void* (*handleGetHardDisks)(IVirtualBox *vboxObj);
|
2014-08-11 10:06:42 +00:00
|
|
|
void* (*handleUSBGetDeviceFilters)(IUSBCommon *USBCommon);
|
2017-10-24 19:35:31 +00:00
|
|
|
void* (*handleMachineGetStorageControllers)(IMachine *machine);
|
2014-08-11 10:06:42 +00:00
|
|
|
void* (*handleMachineGetMediumAttachments)(IMachine *machine);
|
|
|
|
void* (*handleMachineGetSharedFolders)(IMachine *machine);
|
2014-08-11 10:06:54 +00:00
|
|
|
void* (*handleSnapshotGetChildren)(ISnapshot *snapshot);
|
|
|
|
void* (*handleMediumGetChildren)(IMedium *medium);
|
|
|
|
void* (*handleMediumGetSnapshotIds)(IMedium *medium);
|
2014-10-24 01:46:48 +00:00
|
|
|
void* (*handleMediumGetMachineIds)(IMedium *medium);
|
2014-10-02 03:30:28 +00:00
|
|
|
void* (*handleHostGetNetworkInterfaces)(IHost *host);
|
2014-08-11 10:06:14 +00:00
|
|
|
} vboxUniformedArray;
|
|
|
|
|
2014-08-11 10:06:06 +00:00
|
|
|
/* Functions for nsISupports */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*Release)(nsISupports *nsi);
|
2014-08-11 10:06:54 +00:00
|
|
|
nsresult (*AddRef)(nsISupports *nsi);
|
2014-08-11 10:06:06 +00:00
|
|
|
} vboxUniformednsISupports;
|
|
|
|
|
2014-08-11 10:06:04 +00:00
|
|
|
/* Functions for IVirtualBox */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetVersion)(IVirtualBox *vboxObj, PRUnichar **versionUtf16);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetMachine)(IVirtualBox *vboxObj, vboxIID *iid, IMachine **machine);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine);
|
2014-08-11 10:06:12 +00:00
|
|
|
nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties);
|
2014-10-02 03:30:28 +00:00
|
|
|
nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host);
|
2016-11-23 19:01:11 +00:00
|
|
|
nsresult (*CreateMachine)(vboxDriverPtr driver, virDomainDefPtr def, IMachine **machine, char *uuidstr);
|
2016-12-29 20:34:26 +00:00
|
|
|
nsresult (*CreateHardDisk)(IVirtualBox *vboxObj, PRUnichar *format, PRUnichar *location, IMedium **medium);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*RegisterMachine)(IVirtualBox *vboxObj, IMachine *machine);
|
2014-10-24 01:46:43 +00:00
|
|
|
nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType,
|
2016-12-29 20:34:26 +00:00
|
|
|
PRUint32 accessMode, IMedium **medium);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*OpenMedium)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType, PRUint32 accessMode, IMedium **medium);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetHardDiskByIID)(IVirtualBox *vboxObj, vboxIID *iid, IMedium **medium);
|
2014-10-02 03:30:34 +00:00
|
|
|
nsresult (*FindDHCPServerByNetworkName)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
|
|
|
nsresult (*CreateDHCPServer)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
2014-10-02 03:30:35 +00:00
|
|
|
nsresult (*RemoveDHCPServer)(IVirtualBox *vboxObj, IDHCPServer *server);
|
2014-08-11 10:06:04 +00:00
|
|
|
} vboxUniformedIVirtualBox;
|
|
|
|
|
2014-08-11 10:06:14 +00:00
|
|
|
/* Functions for IMachine */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*AddStorageController)(IMachine *machine, PRUnichar *name,
|
|
|
|
PRUint32 connectionType, IStorageController **controller);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetStorageControllerByName)(IMachine *machine, PRUnichar *name,
|
|
|
|
IStorageController **storageController);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*AttachDevice)(IMachine *machine, PRUnichar *name,
|
|
|
|
PRInt32 controllerPort, PRInt32 device,
|
|
|
|
PRUint32 type, IMedium *medium);
|
|
|
|
nsresult (*CreateSharedFolder)(IMachine *machine, PRUnichar *name,
|
|
|
|
PRUnichar *hostPath, PRBool writable,
|
|
|
|
PRBool automount);
|
2014-08-11 10:06:50 +00:00
|
|
|
nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
|
2016-11-23 19:01:11 +00:00
|
|
|
nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine,
|
2016-12-29 20:34:32 +00:00
|
|
|
vboxIID *iid,
|
2014-08-11 10:06:20 +00:00
|
|
|
PRUnichar *sessionType, PRUnichar *env,
|
|
|
|
IProgress **progress);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*Unregister)(IMachine *machine, PRUint32 cleanupMode,
|
|
|
|
PRUint32 *aMediaSize, IMedium ***aMedia);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*FindSnapshot)(IMachine *machine, vboxIID *iid, ISnapshot **snapshot);
|
2014-10-24 01:46:48 +00:00
|
|
|
nsresult (*DetachDevice)(IMachine *machine, PRUnichar *name,
|
|
|
|
PRInt32 controllerPort, PRInt32 device);
|
2014-08-11 10:06:14 +00:00
|
|
|
nsresult (*GetAccessible)(IMachine *machine, PRBool *isAccessible);
|
|
|
|
nsresult (*GetState)(IMachine *machine, PRUint32 *state);
|
2014-08-11 10:06:16 +00:00
|
|
|
nsresult (*GetName)(IMachine *machine, PRUnichar **name);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetId)(IMachine *machine, vboxIID *iid);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*GetBIOSSettings)(IMachine *machine, IBIOSSettings **bios);
|
|
|
|
nsresult (*GetAudioAdapter)(IMachine *machine, IAudioAdapter **audioAdapter);
|
|
|
|
nsresult (*GetNetworkAdapter)(IMachine *machine, PRUint32 slot, INetworkAdapter **adapter);
|
|
|
|
nsresult (*GetChipsetType)(IMachine *machine, PRUint32 *chipsetType);
|
|
|
|
nsresult (*GetSerialPort)(IMachine *machine, PRUint32 slot, ISerialPort **port);
|
|
|
|
nsresult (*GetParallelPort)(IMachine *machine, PRUint32 slot, IParallelPort **port);
|
2016-12-29 20:34:30 +00:00
|
|
|
nsresult (*GetVRDEServer)(IMachine *machine, IVRDEServer **VRDEServer);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*GetUSBCommon)(IMachine *machine, IUSBCommon **USBCommon);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*GetCurrentSnapshot)(IMachine *machine, ISnapshot **currentSnapshot);
|
|
|
|
nsresult (*GetSettingsFilePath)(IMachine *machine, PRUnichar **settingsFilePath);
|
2014-08-11 10:06:36 +00:00
|
|
|
nsresult (*GetCPUCount)(IMachine *machine, PRUint32 *CPUCount);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetCPUCount)(IMachine *machine, PRUint32 CPUCount);
|
2014-08-11 10:06:36 +00:00
|
|
|
nsresult (*GetMemorySize)(IMachine *machine, PRUint32 *memorySize);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetMemorySize)(IMachine *machine, PRUint32 memorySize);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetCPUProperty)(IMachine *machine, PRUint32 property, PRBool *value);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetCPUProperty)(IMachine *machine, PRUint32 property, PRBool value);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetBootOrder)(IMachine *machine, PRUint32 position, PRUint32 *device);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetBootOrder)(IMachine *machine, PRUint32 position, PRUint32 device);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetVRAMSize)(IMachine *machine, PRUint32 *VRAMSize);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetVRAMSize)(IMachine *machine, PRUint32 VRAMSize);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetMonitorCount)(IMachine *machine, PRUint32 *monitorCount);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetMonitorCount)(IMachine *machine, PRUint32 monitorCount);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetAccelerate3DEnabled)(IMachine *machine, PRBool *accelerate3DEnabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetAccelerate3DEnabled)(IMachine *machine, PRBool accelerate3DEnabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetAccelerate2DVideoEnabled)(IMachine *machine, PRBool *accelerate2DVideoEnabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetAccelerate2DVideoEnabled)(IMachine *machine, PRBool accelerate2DVideoEnabled);
|
2014-08-11 10:06:20 +00:00
|
|
|
nsresult (*GetExtraData)(IMachine *machine, PRUnichar *key, PRUnichar **value);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetExtraData)(IMachine *machine, PRUnichar *key, PRUnichar *value);
|
2014-08-11 10:06:54 +00:00
|
|
|
nsresult (*GetSnapshotCount)(IMachine *machine, PRUint32 *snapshotCount);
|
2014-08-11 10:06:18 +00:00
|
|
|
nsresult (*SaveSettings)(IMachine *machine);
|
2014-08-11 10:06:14 +00:00
|
|
|
} vboxUniformedIMachine;
|
|
|
|
|
2014-08-11 10:06:06 +00:00
|
|
|
/* Functions for ISession */
|
|
|
|
typedef struct {
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*Open)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
|
|
|
|
nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
|
2014-08-11 10:06:06 +00:00
|
|
|
nsresult (*GetConsole)(ISession *session, IConsole **console);
|
2014-08-11 10:06:18 +00:00
|
|
|
nsresult (*GetMachine)(ISession *session, IMachine **machine);
|
2014-08-11 10:06:06 +00:00
|
|
|
nsresult (*Close)(ISession *session);
|
|
|
|
} vboxUniformedISession;
|
|
|
|
|
|
|
|
/* Functions for IConsole */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*SaveState)(IConsole *console, IProgress **progress);
|
2014-08-11 10:06:27 +00:00
|
|
|
nsresult (*Pause)(IConsole *console);
|
2014-08-11 10:06:28 +00:00
|
|
|
nsresult (*Resume)(IConsole *console);
|
2014-08-11 10:06:29 +00:00
|
|
|
nsresult (*PowerButton)(IConsole *console);
|
2014-08-11 10:06:32 +00:00
|
|
|
nsresult (*PowerDown)(IConsole *console);
|
2014-08-11 10:06:31 +00:00
|
|
|
nsresult (*Reset)(IConsole *console);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*TakeSnapshot)(IConsole *console, PRUnichar *name,
|
|
|
|
PRUnichar *description, IProgress **progress);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*DeleteSnapshot)(IConsole *console, vboxIID *iid, IProgress **progress);
|
2014-08-11 10:07:05 +00:00
|
|
|
nsresult (*GetDisplay)(IConsole *console, IDisplay **display);
|
2015-04-07 15:37:35 +00:00
|
|
|
nsresult (*GetKeyboard)(IConsole *console, IKeyboard **keyboard);
|
2014-08-11 10:06:06 +00:00
|
|
|
} vboxUniformedIConsole;
|
|
|
|
|
|
|
|
/* Functions for IProgress */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*WaitForCompletion)(IProgress *progress, PRInt32 timeout);
|
|
|
|
nsresult (*GetResultCode)(IProgress *progress, resultCodeUnion *resultCode);
|
2014-08-11 10:06:20 +00:00
|
|
|
nsresult (*GetCompleted)(IProgress *progress, PRBool *completed);
|
2014-08-11 10:06:06 +00:00
|
|
|
} vboxUniformedIProgress;
|
|
|
|
|
2014-08-11 10:06:12 +00:00
|
|
|
/* Functions for ISystemProperties */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetMaxGuestCPUCount)(ISystemProperties *systemProperties, PRUint32 *maxCPUCount);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*GetMaxBootPosition)(ISystemProperties *systemProperties, PRUint32 *maxBootPosition);
|
|
|
|
nsresult (*GetMaxNetworkAdapters)(ISystemProperties *systemProperties, PRUint32 chipset,
|
|
|
|
PRUint32 *maxNetworkAdapters);
|
|
|
|
nsresult (*GetSerialPortCount)(ISystemProperties *systemProperties, PRUint32 *SerialPortCount);
|
|
|
|
nsresult (*GetParallelPortCount)(ISystemProperties *systemProperties, PRUint32 *ParallelPortCount);
|
|
|
|
nsresult (*GetMaxPortCountForStorageBus)(ISystemProperties *systemProperties, PRUint32 bus,
|
|
|
|
PRUint32 *maxPortCount);
|
|
|
|
nsresult (*GetMaxDevicesPerPortForStorageBus)(ISystemProperties *systemProperties,
|
|
|
|
PRUint32 bus, PRUint32 *maxDevicesPerPort);
|
2014-08-11 10:06:36 +00:00
|
|
|
nsresult (*GetMaxGuestRAM)(ISystemProperties *systemProperties, PRUint32 *maxGuestRAM);
|
2014-08-11 10:06:12 +00:00
|
|
|
} vboxUniformedISystemProperties;
|
|
|
|
|
2014-08-11 10:06:19 +00:00
|
|
|
/* Functions for IBIOSSettings */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetACPIEnabled)(IBIOSSettings *bios, PRBool *ACPIEnabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetACPIEnabled)(IBIOSSettings *bios, PRBool ACPIEnabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetIOAPICEnabled)(IBIOSSettings *bios, PRBool *IOAPICEnabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetIOAPICEnabled)(IBIOSSettings *bios, PRBool IOAPICEnabled);
|
|
|
|
} vboxUniformedIBIOSSettings;
|
|
|
|
|
|
|
|
/* Functions for IAudioAdapter */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetEnabled)(IAudioAdapter *audioAdapter, PRBool *enabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetEnabled)(IAudioAdapter *audioAdapter, PRBool enabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetAudioController)(IAudioAdapter *audioAdapter, PRUint32 *audioController);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetAudioController)(IAudioAdapter *audioAdapter, PRUint32 audioController);
|
|
|
|
} vboxUniformedIAudioAdapter;
|
|
|
|
|
|
|
|
/* Functions for INetworkAdapter */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetAttachmentType)(INetworkAdapter *adapter, PRUint32 *attachmentType);
|
|
|
|
nsresult (*GetEnabled)(INetworkAdapter *adapter, PRBool *enabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetEnabled)(INetworkAdapter *adapter, PRBool enabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetAdapterType)(INetworkAdapter *adapter, PRUint32 *adapterType);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetAdapterType)(INetworkAdapter *adapter, PRUint32 adapterType);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetBridgedInterface)(INetworkAdapter *adapter, PRUnichar **bridgedInterface);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetBridgedInterface)(INetworkAdapter *adapter, PRUnichar *bridgedInterface);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetInternalNetwork)(INetworkAdapter *adapter, PRUnichar **internalNetwork);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetInternalNetwork)(INetworkAdapter *adapter, PRUnichar *internalNetwork);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetHostOnlyInterface)(INetworkAdapter *adapter, PRUnichar **hostOnlyInterface);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetHostOnlyInterface)(INetworkAdapter *adapter, PRUnichar *hostOnlyInterface);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetMACAddress)(INetworkAdapter *adapter, PRUnichar **MACAddress);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetMACAddress)(INetworkAdapter *adapter, PRUnichar *MACAddress);
|
|
|
|
nsresult (*AttachToBridgedInterface)(INetworkAdapter *adapter);
|
|
|
|
nsresult (*AttachToInternalNetwork)(INetworkAdapter *adapter);
|
|
|
|
nsresult (*AttachToHostOnlyInterface)(INetworkAdapter *adapter);
|
|
|
|
nsresult (*AttachToNAT)(INetworkAdapter *adapter);
|
|
|
|
} vboxUniformedINetworkAdapter;
|
|
|
|
|
|
|
|
/* Functions for ISerialPort */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetEnabled)(ISerialPort *port, PRBool *enabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetEnabled)(ISerialPort *port, PRBool enabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetPath)(ISerialPort *port, PRUnichar **path);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetPath)(ISerialPort *port, PRUnichar *path);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetIRQ)(ISerialPort *port, PRUint32 *IRQ);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetIRQ)(ISerialPort *port, PRUint32 IRQ);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetIOBase)(ISerialPort *port, PRUint32 *IOBase);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetIOBase)(ISerialPort *port, PRUint32 IOBase);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetHostMode)(ISerialPort *port, PRUint32 *hostMode);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetHostMode)(ISerialPort *port, PRUint32 hostMode);
|
|
|
|
} vboxUniformedISerialPort;
|
|
|
|
|
|
|
|
/* Functions for IParallelPort */
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetEnabled)(IParallelPort *port, PRBool *enabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetEnabled)(IParallelPort *port, PRBool enabled);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetPath)(IParallelPort *port, PRUnichar **path);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetPath)(IParallelPort *port, PRUnichar *path);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetIRQ)(IParallelPort *port, PRUint32 *IRQ);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetIRQ)(IParallelPort *port, PRUint32 IRQ);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetIOBase)(IParallelPort *port, PRUint32 *IOBase);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetIOBase)(IParallelPort *port, PRUint32 IOBase);
|
|
|
|
} vboxUniformedIParallelPort;
|
|
|
|
|
2016-12-29 20:34:30 +00:00
|
|
|
/* Functions for IVRDEServer */
|
2014-08-11 10:06:19 +00:00
|
|
|
typedef struct {
|
2016-12-29 20:34:30 +00:00
|
|
|
nsresult (*GetEnabled)(IVRDEServer *VRDEServer, PRBool *enabled);
|
|
|
|
nsresult (*SetEnabled)(IVRDEServer *VRDEServer, PRBool enabled);
|
|
|
|
nsresult (*GetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer,
|
2017-10-24 21:09:17 +00:00
|
|
|
IMachine *machine, virDomainGraphicsDefPtr graphics);
|
2016-12-29 20:34:30 +00:00
|
|
|
nsresult (*SetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer,
|
2014-08-11 10:06:19 +00:00
|
|
|
virDomainGraphicsDefPtr graphics);
|
2016-12-29 20:34:30 +00:00
|
|
|
nsresult (*GetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool *enabled);
|
|
|
|
nsresult (*SetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool enabled);
|
|
|
|
nsresult (*GetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool *enabled);
|
|
|
|
nsresult (*SetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool enabled);
|
|
|
|
nsresult (*GetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer,
|
2014-08-11 10:06:42 +00:00
|
|
|
PRUnichar **netAddress);
|
2016-12-29 20:34:30 +00:00
|
|
|
nsresult (*SetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer,
|
2014-08-11 10:06:19 +00:00
|
|
|
PRUnichar *netAddress);
|
2016-12-29 20:34:30 +00:00
|
|
|
} vboxUniformedIVRDEServer;
|
2014-08-11 10:06:19 +00:00
|
|
|
|
|
|
|
/* Common Functions for IUSBController and IUSBDeviceFilters */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*Enable)(IUSBCommon *USBCommon);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetEnabled)(IUSBCommon *USBCommon, PRBool *enabled);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*CreateDeviceFilter)(IUSBCommon *USBCommon, PRUnichar *name,
|
|
|
|
IUSBDeviceFilter **filter);
|
|
|
|
nsresult (*InsertDeviceFilter)(IUSBCommon *USBCommon, PRUint32 position,
|
|
|
|
IUSBDeviceFilter *filter);
|
|
|
|
} vboxUniformedIUSBCommon;
|
|
|
|
|
|
|
|
typedef struct {
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetProductId)(IUSBDeviceFilter *USBDeviceFilter, PRUnichar **productId);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetProductId)(IUSBDeviceFilter *USBDeviceFilter, PRUnichar *productId);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetActive)(IUSBDeviceFilter *USBDeviceFilter, PRBool *active);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetActive)(IUSBDeviceFilter *USBDeviceFilter, PRBool active);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetVendorId)(IUSBDeviceFilter *USBDeviceFilter, PRUnichar **vendorId);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetVendorId)(IUSBDeviceFilter *USBDeviceFilter, PRUnichar *vendorId);
|
|
|
|
} vboxUniformedIUSBDeviceFilter;
|
|
|
|
|
|
|
|
/* Functions for IMedium */
|
|
|
|
typedef struct {
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetId)(IMedium *medium, vboxIID *iid);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetLocation)(IMedium *medium, PRUnichar **location);
|
vbox: Rewrite vboxStoragePoolNumOfVolumes
We use typedef IMedium IHardDisk to make IHardDisk hierachy from
IMedium (Actually it did on vbox 2.2 and 3.0's C++ API).
So when calling
VBOX_MEDIUM_FUNC_ARG*(IHardDisk, func, args)
we can directly replace it to
gVBoxAPI.UIMedium.func(IHardDisk, args)
When dealing with this two types, we get some rules from it's
hierachy relationship.
When using IHardDisk and IMedium as input, we can't transfer a
IMedium to IHardDisk. Like:
gVBoxAPI.UIHardDisk.func(IHardDisk *hardDisk, args)
Here, we can't put a *IMedium as a argument.
When using IHardDisk and IMedium as output, we can't transfer a
IHardDisk to IMedium. Like:
gVBoxAPI.UIMachine.GetMedium(IMedium **out)
Here, we can't put a **IHardDisk as a argument. If this case
do happen, we either change the API to GetHardDisk or write a
new one.
2014-10-24 01:46:39 +00:00
|
|
|
nsresult (*GetState)(IMedium *medium, PRUint32 *state);
|
2014-10-24 01:46:40 +00:00
|
|
|
nsresult (*GetName)(IMedium *medium, PRUnichar **name);
|
2014-10-24 01:46:49 +00:00
|
|
|
nsresult (*GetSize)(IMedium *medium, PRUint64 *uSize);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetReadOnly)(IMedium *medium, PRBool *readOnly);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*GetParent)(IMedium *medium, IMedium **parent);
|
2016-12-29 20:34:26 +00:00
|
|
|
nsresult (*GetChildren)(IMedium *medium, PRUint32 *childrenSize,
|
|
|
|
IMedium ***children);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*GetFormat)(IMedium *medium, PRUnichar **format);
|
|
|
|
nsresult (*DeleteStorage)(IMedium *medium, IProgress **progress);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*Release)(IMedium *medium);
|
2014-08-11 10:06:52 +00:00
|
|
|
nsresult (*Close)(IMedium *medium);
|
2014-08-11 10:06:19 +00:00
|
|
|
nsresult (*SetType)(IMedium *medium, PRUint32 type);
|
2016-12-29 20:34:26 +00:00
|
|
|
nsresult (*CreateDiffStorage)(IMedium *medium, IMedium *target,
|
|
|
|
PRUint32 variantSize, PRUint32 *variant,
|
|
|
|
IProgress **progress);
|
|
|
|
nsresult (*CreateBaseStorage)(IMedium *medium, PRUint64 logicalSize,
|
|
|
|
PRUint32 variant, IProgress **progress);
|
|
|
|
nsresult (*GetLogicalSize)(IMedium *medium, PRUint64 *uLogicalSize);
|
2014-08-11 10:06:19 +00:00
|
|
|
} vboxUniformedIMedium;
|
|
|
|
|
2014-08-11 10:06:42 +00:00
|
|
|
/* Functions for IMediumAttachment */
|
|
|
|
typedef struct {
|
2016-12-29 20:34:26 +00:00
|
|
|
nsresult (*GetMedium)(IMediumAttachment *mediumAttachment, IMedium **medium);
|
2014-08-11 10:06:42 +00:00
|
|
|
nsresult (*GetController)(IMediumAttachment *mediumAttachment, PRUnichar **controller);
|
|
|
|
nsresult (*GetType)(IMediumAttachment *mediumAttachment, PRUint32 *type);
|
|
|
|
nsresult (*GetPort)(IMediumAttachment *mediumAttachment, PRInt32 *port);
|
|
|
|
nsresult (*GetDevice)(IMediumAttachment *mediumAttachment, PRInt32 *device);
|
|
|
|
} vboxUniformedIMediumAttachment;
|
|
|
|
|
|
|
|
|
|
|
|
/* Functions for IStorageController */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetBus)(IStorageController *storageController, PRUint32 *bus);
|
2017-10-24 19:35:31 +00:00
|
|
|
nsresult (*SetControllerType)(IStorageController *storageController, PRUint32 controllerType);
|
|
|
|
nsresult (*GetControllerType)(IStorageController *storageController, PRUint32 *controllerType);
|
2014-08-11 10:06:42 +00:00
|
|
|
} vboxUniformedIStorageController;
|
|
|
|
|
|
|
|
/* Functions for ISharedFolder */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetHostPath)(ISharedFolder *sharedFolder, PRUnichar **hostPath);
|
|
|
|
nsresult (*GetName)(ISharedFolder *sharedFolder, PRUnichar **name);
|
|
|
|
nsresult (*GetWritable)(ISharedFolder *sharedFolder, PRBool *writable);
|
|
|
|
} vboxUniformedISharedFolder;
|
|
|
|
|
2014-08-11 10:06:54 +00:00
|
|
|
/* Functions for ISnapshot */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetName)(ISnapshot *snapshot, PRUnichar **name);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetId)(ISnapshot *snapshot, vboxIID *iid);
|
2014-08-11 10:06:54 +00:00
|
|
|
nsresult (*GetMachine)(ISnapshot *snapshot, IMachine **machine);
|
|
|
|
nsresult (*GetDescription)(ISnapshot *snapshot, PRUnichar **description);
|
|
|
|
nsresult (*GetTimeStamp)(ISnapshot *snapshot, PRInt64 *timeStamp);
|
|
|
|
nsresult (*GetParent)(ISnapshot *snapshot, ISnapshot **parent);
|
|
|
|
nsresult (*GetOnline)(ISnapshot *snapshot, PRBool *online);
|
|
|
|
} vboxUniformedISnapshot;
|
|
|
|
|
2014-08-11 10:07:05 +00:00
|
|
|
/* Functions for IDisplay */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetScreenResolution)(IDisplay *display,
|
|
|
|
PRUint32 screenId,
|
|
|
|
PRUint32 *width,
|
|
|
|
PRUint32 *height,
|
|
|
|
PRUint32 *bitsPerPixel,
|
|
|
|
PRInt32 *xOrigin,
|
|
|
|
PRInt32 *yOrigin);
|
|
|
|
nsresult (*TakeScreenShotPNGToArray)(IDisplay *display,
|
|
|
|
PRUint32 screenId,
|
|
|
|
PRUint32 width,
|
|
|
|
PRUint32 height,
|
|
|
|
PRUint32 *screenDataSize,
|
|
|
|
PRUint8** screenData);
|
|
|
|
} vboxUniformedIDisplay;
|
|
|
|
|
2014-10-02 03:30:32 +00:00
|
|
|
/* Functions for IHost */
|
|
|
|
typedef struct {
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*FindHostNetworkInterfaceById)(IHost *host, vboxIID *iid,
|
2014-10-02 03:30:32 +00:00
|
|
|
IHostNetworkInterface **networkInterface);
|
2014-10-02 03:30:33 +00:00
|
|
|
nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name,
|
|
|
|
IHostNetworkInterface **networkInterface);
|
2016-11-23 19:01:11 +00:00
|
|
|
nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver,
|
2014-10-02 03:30:34 +00:00
|
|
|
IHost *host, char *name,
|
|
|
|
IHostNetworkInterface **networkInterface);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIID *iid,
|
2014-10-02 03:30:35 +00:00
|
|
|
IProgress **progress);
|
2014-10-02 03:30:32 +00:00
|
|
|
} vboxUniformedIHost;
|
|
|
|
|
2014-10-02 03:30:28 +00:00
|
|
|
/* Functions for IHostNetworkInterface */
|
|
|
|
typedef struct {
|
|
|
|
nsresult (*GetInterfaceType)(IHostNetworkInterface *hni, PRUint32 *interfaceType);
|
|
|
|
nsresult (*GetStatus)(IHostNetworkInterface *hni, PRUint32 *status);
|
2014-10-02 03:30:29 +00:00
|
|
|
nsresult (*GetName)(IHostNetworkInterface *hni, PRUnichar **name);
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*GetId)(IHostNetworkInterface *hni, vboxIID *iid);
|
2014-10-02 03:30:37 +00:00
|
|
|
nsresult (*GetHardwareAddress)(IHostNetworkInterface *hni, PRUnichar **hardwareAddress);
|
|
|
|
nsresult (*GetIPAddress)(IHostNetworkInterface *hni, PRUnichar **IPAddress);
|
|
|
|
nsresult (*GetNetworkMask)(IHostNetworkInterface *hni, PRUnichar **networkMask);
|
2014-10-02 03:30:34 +00:00
|
|
|
nsresult (*EnableStaticIPConfig)(IHostNetworkInterface *hni, PRUnichar *IPAddress,
|
|
|
|
PRUnichar *networkMask);
|
|
|
|
nsresult (*EnableDynamicIPConfig)(IHostNetworkInterface *hni);
|
|
|
|
nsresult (*DHCPRediscover)(IHostNetworkInterface *hni);
|
2014-10-02 03:30:28 +00:00
|
|
|
} vboxUniformedIHNInterface;
|
|
|
|
|
2014-10-02 03:30:34 +00:00
|
|
|
/* Functions for IDHCPServer */
|
|
|
|
typedef struct {
|
2014-10-02 03:30:37 +00:00
|
|
|
nsresult (*GetIPAddress)(IDHCPServer *dhcpServer, PRUnichar **IPAddress);
|
|
|
|
nsresult (*GetNetworkMask)(IDHCPServer *dhcpServer, PRUnichar **networkMask);
|
|
|
|
nsresult (*GetLowerIP)(IDHCPServer *dhcpServer, PRUnichar **lowerIP);
|
|
|
|
nsresult (*GetUpperIP)(IDHCPServer *dhcpServer, PRUnichar **upperIP);
|
2014-10-02 03:30:34 +00:00
|
|
|
nsresult (*SetEnabled)(IDHCPServer *dhcpServer, PRBool enabled);
|
|
|
|
nsresult (*SetConfiguration)(IDHCPServer *dhcpServer, PRUnichar *IPAddress,
|
|
|
|
PRUnichar *networkMask, PRUnichar *FromIPAddress,
|
|
|
|
PRUnichar *ToIPAddress);
|
|
|
|
nsresult (*Start)(IDHCPServer *dhcpServer, PRUnichar *networkName,
|
|
|
|
PRUnichar *trunkName, PRUnichar *trunkType);
|
2014-10-02 03:30:35 +00:00
|
|
|
nsresult (*Stop)(IDHCPServer *dhcpServer);
|
2014-10-02 03:30:34 +00:00
|
|
|
} vboxUniformedIDHCPServer;
|
|
|
|
|
2015-04-07 15:37:35 +00:00
|
|
|
typedef struct {
|
|
|
|
nsresult (*PutScancode)(IKeyboard *keyboard, PRInt32 scancode);
|
|
|
|
nsresult (*PutScancodes)(IKeyboard *keyboard, PRUint32 scancodesSize,
|
|
|
|
PRInt32 *scanCodes, PRUint32 *codesStored);
|
|
|
|
} vboxUniformedIKeyboard;
|
|
|
|
|
2014-08-11 10:06:14 +00:00
|
|
|
typedef struct {
|
|
|
|
bool (*Online)(PRUint32 state);
|
2014-08-11 10:06:44 +00:00
|
|
|
bool (*Inactive)(PRUint32 state);
|
2014-08-11 10:06:20 +00:00
|
|
|
bool (*NotStart)(PRUint32 state);
|
2014-08-11 10:06:27 +00:00
|
|
|
bool (*Running)(PRUint32 state);
|
2014-08-11 10:06:28 +00:00
|
|
|
bool (*Paused)(PRUint32 state);
|
2014-08-11 10:06:29 +00:00
|
|
|
bool (*PoweredOff)(PRUint32 state);
|
2014-08-11 10:06:14 +00:00
|
|
|
} uniformedMachineStateChecker;
|
|
|
|
|
2014-08-11 10:06:04 +00:00
|
|
|
typedef struct {
|
|
|
|
/* vbox API version */
|
|
|
|
uint32_t APIVersion;
|
|
|
|
uint32_t XPCOMCVersion;
|
|
|
|
/* vbox APIs */
|
2016-12-29 20:34:32 +00:00
|
|
|
nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIID *iid, IMachine **machine);
|
2014-08-11 10:06:18 +00:00
|
|
|
void (*deleteConfig)(IMachine *machine);
|
2016-11-23 19:01:11 +00:00
|
|
|
void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
|
2014-08-11 10:06:36 +00:00
|
|
|
virDomainState (*vboxConvertState)(PRUint32 state);
|
2014-08-11 10:07:03 +00:00
|
|
|
int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot);
|
2014-08-11 10:06:04 +00:00
|
|
|
vboxUniformedPFN UPFN;
|
2014-08-11 10:06:06 +00:00
|
|
|
vboxUniformedIID UIID;
|
2014-08-11 10:06:14 +00:00
|
|
|
vboxUniformedArray UArray;
|
2014-08-11 10:06:06 +00:00
|
|
|
vboxUniformednsISupports nsUISupports;
|
2014-08-11 10:06:04 +00:00
|
|
|
vboxUniformedIVirtualBox UIVirtualBox;
|
2014-08-11 10:06:14 +00:00
|
|
|
vboxUniformedIMachine UIMachine;
|
2014-08-11 10:06:06 +00:00
|
|
|
vboxUniformedISession UISession;
|
|
|
|
vboxUniformedIConsole UIConsole;
|
|
|
|
vboxUniformedIProgress UIProgress;
|
2014-08-11 10:06:12 +00:00
|
|
|
vboxUniformedISystemProperties UISystemProperties;
|
2014-08-11 10:06:19 +00:00
|
|
|
vboxUniformedIBIOSSettings UIBIOSSettings;
|
|
|
|
vboxUniformedIAudioAdapter UIAudioAdapter;
|
|
|
|
vboxUniformedINetworkAdapter UINetworkAdapter;
|
|
|
|
vboxUniformedISerialPort UISerialPort;
|
|
|
|
vboxUniformedIParallelPort UIParallelPort;
|
2016-12-29 20:34:30 +00:00
|
|
|
vboxUniformedIVRDEServer UIVRDEServer;
|
2014-08-11 10:06:19 +00:00
|
|
|
vboxUniformedIUSBCommon UIUSBCommon;
|
|
|
|
vboxUniformedIUSBDeviceFilter UIUSBDeviceFilter;
|
|
|
|
vboxUniformedIMedium UIMedium;
|
2014-08-11 10:06:42 +00:00
|
|
|
vboxUniformedIMediumAttachment UIMediumAttachment;
|
|
|
|
vboxUniformedIStorageController UIStorageController;
|
|
|
|
vboxUniformedISharedFolder UISharedFolder;
|
2014-08-11 10:06:54 +00:00
|
|
|
vboxUniformedISnapshot UISnapshot;
|
2014-08-11 10:07:05 +00:00
|
|
|
vboxUniformedIDisplay UIDisplay;
|
2014-10-02 03:30:32 +00:00
|
|
|
vboxUniformedIHost UIHost;
|
2014-10-02 03:30:28 +00:00
|
|
|
vboxUniformedIHNInterface UIHNInterface;
|
2014-10-02 03:30:34 +00:00
|
|
|
vboxUniformedIDHCPServer UIDHCPServer;
|
2015-04-07 15:37:35 +00:00
|
|
|
vboxUniformedIKeyboard UIKeyboard;
|
2014-08-11 10:06:14 +00:00
|
|
|
uniformedMachineStateChecker machineStateChecker;
|
2014-08-11 10:06:04 +00:00
|
|
|
/* vbox API features */
|
2014-08-11 10:06:19 +00:00
|
|
|
bool chipsetType;
|
2014-08-11 10:06:52 +00:00
|
|
|
bool vboxSnapshotRedefine;
|
2014-08-11 10:06:04 +00:00
|
|
|
} vboxUniformedAPI;
|
|
|
|
|
2014-08-11 10:06:17 +00:00
|
|
|
virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
|
|
|
|
const unsigned char *uuid);
|
2014-08-11 10:06:04 +00:00
|
|
|
|
|
|
|
/* Version specified functions for installing uniformed API */
|
2017-11-07 22:36:34 +00:00
|
|
|
void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
|