master
h 48 lines 1.96 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef NETDATA_PULSE_PARENTS_H
4 #define NETDATA_PULSE_PARENTS_H
5
6 #include "libnetdata/libnetdata.h"
7 #include "streaming/stream-handshake.h"
8
9 typedef enum {
10 PULSE_HOST_STATUS_NONE = 0,
11 PULSE_HOST_STATUS_LOCAL = (1 << 0),
12 PULSE_HOST_STATUS_VIRTUAL = (1 << 1),
13 PULSE_HOST_STATUS_LOADING = (1 << 2),
14 PULSE_HOST_STATUS_ARCHIVED = (1 << 3),
15 PULSE_HOST_STATUS_RCV_OFFLINE = (1 << 4),
16 PULSE_HOST_STATUS_RCV_WAITING = (1 << 5),
17 PULSE_HOST_STATUS_RCV_REPLICATING = (1 << 6),
18 PULSE_HOST_STATUS_RCV_REPLICATION_WAIT = (1 << 7),
19 PULSE_HOST_STATUS_RCV_RUNNING = (1 << 8),
20 PULSE_HOST_STATUS_SND_OFFLINE = (1 << 9),
21 PULSE_HOST_STATUS_SND_PENDING = (1 << 10),
22 PULSE_HOST_STATUS_SND_CONNECTING = (1 << 11),
23 PULSE_HOST_STATUS_SND_NO_DST = (1 << 12),
24 PULSE_HOST_STATUS_SND_NO_DST_FAILED = (1 << 13),
25 PULSE_HOST_STATUS_SND_WAITING = (1 << 14),
26 PULSE_HOST_STATUS_SND_REPLICATING = (1 << 15),
27 PULSE_HOST_STATUS_SND_RUNNING = (1 << 16),
28 PULSE_HOST_STATUS_DELETED = (1 << 17),
29 PULSE_HOST_STATUS_EPHEMERAL = (1 << 18),
30 PULSE_HOST_STATUS_PERMANENT = (1 << 19),
31 } PULSE_HOST_STATUS;
32
33 void pulse_host_status(RRDHOST *host, PULSE_HOST_STATUS status, STREAM_HANDSHAKE reason);
34
35 // receiver events
36
37 void pulse_parent_stream_info_received_request(void);
38 void pulse_parent_receiver_request(void);
39 void pulse_parent_receiver_rejected(STREAM_HANDSHAKE reason);
40
41 // sender
42 void pulse_stream_info_sent_request(void);
43 void pulse_sender_stream_info_failed(const char *destination __maybe_unused, STREAM_HANDSHAKE reason);
44 void pulse_sender_connection_failed(const char *destination __maybe_unused, STREAM_HANDSHAKE reason);
45
46 void pulse_parents_do(bool extended);
47
48 #endif //NETDATA_PULSE_PARENTS_H