rrdfunctions-internals.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_RRDFUNCTIONS_INTERNALS_H
  3. #define NETDATA_RRDFUNCTIONS_INTERNALS_H
  4. #include "rrd.h"
  5. #include "rrdcollector-internals.h"
  6. typedef enum __attribute__((packed)) {
  7. RRD_FUNCTION_LOCAL = (1 << 0),
  8. RRD_FUNCTION_GLOBAL = (1 << 1),
  9. RRD_FUNCTION_DYNCFG = (1 << 2),
  10. // this is 8-bit
  11. } RRD_FUNCTION_OPTIONS;
  12. struct rrd_host_function {
  13. bool sync; // when true, the function is called synchronously
  14. RRD_FUNCTION_OPTIONS options; // RRD_FUNCTION_OPTIONS
  15. HTTP_ACCESS access;
  16. STRING *help;
  17. STRING *tags;
  18. int timeout; // the default timeout of the function
  19. int priority;
  20. rrd_function_execute_cb_t execute_cb;
  21. void *execute_cb_data;
  22. struct rrd_collector *collector;
  23. };
  24. size_t rrd_functions_sanitize(char *dst, const char *src, size_t dst_len);
  25. int rrd_functions_find_by_name(RRDHOST *host, BUFFER *wb, const char *name, size_t key_length, const DICTIONARY_ITEM **item);
  26. #endif //NETDATA_RRDFUNCTIONS_INTERNALS_H