1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_IPC_PACEMAKERD__H
11 #define PCMK__CRM_COMMON_IPC_PACEMAKERD__H
12
13 #include <sys/types.h>
14 #include <crm/common/ipc.h>
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20
21
22
23
24
25
26
27
28 enum pcmk_pacemakerd_state {
29 pcmk_pacemakerd_state_invalid = -1,
30 pcmk_pacemakerd_state_init = 0,
31 pcmk_pacemakerd_state_starting_daemons,
32 pcmk_pacemakerd_state_wait_for_ping,
33
34
35 pcmk_pacemakerd_state_running,
36
37
38 pcmk_pacemakerd_state_shutting_down,
39
40
41 pcmk_pacemakerd_state_shutdown_complete,
42
43 pcmk_pacemakerd_state_remote,
44 pcmk_pacemakerd_state_max = pcmk_pacemakerd_state_remote,
45 };
46
47
48 enum pcmk_pacemakerd_api_reply {
49 pcmk_pacemakerd_reply_unknown,
50
51
52 pcmk_pacemakerd_reply_ping,
53
54 pcmk_pacemakerd_reply_shutdown,
55 };
56
57
58
59
60
61 typedef struct {
62 enum pcmk_pacemakerd_api_reply reply_type;
63
64 union {
65
66 struct {
67 const char *sys_from;
68 enum pcmk_pacemakerd_state state;
69 time_t last_good;
70 int status;
71 } ping;
72
73 struct {
74 int status;
75 } shutdown;
76 } data;
77 } pcmk_pacemakerd_api_reply_t;
78
79
80 int pcmk_pacemakerd_api_ping(pcmk_ipc_api_t *api, const char *ipc_name);
81
82 int pcmk_pacemakerd_api_shutdown(pcmk_ipc_api_t *api, const char *ipc_name);
83
84 enum pcmk_pacemakerd_state
85 pcmk_pacemakerd_api_daemon_state_text2enum(const char *state);
86 const char
87 *pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif