1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__IPC_PACEMAKERD__H
11 # define PCMK__IPC_PACEMAKERD__H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17
18
19
20
21
22
23
24 #include <sys/types.h>
25 #include <crm/common/ipc.h>
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_max = pcmk_pacemakerd_state_shutdown_complete,
36 };
37
38
39 enum pcmk_pacemakerd_api_reply {
40 pcmk_pacemakerd_reply_unknown,
41 pcmk_pacemakerd_reply_ping,
42 };
43
44
45
46
47 typedef struct {
48 enum pcmk_pacemakerd_api_reply reply_type;
49
50 union {
51
52 struct {
53 const char *sys_from;
54 enum pcmk_pacemakerd_state state;
55 time_t last_good;
56 int status;
57 } ping;
58 } data;
59 } pcmk_pacemakerd_api_reply_t;
60
61 int pcmk_pacemakerd_api_ping(pcmk_ipc_api_t *api, const char *ipc_name);
62 enum pcmk_pacemakerd_state
63 pcmk_pacemakerd_api_daemon_state_text2enum(const char *state);
64 const char
65 *pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state);
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif