* Convert a single rule into its representation for later instantiation
*
* Returns 0 in case of success with the result stored in the data structure
- * pointed to by res, != 0 otherwise with the error message stored in the
- * virConnect object.
+ * pointed to by res, != 0 otherwise.
*/
static int
_iptablesCreateRuleInstance(int directionIn,
* Convert a single rule into its representation for later instantiation
*
* Returns 0 in case of success with the result stored in the data structure
- * pointed to by res, != 0 otherwise with the error message stored in the
- * virConnect object.
+ * pointed to by res, != 0 otherwise.
*/
static int
ebtablesCreateRuleInstance(char chainPrefix,
/*
* ebiptablesCreateRuleInstance:
- * @conn : Pointer to a virConnect object
* @nwfilter : The filter
* @rule: The rule of the filter to convert
* @ifname : The name of the interface to apply the rule to
* Convert a single rule into its representation for later instantiation
*
* Returns 0 in case of success with the result stored in the data structure
- * pointed to by res, != 0 otherwise with the error message stored in the
- * virConnect object.
+ * pointed to by res, != 0 otherwise.
*/
static int
-ebiptablesCreateRuleInstance(virConnectPtr conn ATTRIBUTE_UNUSED,
- enum virDomainNetType nettype ATTRIBUTE_UNUSED,
+ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
const char *ifname,
static int
ebiptablesCreateRuleInstanceIterate(
- virConnectPtr conn ATTRIBUTE_UNUSED,
enum virDomainNetType nettype ATTRIBUTE_UNUSED,
virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
return 1;
do {
- rc = ebiptablesCreateRuleInstance(conn,
- nettype,
+ rc = ebiptablesCreateRuleInstance(nettype,
nwfilter,
rule,
ifname,
static int
-ebiptablesDisplayRuleInstance(virConnectPtr conn ATTRIBUTE_UNUSED,
- void *_inst)
+ebiptablesDisplayRuleInstance(void *_inst)
{
ebiptablesRuleInstPtr inst = (ebiptablesRuleInstPtr)_inst;
VIR_INFO("Command Template: '%s', Needed protocol: '%s'",
/**
* ebtablesApplyBasicRules
*
- * @conn: virConnect object
* @ifname: name of the backend-interface to which to apply the rules
* @macaddr: MAC address the VM is using in packets sent through the
* interface
}
static int
-ebiptablesApplyNewRules(virConnectPtr conn ATTRIBUTE_UNUSED,
- const char *ifname,
+ebiptablesApplyNewRules(const char *ifname,
int nruleInstances,
void **_inst)
{
static int
-ebiptablesTearNewRules(virConnectPtr conn ATTRIBUTE_UNUSED,
- const char *ifname)
+ebiptablesTearNewRules(const char *ifname)
{
int cli_status;
virBuffer buf = VIR_BUFFER_INITIALIZER;
static int
-ebiptablesTearOldRules(virConnectPtr conn ATTRIBUTE_UNUSED,
- const char *ifname)
+ebiptablesTearOldRules(const char *ifname)
{
int cli_status;
virBuffer buf = VIR_BUFFER_INITIALIZER;
/**
* ebiptablesRemoveRules:
- * @conn : pointer to virConnect object
* @ifname : the name of the interface to which the rules apply
* @nRuleInstance : the number of given rules
* @_inst : array of rule instantiation data
* commands failed.
*/
static int
-ebiptablesRemoveRules(virConnectPtr conn ATTRIBUTE_UNUSED,
- const char *ifname ATTRIBUTE_UNUSED,
+ebiptablesRemoveRules(const char *ifname ATTRIBUTE_UNUSED,
int nruleInstances,
void **_inst)
{
* for bidirectional traffic and data needs to be added to the incoming
* and outgoing chains.
*
- * Returns 0 in case of success, 1 in case of an error with the error
- * message attached to the virConnect object.
+ * Returns 0 in case of success, 1 in case of an error.
*/
int
virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
* Create a hashmap used for evaluating the firewall rules. Initializes
* it with the standard variable 'MAC' and 'IP' if provided.
*
- * Returns pointer to hashmap, NULL if an error occcurred and error message
- * is attached to the virConnect object.
+ * Returns pointer to hashmap, NULL if an error occcurred.
*/
virNWFilterHashTablePtr
virNWFilterCreateVarHashmap(char *macaddr,
/**
* virNWFilterRuleInstantiate:
- * @conn: pointer to virConnect object
* @techdriver: the driver to use for instantiation
* @filter: The filter the rule is part of
* @rule : The rule that is to be instantiated
* from the instantiation. Returns NULL on error with error reported.
*/
static virNWFilterRuleInstPtr
-virNWFilterRuleInstantiate(virConnectPtr conn,
- virNWFilterTechDriverPtr techdriver,
+virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
virNWFilterRuleDefPtr rule,
ret->techdriver = techdriver;
- rc = techdriver->createRuleInstance(conn, nettype, filter,
+ rc = techdriver->createRuleInstance(nettype, filter,
rule, ifname, vars, ret);
if (rc) {
/**
* _virNWFilterInstantiateRec:
- * @conn: pointer to virConnect object
* @techdriver: The driver to use for instantiation
* @filter: The filter to instantiate
* @ifname: The name of the interface to apply the rules to
* resolved -- among other reasons.
*/
static int
-_virNWFilterInstantiateRec(virConnectPtr conn,
- virNWFilterTechDriverPtr techdriver,
+_virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
const char *ifname,
virNWFilterRuleDefPtr rule = filter->filterEntries[i]->rule;
virNWFilterIncludeDefPtr inc = filter->filterEntries[i]->include;
if (rule) {
- inst = virNWFilterRuleInstantiate(conn,
- techdriver,
+ inst = virNWFilterRuleInstantiate(techdriver,
nettype,
filter,
rule,
break;
}
- rc = _virNWFilterInstantiateRec(conn,
- techdriver,
+ rc = _virNWFilterInstantiateRec(techdriver,
nettype,
next_filter,
ifname,
static int
-virNWFilterDetermineMissingVarsRec(virConnectPtr conn,
- virNWFilterDefPtr filter,
+virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
virNWFilterHashTablePtr vars,
virNWFilterHashTablePtr missing_vars,
int useNewFilter,
break;
}
- rc = virNWFilterDetermineMissingVarsRec(conn,
- next_filter,
+ rc = virNWFilterDetermineMissingVarsRec(next_filter,
tmpvars,
missing_vars,
useNewFilter,
/**
* virNWFilterInstantiate:
- * @conn: pointer to virConnect object
* @techdriver: The driver to use for instantiation
* @filter: The filter to instantiate
* @ifname: The name of the interface to apply the rules to
* Call this function while holding the NWFilter filter update lock
*/
static int
-virNWFilterInstantiate(virConnectPtr conn,
- virNWFilterTechDriverPtr techdriver,
+virNWFilterInstantiate(virNWFilterTechDriverPtr techdriver,
enum virDomainNetType nettype,
virNWFilterDefPtr filter,
const char *ifname,
goto err_exit;
}
- rc = virNWFilterDetermineMissingVarsRec(conn,
- filter,
+ rc = virNWFilterDetermineMissingVarsRec(filter,
vars,
missing_vars,
useNewFilter,
goto err_exit;
}
- rc = _virNWFilterInstantiateRec(conn,
- techdriver,
+ rc = _virNWFilterInstantiateRec(techdriver,
nettype,
filter,
ifname,
if (virNWFilterLockIface(ifname))
goto err_exit;
- rc = techdriver->applyNewRules(conn, ifname, nptrs, ptrs);
+ rc = techdriver->applyNewRules(ifname, nptrs, ptrs);
if (teardownOld && rc == 0)
- techdriver->tearOldRules(conn, ifname);
+ techdriver->tearOldRules(ifname);
if (rc == 0 && (virNetDevValidateConfig(ifname, NULL, ifindex) <= 0)) {
virResetLastError();
* Call this function while holding the NWFilter filter update lock
*/
static int
-__virNWFilterInstantiateFilter(virConnectPtr conn,
- bool teardownOld,
+__virNWFilterInstantiateFilter(bool teardownOld,
const char *ifname,
int ifindex,
const char *linkdev,
break;
}
- rc = virNWFilterInstantiate(conn,
- techdriver,
+ rc = virNWFilterInstantiate(techdriver,
nettype,
filter,
ifname,
goto cleanup;
}
- rc = __virNWFilterInstantiateFilter(conn,
- teardownOld,
+ rc = __virNWFilterInstantiateFilter(teardownOld,
net->ifname,
ifindex,
linkdev,
int
-virNWFilterInstantiateFilterLate(virConnectPtr conn,
- const char *ifname,
+virNWFilterInstantiateFilterLate(const char *ifname,
int ifindex,
const char *linkdev,
enum virDomainNetType nettype,
virNWFilterLockFilterUpdates();
- rc = __virNWFilterInstantiateFilter(conn,
- 1,
+ rc = __virNWFilterInstantiateFilter(true,
ifname,
ifindex,
linkdev,
return rc;
}
-int virNWFilterRollbackUpdateFilter(virConnectPtr conn,
- const virDomainNetDefPtr net)
+int virNWFilterRollbackUpdateFilter(const virDomainNetDefPtr net)
{
const char *drvname = EBIPTABLES_DRIVER_ID;
int ifindex;
else if (virNWFilterLookupLearnReq(ifindex) != NULL)
return 0;
- return techdriver->tearNewRules(conn, net->ifname);
+ return techdriver->tearNewRules(net->ifname);
}
int
-virNWFilterTearOldFilter(virConnectPtr conn,
- virDomainNetDefPtr net)
+virNWFilterTearOldFilter(virDomainNetDefPtr net)
{
const char *drvname = EBIPTABLES_DRIVER_ID;
int ifindex;
else if (virNWFilterLookupLearnReq(ifindex) != NULL)
return 0;
- return techdriver->tearOldRules(conn, net->ifname);
+ return techdriver->tearOldRules(net->ifname);
}
case STEP_TEAR_NEW:
if ( !virHashLookup(cb->skipInterfaces, net->ifname)) {
- cb->err = virNWFilterRollbackUpdateFilter(cb->conn,
- net);
+ cb->err = virNWFilterRollbackUpdateFilter(net);
}
break;
case STEP_TEAR_OLD:
if ( !virHashLookup(cb->skipInterfaces, net->ifname)) {
- cb->err = virNWFilterTearOldFilter(cb->conn, net);
+ cb->err = virNWFilterTearOldFilter(net);
}
break;
}