1
2
3
4
5
6
7
8
9
10 #ifndef CRMD_UTILS__H
11 #define CRMD_UTILS__H
12
13 #include <stdint.h>
14
15 #include <glib.h>
16 #include <libxml/tree.h>
17
18 #include <crm/crm.h>
19 #include <crm/cluster.h>
20 #include <crm/cluster/internal.h>
21 #include <crm/common/xml.h>
22
23 # define FAKE_TE_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
24
25
26 enum controld_node_update_flags {
27
28 controld_node_update_none = UINT32_C(0),
29
30
31 controld_node_update_quick = (UINT32_C(1) << 0),
32
33
34 controld_node_update_cluster = (UINT32_C(1) << 1),
35
36
37 controld_node_update_peer = (UINT32_C(1) << 2),
38
39
40 controld_node_update_join = (UINT32_C(1) << 3),
41
42
43 controld_node_update_expected = (UINT32_C(1) << 4),
44
45
46 controld_node_update_all = controld_node_update_cluster
47 |controld_node_update_peer
48 |controld_node_update_join
49 |controld_node_update_expected,
50 };
51
52 crm_exit_t crmd_exit(crm_exit_t exit_code);
53 _Noreturn void crmd_fast_exit(crm_exit_t exit_code);
54 void controld_shutdown_schedulerd_ipc(void);
55 void controld_stop_sched_timer(void);
56 void controld_free_sched_timer(void);
57 void controld_expect_sched_reply(char *ref);
58
59 void fsa_dump_actions(uint64_t action, const char *text);
60 void fsa_dump_inputs(int log_level, const char *text, long long input_register);
61
62 gboolean update_dc(xmlNode * msg);
63 void crm_update_peer_join(const char *source, pcmk__node_status_t *node,
64 enum controld_join_phase phase);
65 xmlNode *create_node_state_update(pcmk__node_status_t *node, uint32_t flags,
66 xmlNode *parent, const char *source);
67 void populate_cib_nodes(uint32_t flags, const char *source);
68 void crm_update_quorum(gboolean quorum, gboolean force_update);
69 void controld_close_attrd_ipc(void);
70 void update_attrd(const char *host, const char *name, const char *value, const char *user_name, gboolean is_remote_node);
71 void update_attrd_list(GList *attrs, uint32_t opts);
72 void update_attrd_remote_node_removed(const char *host, const char *user_name);
73 void update_attrd_clear_failures(const char *host, const char *rsc,
74 const char *op, const char *interval_spec,
75 gboolean is_remote_node);
76
77 int crmd_join_phase_count(enum controld_join_phase phase);
78 void crmd_join_phase_log(int level);
79
80 void crmd_peer_down(pcmk__node_status_t *peer, bool full);
81
82 bool feature_set_compatible(const char *dc_version, const char *join_version);
83 bool controld_is_local_node(const char *name);
84 pcmk__node_status_t *controld_get_local_node_status(void);
85 const char *get_node_id(xmlNode *lrm_rsc_op);
86
87 #endif