10 #ifndef CRMCOMMON_PRIVATE__H
11 # define CRMCOMMON_PRIVATE__H
19 #include <sys/types.h>
21 #include <libxml/tree.h>
22 #include <qb/qbipcc.h>
25 #define PCMK__BUFFER_SIZE 4096
69 #define pcmk__set_xml_flags(xml_priv, flags_to_set) do { \
70 (xml_priv)->flags = pcmk__set_flags_as(__func__, __LINE__, \
71 LOG_NEVER, "XML", "XML node", (xml_priv)->flags, \
72 (flags_to_set), #flags_to_set); \
75 #define pcmk__clear_xml_flags(xml_priv, flags_to_clear) do { \
76 (xml_priv)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
77 LOG_NEVER, "XML", "XML node", (xml_priv)->flags, \
78 (flags_to_clear), #flags_to_clear); \
96 int offset,
size_t buffer_size);
105 xmlNode *
pcmk__xml_match(xmlNode *haystack, xmlNode *needle,
bool exact);
108 void pcmk__xe_log(
int log_level,
const char *file,
const char *
function,
109 int line,
const char *prefix, xmlNode *
data,
int depth,
117 xmlNode *
pcmk__xc_match(xmlNode *root, xmlNode *search_comment,
bool exact);
144 static inline const char *
145 pcmk__xml_attr_value(
const xmlAttr *attr)
147 return ((attr == NULL) || (attr->children == NULL))? NULL
148 : (
const char *) attr->children->content;
155 #define PCMK__IPC_VERSION 1
157 #define PCMK__CONTROLD_API_MAJOR "1"
158 #define PCMK__CONTROLD_API_MINOR "0"
240 struct qb_ipc_response_header
qb;
308 pid_t *gotpid, uid_t *gotuid, gid_t *gotgid);
311 #endif // CRMCOMMON_PRIVATE__H
void(* free_data)(void *api_data)
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.
enum pcmk_ipc_dispatch dispatch_type
void pcmk__free_acls(GList *acls)
G_GNUC_INTERNAL void pcmk__buffer_add_char(char **buffer, int *offset, int *max, char c)
int(* new_data)(pcmk_ipc_api_t *api)
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__pacemakerd_api_methods(void)
G_GNUC_INTERNAL int pcmk__element_xpath(const char *prefix, xmlNode *xml, char *buffer, int offset, size_t buffer_size)
G_GNUC_INTERNAL void pcmk__mark_xml_attr_dirty(xmlAttr *a)
struct mainloop_io_s mainloop_io_t
void(* dispatch)(pcmk_ipc_api_t *api, xmlNode *msg)
void pcmk__apply_creation_acl(xmlNode *xml, bool check_top)
enum crm_exit_e crm_exit_t
struct pcmk__ipc_header_s pcmk__ipc_header_t
G_GNUC_INTERNAL xmlNode * pcmk__xc_match(xmlNode *root, xmlNode *search_comment, bool exact)
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)
G_GNUC_INTERNAL void pcmk__set_xml_doc_flag(xmlNode *xml, enum xml_private_flags flag)
struct pcmk__deleted_xml_s pcmk__deleted_xml_t
bool pcmk__check_acl(xmlNode *xml, const char *name, enum xml_private_flags mode)
pcmk_ipc_server
Available IPC interfaces.
G_GNUC_INTERNAL void pcmk__xc_update(xmlNode *parent, xmlNode *target, xmlNode *update)
struct crm_ipc_s crm_ipc_t
G_GNUC_INTERNAL bool pcmk__valid_ipc_header(const pcmk__ipc_header_t *header)
struct pcmk__ipc_methods_s pcmk__ipc_methods_t
G_GNUC_INTERNAL int pcmk__send_ipc_request(pcmk_ipc_api_t *api, xmlNode *request)
void pcmk__unpack_acl(xmlNode *source, xmlNode *target, const char *user)
G_GNUC_INTERNAL unsigned int pcmk__ipc_buffer_size(unsigned int max)
G_GNUC_INTERNAL xmlNode * pcmk__xml_match(xmlNode *haystack, xmlNode *needle, bool exact)
int(* post_connect)(pcmk_ipc_api_t *api)
G_GNUC_INTERNAL void pcmk__xe_log(int log_level, const char *file, const char *function, int line, const char *prefix, xmlNode *data, int depth, int options)
G_GNUC_INTERNAL bool pcmk__xa_filterable(const char *name)
G_GNUC_INTERNAL void pcmk__xml2text(xmlNode *data, int options, char **buffer, int *offset, int *max, int depth)
pcmk_ipc_dispatch
How IPC replies should be dispatched.
pcmk_ipc_event
Possible event types that an IPC event callback can be called for.
bool(* reply_expected)(pcmk_ipc_api_t *api, xmlNode *request)
mainloop_io_t * mainloop_io
int pcmk__crm_ipc_is_authentic_process(qb_ipcc_connection_t *qb_ipc, int sock, uid_t refuid, gid_t refgid, pid_t *gotpid, uid_t *gotuid, gid_t *gotgid)
Check the authenticity of the IPC socket peer process.
void pcmk__apply_acl(xmlNode *xml)
struct xml_private_s xml_private_t
void(* post_disconnect)(pcmk_ipc_api_t *api)
G_GNUC_INTERNAL pcmk__ipc_methods_t * pcmk__controld_api_methods(void)
pcmk__ipc_methods_t * cmds
G_GNUC_INTERNAL bool pcmk__tracking_xml_changes(xmlNode *xml, bool lazy)
enum pcmk_ipc_server server
G_GNUC_INTERNAL void pcmk__mark_xml_created(xmlNode *xml)
G_GNUC_INTERNAL void pcmk__xml_update(xmlNode *parent, xmlNode *target, xmlNode *update, bool as_diff)
G_GNUC_INTERNAL int pcmk__xml_position(xmlNode *xml, enum xml_private_flags ignore_if_set)