pacemaker
2.1.8-3980678f03
Scalable High-Availability cluster resource manager
include
crm
common
ipc_pacemakerd.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020-2024 the Pacemaker project contributors
3
*
4
* The version control history for this file may have further details.
5
*
6
* This source code is licensed under the GNU Lesser General Public License
7
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8
*/
9
10
#ifndef PCMK__CRM_COMMON_IPC_PACEMAKERD__H
11
#define PCMK__CRM_COMMON_IPC_PACEMAKERD__H
12
13
#include <sys/types.h>
// time_t
14
#include <
crm/common/ipc.h
>
// pcmk_ipc_api_t
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
27
// NOTE: sbd (as of at least 1.5.2) uses this enum
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
// NOTE: sbd (as of at least 1.5.2) uses this value
35
pcmk_pacemakerd_state_running
,
36
37
// NOTE: sbd (as of at least 1.5.2) uses this value
38
pcmk_pacemakerd_state_shutting_down
,
39
40
// NOTE: sbd (as of at least 1.5.2) uses this value
41
pcmk_pacemakerd_state_shutdown_complete
,
42
43
pcmk_pacemakerd_state_remote
,
44
pcmk_pacemakerd_state_max
=
pcmk_pacemakerd_state_remote
,
45
};
46
48
enum
pcmk_pacemakerd_api_reply
{
49
pcmk_pacemakerd_reply_unknown
,
50
51
// NOTE: sbd (as of at least 1.5.2) uses this value
52
pcmk_pacemakerd_reply_ping
,
53
54
pcmk_pacemakerd_reply_shutdown
,
55
};
56
57
// NOTE: sbd (as of at least 1.5.2) uses this type and some of its members
61
typedef
struct
{
62
enum
pcmk_pacemakerd_api_reply
reply_type;
63
64
union
{
65
// pcmk_pacemakerd_reply_ping
66
struct
{
67
const
char
*
sys_from
;
68
enum
pcmk_pacemakerd_state
state;
69
time_t
last_good
;
70
int
status
;
71
} ping;
72
// pcmk_pacemakerd_reply_shutdown
73
struct
{
74
int
status;
75
} shutdown;
76
}
data
;
77
}
pcmk_pacemakerd_api_reply_t
;
78
79
// NOTE: sbd (as of at least 1.5.2) uses this
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 // PCMK__CRM_COMMON_IPC_PACEMAKERD__H
pcmk_pacemakerd_state_shutting_down
Definition:
ipc_pacemakerd.h:38
data
char data[0]
Definition:
cpg.c:58
pcmk_pacemakerd_state_max
Definition:
ipc_pacemakerd.h:44
pcmk_pacemakerd_state_starting_daemons
Definition:
ipc_pacemakerd.h:31
pcmk_pacemakerd_state_running
Definition:
ipc_pacemakerd.h:35
pcmk_pacemakerd_state_invalid
Definition:
ipc_pacemakerd.h:29
pcmk_pacemakerd_api_reply
pcmk_pacemakerd_api_reply
Possible types of pacemakerd replies.
Definition:
ipc_pacemakerd.h:48
pcmk_pacemakerd_api_reply_t::status
int status
Definition:
ipc_pacemakerd.h:70
pcmk_pacemakerd_state_shutdown_complete
Definition:
ipc_pacemakerd.h:41
pcmk_pacemakerd_api_daemon_state_text2enum
enum pcmk_pacemakerd_state pcmk_pacemakerd_api_daemon_state_text2enum(const char *state)
Definition:
ipc_pacemakerd.c:38
pcmk_pacemakerd_reply_shutdown
Definition:
ipc_pacemakerd.h:54
pcmk_pacemakerd_api_reply_t::last_good
time_t last_good
Definition:
ipc_pacemakerd.h:69
pcmk_pacemakerd_api_reply_t::sys_from
const char * sys_from
Definition:
ipc_pacemakerd.h:67
pcmk_pacemakerd_api_reply_t
Definition:
ipc_pacemakerd.h:61
pcmk_pacemakerd_state_remote
Definition:
ipc_pacemakerd.h:43
pcmk_pacemakerd_api_shutdown
int pcmk_pacemakerd_api_shutdown(pcmk_ipc_api_t *api, const char *ipc_name)
Definition:
ipc_pacemakerd.c:318
pcmk_pacemakerd_state_wait_for_ping
Definition:
ipc_pacemakerd.h:32
pcmk_pacemakerd_api_ping
int pcmk_pacemakerd_api_ping(pcmk_ipc_api_t *api, const char *ipc_name)
Definition:
ipc_pacemakerd.c:312
pcmk_ipc_api_s
Definition:
crmcommon_private.h:241
pcmk_pacemakerd_state_init
Definition:
ipc_pacemakerd.h:30
pcmk_pacemakerd_reply_unknown
Definition:
ipc_pacemakerd.h:49
pcmk_pacemakerd_state
pcmk_pacemakerd_state
Definition:
ipc_pacemakerd.h:28
pcmk_pacemakerd_api_daemon_state_enum2text
const char * pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state)
Definition:
ipc_pacemakerd.c:55
ipc.h
IPC interface to Pacemaker daemons.
pcmk_pacemakerd_reply_ping
Definition:
ipc_pacemakerd.h:52
Generated on Thu Aug 8 2024 18:08:10 for pacemaker by
1.8.14