4
* Copyright (C) 2010 IBM Corporation
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
* Author: Stefan Berger <stefanb@us.ibm.com>
27
#include "datatypes.h"
28
#include "domain_conf.h"
29
#include "domain_nwfilter.h"
31
static virDomainConfNWFilterDriverPtr nwfilterDriver;
34
virDomainConfNWFilterRegister(virDomainConfNWFilterDriverPtr driver) {
35
nwfilterDriver = driver;
39
virDomainConfNWFilterInstantiate(virConnectPtr conn,
40
virDomainNetDefPtr net) {
41
if (nwfilterDriver != NULL)
42
return nwfilterDriver->instantiateFilter(conn, net);
43
/* driver module not available -- don't indicate failure */
48
virDomainConfNWFilterTeardown(virDomainNetDefPtr net) {
49
if (nwfilterDriver != NULL)
50
nwfilterDriver->teardownFilter(net);
54
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
57
if (nwfilterDriver != NULL) {
58
for (i = 0; i < vm->def->nnets; i++)
59
virDomainConfNWFilterTeardown(vm->def->nets[i]);