On 02.10.2014 05:30, Taowei wrote:
---
src/vbox/vbox_common.h | 15 ++++++++++
src/vbox/vbox_network.c | 55 ++++++++++++++++++++++++++++++++++
src/vbox/vbox_tmpl.c | 65 ++++++++++++++++++++---------------------
src/vbox/vbox_uniformed_api.h | 10 +++++++
4 files changed, 111 insertions(+), 34 deletions(-)
diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h
index b5a0353..9f5385b 100644
--- a/src/vbox/vbox_common.h
+++ b/src/vbox/vbox_common.h
@@ -265,6 +265,19 @@ enum MediumVariant
MediumVariant_Diff = 0x20000
};
+enum HostNetworkInterfaceStatus
+{
+ HostNetworkInterfaceStatus_Unknown = 0,
+ HostNetworkInterfaceStatus_Up = 1,
+ HostNetworkInterfaceStatus_Down = 2
+};
+
+enum HostNetworkInterfaceType
+{
+ HostNetworkInterfaceType_Bridged = 1,
+ HostNetworkInterfaceType_HostOnly = 2
+};
+
# define VBOX_E_OBJECT_NOT_FOUND 0x80BB0001
# define VBOX_E_INVALID_VM_STATE 0x80BB0002
# define VBOX_E_VM_ERROR 0x80BB0003
@@ -302,5 +315,7 @@ typedef nsISupports IStorageController;
typedef nsISupports ISharedFolder;
typedef nsISupports ISnapshot;
typedef nsISupports IDisplay;
+typedef nsISupports IHost;
+typedef nsISupports IHostNetworkInterface;
#endif /* VBOX_COMMON_H */
diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c
index af38562..b2e9060 100644
--- a/src/vbox/vbox_network.c
+++ b/src/vbox/vbox_network.c
@@ -31,6 +31,16 @@
VIR_LOG_INIT("vbox.vbox_network");
+#define VBOX_RELEASE(arg) \
+ do { \
+ if (arg) { \
+ gVBoxAPI.nsUISupports.Release((void *)arg); \
The last character is a bit off indentation.
+ (arg) = NULL;
\
+ } \
+ } while (0)
+
+static vboxUniformedAPI gVBoxAPI;
+
Michal