summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/connection.h
blob: fcbe6bd595ae583f01086bf875b1ae431c5aae4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef ACLK_SCHEMA_WRAPPER_CONNECTION_H
#define ACLK_SCHEMA_WRAPPER_CONNECTION_H

#include "capability.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    const char *claim_id;
    unsigned int reachable:1;

    int64_t session_id;

    unsigned int lwt:1;

    struct capability *capabilities;

// TODO in future optional fields
// > 15 optional fields:
// How long the system was running until connection (only applicable when reachable=true)
//    google.protobuf.Duration system_uptime = 15;
// How long the netdata agent was running until connection (only applicable when reachable=true)
//    google.protobuf.Duration agent_uptime = 16;


} update_agent_connection_t;

char *generate_update_agent_connection(size_t *len, const update_agent_connection_t *data);

struct disconnect_cmd {
    uint64_t reconnect_after_s;
    int permaban;
    uint32_t error_code;
    char *error_description;
};

struct disconnect_cmd *parse_disconnect_cmd(const char *data, size_t len);

#ifdef __cplusplus
}
#endif

#endif /* ACLK_SCHEMA_WRAPPER_CONNECTION_H */