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:
Daniel P. Berrange 2014-03-24 12:27:03 +00:00
parent bc46c7fb92
commit 50859fc1dd
8 changed files with 11 additions and 44 deletions

View File

@ -137,7 +137,6 @@ struct _virNWFilterSnoopReq {
char *ifname;
int ifindex;
char *linkdev;
enum virDomainNetType nettype;
char ifkey[VIR_IFKEY_LEN];
virMacAddr macaddr;
char *filtername;
@ -493,7 +492,6 @@ virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl,
req->ifname,
req->ifindex,
req->linkdev,
req->nettype,
&req->macaddr,
req->filtername,
req->vars);
@ -879,7 +877,6 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
req->ifname,
req->ifindex,
req->linkdev,
req->nettype,
&req->macaddr,
req->filtername,
req->vars);
@ -1592,7 +1589,6 @@ int
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
const char *ifname,
const char *linkdev,
enum virDomainNetType nettype,
const unsigned char *vmuuid,
const virMacAddr *macaddr,
const char *filtername,
@ -1628,7 +1624,6 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
req->driver = driver;
req->techdriver = techdriver;
tmp = virNetDevGetIndex(ifname, &req->ifindex);
req->nettype = nettype;
virMacAddrSet(&req->macaddr, macaddr);
req->vars = virNWFilterHashTableCreate(0);
req->linkdev = NULL;
@ -2230,7 +2225,6 @@ int
virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
const char *ifname ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED,
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
const unsigned char *vmuuid ATTRIBUTE_UNUSED,
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
const char *filtername ATTRIBUTE_UNUSED,

View File

@ -32,7 +32,6 @@ void virNWFilterDHCPSnoopShutdown(void);
int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
const char *ifname,
const char *linkdev,
enum virDomainNetType nettype,
const unsigned char *vmuuid,
const virMacAddr *macaddr,
const char *filtername,

View File

