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 enum pcmk_pacemakerd_state {
28 pcmk_pacemakerd_state_invalid = -1,
29 pcmk_pacemakerd_state_init = 0,
30 pcmk_pacemakerd_state_starting_daemons,
31 pcmk_pacemakerd_state_wait_for_ping,
32 pcmk_pacemakerd_state_running,
33 pcmk_pacemakerd_state_shutting_down,
34 pcmk_pacemakerd_state_shutdown_complete,
35 pcmk_pacemakerd_state_remote,
36 pcmk_pacemakerd_state_max = pcmk_pacemakerd_state_remote,
37 };
38
39
40 enum pcmk_pacemakerd_api_reply {
41 pcmk_pacemakerd_reply_unknown,
42 pcmk_pacemakerd_reply_ping,
43 pcmk_pacemakerd_reply_shutdown,
44 };
45
46
47
48
49 typedef struct {
50 enum pcmk_pacemakerd_api_reply reply_type;
51
52 union {
53
54 struct {
55 const char *sys_from;
56 enum pcmk_pacemakerd_state state;
57 time_t last_good;
58 int status;
59 } ping;
60
61 struct {
62 int status;
63 } shutdown;
64 } data;
65 } pcmk_pacemakerd_api_reply_t;
66
67 int pcmk_pacemakerd_api_ping(pcmk_ipc_api_t *api, const char *ipc_name);
68 int pcmk_pacemakerd_api_shutdown(pcmk_ipc_api_t *api, const char *ipc_name);
69
70 enum pcmk_pacemakerd_state
71 pcmk_pacemakerd_api_daemon_state_text2enum(const char *state);
72 const char
73 *pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif