13 #include <sys/types.h> 16 #include <libxml/tree.h> 41 const char *host_to,
const char *sys_to,
42 const char *sys_from,
const char *uuid_from,
45 static uint ref_counter = 0;
47 char *true_from = NULL;
48 xmlNode *request = NULL;
50 (task? task :
"_empty_"),
51 (sys_from? sys_from :
"_empty_"),
52 (
long long) time(NULL), ref_counter++);
54 if (uuid_from != NULL) {
56 (sys_from? sys_from :
"none"));
57 }
else if (sys_from != NULL) {
58 true_from = strdup(sys_from);
60 crm_err(
"Cannot create IPC request: No originating system specified");
75 if (host_to != NULL && strlen(host_to) > 0) {
79 if (msg_data != NULL) {
105 xmlNode *reply = NULL;
115 crm_err(
"Cannot create new_message, no message type in original message");
120 crm_err(
"Cannot create new_message, original message was not a request");
126 crm_err(
"Cannot create new_message, malloc failed");
142 if (host_from != NULL && strlen(host_from) > 0) {
146 if (xml_response_data != NULL) {
158 return pcmk__xml_first_child(tmp);
187 }
else if (!strcmp(
name,
"pacemaker-attrd")) {
190 }
else if (!strcmp(
name,
"pacemaker-based")) {
193 }
else if (!strcmp(
name,
"pacemaker-controld")) {
196 }
else if (!strcmp(
name,
"pacemaker-execd")) {
199 }
else if (!strcmp(
name,
"pacemaker-fenced")) {
202 }
else if (!strcmp(
name,
"pacemaker-schedulerd")) {
gboolean add_message_xml(xmlNode *msg, const char *field, xmlNode *xml)
const char * pcmk__message_name(const char *name)
Get name to be used as identifier for cluster messages.
xmlNode * first_named_child(const xmlNode *parent, const char *name)
xmlNode * create_reply_adv(xmlNode *original_request, xmlNode *xml_response_data, const char *origin)
Create a Pacemaker reply (for IPC or cluster layer)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
enum crm_ais_msg_types type
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
xmlNode * add_node_copy(xmlNode *new_parent, xmlNode *xml_node)
#define CRM_SYSTEM_PENGINE
xmlNode * create_xml_node(xmlNode *parent, const char *name)
xmlNode * get_message_xml(xmlNode *msg, const char *field)
xmlNode * create_request_adv(const char *task, xmlNode *msg_data, const char *host_to, const char *sys_to, const char *sys_from, const char *uuid_from, const char *origin)
Create a Pacemaker request (for IPC or cluster layer)
#define crm_err(fmt, args...)
#define XML_ATTR_RESPONSE