 |
pacemaker
2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
10 #ifndef CRM_INTERNAL__H
11 # define CRM_INTERNAL__H
18 # include <libxml/tree.h>
34 static inline gboolean
35 is_privileged(
const char *user)
41 }
else if (strcmp(user,
"root") == 0) {
52 # define no_argument 0
53 # define required_argument 1
56 # define pcmk_option_default 0x00000
57 # define pcmk_option_hidden 0x00001
58 # define pcmk_option_paragraph 0x00002
59 # define pcmk_option_example 0x00004
81 const char *app_desc);
101 const char *
cluster_option(GHashTable * options, gboolean(*validate) (
const char *),
102 const char *name,
const char *old_name,
const char *def_value);
130 void crm_make_daemon(
const char *name, gboolean daemonize,
const char *pidfile);
133 #define CRM_OP_FMT "%s_%s_%u"
135 static inline long long
136 crm_clear_bit(
const char *
function,
int line,
const char *target,
long long word,
long long bit)
138 long long rc = (word & ~bit);
143 crm_trace(
"Bit 0x%.8llx for %s cleared by %s:%d", bit, target,
function, line);
145 crm_trace(
"Bit 0x%.8llx cleared by %s:%d", bit,
function, line);
151 static inline long long
152 crm_set_bit(
const char *
function,
int line,
const char *target,
long long word,
long long bit)
154 long long rc = (word | bit);
159 crm_trace(
"Bit 0x%.8llx for %s set by %s:%d", bit, target,
function, line);
161 crm_trace(
"Bit 0x%.8llx set by %s:%d", bit,
function, line);
167 # define set_bit(word, bit) word = crm_set_bit(__FUNCTION__, __LINE__, NULL, word, bit)
168 # define clear_bit(word, bit) word = crm_clear_bit(__FUNCTION__, __LINE__, NULL, word, bit)
179 # define crm_config_err(fmt...) { crm_config_error = TRUE; crm_err(fmt); }
180 # define crm_config_warn(fmt...) { crm_config_warning = TRUE; crm_warn(fmt); }
182 # define F_ATTRD_KEY "attr_key"
183 # define F_ATTRD_ATTRIBUTE "attr_name"
184 # define F_ATTRD_REGEX "attr_regex"
185 # define F_ATTRD_TASK "task"
186 # define F_ATTRD_VALUE "attr_value"
187 # define F_ATTRD_SET "attr_set"
188 # define F_ATTRD_IS_REMOTE "attr_is_remote"
189 # define F_ATTRD_IS_PRIVATE "attr_is_private"
190 # define F_ATTRD_SECTION "attr_section"
191 # define F_ATTRD_DAMPEN "attr_dampening"
192 # define F_ATTRD_HOST "attr_host"
193 # define F_ATTRD_HOST_ID "attr_host_id"
194 # define F_ATTRD_USER "attr_user"
195 # define F_ATTRD_WRITER "attr_writer"
196 # define F_ATTRD_VERSION "attr_version"
197 # define F_ATTRD_RESOURCE "attr_resource"
198 # define F_ATTRD_OPERATION "attr_clear_operation"
199 # define F_ATTRD_INTERVAL "attr_clear_interval"
200 # define F_ATTRD_IS_FORCE_WRITE "attrd_is_force_write"
203 # define ATTRD_OP_PEER_REMOVE "peer-remove"
204 # define ATTRD_OP_UPDATE "update"
205 # define ATTRD_OP_UPDATE_BOTH "update-both"
206 # define ATTRD_OP_UPDATE_DELAY "update-delay"
207 # define ATTRD_OP_QUERY "query"
208 # define ATTRD_OP_REFRESH "refresh"
209 # define ATTRD_OP_FLUSH "flush"
210 # define ATTRD_OP_SYNC "sync"
211 # define ATTRD_OP_SYNC_RESPONSE "sync-response"
212 # define ATTRD_OP_CLEAR_FAILURE "clear-failure"
214 # define PCMK_ENV_PHYSICAL_HOST "physical_host"
217 # if SUPPORT_COROSYNC
218 # include <qb/qbipc_common.h>
219 # include <corosync/corotypes.h>
245 qb_ipcs_service_t **ipcs_rw,
246 qb_ipcs_service_t **ipcs_shm,
247 struct qb_ipcs_service_handlers *ro_cb,
248 struct qb_ipcs_service_handlers *rw_cb);
251 qb_ipcs_service_t *ipcs_rw,
252 qb_ipcs_service_t *ipcs_shm);
254 static inline void *realloc_safe(
void *ptr,
size_t size)
256 void *ret = realloc(ptr,
size);
267 void crm_xml_dump(xmlNode *
data,
int options,
char **buffer,
int *offset,
int *max,
int depth);
291 const char *node_name,
const char *session_id,
const char *channel);
char * uid2username(uid_t uid)
const char * crm_acl_get_set_user(xmlNode *request, const char *field, const char *peer_user)
int crm_get_option(int argc, char **argv, int *index)
void crm_buffer_add_char(char **buffer, int *offset, int *max, char c)
void stonith_ipc_server_init(qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
int remote_proxy_dispatch(const char *buffer, ssize_t length, gpointer userdata)
struct pe_cluster_option_s pe_cluster_option
void remote_proxy_relay_response(remote_proxy_t *proxy, xmlNode *msg, int msg_id)
void remote_proxy_relay_event(remote_proxy_t *proxy, xmlNode *msg)
char * crm_compat_realpath(const char *path)
void crm_set_options(const char *short_options, const char *usage, struct crm_option *long_options, const char *app_desc)
gboolean check_sbd_timeout(const char *value)
#define crm_trace(fmt, args...)
int remote_proxy_check(lrmd_t *lrmd, GHashTable *hash)
enum crm_exit_e crm_exit_t
gboolean crm_digest_verify(xmlNode *input, const char *expected)
void crm_make_daemon(const char *name, gboolean daemonize, const char *pidfile)
const char * default_value
void pcmk_panic(const char *origin)
void remote_proxy_ack_shutdown(lrmd_t *lrmd)
Send an acknowledgment of a remote proxy shutdown request.
void cib_ipc_servers_init(qb_ipcs_service_t **ipcs_ro, qb_ipcs_service_t **ipcs_rw, qb_ipcs_service_t **ipcs_shm, struct qb_ipcs_service_handlers *ro_cb, struct qb_ipcs_service_handlers *rw_cb)
remote_proxy_t * remote_proxy_new(lrmd_t *lrmd, struct ipc_client_callbacks *proxy_callbacks, const char *node_name, const char *session_id, const char *channel)
enum crm_proc_flag __attribute__
long crm_auto_watchdog_timeout(void)
gboolean check_number(const char *value)
gboolean(* is_valid)(const char *)
void remote_proxy_disconnected(gpointer data)
qb_ipcs_service_t * crmd_ipc_server_init(struct qb_ipcs_service_handlers *cb)
void config_metadata(const char *name, const char *version, const char *desc_short, const char *desc_long, pe_cluster_option *option_list, int len)
void cib_ipc_servers_destroy(qb_ipcs_service_t *ipcs_ro, qb_ipcs_service_t *ipcs_rw, qb_ipcs_service_t *ipcs_shm)
void remote_proxy_cb(lrmd_t *lrmd, const char *node_name, xmlNode *msg)
gboolean check_time(const char *value)
struct qb_ipc_response_header cs_ipc_header_response_t
void remote_proxy_free(gpointer data)
gboolean check_quorum(const char *value)
const char * description_long
gboolean check_boolean(const char *value)
gboolean check_script(const char *value)
gboolean check_positive_number(const char *value)
void set_daemon_option(const char *option, const char *value)
gboolean check_utilization(const char *value)
struct mainloop_io_s mainloop_io_t
int daemon(int nochdir, int noclose)
const char * daemon_option(const char *option)
const char * description_short
int crm_get_option_long(int argc, char **argv, int *index, const char **longname)
const char * get_cluster_pref(GHashTable *options, pe_cluster_option *option_list, int len, const char *name)
Wrappers for and extensions to libqb logging.
struct remote_proxy_s remote_proxy_t
gboolean check_timer(const char *value)
void remote_proxy_nack_shutdown(lrmd_t *lrmd)
We're not going to shutdown as response to a remote proxy shutdown request.
void attrd_ipc_server_init(qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
void crm_xml_dump(xmlNode *data, int options, char **buffer, int *offset, int *max, int depth)
const char * cluster_option(GHashTable *options, gboolean(*validate)(const char *), const char *name, const char *old_name, const char *def_value)
_Noreturn void crm_help(char cmd, crm_exit_t exit_code)
void strip_text_nodes(xmlNode *xml)
const char * crm_xml_add_last_written(xmlNode *xml_node)
long crm_get_sbd_timeout(void)
pid_t pcmk_locate_sbd(void)
struct crm_ipc_s crm_ipc_t
struct qb_ipc_request_header cs_ipc_header_request_t
void verify_all_options(GHashTable *options, pe_cluster_option *option_list, int len)
gboolean daemon_option_enabled(const char *daemon, const char *option)
void * find_library_function(void **handle, const char *lib, const char *fn, int fatal)
char * generate_hash_key(const char *crm_msg_reference, const char *sys)