pacemaker
1.1.19-c3c624ea3d
Scalable High-Availability cluster resource manager
include
crm
crm.h
Go to the documentation of this file.
1
/*
2
* Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
3
*
4
* This source code is licensed under the GNU Lesser General Public License
5
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
6
*/
7
8
#ifndef CRM__H
9
# define CRM__H
10
17
# include <
crm_config.h
>
18
# include <stdlib.h>
19
# include <glib.h>
20
# include <stdbool.h>
21
22
# include <string.h>
23
24
# include <libxml/tree.h>
25
26
# define CRM_FEATURE_SET "3.0.14"
27
28
# define EOS '\0'
29
# define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) )
30
31
# ifndef MAX_NAME
32
# define MAX_NAME 256
33
# endif
34
35
# ifndef __GNUC__
36
# define __builtin_expect(expr, result) (expr)
37
# endif
38
39
/* Some handy macros used by the Linux kernel */
40
# define __likely(expr) __builtin_expect(expr, 1)
41
# define __unlikely(expr) __builtin_expect(expr, 0)
42
43
# define CRM_META "CRM_meta"
44
45
extern
char
*
crm_system_name
;
46
47
/* *INDENT-OFF* */
48
49
/* Clean these up at some point, some probably should be runtime options */
50
# define SOCKET_LEN 1024
51
# define APPNAME_LEN 256
52
# define MAX_IPC_FAIL 5
53
# define MAX_IPC_DELAY 120
54
55
# define DAEMON_RESPAWN_STOP 100
56
57
# define MSG_LOG 1
58
# define DOT_FSA_ACTIONS 1
59
# define DOT_ALL_FSA_INPUTS 1
60
/* #define FSA_TRACE 1 */
61
62
/* This header defines INFINITY, but it might be defined elsewhere as well
63
* (e.g. math.h), so undefine it first. This, of course, complicates any attempt
64
* to use the other definition in any code that includes this header.
65
*
66
* @TODO: Rename our constant (which will break API backward compatibility).
67
*/
68
# undef INFINITY
69
70
# define INFINITY_S "INFINITY"
71
# define MINUS_INFINITY_S "-INFINITY"
72
73
# define INFINITY 1000000
74
75
/* Sub-systems */
76
# define CRM_SYSTEM_DC "dc"
77
# define CRM_SYSTEM_DCIB "dcib"
78
/* The master CIB */
79
# define CRM_SYSTEM_CIB "cib"
80
# define CRM_SYSTEM_CRMD "crmd"
81
# define CRM_SYSTEM_LRMD "lrmd"
82
# define CRM_SYSTEM_PENGINE "pengine"
83
# define CRM_SYSTEM_TENGINE "tengine"
84
# define CRM_SYSTEM_STONITHD "stonithd"
85
# define CRM_SYSTEM_MCP "pacemakerd"
86
87
// Names of internally generated node attributes
88
# define CRM_ATTR_UNAME "#uname"
89
# define CRM_ATTR_ID "#id"
90
# define CRM_ATTR_KIND "#kind"
91
# define CRM_ATTR_ROLE "#role"
92
# define CRM_ATTR_IS_DC "#is_dc"
93
# define CRM_ATTR_CLUSTER_NAME "#cluster-name"
94
# define CRM_ATTR_SITE_NAME "#site-name"
95
# define CRM_ATTR_UNFENCED "#node-unfenced"
96
# define CRM_ATTR_DIGESTS_ALL "#digests-all"
97
# define CRM_ATTR_DIGESTS_SECURE "#digests-secure"
98
# define CRM_ATTR_RA_VERSION "#ra-version"
99
# define CRM_ATTR_PROTOCOL "#attrd-protocol"
100
101
/* Valid operations */
102
# define CRM_OP_NOOP "noop"
103
# define CRM_OP_JOIN_ANNOUNCE "join_announce"
104
# define CRM_OP_JOIN_OFFER "join_offer"
105
# define CRM_OP_JOIN_REQUEST "join_request"
106
# define CRM_OP_JOIN_ACKNAK "join_ack_nack"
107
# define CRM_OP_JOIN_CONFIRM "join_confirm"
108
# define CRM_OP_PING "ping"
109
# define CRM_OP_NODE_INFO "node-info"
110
# define CRM_OP_THROTTLE "throttle"
111
# define CRM_OP_VOTE "vote"
112
# define CRM_OP_NOVOTE "no-vote"
113
# define CRM_OP_HELLO "hello"
114
# define CRM_OP_PECALC "pe_calc"
115
# define CRM_OP_QUIT "quit"
116
# define CRM_OP_LOCAL_SHUTDOWN "start_shutdown"
117
# define CRM_OP_SHUTDOWN_REQ "req_shutdown"
118
# define CRM_OP_SHUTDOWN "do_shutdown"
119
# define CRM_OP_FENCE "stonith"
120
# define CRM_OP_REGISTER "register"
121
# define CRM_OP_IPC_FWD "ipc_fwd"
122
# define CRM_OP_INVOKE_LRM "lrm_invoke"
123
# define CRM_OP_LRM_REFRESH "lrm_refresh"
/* Deprecated */
124
# define CRM_OP_LRM_QUERY "lrm_query"
125
# define CRM_OP_LRM_DELETE "lrm_delete"
126
# define CRM_OP_LRM_FAIL "lrm_fail"
127
# define CRM_OP_PROBED "probe_complete"
128
# define CRM_OP_REPROBE "probe_again"
129
# define CRM_OP_CLEAR_FAILCOUNT "clear_failcount"
130
# define CRM_OP_REMOTE_STATE "remote_state"
131
# define CRM_OP_RELAXED_SET "one-or-more"
132
# define CRM_OP_RELAXED_CLONE "clone-one-or-more"
133
# define CRM_OP_RM_NODE_CACHE "rm_node_cache"
134
# define CRM_OP_MAINTENANCE_NODES "maintenance_nodes"
135
136
/* @COMPAT: These symbols are deprecated and not used by Pacemaker,
137
* but they are kept for public API backward compatibility.
138
*/
139
# define CRM_OP_DIE "die_no_respawn"
140
# define CRM_OP_RETRIVE_CIB "retrieve_cib"
141
# define CRM_OP_HBEAT "dc_beat"
142
# define CRM_OP_ABORT "abort"
143
# define CRM_OP_EVENTCC "event_cc"
144
# define CRM_OP_TEABORT "te_abort"
145
# define CRM_OP_TEABORTED "te_abort_confirmed"
146
# define CRM_OP_TE_HALT "te_halt"
147
# define CRM_OP_TECOMPLETE "te_complete"
148
# define CRM_OP_TETIMEOUT "te_timeout"
149
# define CRM_OP_TRANSITION "transition"
150
# define CRM_OP_DEBUG_UP "debug_inc"
/* unused since 1.1.8 */
151
# define CRM_OP_DEBUG_DOWN "debug_dec"
/* unused since 1.1.8 */
152
# define CRM_OP_NODES_PROBED "probe_nodes_complete"
153
154
/* Possible cluster membership states */
155
# define CRMD_JOINSTATE_DOWN "down"
156
# define CRMD_JOINSTATE_PENDING "pending"
157
# define CRMD_JOINSTATE_MEMBER "member"
158
# define CRMD_JOINSTATE_NACK "banned"
159
160
# define CRMD_ACTION_DELETE "delete"
161
# define CRMD_ACTION_CANCEL "cancel"
162
163
# define CRMD_ACTION_RELOAD "reload"
164
# define CRMD_ACTION_MIGRATE "migrate_to"
165
# define CRMD_ACTION_MIGRATED "migrate_from"
166
167
# define CRMD_ACTION_START "start"
168
# define CRMD_ACTION_STARTED "running"
169
170
# define CRMD_ACTION_STOP "stop"
171
# define CRMD_ACTION_STOPPED "stopped"
172
173
# define CRMD_ACTION_PROMOTE "promote"
174
# define CRMD_ACTION_PROMOTED "promoted"
175
# define CRMD_ACTION_DEMOTE "demote"
176
# define CRMD_ACTION_DEMOTED "demoted"
177
178
# define CRMD_ACTION_NOTIFY "notify"
179
# define CRMD_ACTION_NOTIFIED "notified"
180
181
# define CRMD_ACTION_STATUS "monitor"
182
# define CRMD_ACTION_METADATA "meta-data"
183
# define CRMD_METADATA_CALL_TIMEOUT 30000
184
185
/* short names */
186
# define RSC_DELETE CRMD_ACTION_DELETE
187
# define RSC_CANCEL CRMD_ACTION_CANCEL
188
189
# define RSC_MIGRATE CRMD_ACTION_MIGRATE
190
# define RSC_MIGRATED CRMD_ACTION_MIGRATED
191
192
# define RSC_START CRMD_ACTION_START
193
# define RSC_STARTED CRMD_ACTION_STARTED
194
195
# define RSC_STOP CRMD_ACTION_STOP
196
# define RSC_STOPPED CRMD_ACTION_STOPPED
197
198
# define RSC_PROMOTE CRMD_ACTION_PROMOTE
199
# define RSC_PROMOTED CRMD_ACTION_PROMOTED
200
# define RSC_DEMOTE CRMD_ACTION_DEMOTE
201
# define RSC_DEMOTED CRMD_ACTION_DEMOTED
202
203
# define RSC_NOTIFY CRMD_ACTION_NOTIFY
204
# define RSC_NOTIFIED CRMD_ACTION_NOTIFIED
205
206
# define RSC_STATUS CRMD_ACTION_STATUS
207
# define RSC_METADATA CRMD_ACTION_METADATA
208
/* *INDENT-ON* */
209
210
typedef
GList *
GListPtr
;
211
212
# include <
crm/common/logging.h
>
213
# include <
crm/common/util.h
>
214
# include <
crm/error.h
>
215
216
static
inline
const
char
*crm_action_str(
const
char
*task,
int
interval) {
217
if
(
safe_str_eq
(task,
RSC_STATUS
) && !interval) {
218
return
"probe"
;
219
}
220
return
task;
221
}
222
223
#endif
crm_config.h
crm_system_name
char * crm_system_name
Definition:
utils.c:70
logging.h
Wrappers for and extensions to libqb logging.
error.h
Error codes and asserts.
util.h
Utility functions.
RSC_STATUS
#define RSC_STATUS
Definition:
crm.h:206
safe_str_eq
#define safe_str_eq(a, b)
Definition:
util.h:72
GListPtr
GList * GListPtr
Definition:
crm.h:210
Generated on Wed Dec 26 2018 00:36:24 for pacemaker by
1.8.13