1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__IPC_CONTROLD__H
11 # define PCMK__IPC_CONTROLD__H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17
18
19
20
21
22
23
24 #include <stdbool.h>
25 #include <glib.h>
26 #include <libxml/tree.h>
27 #include <crm/common/ipc.h>
28
29
30 enum pcmk_controld_api_reply {
31 pcmk_controld_reply_unknown,
32 pcmk_controld_reply_reprobe,
33 pcmk_controld_reply_info,
34 pcmk_controld_reply_resource,
35 pcmk_controld_reply_ping,
36 pcmk_controld_reply_nodes,
37 };
38
39
40 typedef struct {
41 uint32_t id;
42 const char *uname;
43 const char *state;
44 } pcmk_controld_api_node_t;
45
46
47
48
49
50
51
52
53
54
55
56
57 typedef struct {
58 enum pcmk_controld_api_reply reply_type;
59 const char *feature_set;
60 const char *host_from;
61
62 union {
63
64 struct {
65 bool have_quorum;
66 bool is_remote;
67 int id;
68 const char *uuid;
69 const char *uname;
70 const char *state;
71 } node_info;
72
73
74 struct {
75 xmlNode *node_state;
76 } resource;
77
78
79 struct {
80 const char *sys_from;
81 const char *fsa_state;
82 const char *result;
83 } ping;
84
85
86 GList *nodes;
87 } data;
88 } pcmk_controld_api_reply_t;
89
90 int pcmk_controld_api_reprobe(pcmk_ipc_api_t *api, const char *target_node,
91 const char *router_node);
92 int pcmk_controld_api_node_info(pcmk_ipc_api_t *api, uint32_t nodeid);
93 int pcmk_controld_api_fail(pcmk_ipc_api_t *api, const char *target_node,
94 const char *router_node, const char *rsc_id,
95 const char *rsc_long_id, const char *standard,
96 const char *provider, const char *type);
97 int pcmk_controld_api_refresh(pcmk_ipc_api_t *api, const char *target_node,
98 const char *router_node, const char *rsc_id,
99 const char *rsc_long_id, const char *standard,
100 const char *provider, const char *type,
101 bool cib_only);
102 int pcmk_controld_api_ping(pcmk_ipc_api_t *api, const char *node_name);
103 int pcmk_controld_api_list_nodes(pcmk_ipc_api_t *api);
104 int pcmk_controld_api_shutdown(pcmk_ipc_api_t *api, const char *node_name);
105 int pcmk_controld_api_start_election(pcmk_ipc_api_t *api);
106 unsigned int pcmk_controld_api_replies_expected(pcmk_ipc_api_t *api);
107
108 #ifdef __cplusplus
109 }
110 #endif
111
112 #endif