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