2008-10-10 13:57:13 +00:00
|
|
|
/*
|
2014-03-07 13:38:51 +00:00
|
|
|
* bridge_driver.h: core driver methods for managing networks
|
2008-10-10 13:57:13 +00:00
|
|
|
*
|
2015-04-27 11:25:51 +00:00
|
|
|
* Copyright (C) 2006-2015 Red Hat, Inc.
|
2008-10-10 13:57:13 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-10-10 13:57:13 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __VIR_NETWORK__DRIVER_H
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __VIR_NETWORK__DRIVER_H
|
2008-10-10 13:57:13 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
2011-06-24 10:04:38 +00:00
|
|
|
# include "network_conf.h"
|
2011-07-04 06:27:12 +00:00
|
|
|
# include "domain_conf.h"
|
2012-12-12 16:27:01 +00:00
|
|
|
# include "vircommand.h"
|
2012-12-12 16:43:54 +00:00
|
|
|
# include "virdnsmasq.h"
|
2008-10-10 13:57:13 +00:00
|
|
|
|
|
|
|
int networkRegister(void);
|
2011-07-04 06:27:12 +00:00
|
|
|
|
|
|
|
# if WITH_NETWORK
|
2014-01-31 15:48:06 +00:00
|
|
|
int networkAllocateActualDevice(virDomainDefPtr dom,
|
|
|
|
virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
int networkNotifyActualDevice(virDomainDefPtr dom,
|
|
|
|
virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
int networkReleaseActualDevice(virDomainDefPtr dom,
|
|
|
|
virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2011-07-04 06:27:12 +00:00
|
|
|
|
2011-07-07 04:24:08 +00:00
|
|
|
int networkGetNetworkAddress(const char *netname, char **netaddr)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2012-12-06 17:20:39 +00:00
|
|
|
int networkDnsmasqConfContents(virNetworkObjPtr network,
|
|
|
|
const char *pidfile,
|
|
|
|
char **configstr,
|
|
|
|
dnsmasqContext *dctx,
|
|
|
|
dnsmasqCapsPtr caps);
|
2011-07-04 06:27:12 +00:00
|
|
|
# else
|
|
|
|
/* Define no-op replacements that don't drag in any link dependencies. */
|
2014-01-31 15:48:06 +00:00
|
|
|
# define networkAllocateActualDevice(dom, iface) 0
|
2011-07-26 11:57:34 +00:00
|
|
|
# define networkGetNetworkAddress(netname, netaddr) (-2)
|
2012-12-06 17:20:39 +00:00
|
|
|
# define networkDnsmasqConfContents(network, pidfile, configstr, \
|
|
|
|
dctx, caps) 0
|
2015-04-27 11:25:51 +00:00
|
|
|
|
|
|
|
static inline int
|
|
|
|
networkNotifyActualDevice(virDomainDefPtr dom ATTRIBUTE_UNUSED,
|
|
|
|
virDomainNetDefPtr iface ATTRIBUTE_UNUSED)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
networkReleaseActualDevice(virDomainDefPtr dom ATTRIBUTE_UNUSED,
|
|
|
|
virDomainNetDefPtr iface ATTRIBUTE_UNUSED)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-04 06:27:12 +00:00
|
|
|
# endif
|
2008-10-10 13:57:13 +00:00
|
|
|
|
2011-06-27 14:55:13 +00:00
|
|
|
typedef char *(*networkDnsmasqLeaseFileNameFunc)(const char *netname);
|
|
|
|
|
2008-10-10 13:57:13 +00:00
|
|
|
#endif /* __VIR_NETWORK__DRIVER_H */
|