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