connection.h 1.1 KB

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