This source file includes following definitions.
- crm_action_str
1
2
3
4
5
6
7
8
9
10 #ifndef CRM__H
11 # define CRM__H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17
18
19
20
21
22
23 # include <crm_config.h>
24 # include <stdlib.h>
25 # include <glib.h>
26 # include <stdbool.h>
27
28 # include <string.h>
29
30 # include <libxml/tree.h>
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 # define CRM_FEATURE_SET "3.6.1"
55
56 # define EOS '\0'
57 # define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) )
58
59 # ifndef MAX_NAME
60 # define MAX_NAME 256
61 # endif
62
63 # ifndef __GNUC__
64 # define __builtin_expect(expr, result) (expr)
65 # endif
66
67
68 # define __likely(expr) __builtin_expect(expr, 1)
69 # define __unlikely(expr) __builtin_expect(expr, 0)
70
71 # define CRM_META "CRM_meta"
72
73 extern char *crm_system_name;
74
75
76
77
78 # define MAX_IPC_DELAY 120
79
80
81 # define CRM_SCORE_INFINITY 1000000
82 # define CRM_INFINITY_S "INFINITY"
83 # define CRM_PLUS_INFINITY_S "+" CRM_INFINITY_S
84 # define CRM_MINUS_INFINITY_S "-" CRM_INFINITY_S
85
86
87
88
89
90
91
92 # undef INFINITY
93 # define INFINITY_S "INFINITY"
94 # define MINUS_INFINITY_S "-INFINITY"
95 # define INFINITY 1000000
96
97
98 # define CRM_SYSTEM_DC "dc"
99 # define CRM_SYSTEM_DCIB "dcib"
100
101 # define CRM_SYSTEM_CIB "cib"
102 # define CRM_SYSTEM_CRMD "crmd"
103 # define CRM_SYSTEM_LRMD "lrmd"
104 # define CRM_SYSTEM_PENGINE "pengine"
105 # define CRM_SYSTEM_TENGINE "tengine"
106 # define CRM_SYSTEM_STONITHD "stonithd"
107 # define CRM_SYSTEM_MCP "pacemakerd"
108
109
110 # define CRM_ATTR_UNAME "#uname"
111 # define CRM_ATTR_ID "#id"
112 # define CRM_ATTR_KIND "#kind"
113 # define CRM_ATTR_ROLE "#role"
114 # define CRM_ATTR_IS_DC "#is_dc"
115 # define CRM_ATTR_CLUSTER_NAME "#cluster-name"
116 # define CRM_ATTR_SITE_NAME "#site-name"
117 # define CRM_ATTR_UNFENCED "#node-unfenced"
118 # define CRM_ATTR_DIGESTS_ALL "#digests-all"
119 # define CRM_ATTR_DIGESTS_SECURE "#digests-secure"
120 # define CRM_ATTR_RA_VERSION "#ra-version"
121 # define CRM_ATTR_PROTOCOL "#attrd-protocol"
122
123
124 # define CRM_OP_NOOP "noop"
125 # define CRM_OP_JOIN_ANNOUNCE "join_announce"
126 # define CRM_OP_JOIN_OFFER "join_offer"
127 # define CRM_OP_JOIN_REQUEST "join_request"
128 # define CRM_OP_JOIN_ACKNAK "join_ack_nack"
129 # define CRM_OP_JOIN_CONFIRM "join_confirm"
130 # define CRM_OP_PING "ping"
131 # define CRM_OP_NODE_INFO "node-info"
132 # define CRM_OP_THROTTLE "throttle"
133 # define CRM_OP_VOTE "vote"
134 # define CRM_OP_NOVOTE "no-vote"
135 # define CRM_OP_HELLO "hello"
136 # define CRM_OP_PECALC "pe_calc"
137 # define CRM_OP_QUIT "quit"
138 # define CRM_OP_LOCAL_SHUTDOWN "start_shutdown"
139 # define CRM_OP_SHUTDOWN_REQ "req_shutdown"
140 # define CRM_OP_SHUTDOWN "do_shutdown"
141 # define CRM_OP_FENCE "stonith"
142 # define CRM_OP_REGISTER "register"
143 # define CRM_OP_IPC_FWD "ipc_fwd"
144 # define CRM_OP_INVOKE_LRM "lrm_invoke"
145 # define CRM_OP_LRM_REFRESH "lrm_refresh"
146 # define CRM_OP_LRM_QUERY "lrm_query"
147 # define CRM_OP_LRM_DELETE "lrm_delete"
148 # define CRM_OP_LRM_FAIL "lrm_fail"
149 # define CRM_OP_PROBED "probe_complete"
150 # define CRM_OP_REPROBE "probe_again"
151 # define CRM_OP_CLEAR_FAILCOUNT "clear_failcount"
152 # define CRM_OP_REMOTE_STATE "remote_state"
153 # define CRM_OP_RELAXED_SET "one-or-more"
154 # define CRM_OP_RELAXED_CLONE "clone-one-or-more"
155 # define CRM_OP_RM_NODE_CACHE "rm_node_cache"
156 # define CRM_OP_MAINTENANCE_NODES "maintenance_nodes"
157
158
159 # define CRMD_JOINSTATE_DOWN "down"
160 # define CRMD_JOINSTATE_PENDING "pending"
161 # define CRMD_JOINSTATE_MEMBER "member"
162 # define CRMD_JOINSTATE_NACK "banned"
163
164 # define CRMD_ACTION_DELETE "delete"
165 # define CRMD_ACTION_CANCEL "cancel"
166
167 # define CRMD_ACTION_RELOAD "reload"
168 # define CRMD_ACTION_MIGRATE "migrate_to"
169 # define CRMD_ACTION_MIGRATED "migrate_from"
170
171 # define CRMD_ACTION_START "start"
172 # define CRMD_ACTION_STARTED "running"
173
174 # define CRMD_ACTION_STOP "stop"
175 # define CRMD_ACTION_STOPPED "stopped"
176
177 # define CRMD_ACTION_PROMOTE "promote"
178 # define CRMD_ACTION_PROMOTED "promoted"
179 # define CRMD_ACTION_DEMOTE "demote"
180 # define CRMD_ACTION_DEMOTED "demoted"
181
182 # define CRMD_ACTION_NOTIFY "notify"
183 # define CRMD_ACTION_NOTIFIED "notified"
184
185 # define CRMD_ACTION_STATUS "monitor"
186 # define CRMD_ACTION_METADATA "meta-data"
187 # define CRMD_METADATA_CALL_TIMEOUT 30000
188
189
190 # define RSC_DELETE CRMD_ACTION_DELETE
191 # define RSC_CANCEL CRMD_ACTION_CANCEL
192
193 # define RSC_MIGRATE CRMD_ACTION_MIGRATE
194 # define RSC_MIGRATED CRMD_ACTION_MIGRATED
195
196 # define RSC_START CRMD_ACTION_START
197 # define RSC_STARTED CRMD_ACTION_STARTED
198
199 # define RSC_STOP CRMD_ACTION_STOP
200 # define RSC_STOPPED CRMD_ACTION_STOPPED
201
202 # define RSC_PROMOTE CRMD_ACTION_PROMOTE
203 # define RSC_PROMOTED CRMD_ACTION_PROMOTED
204 # define RSC_DEMOTE CRMD_ACTION_DEMOTE
205 # define RSC_DEMOTED CRMD_ACTION_DEMOTED
206
207 # define RSC_NOTIFY CRMD_ACTION_NOTIFY
208 # define RSC_NOTIFIED CRMD_ACTION_NOTIFIED
209
210 # define RSC_STATUS CRMD_ACTION_STATUS
211 # define RSC_METADATA CRMD_ACTION_METADATA
212
213
214 typedef GList *GListPtr;
215
216 # include <crm/common/logging.h>
217 # include <crm/common/util.h>
218
219 static inline const char *
220 crm_action_str(const char *task, guint interval_ms) {
221 if ((task != NULL) && (interval_ms == 0)
222 && (strcasecmp(task, RSC_STATUS) == 0)) {
223 return "probe";
224 }
225 return task;
226 }
227
228 #ifdef __cplusplus
229 }
230 #endif
231
232 #endif