set_xml_property_copy( msg_options, XML_ATTR_OP, CRM_OP_PING);
do_work(ll_cluster_t * hb_cluster){	int ret = 1;	/* construct the request */	xmlNodePtr msg_data = NULL;	gboolean all_is_good = TRUE;		msg_options = create_xml_node(NULL, XML_TAG_OPTIONS);	set_xml_property_copy(msg_options, XML_ATTR_VERBOSE, admin_verbose);	set_xml_property_copy(msg_options, XML_ATTR_TIMEOUT, "0");	if (DO_HEALTH == TRUE) {		crm_verbose("Querying the system");				sys_to = CRM_SYSTEM_DC;				if (dest_node != NULL) {			sys_to = CRM_SYSTEM_CRMD;			if (BE_VERBOSE) {				expected_responses = -1;/* wait until timeout instead */			}						set_xml_property_copy(				msg_options, XML_ATTR_OP, CRM_OP_PING);						set_xml_property_copy(				msg_options, XML_ATTR_TIMEOUT, "0");		} else {			crm_info("Cluster-wide health not available yet");			all_is_good = FALSE;		}					} else if(DO_ELECT_DC) {		/* tell the local node to initiate an election */		sys_to = CRM_SYSTEM_CRMD;		set_xml_property_copy(			msg_options, XML_ATTR_OP, CRM_OP_VOTE);				set_xml_property_copy(			msg_options, XML_ATTR_TIMEOUT, "0");				dest_node = NULL;		ret = 0; /* no return message */			} else if(DO_WHOIS_DC) {		sys_to = CRM_SYSTEM_DC;		set_xml_property_copy(			msg_options, XML_ATTR_OP, CRM_OP_PING);					set_xml_property_copy(			msg_options, XML_ATTR_TIMEOUT, "0");		dest_node = NULL;	} else if(DO_RESOURCE || DO_RESOURCE_LIST || DO_NODE_LIST || DO_OPTION){		cib_t *	the_cib = cib_new();		xmlNodePtr output = NULL;		int call_options = cib_sync_call;				enum cib_errors rc = the_cib->cmds->signon(			the_cib, cib_command);		if(rc != cib_ok) {			return -1;					} else if(DO_RESOURCE) {			the_cib->cmds->query(				the_cib, XML_CIB_TAG_STATUS,				&output, call_options);			do_find_resource(rsc_name, output);		} else if(DO_RESOURCE_LIST) {			the_cib->cmds->query(				the_cib, XML_CIB_TAG_RESOURCES,				&output, call_options);						do_find_resource_list(output);					} else if(DO_NODE_LIST) {			the_cib->cmds->query(				the_cib, XML_CIB_TAG_NODES,				&output, call_options);			do_find_node_list(output);		} else if(DO_OPTION) {			char *name = NULL;			char *value = NULL;			xmlNodePtr xml_option = NULL;			xmlNodePtr fragment = NULL;			if(decodeNVpair(crm_option, '=', &name, &value)==FALSE){				crm_err("%s needs to be of the form"					" <name>=<value>", crm_option);				return -1;			}						xml_option = create_xml_node(NULL, XML_CIB_TAG_NVPAIR);			set_xml_property_copy(				xml_option, XML_NVPAIR_ATTR_NAME, name);			set_xml_property_copy(				xml_option, XML_NVPAIR_ATTR_VALUE, value);						fragment = create_cib_fragment(xml_option, NULL);			free_xml(xml_option);			crm_free(name);			crm_free(value);						rc = the_cib->cmds->modify(				the_cib, XML_CIB_TAG_CRMCONFIG, fragment,				NULL, call_options|cib_discard_reply);						free_xml(fragment);		}		free_xml(output);		the_cib->cmds->signoff(the_cib);		return rc;			} else if(DO_RESET) {		/* tell dest_node to initiate the shutdown proceedure		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		set_xml_property_copy(			msg_options, XML_ATTR_OP, CRM_OP_LOCAL_SHUTDOWN);				set_xml_property_copy(			msg_options, XML_ATTR_TIMEOUT, "0");				ret = 0; /* no return message */			} else if(DO_DEBUG == debug_inc) {		/* tell dest_node to increase its debug level		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		set_xml_property_copy(msg_options, XML_ATTR_OP, CRM_OP_DEBUG_UP);		set_xml_property_copy(msg_options, XML_ATTR_TIMEOUT, "0");				ret = 0; /* no return message */			} else if(DO_DEBUG == debug_dec) {		/* tell dest_node to increase its debug level		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		set_xml_property_copy(msg_options, XML_ATTR_OP, CRM_OP_DEBUG_DOWN);		set_xml_property_copy(msg_options, XML_ATTR_TIMEOUT, "0");				ret = 0; /* no return message */			} else {		crm_err("Unknown options");		all_is_good = FALSE;	}		if(all_is_good == FALSE) {		crm_err("Creation of request failed.  No message to send");		return -1;	}/* send it */	if (crmd_channel == NULL) {		crm_err("The IPC connection is not valid, cannot send anything");		return -1;	}	if(sys_to == NULL) {		if (dest_node != NULL)			sys_to = CRM_SYSTEM_CRMD;		else			sys_to = CRM_SYSTEM_DC;					}			send_ipc_request(		crmd_channel, msg_options, msg_data,		dest_node, sys_to, crm_system_name,		admin_uuid, this_msg_reference);	return ret;}