| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef ACLK_SCHEMA_WRAPPER_CONNECTION_H |
| 4 | #define ACLK_SCHEMA_WRAPPER_CONNECTION_H |
| 5 | |
| 6 | #include "capability.h" |
| 7 | |
| 8 | #ifdef __cplusplus |
| 9 | extern "C" { |
| 10 | #endif |
| 11 | |
| 12 | typedef struct { |
| 13 | const char *claim_id; |
| 14 | unsigned int reachable:1; |
| 15 | |
| 16 | int64_t session_id; |
| 17 | |
| 18 | unsigned int lwt:1; |
| 19 | |
| 20 | const struct capability *capabilities; |
| 21 | |
| 22 | // TODO in future optional fields |
| 23 | // > 15 optional fields: |
| 24 | // How long the system was running until connection (only applicable when reachable=true) |
| 25 | // google.protobuf.Duration system_uptime = 15; |
| 26 | // How long the netdata agent was running until connection (only applicable when reachable=true) |
| 27 | // google.protobuf.Duration agent_uptime = 16; |
| 28 | |
| 29 | |
| 30 | } update_agent_connection_t; |
| 31 | |
| 32 | char *generate_update_agent_connection(size_t *len, const update_agent_connection_t *data); |
| 33 | |
| 34 | struct disconnect_cmd { |
| 35 | uint64_t reconnect_after_s; |
| 36 | int permaban; |
| 37 | uint32_t error_code; |
| 38 | char *error_description; |
| 39 | }; |
| 40 | |
| 41 | struct disconnect_cmd *parse_disconnect_cmd(const char *data, size_t len); |
| 42 | |
| 43 | #ifdef __cplusplus |
| 44 | } |
| 45 | #endif |
| 46 | |
| 47 | #endif /* ACLK_SCHEMA_WRAPPER_CONNECTION_H */ |