mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 17:17:56 +03:00
nwfilter: define a typedef for struct ebtablesSubChainInst
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b9f829b66f
commit
ad668b98e9
@ -3269,7 +3269,9 @@ ebtablesRuleInstCommand(virFirewallPtr fw,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ebtablesSubChainInst {
|
typedef struct _ebtablesSubChainInst ebtablesSubChainInst;
|
||||||
|
typedef ebtablesSubChainInst *ebtablesSubChainInstPtr;
|
||||||
|
struct _ebtablesSubChainInst {
|
||||||
virNWFilterChainPriority priority;
|
virNWFilterChainPriority priority;
|
||||||
bool incoming;
|
bool incoming;
|
||||||
enum l3_proto_idx protoidx;
|
enum l3_proto_idx protoidx;
|
||||||
@ -3280,8 +3282,8 @@ struct ebtablesSubChainInst {
|
|||||||
static int
|
static int
|
||||||
ebtablesSubChainInstSort(const void *a, const void *b)
|
ebtablesSubChainInstSort(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
const struct ebtablesSubChainInst **insta = (const struct ebtablesSubChainInst **)a;
|
const ebtablesSubChainInst **insta = (const ebtablesSubChainInst **)a;
|
||||||
const struct ebtablesSubChainInst **instb = (const struct ebtablesSubChainInst **)b;
|
const ebtablesSubChainInst **instb = (const ebtablesSubChainInst **)b;
|
||||||
|
|
||||||
/* priorities are limited to range [-1000, 1000] */
|
/* priorities are limited to range [-1000, 1000] */
|
||||||
return (*insta)->priority - (*instb)->priority;
|
return (*insta)->priority - (*instb)->priority;
|
||||||
@ -3291,7 +3293,7 @@ ebtablesSubChainInstSort(const void *a, const void *b)
|
|||||||
static int
|
static int
|
||||||
ebtablesGetSubChainInsts(virHashTablePtr chains,
|
ebtablesGetSubChainInsts(virHashTablePtr chains,
|
||||||
bool incoming,
|
bool incoming,
|
||||||
struct ebtablesSubChainInst ***insts,
|
ebtablesSubChainInstPtr **insts,
|
||||||
size_t *ninsts)
|
size_t *ninsts)
|
||||||
{
|
{
|
||||||
virHashKeyValuePairPtr filter_names;
|
virHashKeyValuePairPtr filter_names;
|
||||||
@ -3304,7 +3306,7 @@ ebtablesGetSubChainInsts(virHashTablePtr chains,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (i = 0; filter_names[i].key; i++) {
|
for (i = 0; filter_names[i].key; i++) {
|
||||||
struct ebtablesSubChainInst *inst;
|
ebtablesSubChainInstPtr inst;
|
||||||
enum l3_proto_idx idx = ebtablesGetProtoIdxByFiltername(
|
enum l3_proto_idx idx = ebtablesGetProtoIdxByFiltername(
|
||||||
filter_names[i].key);
|
filter_names[i].key);
|
||||||
|
|
||||||
@ -3344,7 +3346,7 @@ ebiptablesApplyNewRules(const char *ifname,
|
|||||||
bool haveEbtables = false;
|
bool haveEbtables = false;
|
||||||
bool haveIptables = false;
|
bool haveIptables = false;
|
||||||
bool haveIp6tables = false;
|
bool haveIp6tables = false;
|
||||||
struct ebtablesSubChainInst **subchains = NULL;
|
ebtablesSubChainInstPtr *subchains = NULL;
|
||||||
size_t nsubchains = 0;
|
size_t nsubchains = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user