10 #ifndef PCMK__CRM_COMMON_UTIL__H 11 # define PCMK__CRM_COMMON_UTIL__H 13 # include <sys/types.h> 21 # include <libxml/tree.h> 39 # define ONLINESTATUS "online" // Status of an online client 40 # define OFFLINESTATUS "offline" // Status of an offline client 64 gboolean
parse_op_key(const
char *key,
char **rsc_id,
char **op_type,
67 int *action_id,
int *target_rc);
69 int *transition_id,
int *action_id,
70 int *
op_status,
int *op_rc,
int *target_rc);
75 const
char *task, const
char *interval_spec,
77 #define CRM_DEFAULT_OP_TIMEOUT_S "20s" 86 void crm_abort(
const char *file,
const char *
function,
int line,
87 const char *condition, gboolean do_core, gboolean do_fork);
99 pcmk_any_flags_set(uint64_t flag_group, uint64_t flags_to_check)
101 return (flag_group & flags_to_check) != 0;
114 pcmk_all_flags_set(uint64_t flag_group, uint64_t flags_to_check)
116 return (flag_group & flags_to_check) == flags_to_check;
122 #define pcmk_is_set(g, f) pcmk_all_flags_set((g), (f)) 137 #ifdef HAVE_GNUTLS_GNUTLS_H 138 void crm_gnutls_global_init(
void);
146 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) API related to resource agents.
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
xmlNode * crm_create_op_xml(xmlNode *parent, const char *prefix, const char *task, const char *interval_spec, const char *timeout)
Create a CIB XML element for an operation.
bool crm_is_daemon_name(const char *name)
Check whether string represents a client name used by cluster daemons.
char * crm_generate_uuid(void)
int rsc_op_expected_rc(lrmd_event_data_t *event)
int char2score(const char *score)
Get the integer value of a score string.
long long crm_get_msec(const char *input)
Parse a time+units string and return milliseconds equivalent.
char * score2char_stack(int score, char *buf, size_t len)
Convert an integer score to a string, using a provided buffer.
const char * crm_meta_value(GHashTable *hash, const char *field)
bool pcmk_is_probe(const char *task, guint interval)
bool crm_op_needs_metadata(const char *rsc_class, const char *op)
Check whether an operation requires resource agent meta-data.
char * pcmk_promotion_score_name(const char *rsc_id)
Return the name of the node attribute used as a promotion score.
int crm_user_lookup(const char *name, uid_t *uid, gid_t *gid)
int pcmk_daemon_user(uid_t *uid, gid_t *gid)
Get user and group IDs of pacemaker daemon user.
char * crm_meta_name(const char *field)
Low-level API for XML Access Control Lists (ACLs)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
bool pcmk_xe_mask_probe_failure(xmlNode *xml_op)
bool pcmk_str_is_infinity(const char *s)
Function and executable result codes.
int crm_str_to_boolean(const char *s, int *ret)
bool pcmk_xe_is_probe(xmlNode *xml_op)
gboolean did_rsc_op_fail(lrmd_event_data_t *event, int target_rc)
bool pcmk_str_is_minus_infinity(const char *s)
char guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
gboolean decode_transition_key(const char *key, char **uuid, int *transition_id, int *action_id, int *target_rc)
Parse a transition key into its constituent parts.
Deprecated Pacemaker utilities.
int compare_version(const char *version1, const char *version2)
gboolean decode_transition_magic(const char *magic, char **uuid, int *transition_id, int *action_id, int *op_status, int *op_rc, int *target_rc)
Parse a transition magic string into its constituent parts.
int pcmk__add_scores(int score1, int score2)
char * crm_md5sum(const char *buffer)
gboolean crm_is_true(const char *s)
char * pcmk_hostname(void)
Get the local hostname.
char * crm_strip_trailing_newline(char *str)
void crm_abort(const char *file, const char *function, int line, const char *condition, gboolean do_core, gboolean do_fork)
int crm_default_remote_port(void)
Get the default remote connection TCP port on this host.
char * score2char(int score)
Return the string equivalent of an integer score.