Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/conf/nwfilter_conf.h | 93 ++++++++++++++--------------
src/conf/nwfilter_ipaddrmap.h | 5 +-
src/conf/nwfilter_params.h | 28 ++++-----
src/conf/virnwfilterbindingdef.h | 13 ++--
src/conf/virnwfilterbindingobj.h | 11 ++--
src/conf/virnwfilterbindingobjlist.h | 8 +--
src/conf/virnwfilterobj.h | 11 ++--
7 files changed, 73 insertions(+), 96 deletions(-)
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index 4366ccc4d1..13db58e380 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -22,18 +22,17 @@
* <
http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_NWFILTER_CONF_H
-# define LIBVIRT_NWFILTER_CONF_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# include "virhash.h"
-# include "virxml.h"
-# include "virbuffer.h"
-# include "virsocketaddr.h"
-# include "virmacaddr.h"
-# include "virdomainobjlist.h"
-# include "virenum.h"
+#include "virhash.h"
+#include "virxml.h"
+#include "virbuffer.h"
+#include "virsocketaddr.h"
+#include "virmacaddr.h"
+#include "virdomainobjlist.h"
+#include "virenum.h"
/* XXX
* The config parser/structs should not be using platform specific
@@ -41,21 +40,21 @@
* so temporarily define them until this can be re-written to use
* locally defined enums for all constants
*/
-# ifndef ETHERTYPE_IP
-# define ETHERTYPE_IP 0x0800
-# endif
-# ifndef ETHERTYPE_ARP
-# define ETHERTYPE_ARP 0x0806
-# endif
-# ifndef ETHERTYPE_REVARP
-# define ETHERTYPE_REVARP 0x8035
-# endif
-# ifndef ETHERTYPE_IPV6
-# define ETHERTYPE_IPV6 0x86dd
-# endif
-# ifndef ETHERTYPE_VLAN
-# define ETHERTYPE_VLAN 0x8100
-# endif
+#ifndef ETHERTYPE_IP
+# define ETHERTYPE_IP 0x0800
+#endif
+#ifndef ETHERTYPE_ARP
+# define ETHERTYPE_ARP 0x0806
+#endif
+#ifndef ETHERTYPE_REVARP
+# define ETHERTYPE_REVARP 0x8035
+#endif
+#ifndef ETHERTYPE_IPV6
+# define ETHERTYPE_IPV6 0x86dd
+#endif
+#ifndef ETHERTYPE_VLAN
+# define ETHERTYPE_VLAN 0x8100
+#endif
/**
* Chain suffix size is:
@@ -66,7 +65,7 @@
* terminating '0' =
* 32-3-15-1-1 = 12
*/
-# define MAX_CHAIN_SUFFIX_SIZE 12
+#define MAX_CHAIN_SUFFIX_SIZE 12
typedef enum {
@@ -76,13 +75,13 @@ typedef enum {
} virNWFilterEntryItemFlags;
-# define MAX_COMMENT_LENGTH 256
-# define MAX_IPSET_NAME_LENGTH 32 /* incl. terminating '\0' */
+#define MAX_COMMENT_LENGTH 256
+#define MAX_IPSET_NAME_LENGTH 32 /* incl. terminating '\0' */
-# define HAS_ENTRY_ITEM(data) \
+#define HAS_ENTRY_ITEM(data) \
(((data)->flags) & NWFILTER_ENTRY_ITEM_FLAG_EXISTS)
-# define ENTRY_WANT_NEG_SIGN(data) \
+#define ENTRY_WANT_NEG_SIGN(data) \
(((data)->flags) & NWFILTER_ENTRY_ITEM_FLAG_IS_NEG)
/* datatypes appearing in rule attributes */
@@ -108,7 +107,7 @@ typedef enum attrDatatype {
DATATYPE_LAST = (1 << 17),
} virNWFilterAttrDataType;
-# define NWFILTER_MAC_BGA "01:80:c2:00:00:00"
+#define NWFILTER_MAC_BGA "01:80:c2:00:00:00"
typedef struct _nwItemDesc nwItemDesc;
@@ -138,7 +137,7 @@ struct _nwItemDesc {
} u;
};
-# define VALID_IPSETNAME \
+#define VALID_IPSETNAME \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-+ "
typedef struct _ethHdrDataDef ethHdrDataDef;
@@ -426,20 +425,20 @@ typedef enum {
} virNWFilterEbtablesTableType;
-# define MIN_RULE_PRIORITY -1000
-# define MAX_RULE_PRIORITY 1000
+#define MIN_RULE_PRIORITY -1000
+#define MAX_RULE_PRIORITY 1000
-# define NWFILTER_MIN_FILTER_PRIORITY -1000
-# define NWFILTER_MAX_FILTER_PRIORITY MAX_RULE_PRIORITY
+#define NWFILTER_MIN_FILTER_PRIORITY -1000
+#define NWFILTER_MAX_FILTER_PRIORITY MAX_RULE_PRIORITY
-# define NWFILTER_ROOT_FILTER_PRI 0
-# define NWFILTER_STP_FILTER_PRI -810
-# define NWFILTER_MAC_FILTER_PRI -800
-# define NWFILTER_VLAN_FILTER_PRI -750
-# define NWFILTER_IPV4_FILTER_PRI -700
-# define NWFILTER_IPV6_FILTER_PRI -600
-# define NWFILTER_ARP_FILTER_PRI -500
-# define NWFILTER_RARP_FILTER_PRI -400
+#define NWFILTER_ROOT_FILTER_PRI 0
+#define NWFILTER_STP_FILTER_PRI -810
+#define NWFILTER_MAC_FILTER_PRI -800
+#define NWFILTER_VLAN_FILTER_PRI -750
+#define NWFILTER_IPV4_FILTER_PRI -700
+#define NWFILTER_IPV6_FILTER_PRI -600
+#define NWFILTER_ARP_FILTER_PRI -500
+#define NWFILTER_RARP_FILTER_PRI -400
typedef enum {
RULE_FLAG_NO_STATEMATCH = (1 << 0),
@@ -451,7 +450,7 @@ typedef enum {
} virNWFilterRuleFlags;
-# define IPTABLES_STATE_FLAGS \
+#define IPTABLES_STATE_FLAGS \
(RULE_FLAG_STATE_NEW | \
RULE_FLAG_STATE_ESTABLISHED | \
RULE_FLAG_STATE_RELATED | \
@@ -525,7 +524,7 @@ typedef enum {
VIR_NWFILTER_CHAINSUFFIX_LAST,
} virNWFilterChainSuffixType;
-# define VALID_CHAINNAME \
+#define VALID_CHAINNAME \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-"
typedef int32_t virNWFilterChainPriority;
@@ -615,5 +614,3 @@ VIR_ENUM_DECL(virNWFilterJumpTarget);
VIR_ENUM_DECL(virNWFilterChainPolicy);
VIR_ENUM_DECL(virNWFilterEbtablesTable);
VIR_ENUM_DECL(virNWFilterChainSuffix);
-
-#endif /* LIBVIRT_NWFILTER_CONF_H */
diff --git a/src/conf/nwfilter_ipaddrmap.h b/src/conf/nwfilter_ipaddrmap.h
index 13e763ae7e..ebb999a29a 100644
--- a/src/conf/nwfilter_ipaddrmap.h
+++ b/src/conf/nwfilter_ipaddrmap.h
@@ -20,8 +20,7 @@
*
*/
-#ifndef LIBVIRT_NWFILTER_IPADDRMAP_H
-# define LIBVIRT_NWFILTER_IPADDRMAP_H
+#pragma once
int virNWFilterIPAddrMapInit(void);
void virNWFilterIPAddrMapShutdown(void);
@@ -30,5 +29,3 @@ int virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr);
int virNWFilterIPAddrMapDelIPAddr(const char *ifname,
const char *ipaddr);
virNWFilterVarValuePtr virNWFilterIPAddrMapGetIPAddr(const char *ifname);
-
-#endif /* LIBVIRT_NWFILTER_IPADDRMAP_H */
diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h
index 9abeeba43a..d51f3f7f9f 100644
--- a/src/conf/nwfilter_params.h
+++ b/src/conf/nwfilter_params.h
@@ -19,13 +19,12 @@
* <
http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_NWFILTER_PARAMS_H
-# define LIBVIRT_NWFILTER_PARAMS_H
+#pragma once
-# include "virhash.h"
-# include "virbuffer.h"
-# include "virmacaddr.h"
-# include "virxml.h"
+#include "virhash.h"
+#include "virbuffer.h"
+#include "virmacaddr.h"
+#include "virxml.h"
typedef enum {
NWFILTER_VALUE_TYPE_SIMPLE,
@@ -74,16 +73,16 @@ int virNWFilterHashTablePutAll(virHashTablePtr src,
bool virNWFilterHashTableEqual(virHashTablePtr a,
virHashTablePtr b);
-# define VALID_VARNAME \
+#define VALID_VARNAME \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
-# define VALID_VARVALUE \
+#define VALID_VARVALUE \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:"
-# define NWFILTER_VARNAME_IP "IP"
-# define NWFILTER_VARNAME_MAC "MAC"
-# define NWFILTER_VARNAME_CTRL_IP_LEARNING "CTRL_IP_LEARNING"
-# define NWFILTER_VARNAME_DHCPSERVER "DHCPSERVER"
+#define NWFILTER_VARNAME_IP "IP"
+#define NWFILTER_VARNAME_MAC "MAC"
+#define NWFILTER_VARNAME_CTRL_IP_LEARNING "CTRL_IP_LEARNING"
+#define NWFILTER_VARNAME_DHCPSERVER "DHCPSERVER"
typedef enum {
VIR_NWFILTER_VAR_ACCESS_ELEMENT = 0,
@@ -106,7 +105,7 @@ struct _virNWFilterVarAccess {
char *varName;
};
-# define VIR_NWFILTER_MAX_ITERID 1000
+#define VIR_NWFILTER_MAX_ITERID 1000
void virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess);
bool virNWFilterVarAccessEqual(const virNWFilterVarAccess *a,
@@ -150,6 +149,3 @@ virNWFilterVarCombIterPtr virNWFilterVarCombIterNext(
virNWFilterVarCombIterPtr ci);
const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci,
const virNWFilterVarAccess *);
-
-
-#endif /* LIBVIRT_NWFILTER_PARAMS_H */
diff --git a/src/conf/virnwfilterbindingdef.h b/src/conf/virnwfilterbindingdef.h
index 7cd2890b15..3d291fd6bf 100644
--- a/src/conf/virnwfilterbindingdef.h
+++ b/src/conf/virnwfilterbindingdef.h
@@ -19,13 +19,12 @@
*
*/
-#ifndef LIBVIRT_VIRNWFILTERBINDINGDEF_H
-# define LIBVIRT_VIRNWFILTERBINDINGDEF_H
+#pragma once
-# include "internal.h"
-# include "virmacaddr.h"
-# include "virhash.h"
-# include "virbuffer.h"
+#include "internal.h"
+#include "virmacaddr.h"
+#include "virhash.h"
+#include "virbuffer.h"
typedef struct _virNWFilterBindingDef virNWFilterBindingDef;
typedef virNWFilterBindingDef *virNWFilterBindingDefPtr;
@@ -62,5 +61,3 @@ virNWFilterBindingDefFormat(const virNWFilterBindingDef *def);
int
virNWFilterBindingDefFormatBuf(virBufferPtr buf,
const virNWFilterBindingDef *def);
-
-#endif /* LIBVIRT_VIRNWFILTERBINDINGDEF_H */
diff --git a/src/conf/virnwfilterbindingobj.h b/src/conf/virnwfilterbindingobj.h
index b26bb3c8ec..2318f042bc 100644
--- a/src/conf/virnwfilterbindingobj.h
+++ b/src/conf/virnwfilterbindingobj.h
@@ -19,12 +19,11 @@
*
*/
-#ifndef LIBVIRT_VIRNWFILTERBINDINGOBJ_H
-# define LIBVIRT_VIRNWFILTERBINDINGOBJ_H
+#pragma once
-# include "internal.h"
-# include "virnwfilterbindingdef.h"
-# include "virobject.h"
+#include "internal.h"
+#include "virnwfilterbindingdef.h"
+#include "virobject.h"
typedef struct _virNWFilterBindingObj virNWFilterBindingObj;
typedef virNWFilterBindingObj *virNWFilterBindingObjPtr;
@@ -69,5 +68,3 @@ virNWFilterBindingObjParseFile(const char *filename);
char *
virNWFilterBindingObjFormat(const virNWFilterBindingObj *obj);
-
-#endif /* LIBVIRT_VIRNWFILTERBINDINGOBJ_H */
diff --git a/src/conf/virnwfilterbindingobjlist.h b/src/conf/virnwfilterbindingobjlist.h
index b0fb90f667..a819b4cc8a 100644
--- a/src/conf/virnwfilterbindingobjlist.h
+++ b/src/conf/virnwfilterbindingobjlist.h
@@ -18,10 +18,9 @@
* <
http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H
-# define LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H
+#pragma once
-# include "virnwfilterbindingobj.h"
+#include "virnwfilterbindingobj.h"
typedef struct _virNWFilterBindingObjList virNWFilterBindingObjList;
typedef virNWFilterBindingObjList *virNWFilterBindingObjListPtr;
@@ -62,6 +61,3 @@ virNWFilterBindingObjListExport(virNWFilterBindingObjListPtr bindings,
virConnectPtr conn,
virNWFilterBindingPtr **bindinglist,
virNWFilterBindingObjListACLFilter filter);
-
-
-#endif /* LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H */
diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h
index 2369c20313..bdf5c51fe2 100644
--- a/src/conf/virnwfilterobj.h
+++ b/src/conf/virnwfilterobj.h
@@ -17,13 +17,12 @@
* <
http://www.gnu.org/licenses/>.
*/
-#ifndef LIBVIRT_VIRNWFILTEROBJ_H
-# define LIBVIRT_VIRNWFILTEROBJ_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# include "nwfilter_conf.h"
-# include "virnwfilterbindingobjlist.h"
+#include "nwfilter_conf.h"
+#include "virnwfilterbindingobjlist.h"
typedef struct _virNWFilterObj virNWFilterObj;
typedef virNWFilterObj *virNWFilterObjPtr;
@@ -114,5 +113,3 @@ virNWFilterObjLock(virNWFilterObjPtr obj);
void
virNWFilterObjUnlock(virNWFilterObjPtr obj);
-
-#endif /* LIBVIRT_VIRNWFILTEROBJ_H */
--
2.20.1