[libvirt] [PATCH v4 03/15] Add internal API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds the internal API extensions for network filtering (ACL) support.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

---
 src/driver.h |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

Index: libvirt-acl/src/driver.h
===================================================================
--- libvirt-acl.orig/src/driver.h
+++ libvirt-acl/src/driver.h
@@ -994,6 +994,58 @@ struct _virStreamDriver {
 };
 
 
+typedef int
+    (*virDrvConnectNumOfNWFilters)        (virConnectPtr conn);
+typedef int
+    (*virDrvConnectListNWFilters)         (virConnectPtr conn,
+                                           char **const names,
+                                           int maxnames);
+typedef virNWFilterPtr
+    (*virDrvNWFilterLookupByName)             (virConnectPtr conn,
+                                               const char *name);
+typedef virNWFilterPtr
+    (*virDrvNWFilterLookupByUUID)             (virConnectPtr conn,
+                                               const unsigned char *uuid);
+typedef virNWFilterPtr
+    (*virDrvNWFilterDefineXML)                (virConnectPtr conn,
+                                               const char *xmlDesc,
+                                               unsigned int flags);
+typedef int
+    (*virDrvNWFilterUndefine)                 (virNWFilterPtr pool);
+
+typedef char *
+    (*virDrvNWFilterGetXMLDesc)              (virNWFilterPtr pool,
+                                              unsigned int flags);
+
+
+typedef struct _virNWFilterDriver virNWFilterDriver;
+typedef virNWFilterDriver *virNWFilterDriverPtr;
+
+/**
+ * _virNWFilterDriver:
+ *
+ * Structure associated to a network filter driver, defining the various
+ * entry points for it.
+ *
+ * All drivers must support the following fields/methods:
+ *  - open
+ *  - close
+ */
+struct _virNWFilterDriver {
+    const char * name;    /* the name of the driver */
+    virDrvOpen            open;
+    virDrvClose           close;
+
+    virDrvConnectNumOfNWFilters numOfNWFilters;
+    virDrvConnectListNWFilters listNWFilters;
+    virDrvNWFilterLookupByName nwfilterLookupByName;
+    virDrvNWFilterLookupByUUID nwfilterLookupByUUID;
+    virDrvNWFilterDefineXML defineXML;
+    virDrvNWFilterUndefine undefine;
+    virDrvNWFilterGetXMLDesc getXMLDesc;
+};
+
+
 /*
  * Registration
  * TODO: also need ways to (des)activate a given driver
@@ -1005,6 +1057,7 @@ int virRegisterInterfaceDriver(virInterf
 int virRegisterStorageDriver(virStorageDriverPtr);
 int virRegisterDeviceMonitor(virDeviceMonitorPtr);
 int virRegisterSecretDriver(virSecretDriverPtr);
+int virRegisterNWFilterDriver(virNWFilterDriverPtr);
 # ifdef WITH_LIBVIRTD
 int virRegisterStateDriver(virStateDriverPtr);
 # endif

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]