op = xmlGetProp(root_xml_node, XML_DC_ATTR_OP); 
op = xmlGetProp(action, XML_DC_ATTR_OP); 
process_message(xmlNodePtr root_xml_node, gboolean from_ipc, const char *src_node_name){    xmlNodePtr action = validate_crm_message(root_xml_node, NULL, NULL);    if(root_xml_node == NULL)    {	cl_log(LOG_INFO, "Message was not valid... discarding message.");	return;    }    const char *src_sys   = xmlGetProp(root_xml_node, XML_MSG_ATTR_SRCSUBSYS);    const char *dest_sys  = xmlGetProp(root_xml_node, XML_MSG_ATTR_SUBSYS);    const char *reference = xmlGetProp(root_xml_node, XML_MSG_ATTR_REFERENCE);    /* check the message is for us...     *   ie. for the DC and we are it     *       or it was specifically addressed to us.     */    const char *tag = XML_RESP_TAG_CRM;        const char *op = NULL;    // Try to avoid even more string comparisions    int crm_dc_other = 0;    if(i_am_dc && strcmp("dc", dest_sys) == 0)    {	crm_dc_other = 1;	tag = XML_RESP_TAG_DC;	op = xmlGetProp(root_xml_node, XML_DC_ATTR_OP);	if(op == NULL)	{	    cl_log(LOG_ERR, "Invalid XML message.  No value for (%s) specified in (%s).", XML_DC_ATTR_OP, root_xml_node->name); 	    return;	}    }    else if(strcmp("crm", dest_sys) == 0)    {	crm_dc_other = 2;	op = xmlGetProp(action, XML_CRM_ATTR_OP);	if(op == NULL)	{	    cl_log(LOG_ERR, "Invalid XML message.  No value for (%s) specified in (%s).", XML_CRM_ATTR_OP, root_xml_node->name); 	    return;	}    }    else if(dest_sys[0] != 'd') crm_dc_other = 3;    xmlNodePtr response = NULL, wrapper = NULL;;    switch(crm_dc_other)    {	case 1:	    // DC specific actions	    // fall through and do the things common to the DC and the CRMd	case 2:	    // DC/CRM actions	    if(strcmp("ping", op) == 0)	    {		// eventually do some stuff to figure out if we *are* ok		xmlNodePtr ping = createPingAnswerFragment(dest_sys, NULL, "ok");		wrapper = createIpcMessage(reference, dest_sys, NULL, ping, FALSE);		response = createCrmMsg(reference, dest_sys, src_sys, wrapper, FALSE);		send_xmlha_message(hb_fd, response, src_node_name, NULL);	    }	    else if(strcmp("ping_deep", op) == 0)	    {		// eventually do some stuff to figure out if we *are* ok		xmlNodePtr ping = createPingAnswerFragment(dest_sys, NULL, "ok");		wrapper = createIpcMessage(reference, dest_sys, NULL, ping, FALSE);		response = createCrmMsg(reference, dest_sys, src_sys, wrapper, FALSE);		send_xmlha_message(hb_fd, response, src_node_name, NULL);		/* Now pass the ping request on to all subsystems for them		 *  to reply to individually.		 *		 * Basically this means we are pushing the complexity back		 *  on to the client.  Therefore it is the client that must		 *  decide, based on the results it recieves, if all		 *  subsystems are alive.		 *		 * ... Unless we choose another method, other than IPC 		 *  message/response, of pinging locally.		 */		const char *local_sub_sys = "lrmd";		ping = createPingRequest(reference, dest_sys, local_sub_sys);		relay_ha_to_ipc(ping, local_sub_sys, src_node_name);		local_sub_sys = "cib";		cl_log(LOG_DEBUG, "Building Ping Request");		ping = createPingRequest(reference, src_sys, local_sub_sys);		wrapper = createCrmMsg(reference, src_sys, local_sub_sys, ping, TRUE);		cl_log(LOG_DEBUG, "Sending Ping Request");		relay_ha_to_ipc(wrapper, local_sub_sys, src_node_name);		cl_log(LOG_DEBUG, "Sent Ping Request");		//   ...	    }	    // else if dc action, skip	    else	    {		cl_log(LOG_ERR, "The specified operation (%s) is not (yet?) supported\n", op);	    }	    	    cl_log(LOG_DEBUG, "The (%s) Received and processed message.", dest_sys);	    break;	case 3:	    /* forward the request to the correct sub-system, making a note of where	     * the reply should go if it was a request	     */	    if(from_ipc)		relay_ipc_to_ha(root_xml_node);		    	    else		relay_ha_to_ipc(root_xml_node, dest_sys, src_node_name);	    break;	case 0:	    // it was for the DC but that isnt us	    cl_log(LOG_DEBUG, "Received a message for the DC, but that isnt us.");	default:	    cl_log(LOG_ERR, "Unknown CRM state.");	    break;    }}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/ea49e927cf7a87359e44d087341624427b4dacc8/crmd.c/buggy/crm/crmd/crmd.c