@ -2649,8 +2649,7 @@ ebtablesCreateRuleInstance(char chainPrefix,
* pointed to by res, -1 otherwise
*/
static int
ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
virNWFilterDefPtr nwfilter,
ebiptablesCreateRuleInstance(virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
const char *ifname,
virNWFilterVarCombIterPtr vars,
@ -2740,13 +2739,11 @@ ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
}
static int
ebiptablesCreateRuleInstanceIterate(
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
const char *ifname,
virNWFilterHashTablePtr vars,
virNWFilterRuleInstPtr res)
ebiptablesCreateRuleInstanceIterate(virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
const char *ifname,
virNWFilterHashTablePtr vars,
virNWFilterRuleInstPtr res)
{
int rc = 0;
virNWFilterVarCombIterPtr vciter, tmp;
@ -2761,8 +2758,7 @@ ebiptablesCreateRuleInstanceIterate(
return -1;
do {
rc = ebiptablesCreateRuleInstance(nettype,
nwfilter,
rc = ebiptablesCreateRuleInstance(nwfilter,
rule,
ifname,
tmp,

View File

@ -289,7 +289,6 @@ virNWFilterPrintVars(virHashTablePtr vars,
*/
static virNWFilterRuleInstPtr
virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
virNWFilterRuleDefPtr rule,
const char *ifname,
@ -304,7 +303,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
ret->techdriver = techdriver;
rc = techdriver->createRuleInstance(nettype, filter,
rc = techdriver->createRuleInstance(filter,
rule, ifname, vars, ret);
if (rc) {
@ -376,7 +375,6 @@ virNWFilterCreateVarsFrom(virNWFilterHashTablePtr vars1,
*/
static int
_virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
const char *ifname,
virNWFilterHashTablePtr vars,
@ -396,7 +394,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
virNWFilterIncludeDefPtr inc = filter->filterEntries[i]->include;
if (rule) {
inst = virNWFilterRuleInstantiate(techdriver,
nettype,
filter,
rule,
ifname,
@ -449,7 +446,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
}
rc = _virNWFilterInstantiateRec(techdriver,
nettype,
next_filter,
ifname,
tmpvars,
@ -634,7 +630,6 @@ virNWFilterRuleInstancesToArray(int nEntries,
static int
virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
const char *ifname,
int ifindex,
@ -690,7 +685,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
}
if (STRCASEEQ(learning, "dhcp")) {
rc = virNWFilterDHCPSnoopReq(techdriver, ifname, linkdev,
nettype, vmuuid, macaddr,
vmuuid, macaddr,
filter->name, vars, driver);
goto err_exit;
} else if (STRCASEEQ(learning, "any")) {
@ -699,7 +694,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
ifname,
ifindex,
linkdev,
nettype, macaddr,
macaddr,
filter->name,
vars, driver,
DETECT_DHCP|DETECT_STATIC);
@ -723,7 +718,6 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
}
rc = _virNWFilterInstantiateRec(techdriver,
nettype,
filter,
ifname,
vars,
@ -805,7 +799,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
const virMacAddr *macaddr,
const char *filtername,
virNWFilterHashTablePtr filterparams,
@ -892,7 +885,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
rc = virNWFilterInstantiate(vmuuid,
techdriver,
nettype,
filter,
ifname,
ifindex,
@ -953,7 +945,6 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
net->ifname,
ifindex,
linkdev,
net->type,
&net->mac,
net->filter,
net->filterparams,
@ -974,7 +965,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
const virMacAddr *macaddr,
const char *filtername,
virNWFilterHashTablePtr filterparams)
@ -991,7 +981,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
ifname,
ifindex,
linkdev,
nettype,
macaddr,
filtername,
filterparams,

View File

@ -51,7 +51,6 @@ int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
const virMacAddr *macaddr,
const char *filtername,
virNWFilterHashTablePtr filterparams);

View File

@ -622,7 +622,6 @@ learnIPAddressThread(void *arg)
req->ifname,
req->ifindex,
req->linkdev,
req->nettype,
&req->macaddr,
req->filtername,
req->filterparams);
@ -661,7 +660,6 @@ learnIPAddressThread(void *arg)
* @ifindex: the index of the interface
* @linkdev : the name of the link device; currently only used in case of a
* macvtap device
* @nettype : the type of interface
* @macaddr : the MAC address of the interface
* @filtername : the name of the top-level filter to apply to the interface
* once its IP address has been detected
@ -681,7 +679,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
const virMacAddr *macaddr,
const char *filtername,
virNWFilterHashTablePtr filterparams,
@ -733,7 +730,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
}
req->ifindex = ifindex;
req->nettype = nettype;
virMacAddrSet(&req->macaddr, macaddr);
req->driver = driver;
req->filterparams = ht;
@ -771,7 +767,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
const char *ifname ATTRIBUTE_UNUSED,
int ifindex ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED,
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
const char *filtername ATTRIBUTE_UNUSED,
virNWFilterHashTablePtr filterparams ATTRIBUTE_UNUSED,

View File

@ -42,7 +42,6 @@ struct _virNWFilterIPAddrLearnReq {
char ifname[IF_NAMESIZE];
int ifindex;
char linkdev[IF_NAMESIZE];
enum virDomainNetType nettype;
virMacAddr macaddr;
char *filtername;
virNWFilterHashTablePtr filterparams;
@ -58,7 +57,6 @@ int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
const virMacAddr *macaddr,
const char *filtername,
virNWFilterHashTablePtr filterparams,

View File

@ -44,10 +44,7 @@ struct _virNWFilterRuleInst {
typedef int (*virNWFilterTechDrvInit)(bool privileged);
typedef void (*virNWFilterTechDrvShutdown)(void);
enum virDomainNetType;
typedef int (*virNWFilterRuleCreateInstance)(enum virDomainNetType nettype,
virNWFilterDefPtr filter,
typedef int (*virNWFilterRuleCreateInstance)(virNWFilterDefPtr filter,
virNWFilterRuleDefPtr rule,
const char *ifname,
virNWFilterHashTablePtr vars,