[Libvirt-cim] [V4 PATCH 7/8] vlan library - add interface for CIM model code

Wenchao Xia xiawenc at linux.vnet.ibm.com
Wed Jan 18 09:43:02 UTC 2012


    This patch simple add APIs.

Signed-off-by: Wenchao Xia <xiawenc at cn.ibm.com>
---
 libnetwork/host_network_API.c |   30 ++++++++++++++++++++++++++++++
 libnetwork/host_network_API.h |   25 +++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 libnetwork/host_network_API.c
 create mode 100644 libnetwork/host_network_API.h

diff --git a/libnetwork/host_network_API.c b/libnetwork/host_network_API.c
new file mode 100644
index 0000000..975dbda
--- /dev/null
+++ b/libnetwork/host_network_API.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright IBM Corp. 2012
+ *
+ * Authors:
+ *  Wenchao Xia <xiawenc at cn.ibm.com>
+ *
+ * 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.
+ */
+
+
+#include "host_network_API.h"
+#include "host_network_implement_OSAPI.h"
+#include "host_network_error.h"
+
+/* this layer is added to devide the abstraction and implemention, so that
+   different implemention could be used and switched */
+
+int get_host_ifaces(EthIfacesList *plist,
+                        eth_iface_filter_func filter_func, void *filter_opaque)
+{
+    return get_host_eth_ifaces_osapi(plist, filter_func, filter_opaque);
+}
+
+char *get_host_iface_error_reason(int errno)
+{
+    return translate_error_no(errno);
+}
diff --git a/libnetwork/host_network_API.h b/libnetwork/host_network_API.h
new file mode 100644
index 0000000..e3732a4
--- /dev/null
+++ b/libnetwork/host_network_API.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright IBM Corp. 2012
+ *
+ * Authors:
+ *  Wenchao Xia <xiawenc at cn.ibm.com>
+ *
+ * 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.
+ */
+
+#ifndef HOST_NETWORK_API
+#define HOST_NETWORK_API
+
+#include "dll_magic.h"
+#include "host_network_basic.h"
+#include "host_network_helper.h"
+
+DLL_PUBLIC int get_host_ifaces(EthIfacesList *plist,
+                        eth_iface_filter_func filter_func, void *filter_opaque);
+
+DLL_PUBLIC char *get_host_iface_error_reason(int errno);
+
+#endif
-- 
1.7.1





More information about the Libvirt-cim mailing list