10 #ifndef PCMK__COMMON_CRMCOMMON_PRIVATE__H 11 #define PCMK__COMMON_CRMCOMMON_PRIVATE__H 19 #include <sys/types.h> 22 #include <libxml/tree.h> 23 #include <qb/qbipcc.h> 40 #define PCMK__BUFFER_SIZE 4096 42 #if defined(PCMK__UNIT_TESTING) 43 #undef G_GNUC_INTERNAL 44 #define G_GNUC_INTERNAL 69 #define PCMK__XML_DOC_PRIVATE_MAGIC 0x81726354UL 70 #define PCMK__XML_NODE_PRIVATE_MAGIC 0x54637281UL 73 #define PCMK__XML_ENTITY_AMP "&" 74 #define PCMK__XML_ENTITY_GT ">" 75 #define PCMK__XML_ENTITY_LT "<" 76 #define PCMK__XML_ENTITY_QUOT """ 78 #define pcmk__set_xml_flags(xml_priv, flags_to_set) do { \ 79 (xml_priv)->flags = pcmk__set_flags_as(__func__, __LINE__, \ 80 LOG_NEVER, "XML", "XML node", (xml_priv)->flags, \ 81 (flags_to_set), #flags_to_set); \ 84 #define pcmk__clear_xml_flags(xml_priv, flags_to_clear) do { \ 85 (xml_priv)->flags = pcmk__clear_flags_as(__func__, __LINE__, \ 86 LOG_NEVER, "XML", "XML node", (xml_priv)->flags, \ 87 (flags_to_clear), #flags_to_clear); \ 116 xmlNode *
pcmk__xml_match(
const xmlNode *haystack,
const xmlNode *needle,
120 xmlNode *
pcmk__xc_match(
const xmlNode *root,
const xmlNode *search_comment,
203 #define PCMK__IPC_VERSION 1 205 #define PCMK__CONTROLD_API_MAJOR "1" 206 #define PCMK__CONTROLD_API_MINOR "0" 290 struct qb_ipc_response_header
qb;
329 #define PCMK__XML_PREFIX_CREATED "++" 332 #define PCMK__XML_PREFIX_DELETED "--" 335 #define PCMK__XML_PREFIX_MODIFIED "+ " 338 #define PCMK__XML_PREFIX_MOVED "+~" 345 const char *filename,
char **argv);
395 const char *value1,
const char *value2);
427 #define PCMK__PW_BUFFER_LEN 500 464 #endif // PCMK__COMMON_CRMCOMMON_PRIVATE__H G_GNUC_INTERNAL enum pcmk__type pcmk__parse_type(const char *type, enum pcmk__comparison op, const char *value1, const char *value2)
G_GNUC_INTERNAL int pcmk__evaluate_date_spec(const xmlNode *date_spec, const crm_time_t *now)
G_GNUC_INTERNAL bool pcmk__xml_reset_node_flags(xmlNode *xml, void *user_data)
enum pcmk_ipc_dispatch dispatch_type
G_GNUC_INTERNAL bool pcmk__xml_is_name_char(const char *utf8, int *len)
enum pcmk_ipc_server type
G_GNUC_INTERNAL int pcmk__evaluate_attr_expression(const xmlNode *expression, const pcmk_rule_input_t *rule_input)
struct crm_time_s crm_time_t
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__schedulerd_api_methods(void)
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__pacemakerd_api_methods(void)
G_GNUC_INTERNAL void pcmk__mark_xml_attr_dirty(xmlAttr *a)
G_GNUC_INTERNAL void pcmk__log_xmllib_err(void *ctx, const char *fmt,...) G_GNUC_PRINTF(2
G_GNUC_INTERNAL int pcmk__xml_position(const xmlNode *xml, enum xml_private_flags ignore_if_set)
G_GNUC_INTERNAL int pcmk__evaluate_op_expression(const xmlNode *expr, const pcmk_rule_input_t *rule_input)
G_GNUC_INTERNAL void pcmk__register_option_messages(pcmk__output_t *out)
G_GNUC_INTERNAL void pcmk__xml_set_parent_flags(xmlNode *xml, uint64_t flags)
struct mainloop_io_s mainloop_io_t
G_GNUC_INTERNAL bool pcmk__is_user_in_group(const char *user, const char *group)
enum crm_exit_e crm_exit_t
G_GNUC_INTERNAL const char * pcmk__time_component_attr(enum pcmk__time_component component)
struct pcmk__ipc_header_s pcmk__ipc_header_t
G_GNUC_INTERNAL void pcmk__call_ipc_callback(pcmk_ipc_api_t *api, enum pcmk_ipc_event event_type, crm_exit_t status, void *event_data)
Wrappers for and extensions to glib mainloop.
G_GNUC_INTERNAL int pcmk__cmp_by_type(const char *value1, const char *value2, enum pcmk__type type)
G_GNUC_INTERNAL bool pcmk__output_text_get_fancy(pcmk__output_t *out)
Wrappers for and extensions to libqb logging.
G_GNUC_INTERNAL bool pcmk__marked_as_deleted(xmlAttrPtr a, void *user_data)
G_GNUC_INTERNAL int pcmk__xe_set_score(xmlNode *target, const char *name, const char *value)
G_GNUC_INTERNAL bool pcmk__xml_is_name_start_char(const char *utf8, int *len)
struct xml_doc_private_s xml_doc_private_t
G_GNUC_INTERNAL xmlDoc * pcmk__xml_new_doc(void)
G_GNUC_INTERNAL int pcmk__bare_output_new(pcmk__output_t **out, const char *fmt_name, const char *filename, char **argv)
struct pcmk__deleted_xml_s pcmk__deleted_xml_t
G_GNUC_INTERNAL GList * pcmk__find_x_0_schema(void)
Formatted output for pacemaker tools.
pcmk_ipc_server
Available IPC interfaces.
G_GNUC_INTERNAL void pcmk__xc_update(xmlNode *parent, xmlNode *target, xmlNode *update)
G_GNUC_INTERNAL void pcmk__xml_new_private_data(xmlNode *xml)
G_GNUC_INTERNAL void pcmk__apply_creation_acl(xmlNode *xml, bool check_top)
struct crm_ipc_s crm_ipc_t
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__attrd_api_methods(void)
G_GNUC_INTERNAL void pcmk__xml_free_node(xmlNode *xml)
G_GNUC_INTERNAL int pcmk__add_time_from_xml(crm_time_t *t, enum pcmk__time_component component, const xmlNode *xml)
G_GNUC_INTERNAL int pcmk__send_ipc_request(pcmk_ipc_api_t *api, const xmlNode *request)
G_GNUC_INTERNAL void pcmk__xml_free_private_data(xmlNode *xml)
G_GNUC_INTERNAL enum pcmk__reference_source pcmk__parse_source(const char *source)
Wrappers for and extensions to libxml2.
G_GNUC_INTERNAL bool pcmk__valid_ipc_header(const pcmk__ipc_header_t *header)
G_GNUC_INTERNAL int pcmk__unpack_duration(const xmlNode *duration, const crm_time_t *start, crm_time_t **end)
struct pcmk__ipc_methods_s pcmk__ipc_methods_t
void(* pcmk_ipc_callback_t)(pcmk_ipc_api_t *api, enum pcmk_ipc_event event_type, crm_exit_t status, void *event_data, void *user_data)
Callback function type for Pacemaker daemon IPC APIs.
int(* post_connect)(pcmk_ipc_api_t *api)
Function and executable result codes.
G_GNUC_INTERNAL xmlNode * pcmk__xml_match(const xmlNode *haystack, const xmlNode *needle, bool exact)
G_GNUC_INTERNAL void pcmk__apply_acl(xmlNode *xml)
G_GNUC_INTERNAL unsigned int pcmk__ipc_buffer_size(unsigned int max)
G_GNUC_INTERNAL bool pcmk__xa_filterable(const char *name)
struct xml_node_private_s xml_node_private_t
int(* new_data)(pcmk_ipc_api_t *api)
pcmk_ipc_dispatch
How IPC replies should be dispatched.
pcmk_ipc_event
Possible event types that an IPC event callback can be called for.
mainloop_io_t * mainloop_io
bool(* dispatch)(pcmk_ipc_api_t *api, xmlNode *msg)
bool(* reply_expected)(pcmk_ipc_api_t *api, const xmlNode *request)
G_GNUC_INTERNAL void pcmk__set_time_if_earlier(crm_time_t *target, const crm_time_t *source)
G_GNUC_INTERNAL void pcmk__dump_xml_attr(const xmlAttr *attr, GString *buffer)
pcmk__schema_version_t version
This structure contains everything that makes up a single output formatter.
void(* free_data)(void *api_data)
G_GNUC_INTERNAL void pcmk__free_acls(GList *acls)
G_GNUC_INTERNAL void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user)
IPC interface to Pacemaker daemons.
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__controld_api_methods(void)
pcmk__ipc_methods_t * cmds
G_GNUC_INTERNAL enum pcmk__comparison pcmk__parse_comparison(const char *op)
G_GNUC_INTERNAL void G_GNUC_INTERNAL void pcmk__mark_xml_node_dirty(xmlNode *xml)
G_GNUC_INTERNAL bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy)
void(* post_disconnect)(pcmk_ipc_api_t *api)
G_GNUC_INTERNAL xmlNode * pcmk__xc_match(const xmlNode *root, const xmlNode *search_comment, bool exact)
enum pcmk_ipc_server server
G_GNUC_INTERNAL int pcmk__xa_remove(xmlAttr *attr, bool force)
G_GNUC_INTERNAL void pcmk__register_patchset_messages(pcmk__output_t *out)
G_GNUC_INTERNAL int pcmk__evaluate_rsc_expression(const xmlNode *expr, const pcmk_rule_input_t *rule_input)