} else if(strcmp(op, CRM_OP_CREATE) == 0 || strcmp(op, CRM_OP_UPDATE) == 0 || strcmp(op, CRM_OP_ERASE) == 0 || strcmp(op, CRM_OP_REPLACE) == 0 || strcmp(op, CRM_OP_DELETE) == 0) { next_input = I_CIB_OP;
handle_request(xmlNodePtr stored_msg){	xmlNodePtr wrapper = NULL;	enum crmd_fsa_input next_input = I_NULL;	const char *sys_to   = get_xml_attr(		stored_msg, NULL, XML_ATTR_SYSTO, TRUE);	const char *host_from= get_xml_attr(		stored_msg, NULL, XML_ATTR_HOSTFROM, FALSE);	const char *op       = get_xml_attr(		stored_msg, XML_TAG_OPTIONS, XML_ATTR_OP, TRUE);	crm_verbose("Received %s in state %s",		    op, fsa_state2string(fsa_state));		if(op == NULL) {		crm_xml_err(stored_msg, "Bad message");		/*========== common actions ==========*/	} else if(strcmp(op, CRM_OP_VOTE) == 0) {		/* count the vote and decide what to do after that */		register_fsa_input_w_actions(			C_HA_MESSAGE, I_NULL, stored_msg, A_ELECTION_COUNT);#if 0		/* force the DC into an election mode?		 * its the old way of doing things but what is gained?		 */		if(AM_I_DC) {			next_input = I_ELECTION;		}#endif			} else if(strcmp(op, "init_shutdown") == 0) {				crm_shutdown(SIGTERM);		/*next_input = I_SHUTDOWN; */		next_input = I_NULL;				} else if(strcmp(op, CRM_OP_QUERY) == 0) {				next_input = I_CIB_OP;	} else if(strcmp(op, CRM_OP_PING) == 0) {		/* eventually do some stuff to figure out		 * if we /are/ ok		 */		xmlNodePtr ping = createPingAnswerFragment(sys_to, "ok");		set_xml_property_copy(ping, "crmd_state",				      fsa_state2string(fsa_state));				wrapper = create_reply(stored_msg, ping);				relay_message(wrapper, TRUE);		free_xml(wrapper);#if 0		/* probably better to do this via signals on the		 * local node		 */	} else if(strcmp(op, "debug_inc") == 0) {		int level = get_crm_log_level();		set_crm_log_level(level+1);		crm_info("Debug set to %d (was %d)",			 get_crm_log_level(), level);			} else if(strcmp(op, "debug_dec") == 0) {		int level = get_crm_log_level();		set_crm_log_level(level-1);		crm_info("Debug set to %d (was %d)",			 get_crm_log_level(), level);#endif				/*========== (NOT_DC)-Only Actions ==========*/	} else if(AM_I_DC == FALSE){		gboolean dc_match = safe_str_eq(host_from, fsa_our_dc);		if(dc_match || fsa_our_dc == NULL) {			if(strcmp(op, CRM_OP_HBEAT) == 0) {				next_input = I_DC_HEARTBEAT;							} else if(strcmp(op, CRM_OP_WELCOME) == 0) {				next_input = I_JOIN_OFFER;							} else if(fsa_our_dc == NULL) {				crm_warn("CRMd discarding request: %s"					" (DC: %s, from: %s)",					op, crm_str(fsa_our_dc), host_from);				crm_xml_warn(stored_msg, "Ignored Request");							} else if(strcmp(op, CRM_OP_RETRIVE_CIB) == 0) {				next_input = I_CIB_OP;							} else if(strcmp(op, CRM_OP_JOINACK) == 0) {				next_input = I_JOIN_RESULT;							} else if(strcmp(op, CRM_OP_REPLACE) == 0) {				next_input = I_CIB_OP;						} else if(strcmp(op, CRM_OP_UPDATE) == 0) {				next_input = I_CIB_OP;						} else if(strcmp(op, CRM_OP_SHUTDOWN) == 0) {				next_input = I_TERMINATE;							} else {				crm_err("CRMd didnt expect request: %s", op);				crm_xml_err(stored_msg, "Bad Request");			}					} else {			crm_warn("Discarding %s op from %s", op, host_from);		}		/*========== DC-Only Actions ==========*/	} else if(AM_I_DC){		if(strcmp(op, CRM_OP_TEABORT) == 0) {			if(fsa_state != S_INTEGRATION) {				next_input = I_PE_CALC;			} else {					crm_debug("Ignoring %s in state %s."					"  Waiting for the integration to"					" complete first.",					op, fsa_state2string(fsa_state));			}						} else if(strcmp(op, CRM_OP_TECOMPLETE) == 0) {/* 			if(fsa_state == S_TRANSITION_ENGINE) { */				next_input = I_TE_SUCCESS;/* 			} else { *//* 				crm_warn("Op %s is only valid in state %s..." *//* 					 "We are in (%s)", *//* 					 op, *//* 					 fsa_state2string(S_TRANSITION_ENGINE), *//* 					 fsa_state2string(fsa_state)); *//* 			} */		} else if(strcmp(op, CRM_OP_CREATE) == 0			      || strcmp(op, CRM_OP_UPDATE) == 0			      || strcmp(op, CRM_OP_ERASE) == 0			      || strcmp(op, CRM_OP_REPLACE) == 0			      || strcmp(op, CRM_OP_DELETE) == 0) {			next_input = I_CIB_OP;					} else if(strcmp(op, CRM_OP_ANNOUNCE) == 0) {			next_input = I_NODE_JOIN;					} else if(strcmp(op, CRM_OP_SHUTDOWN_REQ) == 0) {			/* a slave wants to shut down */			/* create cib fragment and add to message */			next_input = handle_shutdown_request(stored_msg);					} else {			crm_err("Unexpected request (%s) sent to the DC", op);			crm_xml_err(stored_msg, "Bad Request");		}			}	return next_input;}