2013-07-24 12:22:54 +00:00
|
|
|
/*
|
2014-03-07 13:38:51 +00:00
|
|
|
* bridge_driver_platform.h: platform specific routines for bridge driver
|
2013-07-24 12:22:54 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2013 Red Hat, Inc.
|
|
|
|
* 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
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-12-13 14:53:50 +00:00
|
|
|
#ifndef LIBVIRT_BRIDGE_DRIVER_PLATFORM_H
|
|
|
|
# define LIBVIRT_BRIDGE_DRIVER_PLATFORM_H
|
2013-07-24 12:22:54 +00:00
|
|
|
|
|
|
|
# include "internal.h"
|
|
|
|
# include "virthread.h"
|
|
|
|
# include "virdnsmasq.h"
|
2017-03-08 15:25:24 +00:00
|
|
|
# include "virnetworkobj.h"
|
2013-12-11 10:38:02 +00:00
|
|
|
# include "object_event.h"
|
2013-07-24 12:22:54 +00:00
|
|
|
|
|
|
|
/* Main driver state */
|
|
|
|
struct _virNetworkDriverState {
|
|
|
|
virMutex lock;
|
|
|
|
|
2018-01-26 11:16:00 +00:00
|
|
|
/* Read-only */
|
|
|
|
bool privileged;
|
|
|
|
|
2015-03-10 14:42:18 +00:00
|
|
|
/* Immutable pointer, self-locking APIs */
|
2015-02-23 15:41:55 +00:00
|
|
|
virNetworkObjListPtr networks;
|
2013-07-24 12:22:54 +00:00
|
|
|
|
2015-03-10 14:42:18 +00:00
|
|
|
/* Immutable pointers, Immutable objects */
|
2013-07-24 12:22:54 +00:00
|
|
|
char *networkConfigDir;
|
|
|
|
char *networkAutostartDir;
|
|
|
|
char *stateDir;
|
|
|
|
char *pidDir;
|
|
|
|
char *dnsmasqStateDir;
|
|
|
|
char *radvdStateDir;
|
2015-03-10 14:42:18 +00:00
|
|
|
|
|
|
|
/* Require lock to get a reference on the object,
|
|
|
|
* lockless access thereafter
|
|
|
|
*/
|
2013-07-24 12:22:54 +00:00
|
|
|
dnsmasqCapsPtr dnsmasqCaps;
|
2013-12-11 10:38:02 +00:00
|
|
|
|
2015-03-10 14:42:18 +00:00
|
|
|
/* Immutable pointer, self-locking APIs */
|
2013-12-11 10:38:02 +00:00
|
|
|
virObjectEventStatePtr networkEventState;
|
2013-07-24 12:22:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virNetworkDriverState virNetworkDriverState;
|
|
|
|
typedef virNetworkDriverState *virNetworkDriverStatePtr;
|
|
|
|
|
2019-05-21 11:40:13 +00:00
|
|
|
void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup);
|
2018-12-05 13:29:07 +00:00
|
|
|
void networkPostReloadFirewallRules(bool startup);
|
|
|
|
|
2014-03-19 16:56:35 +00:00
|
|
|
int networkCheckRouteCollision(virNetworkDefPtr def);
|
2013-07-24 12:22:54 +00:00
|
|
|
|
2014-03-19 16:56:35 +00:00
|
|
|
int networkAddFirewallRules(virNetworkDefPtr def);
|
2013-07-24 12:22:54 +00:00
|
|
|
|
2014-03-19 16:56:35 +00:00
|
|
|
void networkRemoveFirewallRules(virNetworkDefPtr def);
|
2013-07-24 12:22:54 +00:00
|
|
|
|
2018-12-13 14:53:50 +00:00
|
|
|
#endif /* LIBVIRT_BRIDGE_DRIVER_PLATFORM_H */
|