mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 11:01:19 +00:00
Remove virDomainNetType parameter from nwfilter drivers
The 'virDomainNetType' is unused in every impl of the virNWFilterRuleCreateInstance driver method. Remove it from the code to avoid the dependancy on the external enum. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
bc46c7fb92
commit
50859fc1dd
@ -137,7 +137,6 @@ struct _virNWFilterSnoopReq {
|
|||||||
char *ifname;
|
char *ifname;
|
||||||
int ifindex;
|
int ifindex;
|
||||||
char *linkdev;
|
char *linkdev;
|
||||||
enum virDomainNetType nettype;
|
|
||||||
char ifkey[VIR_IFKEY_LEN];
|
char ifkey[VIR_IFKEY_LEN];
|
||||||
virMacAddr macaddr;
|
virMacAddr macaddr;
|
||||||
char *filtername;
|
char *filtername;
|
||||||
@ -493,7 +492,6 @@ virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl,
|
|||||||
req->ifname,
|
req->ifname,
|
||||||
req->ifindex,
|
req->ifindex,
|
||||||
req->linkdev,
|
req->linkdev,
|
||||||
req->nettype,
|
|
||||||
&req->macaddr,
|
&req->macaddr,
|
||||||
req->filtername,
|
req->filtername,
|
||||||
req->vars);
|
req->vars);
|
||||||
@ -879,7 +877,6 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
|
|||||||
req->ifname,
|
req->ifname,
|
||||||
req->ifindex,
|
req->ifindex,
|
||||||
req->linkdev,
|
req->linkdev,
|
||||||
req->nettype,
|
|
||||||
&req->macaddr,
|
&req->macaddr,
|
||||||
req->filtername,
|
req->filtername,
|
||||||
req->vars);
|
req->vars);
|
||||||
@ -1592,7 +1589,6 @@ int
|
|||||||
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
|
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const unsigned char *vmuuid,
|
const unsigned char *vmuuid,
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
@ -1628,7 +1624,6 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
|
|||||||
req->driver = driver;
|
req->driver = driver;
|
||||||
req->techdriver = techdriver;
|
req->techdriver = techdriver;
|
||||||
tmp = virNetDevGetIndex(ifname, &req->ifindex);
|
tmp = virNetDevGetIndex(ifname, &req->ifindex);
|
||||||
req->nettype = nettype;
|
|
||||||
virMacAddrSet(&req->macaddr, macaddr);
|
virMacAddrSet(&req->macaddr, macaddr);
|
||||||
req->vars = virNWFilterHashTableCreate(0);
|
req->vars = virNWFilterHashTableCreate(0);
|
||||||
req->linkdev = NULL;
|
req->linkdev = NULL;
|
||||||
@ -2230,7 +2225,6 @@ int
|
|||||||
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
|
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
|
||||||
const char *ifname ATTRIBUTE_UNUSED,
|
const char *ifname ATTRIBUTE_UNUSED,
|
||||||
const char *linkdev ATTRIBUTE_UNUSED,
|
const char *linkdev ATTRIBUTE_UNUSED,
|
||||||
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
|
|
||||||
const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
||||||
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
|
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
|
||||||
const char *filtername ATTRIBUTE_UNUSED,
|
const char *filtername ATTRIBUTE_UNUSED,
|
||||||
|
@ -32,7 +32,6 @@ void virNWFilterDHCPSnoopShutdown(void);
|
|||||||
int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
|
int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const unsigned char *vmuuid,
|
const unsigned char *vmuuid,
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
|
@ -2649,8 +2649,7 @@ ebtablesCreateRuleInstance(char chainPrefix,
|
|||||||
* pointed to by res, -1 otherwise
|
* pointed to by res, -1 otherwise
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
|
ebiptablesCreateRuleInstance(virNWFilterDefPtr nwfilter,
|
||||||
virNWFilterDefPtr nwfilter,
|
|
||||||
virNWFilterRuleDefPtr rule,
|
virNWFilterRuleDefPtr rule,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterVarCombIterPtr vars,
|
virNWFilterVarCombIterPtr vars,
|
||||||
@ -2740,9 +2739,7 @@ ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ebiptablesCreateRuleInstanceIterate(
|
ebiptablesCreateRuleInstanceIterate(virNWFilterDefPtr nwfilter,
|
||||||
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
|
|
||||||
virNWFilterDefPtr nwfilter,
|
|
||||||
virNWFilterRuleDefPtr rule,
|
virNWFilterRuleDefPtr rule,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterHashTablePtr vars,
|
virNWFilterHashTablePtr vars,
|
||||||
@ -2761,8 +2758,7 @@ ebiptablesCreateRuleInstanceIterate(
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
rc = ebiptablesCreateRuleInstance(nettype,
|
rc = ebiptablesCreateRuleInstance(nwfilter,
|
||||||
nwfilter,
|
|
||||||
rule,
|
rule,
|
||||||
ifname,
|
ifname,
|
||||||
tmp,
|
tmp,
|
||||||
|
@ -289,7 +289,6 @@ virNWFilterPrintVars(virHashTablePtr vars,
|
|||||||
*/
|
*/
|
||||||
static virNWFilterRuleInstPtr
|
static virNWFilterRuleInstPtr
|
||||||
virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
|
virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
virNWFilterDefPtr filter,
|
virNWFilterDefPtr filter,
|
||||||
virNWFilterRuleDefPtr rule,
|
virNWFilterRuleDefPtr rule,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
@ -304,7 +303,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
|
|||||||
|
|
||||||
ret->techdriver = techdriver;
|
ret->techdriver = techdriver;
|
||||||
|
|
||||||
rc = techdriver->createRuleInstance(nettype, filter,
|
rc = techdriver->createRuleInstance(filter,
|
||||||
rule, ifname, vars, ret);
|
rule, ifname, vars, ret);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
@ -376,7 +375,6 @@ virNWFilterCreateVarsFrom(virNWFilterHashTablePtr vars1,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
_virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
_virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
virNWFilterDefPtr filter,
|
virNWFilterDefPtr filter,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterHashTablePtr vars,
|
virNWFilterHashTablePtr vars,
|
||||||
@ -396,7 +394,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
|||||||
virNWFilterIncludeDefPtr inc = filter->filterEntries[i]->include;
|
virNWFilterIncludeDefPtr inc = filter->filterEntries[i]->include;
|
||||||
if (rule) {
|
if (rule) {
|
||||||
inst = virNWFilterRuleInstantiate(techdriver,
|
inst = virNWFilterRuleInstantiate(techdriver,
|
||||||
nettype,
|
|
||||||
filter,
|
filter,
|
||||||
rule,
|
rule,
|
||||||
ifname,
|
ifname,
|
||||||
@ -449,7 +446,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = _virNWFilterInstantiateRec(techdriver,
|
rc = _virNWFilterInstantiateRec(techdriver,
|
||||||
nettype,
|
|
||||||
next_filter,
|
next_filter,
|
||||||
ifname,
|
ifname,
|
||||||
tmpvars,
|
tmpvars,
|
||||||
@ -634,7 +630,6 @@ virNWFilterRuleInstancesToArray(int nEntries,
|
|||||||
static int
|
static int
|
||||||
virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
||||||
virNWFilterTechDriverPtr techdriver,
|
virNWFilterTechDriverPtr techdriver,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
virNWFilterDefPtr filter,
|
virNWFilterDefPtr filter,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
@ -690,7 +685,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
if (STRCASEEQ(learning, "dhcp")) {
|
if (STRCASEEQ(learning, "dhcp")) {
|
||||||
rc = virNWFilterDHCPSnoopReq(techdriver, ifname, linkdev,
|
rc = virNWFilterDHCPSnoopReq(techdriver, ifname, linkdev,
|
||||||
nettype, vmuuid, macaddr,
|
vmuuid, macaddr,
|
||||||
filter->name, vars, driver);
|
filter->name, vars, driver);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
} else if (STRCASEEQ(learning, "any")) {
|
} else if (STRCASEEQ(learning, "any")) {
|
||||||
@ -699,7 +694,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
|||||||
ifname,
|
ifname,
|
||||||
ifindex,
|
ifindex,
|
||||||
linkdev,
|
linkdev,
|
||||||
nettype, macaddr,
|
macaddr,
|
||||||
filter->name,
|
filter->name,
|
||||||
vars, driver,
|
vars, driver,
|
||||||
DETECT_DHCP|DETECT_STATIC);
|
DETECT_DHCP|DETECT_STATIC);
|
||||||
@ -723,7 +718,6 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = _virNWFilterInstantiateRec(techdriver,
|
rc = _virNWFilterInstantiateRec(techdriver,
|
||||||
nettype,
|
|
||||||
filter,
|
filter,
|
||||||
ifname,
|
ifname,
|
||||||
vars,
|
vars,
|
||||||
@ -805,7 +799,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
virNWFilterHashTablePtr filterparams,
|
virNWFilterHashTablePtr filterparams,
|
||||||
@ -892,7 +885,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
|
|||||||
|
|
||||||
rc = virNWFilterInstantiate(vmuuid,
|
rc = virNWFilterInstantiate(vmuuid,
|
||||||
techdriver,
|
techdriver,
|
||||||
nettype,
|
|
||||||
filter,
|
filter,
|
||||||
ifname,
|
ifname,
|
||||||
ifindex,
|
ifindex,
|
||||||
@ -953,7 +945,6 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
|
|||||||
net->ifname,
|
net->ifname,
|
||||||
ifindex,
|
ifindex,
|
||||||
linkdev,
|
linkdev,
|
||||||
net->type,
|
|
||||||
&net->mac,
|
&net->mac,
|
||||||
net->filter,
|
net->filter,
|
||||||
net->filterparams,
|
net->filterparams,
|
||||||
@ -974,7 +965,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
virNWFilterHashTablePtr filterparams)
|
virNWFilterHashTablePtr filterparams)
|
||||||
@ -991,7 +981,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
|
|||||||
ifname,
|
ifname,
|
||||||
ifindex,
|
ifindex,
|
||||||
linkdev,
|
linkdev,
|
||||||
nettype,
|
|
||||||
macaddr,
|
macaddr,
|
||||||
filtername,
|
filtername,
|
||||||
filterparams,
|
filterparams,
|
||||||
|
@ -51,7 +51,6 @@ int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
virNWFilterHashTablePtr filterparams);
|
virNWFilterHashTablePtr filterparams);
|
||||||
|
@ -622,7 +622,6 @@ learnIPAddressThread(void *arg)
|
|||||||
req->ifname,
|
req->ifname,
|
||||||
req->ifindex,
|
req->ifindex,
|
||||||
req->linkdev,
|
req->linkdev,
|
||||||
req->nettype,
|
|
||||||
&req->macaddr,
|
&req->macaddr,
|
||||||
req->filtername,
|
req->filtername,
|
||||||
req->filterparams);
|
req->filterparams);
|
||||||
@ -661,7 +660,6 @@ learnIPAddressThread(void *arg)
|
|||||||
* @ifindex: the index of the interface
|
* @ifindex: the index of the interface
|
||||||
* @linkdev : the name of the link device; currently only used in case of a
|
* @linkdev : the name of the link device; currently only used in case of a
|
||||||
* macvtap device
|
* macvtap device
|
||||||
* @nettype : the type of interface
|
|
||||||
* @macaddr : the MAC address of the interface
|
* @macaddr : the MAC address of the interface
|
||||||
* @filtername : the name of the top-level filter to apply to the interface
|
* @filtername : the name of the top-level filter to apply to the interface
|
||||||
* once its IP address has been detected
|
* once its IP address has been detected
|
||||||
@ -681,7 +679,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
virNWFilterHashTablePtr filterparams,
|
virNWFilterHashTablePtr filterparams,
|
||||||
@ -733,7 +730,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
req->ifindex = ifindex;
|
req->ifindex = ifindex;
|
||||||
req->nettype = nettype;
|
|
||||||
virMacAddrSet(&req->macaddr, macaddr);
|
virMacAddrSet(&req->macaddr, macaddr);
|
||||||
req->driver = driver;
|
req->driver = driver;
|
||||||
req->filterparams = ht;
|
req->filterparams = ht;
|
||||||
@ -771,7 +767,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
|
|||||||
const char *ifname ATTRIBUTE_UNUSED,
|
const char *ifname ATTRIBUTE_UNUSED,
|
||||||
int ifindex ATTRIBUTE_UNUSED,
|
int ifindex ATTRIBUTE_UNUSED,
|
||||||
const char *linkdev ATTRIBUTE_UNUSED,
|
const char *linkdev ATTRIBUTE_UNUSED,
|
||||||
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
|
|
||||||
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
|
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
|
||||||
const char *filtername ATTRIBUTE_UNUSED,
|
const char *filtername ATTRIBUTE_UNUSED,
|
||||||
virNWFilterHashTablePtr filterparams ATTRIBUTE_UNUSED,
|
virNWFilterHashTablePtr filterparams ATTRIBUTE_UNUSED,
|
||||||
|
@ -42,7 +42,6 @@ struct _virNWFilterIPAddrLearnReq {
|
|||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
int ifindex;
|
int ifindex;
|
||||||
char linkdev[IF_NAMESIZE];
|
char linkdev[IF_NAMESIZE];
|
||||||
enum virDomainNetType nettype;
|
|
||||||
virMacAddr macaddr;
|
virMacAddr macaddr;
|
||||||
char *filtername;
|
char *filtername;
|
||||||
virNWFilterHashTablePtr filterparams;
|
virNWFilterHashTablePtr filterparams;
|
||||||
@ -58,7 +57,6 @@ int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
const char *linkdev,
|
const char *linkdev,
|
||||||
enum virDomainNetType nettype,
|
|
||||||
const virMacAddr *macaddr,
|
const virMacAddr *macaddr,
|
||||||
const char *filtername,
|
const char *filtername,
|
||||||
virNWFilterHashTablePtr filterparams,
|
virNWFilterHashTablePtr filterparams,
|
||||||
|
@ -44,10 +44,7 @@ struct _virNWFilterRuleInst {
|
|||||||
typedef int (*virNWFilterTechDrvInit)(bool privileged);
|
typedef int (*virNWFilterTechDrvInit)(bool privileged);
|
||||||
typedef void (*virNWFilterTechDrvShutdown)(void);
|
typedef void (*virNWFilterTechDrvShutdown)(void);
|
||||||
|
|
||||||
enum virDomainNetType;
|
typedef int (*virNWFilterRuleCreateInstance)(virNWFilterDefPtr filter,
|
||||||
|
|
||||||
typedef int (*virNWFilterRuleCreateInstance)(enum virDomainNetType nettype,
|
|
||||||
virNWFilterDefPtr filter,
|
|
||||||
virNWFilterRuleDefPtr rule,
|
virNWFilterRuleDefPtr rule,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterHashTablePtr vars,
|
virNWFilterHashTablePtr vars,
|
||||||
|
Loading…
Reference in New Issue
Block a user