summaryrefslogtreecommitdiffstats
path: root/src/aclk/aclk.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:36:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:37:11 +0000
commit910c794ec6d0a364b4aabccf22b715cb45780e83 (patch)
tree561a9ef6b6a4668102674e1a52b3e7563c57ac61 /src/aclk/aclk.h
parentReleasing debian version 1.47.5-1. (diff)
downloadnetdata-910c794ec6d0a364b4aabccf22b715cb45780e83.tar.xz
netdata-910c794ec6d0a364b4aabccf22b715cb45780e83.zip
Merging upstream version 2.0.0 (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 72d1a2e1..45a2eac8 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);