summaryrefslogtreecommitdiffstats
path: root/src/plugins.d/pluginsd_functions.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:36:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:37:11 +0000
commit910c794ec6d0a364b4aabccf22b715cb45780e83 (patch)
tree561a9ef6b6a4668102674e1a52b3e7563c57ac61 /src/plugins.d/pluginsd_functions.h
parentReleasing debian version 1.47.5-1. (diff)
downloadnetdata-910c794ec6d0a364b4aabccf22b715cb45780e83.tar.xz
netdata-910c794ec6d0a364b4aabccf22b715cb45780e83.zip
Merging upstream version 2.0.0 (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/plugins.d/pluginsd_functions.h')
-rw-r--r--src/plugins.d/pluginsd_functions.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugins.d/pluginsd_functions.h b/src/plugins.d/pluginsd_functions.h
new file mode 100644
index 00000000..ad47dc23
--- /dev/null
+++ b/src/plugins.d/pluginsd_functions.h
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_PLUGINSD_FUNCTIONS_H
+#define NETDATA_PLUGINSD_FUNCTIONS_H
+
+#include "pluginsd_internals.h"
+
+struct inflight_function {
+ nd_uuid_t transaction;
+
+ int code;
+ int timeout_s;
+ STRING *function;
+ BUFFER *payload;
+ HTTP_ACCESS access;
+ const char *source;
+
+ BUFFER *result_body_wb;
+
+ usec_t *stop_monotonic_ut; // pointer to caller data
+ usec_t started_monotonic_ut;
+ usec_t sent_monotonic_ut;
+ PARSER *parser;
+
+ bool sent_successfully;
+
+ struct {
+ rrd_function_result_callback_t cb;
+ void *data;
+ } result;
+
+ struct {
+ rrd_function_progress_cb_t cb;
+ void *data;
+ } progress;
+};
+
+PARSER_RC pluginsd_function(char **words, size_t num_words, PARSER *parser);
+PARSER_RC pluginsd_function_result_begin(char **words, size_t num_words, PARSER *parser);
+PARSER_RC pluginsd_function_progress(char **words, size_t num_words, PARSER *parser);
+
+void pluginsd_inflight_functions_init(PARSER *parser);
+void pluginsd_inflight_functions_cleanup(PARSER *parser);
+void pluginsd_inflight_functions_garbage_collect(PARSER *parser, usec_t now_ut);
+
+int pluginsd_function_execute_cb(struct rrd_function_execute *rfe, void *data);
+
+#endif //NETDATA_PLUGINSD_FUNCTIONS_H