reference, sys_to);
crm_msg_reference, sys_to);
relay_message(xmlNodePtr root_xml_node, gboolean originated_locally, const char *host_from){    FNIN();    const char *sys_from   = xmlGetProp(root_xml_node, XML_MSG_ATTR_SYSFROM);    const char *host_to    = xmlGetProp(root_xml_node, XML_MSG_ATTR_HOSTTO);    const char *sys_to     = xmlGetProp(root_xml_node, XML_MSG_ATTR_SYSTO);    const char *reference  = xmlGetProp(root_xml_node, XML_MSG_ATTR_REFERENCE);    const char *type       = xmlGetProp(root_xml_node, XML_MSG_ATTR_MSGTYPE);    if(sys_to == NULL || reference == NULL || type == NULL)    {	CRM_DEBUG("relay_message: Invalid message, discarding.");	FNRET(TRUE); // Discard.  Should have been picked up by now anyway    }        int is_for_dc  = (strcmp(CRM_SYSTEM_DC, sys_to) == 0);    int is_for_crm = (strcmp(CRM_SYSTEM_CRMD, sys_to) == 0);    int is_request = (strcmp("request", type) == 0);    int is_local   = (host_to == NULL || strlen(host_to) == 0 || strcmp(our_uname, host_to) == 0);    gboolean processing_complete = FALSE;    CRM_DEBUG("relaying message");    CRM_DEBUG2("originated locally %d", originated_locally);    CRM_DEBUG2("is dc %d", is_for_dc);    CRM_DEBUG2("is crm %d", is_for_crm);    CRM_DEBUG2("is request %d", is_request);    CRM_DEBUG2("is local %d", is_local);    CRM_DEBUG2("our host [%s]", our_uname);    CRM_DEBUG2("dest host [%s]", host_to);        if(is_request == 1 && is_for_dc == 0 && originated_locally == FALSE)    {	/* save host/reference in routing table	 * so that responses will be directed appropriately	 */	CRM_DEBUG("Generating key to look up hash table with");	gpointer action_ref = (gpointer)generate_hash_key(reference, sys_to);	CRM_DEBUG2("key (%s)", (char*)action_ref);	if(g_hash_table_lookup (pending_remote_replies, action_ref) == NULL)	{	    CRM_DEBUG2("Updating reference table for %s", host_from);	    gpointer value = (gpointer)generate_hash_value(host_from, sys_from);	    CRM_DEBUG2("value (%s)", (char*)value);	    g_hash_table_insert (pending_remote_replies, action_ref, value);	    // remove from the table based on FIFO or a timed sweep or something	    // cleanup_referenceTable();	}	else	{	    cl_log(LOG_INFO,		   "Already processing a message with reference number"		   " (%s) for sub-system (%s)... discarding message.",		   reference, sys_to);	    processing_complete = TRUE;	}    }    if(is_for_dc)    {	// only forward dc messages if they originated locally	if(originated_locally && i_am_dc == FALSE)	{	    // DC Messages are always broadcast	    send_msg_to_ha(root_xml_node, NULL);	    processing_complete = TRUE;	}	else if(i_am_dc == FALSE)	{	    processing_complete = TRUE;  // ignore	}    }    else if(is_local)    {	if(!is_for_crm)	{	    send_msg_to_ipc(root_xml_node, sys_to);	    processing_complete = TRUE;	}    }    else    {	char *dest_node = find_destination_host(root_xml_node, reference, sys_from, is_request);	send_msg_to_ha(root_xml_node, dest_node);	processing_complete = TRUE;    }    FNRET(processing_complete);}