summaryrefslogtreecommitdiffstats
path: root/src/aclk/aclk.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/aclk/aclk.h')
-rw-r--r--src/aclk/aclk.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/aclk/aclk.h b/src/aclk/aclk.h
index 72d1a2e11..45a2eac85 100644
--- a/src/aclk/aclk.h
+++ b/src/aclk/aclk.h
@@ -4,14 +4,19 @@
#include "daemon/common.h"
-#ifdef ENABLE_ACLK
#include "aclk_util.h"
-#include "aclk_rrdhost_state.h"
+//#include "aclk_rrdhost_state.h"
// How many MQTT PUBACKs we need to get to consider connection
// stable for the purposes of TBEB (truncated binary exponential backoff)
#define ACLK_PUBACKS_CONN_STABLE 3
-#endif /* ENABLE_ACLK */
+
+typedef enum {
+ ACLK_NO_DISCONNECT = 0,
+ ACLK_CLOUD_DISCONNECT = 1,
+ ACLK_RELOAD_CONF = 2,
+ ACLK_PING_TIMEOUT = 3
+} ACLK_DISCONNECT_ACTION;
typedef enum __attribute__((packed)) {
ACLK_STATUS_CONNECTED = 0,
@@ -39,12 +44,19 @@ extern ACLK_STATUS aclk_status;
extern const char *aclk_cloud_base_url;
const char *aclk_status_to_string(void);
-extern int aclk_connected;
extern int aclk_ctx_based;
extern int aclk_disable_runtime;
-extern int aclk_stats_enabled;
+//extern int aclk_stats_enabled;
extern int aclk_kill_link;
+bool aclk_online(void);
+bool aclk_online_for_contexts(void);
+bool aclk_online_for_alerts(void);
+bool aclk_online_for_nodes(void);
+
+void aclk_config_get_query_scope(void);
+bool aclk_query_scope_has(HTTP_ACL acl);
+
extern time_t last_conn_time_mqtt;
extern time_t last_conn_time_appl;
extern time_t last_disconnect_time;
@@ -57,15 +69,10 @@ extern time_t aclk_session_sec;
extern time_t aclk_block_until;
extern int aclk_connection_counter;
-extern int disconnect_req;
+extern ACLK_DISCONNECT_ACTION disconnect_req;
-#ifdef ENABLE_ACLK
void *aclk_main(void *ptr);
-extern netdata_mutex_t aclk_shared_state_mutex;
-#define ACLK_SHARED_STATE_LOCK netdata_mutex_lock(&aclk_shared_state_mutex)
-#define ACLK_SHARED_STATE_UNLOCK netdata_mutex_unlock(&aclk_shared_state_mutex)
-
extern struct aclk_shared_state {
// To wait for `disconnect` message PUBACK
// when shutting down
@@ -80,8 +87,6 @@ void aclk_send_node_instances(void);
void aclk_send_bin_msg(char *msg, size_t msg_len, enum aclk_topics subtopic, const char *msgname);
-#endif /* ENABLE_ACLK */
-
char *aclk_state(void);
char *aclk_state_json(void);
void add_aclk_host_labels(void);