From 83ba6762cc43d9db581b979bb5e3445669e46cc2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 25 Nov 2024 18:33:56 +0100 Subject: Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145). Signed-off-by: Daniel Baumann --- src/claim/claim.h | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'src/claim/claim.h') diff --git a/src/claim/claim.h b/src/claim/claim.h index ccab8aaa1..073771d1c 100644 --- a/src/claim/claim.h +++ b/src/claim/claim.h @@ -4,29 +4,32 @@ #define NETDATA_CLAIM_H 1 #include "daemon/common.h" +#include "cloud-status.h" +#include "claim_id.h" + +const char *claim_agent_failure_reason_get(void); +void claim_agent_failure_reason_set(const char *format, ...) PRINTFLIKE(1, 2); -extern char *claiming_pending_arguments; extern struct config cloud_config; -typedef enum __attribute__((packed)) { - CLAIM_AGENT_OK, - CLAIM_AGENT_CLOUD_DISABLED, - CLAIM_AGENT_NO_CLOUD_URL, - CLAIM_AGENT_CANNOT_EXECUTE_CLAIM_SCRIPT, - CLAIM_AGENT_CLAIM_SCRIPT_FAILED, - CLAIM_AGENT_CLAIM_SCRIPT_RETURNED_INVALID_CODE, - CLAIM_AGENT_FAILED_WITH_MESSAGE, -} CLAIM_AGENT_RESPONSE; - -CLAIM_AGENT_RESPONSE claim_agent(const char *claiming_arguments, bool force, const char **msg); -char *get_agent_claimid(void); -void load_claiming_state(void); -void load_cloud_conf(int silent); -void claim_reload_all(void); - -bool netdata_random_session_id_generate(void); -const char *netdata_random_session_id_get_filename(void); -bool netdata_random_session_id_matches(const char *guid); -int api_v2_claim(struct web_client *w, char *url); +bool claim_agent(const char *url, const char *token, const char *rooms, const char *proxy, bool insecure); +bool claim_agent_automatically(void); + +bool claimed_id_save_to_file(const char *claimed_id_str); + +bool is_agent_claimed(void); +bool claim_id_matches(const char *claim_id); +bool claim_id_matches_any(const char *claim_id); +bool load_claiming_state(void); +void cloud_conf_load(int silent); +void cloud_conf_init_after_registry(void); +bool cloud_conf_save(void); +bool cloud_conf_regenerate(const char *claimed_id_str, const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, int insecure); +CLOUD_STATUS claim_reload_and_wait_online(void); + +const char *cloud_config_url_get(void); +void cloud_config_url_set(const char *url); +const char *cloud_config_proxy_get(void); +bool cloud_config_insecure_get(void); #endif //NETDATA_CLAIM_H -- cgit v1.2.3