[libvirt] [PATCH 04/12] Move virNWFilter related APIs out of libvirt.h.in

Daniel P. Berrange berrange at redhat.com
Thu Oct 23 12:58:26 UTC 2014


Create a new libvirt-nwfilter.h file to hold the public
API definitions for the virNWFilter type. This header
file is not self-contained, so applications will not directly
include it. They will contain to #include <libvirt/libvirt.h>
---
 docs/apibuild.py                   |  1 +
 include/libvirt/Makefile.am        |  1 +
 include/libvirt/libvirt-nwfilter.h | 95 ++++++++++++++++++++++++++++++++++++++
 include/libvirt/libvirt.h.in       | 64 +------------------------
 4 files changed, 98 insertions(+), 63 deletions(-)
 create mode 100644 include/libvirt/libvirt-nwfilter.h

diff --git a/docs/apibuild.py b/docs/apibuild.py
index 0e0f052..9a7cb72 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -25,6 +25,7 @@ included_files = {
   "libvirt-domain-snapshot.h": "header with general libvirt API definitions",
   "libvirt-interface.h": "header with general libvirt API definitions",
   "libvirt-network.h": "header with general libvirt API definitions",
+  "libvirt-nwfilter.h": "header with general libvirt API definitions",
   "virterror.h": "header with error specific API definitions",
   "libvirt.c": "Main interfaces for the libvirt library",
   "libvirt-domain.c": "Domain interfaces for the libvirt library",
diff --git a/include/libvirt/Makefile.am b/include/libvirt/Makefile.am
index 9e7b1fb..e169104 100644
--- a/include/libvirt/Makefile.am
+++ b/include/libvirt/Makefile.am
@@ -22,6 +22,7 @@ virinc_HEADERS = libvirt.h		\
 		 libvirt-domain-snapshot.h \
 		 libvirt-interface.h \
 		 libvirt-network.h \
+		 libvirt-nwfilter.h \
 		 libvirt-lxc.h		\
 		 libvirt-qemu.h		\
 		 virterror.h
diff --git a/include/libvirt/libvirt-nwfilter.h b/include/libvirt/libvirt-nwfilter.h
new file mode 100644
index 0000000..9f01c17
--- /dev/null
+++ b/include/libvirt/libvirt-nwfilter.h
@@ -0,0 +1,95 @@
+/*
+ * libvirt-nwfilter.h
+ * Summary: APIs for management of nwfilters
+ * Description: Provides APIs for the management of nwfilters
+ * Author: Daniel Veillard <veillard at redhat.com>
+ *
+ * Copyright (C) 2006-2014 Red Hat, Inc.
+ *
+ * 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/>.
+ */
+
+#ifndef __VIR_LIBVIRT_NWFILTER_H__
+# define __VIR_LIBVIRT_NWFILTER_H__
+
+# ifndef __VIR_LIBVIRT_H_INCLUDES__
+#  error "Don't include this file directly, only use libvirt/libvirt.h"
+# endif
+
+/**
+ * virNWFilter:
+ *
+ * a virNWFilter is a private structure representing a network filter
+ */
+typedef struct _virNWFilter virNWFilter;
+
+/**
+ * virNWFilterPtr:
+ *
+ * a virNWFilterPtr is pointer to a virNWFilter private structure,
+ * this is the type used to reference a network filter in the API.
+ */
+typedef virNWFilter *virNWFilterPtr;
+
+
+/*
+ * List NWFilters
+ */
+int                     virConnectNumOfNWFilters (virConnectPtr conn);
+int                     virConnectListNWFilters  (virConnectPtr conn,
+                                                  char **const names,
+                                                  int maxnames);
+int                     virConnectListAllNWFilters(virConnectPtr conn,
+                                                   virNWFilterPtr **filters,
+                                                   unsigned int flags);
+/*
+ * Lookup nwfilter by name or uuid
+ */
+virNWFilterPtr          virNWFilterLookupByName       (virConnectPtr conn,
+                                                       const char *name);
+virNWFilterPtr          virNWFilterLookupByUUID       (virConnectPtr conn,
+                                                       const unsigned char *uuid);
+virNWFilterPtr          virNWFilterLookupByUUIDString (virConnectPtr conn,
+                                                       const char *uuid);
+
+/*
+ * Define persistent nwfilter
+ */
+virNWFilterPtr          virNWFilterDefineXML    (virConnectPtr conn,
+                                                 const char *xmlDesc);
+
+/*
+ * Delete persistent nwfilter
+ */
+int                     virNWFilterUndefine     (virNWFilterPtr nwfilter);
+
+/*
+ * NWFilter destroy/free
+ */
+int                     virNWFilterRef          (virNWFilterPtr nwfilter);
+int                     virNWFilterFree         (virNWFilterPtr nwfilter);
+
+/*
+ * NWFilter information
+ */
+const char*             virNWFilterGetName       (virNWFilterPtr nwfilter);
+int                     virNWFilterGetUUID       (virNWFilterPtr nwfilter,
+                                                  unsigned char *uuid);
+int                     virNWFilterGetUUIDString (virNWFilterPtr nwfilter,
+                                                  char *buf);
+char *                  virNWFilterGetXMLDesc    (virNWFilterPtr nwfilter,
+                                                  unsigned int flags);
+
+#endif /* __VIR_LIBVIRT_NWFILTER_H__ */
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index e231bde..c37ab28 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4962,69 +4962,6 @@ int virConnectDomainEventDeregisterAny(virConnectPtr conn,
 
 
 /**
- * virNWFilter:
- *
- * a virNWFilter is a private structure representing a network filter
- */
-typedef struct _virNWFilter virNWFilter;
-
-/**
- * virNWFilterPtr:
- *
- * a virNWFilterPtr is pointer to a virNWFilter private structure,
- * this is the type used to reference a network filter in the API.
- */
-typedef virNWFilter *virNWFilterPtr;
-
-
-/*
- * List NWFilters
- */
-int                     virConnectNumOfNWFilters (virConnectPtr conn);
-int                     virConnectListNWFilters  (virConnectPtr conn,
-                                                  char **const names,
-                                                  int maxnames);
-int                     virConnectListAllNWFilters(virConnectPtr conn,
-                                                   virNWFilterPtr **filters,
-                                                   unsigned int flags);
-/*
- * Lookup nwfilter by name or uuid
- */
-virNWFilterPtr          virNWFilterLookupByName       (virConnectPtr conn,
-                                                       const char *name);
-virNWFilterPtr          virNWFilterLookupByUUID       (virConnectPtr conn,
-                                                       const unsigned char *uuid);
-virNWFilterPtr          virNWFilterLookupByUUIDString (virConnectPtr conn,
-                                                       const char *uuid);
-
-/*
- * Define persistent nwfilter
- */
-virNWFilterPtr          virNWFilterDefineXML    (virConnectPtr conn,
-                                                 const char *xmlDesc);
-
-/*
- * Delete persistent nwfilter
- */
-int                     virNWFilterUndefine     (virNWFilterPtr nwfilter);
-
-/*
- * NWFilter destroy/free
- */
-int                     virNWFilterRef          (virNWFilterPtr nwfilter);
-int                     virNWFilterFree         (virNWFilterPtr nwfilter);
-
-/*
- * NWFilter information
- */
-const char*             virNWFilterGetName       (virNWFilterPtr nwfilter);
-int                     virNWFilterGetUUID       (virNWFilterPtr nwfilter,
-                                                  unsigned char *uuid);
-int                     virNWFilterGetUUIDString (virNWFilterPtr nwfilter,
-                                                  char *buf);
-char *                  virNWFilterGetXMLDesc    (virNWFilterPtr nwfilter,
-                                                  unsigned int flags);
-/**
  * virDomainConsoleFlags
  *
  * Since 0.9.10
@@ -5265,6 +5202,7 @@ typedef virMemoryParameter *virMemoryParameterPtr;
 #include <libvirt/libvirt-domain-snapshot.h>
 #include <libvirt/libvirt-interface.h>
 #include <libvirt/libvirt-network.h>
+#include <libvirt/libvirt-nwfilter.h>
 #undef __VIR_LIBVIRT_H_INCLUDES__
 
 #ifdef __cplusplus
-- 
2.1.0




More information about the libvir-list mailing list