From 822c8f60b72cca97fb2c86db37835a60917d1c7e Mon Sep 17 00:00:00 2001 From: Daniel Gollub Date: Mon, 11 Nov 2019 15:07:38 +0100 Subject: DANOS Import --- tacplus-daemon/global.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tacplus-daemon/global.h (limited to 'tacplus-daemon/global.h') diff --git a/tacplus-daemon/global.h b/tacplus-daemon/global.h new file mode 100644 index 0000000..d7bb592 --- /dev/null +++ b/tacplus-daemon/global.h @@ -0,0 +1,38 @@ +/* + TACACS+ D-Bus Daemon code + + Copyright (c) 2019, AT&T Intellectual Property + + SPDX-License-Identifier: GPL-2.0-only +*/ + +#include +#include +#include +#include +#include + +struct tacplus_global_state { + /* Lock to be held while manipulating global state */ + pthread_mutex_t lock; + + /* ID of the offline expiry timer returned from timer_create() */ + timer_t offline_timer; + + /* Internal timer ID used to detect expiry races */ + uint8_t offline_timer_id; + + /* Flag indicating whether the component is offline */ + bool offline; +}; + +typedef struct { + struct tacplus_options *opts; + struct tacplus_global_state state; +} ConnectionControl; + +extern ConnectionControl *connControl; + +bool tacplusd_go_online(); +bool tacplusd_go_offline(const struct timespec *); +bool tacplusd_online(); -- cgit v1.2.3