const char *sys_from = get_xml_attr(stored_msg, NULL, XML_ATTR_SYSFROM, TRUE);
handle_message(xmlNodePtr stored_msg){	enum crmd_fsa_input next_input = I_NULL;	const char *sys_to   = get_xml_attr(stored_msg, NULL,					    XML_ATTR_SYSTO, TRUE);	const char *sys_from = get_xml_attr(stored_msg, NULL,					    XML_ATTR_SYSFROM, TRUE);	const char *type     = get_xml_attr(stored_msg, NULL,					    XML_ATTR_MSGTYPE, TRUE);		const char *op       = get_xml_attr(stored_msg, XML_TAG_OPTIONS,					    XML_ATTR_OP, TRUE);//	xml_message_debug(stored_msg, "Processing message");	if(type == NULL || op == NULL) {		cl_log(LOG_ERR, "Ignoring message (type=%s), (op=%s)",		       type, op);		xml_message_debug(stored_msg, "Bad message");			} else if(strcmp(type, XML_ATTR_REQUEST) == 0){		if(strcmp(op, CRM_OPERATION_VOTE) == 0) {			next_input = I_ELECTION;						} else if(strcmp(op, CRM_OPERATION_HBEAT) == 0) {			next_input = I_DC_HEARTBEAT;						} else if(strcmp(op, CRM_OPERATION_WELCOME) == 0) {			next_input = I_WELCOME;						} else if(strcmp(op, CRM_OPERATION_SHUTDOWN_REQ) == 0) {			next_input = I_CIB_OP;						} else if(strcmp(op, CRM_OPERATION_SHUTDOWN) == 0) {			next_input = I_TERMINATE;					} else if(strcmp(op, CRM_OPERATION_ANNOUNCE) == 0) {			next_input = I_NODE_JOIN;					} else if(strcmp(op, CRM_OPERATION_REPLACE) == 0			|| strcmp(op, CRM_OPERATION_ERASE) == 0) {			next_input = I_CIB_OP;			fprintf(router_strm, "Message result: CIB Op\n");		} else if(AM_I_DC			  && (strcmp(op, CRM_OPERATION_CREATE) == 0			      || strcmp(op, CRM_OPERATION_UPDATE) == 0			      || strcmp(op, CRM_OPERATION_DELETE) == 0)) {			/* updates should only be performed on the DC */			next_input = I_CIB_OP;						} else if(strcmp(op, CRM_OPERATION_PING) == 0) {			/* eventually do some stuff to figure out			 * if we /are/ ok			 */			xmlNodePtr ping =				createPingAnswerFragment(sys_to, "ok");							xmlNodePtr wrapper = create_reply(stored_msg, ping);			relay_message(wrapper, TRUE);			free_xml(wrapper);						} else {			cl_log(LOG_ERR,			       "Unexpected request (op=%s) sent to the %s",			       op, AM_I_DC?"DC":"CRMd");		}			} else if(strcmp(type, XML_ATTR_RESPONSE) == 0) {		if(strcmp(op, CRM_OPERATION_WELCOME) == 0) {			next_input = I_WELCOME_ACK;						} else if(strcmp(op, CRM_OPERATION_VOTE) == 0			  || strcmp(op, CRM_OPERATION_HBEAT) == 0			  || strcmp(op, CRM_OPERATION_WELCOME) == 0			  || strcmp(op, CRM_OPERATION_SHUTDOWN_REQ) == 0			  || strcmp(op, CRM_OPERATION_SHUTDOWN) == 0			  || strcmp(op, CRM_OPERATION_ANNOUNCE) == 0) {			next_input = I_NULL;					} else if(AM_I_DC			  && (strcmp(op, CRM_OPERATION_CREATE) == 0			      || strcmp(op, CRM_OPERATION_UPDATE) == 0			      || strcmp(op, CRM_OPERATION_DELETE) == 0			      || strcmp(op, CRM_OPERATION_ERASE) == 0)) {			// perhaps we should do somethign with these replies			fprintf(router_strm, "Message result: CIB Reply\n");			next_input = I_CIB_UPDATE;					} else if(AM_I_DC && strcmp(sys_from, CRM_SYSTEM_CIB) == 0) {							/* this is a reply to our earlier command			 * Send it to the relevant node(s)			 */			const char *uname =				get_xml_attr(stored_msg, XML_TAG_OPTIONS,					     "forward_to", FALSE);			xmlNodePtr data = find_xml_node(stored_msg,							XML_TAG_FRAGMENT);			xmlNodePtr local_options = NULL;						/* If this is part of join request processing,			 * ask for the status section, otherwise just blast			 * it down to them.			 */			if(uname != NULL) {				local_options = set_xml_attr(NULL,							     XML_TAG_OPTIONS,							     XML_ATTR_VERBOSE,							     "true",							     TRUE);			}						send_request(local_options, data, CRM_OPERATION_REPLACE,				     uname, CRM_SYSTEM_CRMD);			free_xml(local_options);					} else {			cl_log(LOG_ERR,			       "Unexpected response (op=%s) sent to the %s",			       op, AM_I_DC?"DC":"CRMd");		}	} else {		cl_log(LOG_ERR, "Unexpected message type %s", type);				}/* 	CRM_DEBUG3("%s: Next input is %s", __FUNCTION__, *//* 		   fsa_input2string(next_input)); */				return next_input;		}