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/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:33 +00:00
|
|
|
#pragma once
|
2013-07-24 12:22:54 +00:00
|
|
|
|
2019-06-18 16:12:33 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include "virthread.h"
|
|
|
|
#include "virdnsmasq.h"
|
|
|
|
#include "virnetworkobj.h"
|
|
|
|
#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;
|
|
|
|
|
2019-05-23 10:34:08 +00:00
|
|
|
/* pid file FD, ensures two copies of the driver can't use the same root */
|
|
|
|
int lockFD;
|
|
|
|
|
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);
|