mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
conf: nwfilter: use #pragma once in headers
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
54c5224e75
commit
44dc50ec23
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user