pacemaker  1.1.14-70404b0
Scalable High-Availability cluster resource manager
crm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CRM__H
19 # define CRM__H
20 
27 # include <crm_config.h>
28 # include <stdlib.h>
29 # include <glib.h>
30 # include <stdbool.h>
31 
32 # undef MIN
33 # undef MAX
34 # include <string.h>
35 
36 # include <libxml/tree.h>
37 
38 # define CRM_FEATURE_SET "3.0.10"
39 
40 # define EOS '\0'
41 # define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) )
42 
43 # ifndef MAX_NAME
44 # define MAX_NAME 256
45 # endif
46 
47 # ifndef __GNUC__
48 # define __builtin_expect(expr, result) (expr)
49 # endif
50 
51 /* Some handy macros used by the Linux kernel */
52 # define __likely(expr) __builtin_expect(expr, 1)
53 # define __unlikely(expr) __builtin_expect(expr, 0)
54 
55 # define CRM_META "CRM_meta"
56 
57 extern char *crm_system_name;
58 
59 /* *INDENT-OFF* */
60 
61 /* Clean these up at some point, some probably should be runtime options */
62 # define SOCKET_LEN 1024
63 # define APPNAME_LEN 256
64 # define MAX_IPC_FAIL 5
65 # define MAX_IPC_DELAY 120
66 
67 # define DAEMON_RESPAWN_STOP 100
68 
69 # define MSG_LOG 1
70 # define DOT_FSA_ACTIONS 1
71 # define DOT_ALL_FSA_INPUTS 1
72 /* #define FSA_TRACE 1 */
73 
74 # define INFINITY_S "INFINITY"
75 # define MINUS_INFINITY_S "-INFINITY"
76 
77 # define INFINITY 1000000
78 
79 /* Sub-systems */
80 # define CRM_SYSTEM_DC "dc"
81 # define CRM_SYSTEM_DCIB "dcib"
82  /* The master CIB */
83 # define CRM_SYSTEM_CIB "cib"
84 # define CRM_SYSTEM_CRMD "crmd"
85 # define CRM_SYSTEM_LRMD "lrmd"
86 # define CRM_SYSTEM_PENGINE "pengine"
87 # define CRM_SYSTEM_TENGINE "tengine"
88 # define CRM_SYSTEM_STONITHD "stonithd"
89 # define CRM_SYSTEM_MCP "pacemakerd"
90 
91 /* Valid operations */
92 # define CRM_OP_NOOP "noop"
93 
94 # define CRM_OP_JOIN_ANNOUNCE "join_announce"
95 # define CRM_OP_JOIN_OFFER "join_offer"
96 # define CRM_OP_JOIN_REQUEST "join_request"
97 # define CRM_OP_JOIN_ACKNAK "join_ack_nack"
98 # define CRM_OP_JOIN_CONFIRM "join_confirm"
99 
100 # define CRM_OP_DIE "die_no_respawn"
101 # define CRM_OP_RETRIVE_CIB "retrieve_cib"
102 # define CRM_OP_PING "ping"
103 # define CRM_OP_THROTTLE "throttle"
104 # define CRM_OP_VOTE "vote"
105 # define CRM_OP_NOVOTE "no-vote"
106 # define CRM_OP_HELLO "hello"
107 # define CRM_OP_HBEAT "dc_beat"
108 # define CRM_OP_PECALC "pe_calc"
109 # define CRM_OP_ABORT "abort"
110 # define CRM_OP_QUIT "quit"
111 # define CRM_OP_LOCAL_SHUTDOWN "start_shutdown"
112 # define CRM_OP_SHUTDOWN_REQ "req_shutdown"
113 # define CRM_OP_SHUTDOWN "do_shutdown"
114 # define CRM_OP_FENCE "stonith"
115 # define CRM_OP_EVENTCC "event_cc"
116 # define CRM_OP_TEABORT "te_abort"
117 # define CRM_OP_TEABORTED "te_abort_confirmed" /* we asked */
118 # define CRM_OP_TE_HALT "te_halt"
119 # define CRM_OP_TECOMPLETE "te_complete"
120 # define CRM_OP_TETIMEOUT "te_timeout"
121 # define CRM_OP_TRANSITION "transition"
122 # define CRM_OP_REGISTER "register"
123 # define CRM_OP_IPC_FWD "ipc_fwd"
124 # define CRM_OP_DEBUG_UP "debug_inc"
125 # define CRM_OP_DEBUG_DOWN "debug_dec"
126 # define CRM_OP_INVOKE_LRM "lrm_invoke"
127 # define CRM_OP_LRM_REFRESH "lrm_refresh" /* Deprecated */
128 # define CRM_OP_LRM_QUERY "lrm_query"
129 # define CRM_OP_LRM_DELETE "lrm_delete"
130 # define CRM_OP_LRM_FAIL "lrm_fail"
131 # define CRM_OP_PROBED "probe_complete"
132 # define CRM_OP_NODES_PROBED "probe_nodes_complete"
133 # define CRM_OP_REPROBE "probe_again"
134 # define CRM_OP_CLEAR_FAILCOUNT "clear_failcount"
135 # define CRM_OP_RELAXED_SET "one-or-more"
136 # define CRM_OP_RELAXED_CLONE "clone-one-or-more"
137 # define CRM_OP_RM_NODE_CACHE "rm_node_cache"
138 
139 # define CRMD_JOINSTATE_DOWN "down"
140 # define CRMD_JOINSTATE_PENDING "pending"
141 # define CRMD_JOINSTATE_MEMBER "member"
142 # define CRMD_JOINSTATE_NACK "banned"
143 
144 # define CRMD_ACTION_DELETE "delete"
145 # define CRMD_ACTION_CANCEL "cancel"
146 
147 # define CRMD_ACTION_MIGRATE "migrate_to"
148 # define CRMD_ACTION_MIGRATED "migrate_from"
149 
150 # define CRMD_ACTION_START "start"
151 # define CRMD_ACTION_STARTED "running"
152 
153 # define CRMD_ACTION_STOP "stop"
154 # define CRMD_ACTION_STOPPED "stopped"
155 
156 # define CRMD_ACTION_PROMOTE "promote"
157 # define CRMD_ACTION_PROMOTED "promoted"
158 # define CRMD_ACTION_DEMOTE "demote"
159 # define CRMD_ACTION_DEMOTED "demoted"
160 
161 # define CRMD_ACTION_NOTIFY "notify"
162 # define CRMD_ACTION_NOTIFIED "notified"
163 
164 # define CRMD_ACTION_STATUS "monitor"
165 
166 /* short names */
167 # define RSC_DELETE CRMD_ACTION_DELETE
168 # define RSC_CANCEL CRMD_ACTION_CANCEL
169 
170 # define RSC_MIGRATE CRMD_ACTION_MIGRATE
171 # define RSC_MIGRATED CRMD_ACTION_MIGRATED
172 
173 # define RSC_START CRMD_ACTION_START
174 # define RSC_STARTED CRMD_ACTION_STARTED
175 
176 # define RSC_STOP CRMD_ACTION_STOP
177 # define RSC_STOPPED CRMD_ACTION_STOPPED
178 
179 # define RSC_PROMOTE CRMD_ACTION_PROMOTE
180 # define RSC_PROMOTED CRMD_ACTION_PROMOTED
181 # define RSC_DEMOTE CRMD_ACTION_DEMOTE
182 # define RSC_DEMOTED CRMD_ACTION_DEMOTED
183 
184 # define RSC_NOTIFY CRMD_ACTION_NOTIFY
185 # define RSC_NOTIFIED CRMD_ACTION_NOTIFIED
186 
187 # define RSC_STATUS CRMD_ACTION_STATUS
188 /* *INDENT-ON* */
189 
190 typedef GList *GListPtr;
191 
192 # include <crm/common/logging.h>
193 # include <crm/common/util.h>
194 # include <crm/error.h>
195 
196 # define crm_str_hash g_str_hash_traditional
197 
198 guint crm_strcase_hash(gconstpointer v);
199 guint g_str_hash_traditional(gconstpointer v);
200 
201 #endif
char * crm_system_name
Definition: utils.c:65
Wrappers for and extensions to libqb logging.
Error codes and asserts.
guint crm_strcase_hash(gconstpointer v)
Definition: utils.c:2256
Utility functions.
guint g_str_hash_traditional(gconstpointer v)
Definition: utils.c:2244
GList * GListPtr
Definition: crm.h:190