// SPDX-License-Identifier: GPL-3.0-or-later#include"aclk.h"#include"aclk_stats.h"#include"mqtt_wss_client.h"#include"aclk_otp.h"#include"aclk_tx_msgs.h"#include"aclk_query.h"#include"aclk_query_queue.h"#include"aclk_util.h"#include"aclk_rx_msgs.h"#include"aclk_collector_list.h"#include"https_client.h"#include"aclk_proxy.h"#ifdef ACLK_LOG_CONVERSATION_DIR#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#endif#define ACLK_STABLE_TIMEOUT 3 // Minimum delay to mark AGENT as stableintaclk_pubacks_per_conn=0;// How many PubAcks we got since MQTT conn est.intaclk_rcvd_cloud_msgs=0;intaclk_connection_counter=0;intdisconnect_req=0;intaclk_alert_reloaded=1;//1 on startup, and again on health_reloadtime_taclk_block_until=0;mqtt_wss_clientmqttwss_client;netdata_mutex_taclk_shared_state_mutex=NETDATA_MUTEX_INITIALIZER;#define ACLK_SHARED_STATE_LOCK netdata_mutex_lock(&aclk_shared_state_mutex)#define ACLK_SHARED_STATE_UNLOCK netdata_mutex_unlock(&aclk_shared_state_mutex)structaclk_shared_stateaclk_shared_state