| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_STREAM_H |
| 4 | #define NETDATA_STREAM_H 1 |
| 5 | |
| 6 | #include "libnetdata/libnetdata.h" |
| 7 | #include "stream-traffic-types.h" |
| 8 | |
| 9 | struct rrdhost; |
| 10 | struct sender_state; |
| 11 | struct receiver_state; |
| 12 | |
| 13 | #include "stream-conf.h" |
| 14 | #include "stream-handshake.h" |
| 15 | #include "stream-capabilities.h" |
| 16 | #include "stream-parents.h" |
| 17 | |
| 18 | // starting and stopping senders |
| 19 | void stream_sender_start_localhost(void *ptr); |
| 20 | void stream_sender_start_host(struct rrdhost *host); |
| 21 | void stream_sender_signal_to_stop_and_wait(struct rrdhost *host, STREAM_HANDSHAKE reason, bool wait); |
| 22 | void stream_connector_remove_host(RRDHOST *host); |
| 23 | |
| 24 | // managing host sender structures |
| 25 | void stream_sender_structures_init(struct rrdhost *host, bool stream, STRING *parents, STRING *api_key, STRING *send_charts_matching); |
| 26 | void stream_sender_structures_free(struct rrdhost *host); |
| 27 | |
| 28 | // querying host sender information |
| 29 | bool stream_sender_is_connected_with_ssl(struct rrdhost *host); |
| 30 | bool stream_sender_has_compression(struct rrdhost *host); |
| 31 | bool stream_sender_has_capabilities(struct rrdhost *host, STREAM_CAPABILITIES capabilities); |
| 32 | |
| 33 | // receiver API |
| 34 | uint32_t stream_receivers_currently_connected(void); |
| 35 | struct web_client; |
| 36 | int stream_receiver_accept_connection(struct web_client *w, char *decoded_query_string); |
| 37 | bool receiver_has_capability(struct rrdhost *host, STREAM_CAPABILITIES caps); |
| 38 | void stream_receiver_free(struct receiver_state *rpt); |
| 39 | bool stream_receiver_signal_to_stop_and_wait(struct rrdhost *host, STREAM_HANDSHAKE reason); |
| 40 | char *stream_receiver_program_version_strdupz(struct rrdhost *host); |
| 41 | |
| 42 | #include "database/rrdhost-status.h" |
| 43 | #include "protocol/commands.h" |
| 44 | #include "stream-path.h" |
| 45 | #include "stream-control.h" |
| 46 | |
| 47 | void stream_threads_cancel(void); |
| 48 | |
| 49 | #endif //NETDATA_STREAM_H |