pluginsd_parser.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_PLUGINSD_PARSER_H
  3. #define NETDATA_PLUGINSD_PARSER_H
  4. #include "daemon/common.h"
  5. typedef enum __attribute__ ((__packed__)) {
  6. PARSER_INIT_PLUGINSD = (1 << 1),
  7. PARSER_INIT_STREAMING = (1 << 2),
  8. } PLUGINSD_KEYWORDS;
  9. typedef struct parser_user_object {
  10. PARSER *parser;
  11. RRDSET *st;
  12. RRDHOST *host;
  13. void *opaque;
  14. struct plugind *cd;
  15. int trust_durations;
  16. DICTIONARY *new_host_labels;
  17. DICTIONARY *chart_rrdlabels_linked_temporarily;
  18. size_t data_collections_count;
  19. int enabled;
  20. STREAM_CAPABILITIES capabilities; // receiver capabilities
  21. struct {
  22. bool parsing_host;
  23. uuid_t machine_guid;
  24. char machine_guid_str[UUID_STR_LEN];
  25. STRING *hostname;
  26. DICTIONARY *rrdlabels;
  27. } host_define;
  28. struct parser_user_object_replay {
  29. time_t start_time;
  30. time_t end_time;
  31. usec_t start_time_ut;
  32. usec_t end_time_ut;
  33. time_t wall_clock_time;
  34. bool rset_enabled;
  35. } replay;
  36. struct parser_user_object_v2 {
  37. bool locked_data_collection;
  38. RRDSET_STREAM_BUFFER stream_buffer; // sender capabilities in this
  39. time_t update_every;
  40. time_t end_time;
  41. time_t wall_clock_time;
  42. bool ml_locked;
  43. } v2;
  44. } PARSER_USER_OBJECT;
  45. PARSER_RC pluginsd_function(char **words, size_t num_words, void *user);
  46. PARSER_RC pluginsd_function_result_begin(char **words, size_t num_words, void *user);
  47. void inflight_functions_init(PARSER *parser);
  48. void pluginsd_keywords_init(PARSER *parser, PLUGINSD_KEYWORDS types);
  49. #endif //NETDATA_PLUGINSD_PARSER_H