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