osaf/services/saf/amf/amfd/csi.cc | 2 +- osaf/services/saf/amf/amfd/include/proc.h | 15 --------------- osaf/services/saf/amf/amfd/include/sg.h | 14 ++++++++++++-- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 24 +----------------------- osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 24 +----------------------- osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 24 +----------------------- osaf/services/saf/amf/amfd/sg_nway_fsm.cc | 22 +--------------------- osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 24 +----------------------- osaf/services/saf/amf/amfd/si.cc | 2 +- osaf/services/saf/amf/amfd/si_dep.cc | 2 +- 10 files changed, 20 insertions(+), 133 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/csi.cc b/osaf/services/saf/amf/amfd/csi.cc --- a/osaf/services/saf/amf/amfd/csi.cc +++ b/osaf/services/saf/amf/amfd/csi.cc @@ -921,7 +921,7 @@ SaAisErrorT csi_assign_hdlr(AVD_CSI *csi }/* if (NULL != csi->si->list_of_sisu) */ else if (csi->si->saAmfSIAdminState == SA_AMF_ADMIN_UNLOCKED) { /* CSI has been added into an SI, now SI can be assigned */ - csi->si->sg_of_si->si_func(avd_cb, csi->si); + csi->si->sg_of_si->si_assign(avd_cb, csi->si); } done: return rc; diff --git a/osaf/services/saf/amf/amfd/include/proc.h b/osaf/services/saf/amf/amfd/include/proc.h --- a/osaf/services/saf/amf/amfd/include/proc.h +++ b/osaf/services/saf/amf/amfd/include/proc.h @@ -53,7 +53,6 @@ uint32_t avd_sg_susi_mod_snd_honouring_s uint32_t avd_sg_su_si_del_snd(AVD_CL_CB *cb, AVD_SU *su); /* The following are for 2N redundancy model */ -uint32_t avd_sg_2n_si_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_2n_su_insvc_func(AVD_CL_CB *cb, AVD_SU *su); extern SaAisErrorT avd_sg_2n_siswap_func(AVD_SI *si, SaInvocationT invocation); uint32_t avd_sg_2n_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); @@ -61,16 +60,13 @@ uint32_t avd_sg_2n_susi_sucss_func(AVD_C AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_2n_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); -uint32_t avd_sg_2n_realign_func(AVD_CL_CB *cb, AVD_SG *sg); uint32_t avd_sg_2n_su_admin_fail(AVD_CL_CB *cb, AVD_SU *su, AVD_AVND *avnd); uint32_t avd_sg_2n_si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_2n_sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); -void avd_sg_2n_node_fail_func(AVD_CL_CB *cb, AVD_SU *su); void avd_sg_2n_init(AVD_SG *sg); /* The following are for N-Way redundancy model */ uint32_t avd_sg_nway_si_assign(AVD_CL_CB *, AVD_SG *); -uint32_t avd_sg_nway_si_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nway_su_insvc_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nway_siswitch_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nway_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); @@ -78,15 +74,12 @@ uint32_t avd_sg_nway_susi_sucss_func(AVD AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nway_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); -uint32_t avd_sg_nway_realign_func(AVD_CL_CB *cb, AVD_SG *sg); uint32_t avd_sg_nway_su_admin_fail(AVD_CL_CB *cb, AVD_SU *su, AVD_AVND *avnd); uint32_t avd_sg_nway_si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nway_sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); -void avd_sg_nway_node_fail_func(AVD_CL_CB *cb, AVD_SU *su); void avd_sg_nway_init(AVD_SG *sg); /* The following are for N+M redundancy model */ -uint32_t avd_sg_npm_si_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_npm_su_insvc_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_npm_siswitch_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_npm_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); @@ -94,42 +87,34 @@ uint32_t avd_sg_npm_susi_sucss_func(AVD_ AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_npm_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); -uint32_t avd_sg_npm_realign_func(AVD_CL_CB *cb, AVD_SG *sg); uint32_t avd_sg_npm_su_admin_fail(AVD_CL_CB *cb, AVD_SU *su, AVD_AVND *avnd); uint32_t avd_sg_npm_si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_npm_sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); -void avd_sg_npm_node_fail_func(AVD_CL_CB *cb, AVD_SU *su); void avd_sg_npm_init(AVD_SG *sg); /* The following are for No redundancy model */ -uint32_t avd_sg_nored_si_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nored_su_insvc_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nored_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nored_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nored_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); -uint32_t avd_sg_nored_realign_func(AVD_CL_CB *cb, AVD_SG *sg); uint32_t avd_sg_nored_su_admin_fail(AVD_CL_CB *cb, AVD_SU *su, AVD_AVND *avnd); uint32_t avd_sg_nored_si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nored_sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); -void avd_sg_nored_node_fail_func(AVD_CL_CB *cb, AVD_SU *su); void avd_sg_nored_init(AVD_SG *sg); /* The following are for N-way Active redundancy model */ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD_CL_CB *cb, AVD_SG *sg); -uint32_t avd_sg_nacvred_si_func(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nacvred_su_insvc_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nacvred_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nacvred_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nacvred_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); -uint32_t avd_sg_nacvred_realign_func(AVD_CL_CB *cb, AVD_SG *sg); uint32_t avd_sg_nacvred_su_admin_fail(AVD_CL_CB *cb, AVD_SU *su, AVD_AVND *avnd); uint32_t avd_sg_nacvred_si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t avd_sg_nacvred_sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); -void avd_sg_nacvred_node_fail_func(AVD_CL_CB *cb, AVD_SU *su); void avd_sg_nacv_init(AVD_SG *sg); void avd_node_up_evh(AVD_CL_CB *cb, struct avd_evt_tag *evt); diff --git a/osaf/services/saf/amf/amfd/include/sg.h b/osaf/services/saf/amf/amfd/include/sg.h --- a/osaf/services/saf/amf/amfd/include/sg.h +++ b/osaf/services/saf/amf/amfd/include/sg.h @@ -229,8 +229,13 @@ public: */ virtual uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg) = 0; - // Handle new SI or admin op UNLOCK of SI - uint32_t (*si_func)(AVD_CL_CB *cb, AVD_SI *si); + /** + * Handle new SI or admin op UNLOCK of SI + * @param cb + * @param si + * @return + */ + virtual uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si) = 0; // Handle SI admin op LOCK/SHUTDOWN uint32_t (*si_admin_down)(AVD_CL_CB *cb, AVD_SI *si); @@ -275,6 +280,7 @@ public: ~SG_2N(); void node_fail(AVD_CL_CB*, AVD_SU*); uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg); + uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si); }; /** @@ -285,6 +291,7 @@ public: ~SG_NORED(); void node_fail(AVD_CL_CB*, AVD_SU*); uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg); + uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si); }; /** @@ -295,6 +302,7 @@ public: ~SG_NPM(); void node_fail(AVD_CL_CB*, AVD_SU*); uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg); + uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si); }; /** @@ -305,6 +313,7 @@ public: ~SG_NACV(); void node_fail(AVD_CL_CB*, AVD_SU*); uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg); + uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si); }; /** @@ -315,6 +324,7 @@ public: ~SG_NWAY(); void node_fail(AVD_CL_CB*, AVD_SU*); uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg); + uint32_t si_assign(AVD_CL_CB *cb, AVD_SI *si); }; diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc @@ -718,28 +718,7 @@ done: return return_su; } -/***************************************************************************** - * Function: avd_sg_2n_si_func - * - * Purpose: This function is called when a new SI is added to a SG. The SG is - * of type 2N redundancy model. This function will perform the functionality - * described in the SG FSM design. - * - * Input: cb - the AVD control block - * si - The pointer to the service instance. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a 2N redundancy model specific function. If there are - * any SIs being transitioned due to operator, this call will return - * failure. - * - * - **************************************************************************/ - -uint32_t avd_sg_2n_si_func(AVD_CL_CB *cb, AVD_SI *si) -{ +uint32_t SG_2N::si_assign(AVD_CL_CB *cb, AVD_SI *si) { AVD_SU *l_su; TRACE_ENTER2("'%s', %u", si->name.value, si->sg_of_si->sg_fsm_state); @@ -4132,7 +4111,6 @@ AVD_SU *get_other_su_from_oper_list(AVD_ */ void avd_sg_2n_init(AVD_SG *sg) { - sg->si_func = avd_sg_2n_si_func; sg->si_admin_down = avd_sg_2n_si_admin_down; sg->si_swap = avd_sg_2n_siswap_func; sg->sg_admin_down = avd_sg_2n_sg_admin_down; diff --git a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc @@ -113,28 +113,7 @@ static AVD_SU *avd_sg_nored_su_chose_asg return sg->su_oper_list.su; } -/***************************************************************************** - * Function: avd_sg_nored_si_func - * - * Purpose: This function is called when a new SI is added to a SG. The SG is - * of type No redundancy model. This function will perform the functionality - * described in the SG FSM design. - * - * Input: cb - the AVD control block - * si - The pointer to the service instance. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a No redundancy model specific function. If there are - * any SIs being transitioned due to operator, this call will return - * failure. - * - * - **************************************************************************/ - -uint32_t avd_sg_nored_si_func(AVD_CL_CB *cb, AVD_SI *si) -{ +uint32_t SG_NORED::si_assign(AVD_CL_CB *cb, AVD_SI *si) { TRACE_ENTER2("%u", si->sg_of_si->sg_fsm_state); /* If the SG FSM state is not stable just return success. */ @@ -1398,7 +1377,6 @@ uint32_t avd_sg_nored_sg_admin_down(AVD_ */ void avd_sg_nored_init(AVD_SG *sg) { - sg->si_func = avd_sg_nored_si_func; sg->si_admin_down = avd_sg_nored_si_admin_down; sg->sg_admin_down = avd_sg_nored_sg_admin_down; sg->su_insvc = avd_sg_nored_su_insvc_func; diff --git a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc @@ -879,28 +879,7 @@ done: return sg->su_oper_list.su; } -/***************************************************************************** - * Function: avd_sg_npm_si_func - * - * Purpose: This function is called when a new SI is added to a SG. The SG is - * of type N+M redundancy model. This function will perform the functionality - * described in the SG FSM design. - * - * Input: cb - the AVD control block - * si - The pointer to the service instance. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a N+M redundancy model specific function. If there are - * any SIs being transitioned due to operator, this call will return - * failure. - * - * - **************************************************************************/ - -uint32_t avd_sg_npm_si_func(AVD_CL_CB *cb, AVD_SI *si) -{ +uint32_t SG_NPM::si_assign(AVD_CL_CB *cb, AVD_SI *si) { TRACE_ENTER2("%u", si->sg_of_si->sg_fsm_state); /* If the SG FSM state is not stable just return success. */ @@ -4578,7 +4557,6 @@ uint32_t avd_sg_npm_sg_admin_down(AVD_CL */ void avd_sg_npm_init(AVD_SG *sg) { - sg->si_func = avd_sg_npm_si_func; sg->si_admin_down = avd_sg_npm_si_admin_down; sg->sg_admin_down = avd_sg_npm_sg_admin_down; sg->su_insvc = avd_sg_npm_su_insvc_func; diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc @@ -79,26 +79,7 @@ static AVD_SU_SI_REL * find_pref_standby } \ }; -/***************************************************************************** - * Function: avd_sg_nway_si_func - * - * Purpose: This function is called when a new SI is added to a SG. The SG is - * of type N-Way redundancy model. This function will perform the functionality - * described in the SG FSM design. - * - * Input: cb - the AVD control block - * si - The pointer to the service instance. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * Notes: This is a N-Way redundancy model specific function. If there are - * any SIs being transitioned due to operator, this call will return - * failure. - * - **************************************************************************/ -uint32_t avd_sg_nway_si_func(AVD_CL_CB *cb, AVD_SI *si) -{ +uint32_t SG_NWAY::si_assign(AVD_CL_CB *cb, AVD_SI *si) { uint32_t rc = NCSCC_RC_SUCCESS; TRACE_ENTER2(" SI '%s'",si->name.value); @@ -3659,7 +3640,6 @@ void avd_sg_nway_node_fail_sg_realign(AV */ void avd_sg_nway_init(AVD_SG *sg) { - sg->si_func = avd_sg_nway_si_func; sg->si_admin_down = avd_sg_nway_si_admin_down; sg->sg_admin_down = avd_sg_nway_sg_admin_down; sg->su_insvc = avd_sg_nway_su_insvc_func; diff --git a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc @@ -225,28 +225,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD return sg->su_oper_list.su; } -/***************************************************************************** - * Function: avd_sg_nacvred_si_func - * - * Purpose: This function is called when a new SI is added to a SG. The SG is - * of type N-way active redundancy model. This function will perform the functionality - * described in the SG FSM design. - * - * Input: cb - the AVD control block - * si - The pointer to the service instance. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a N-way active redundancy model specific function. If there are - * any SIs being transitioned due to operator, this call will just return - * success. - * - * - **************************************************************************/ - -uint32_t avd_sg_nacvred_si_func(AVD_CL_CB *cb, AVD_SI *si) -{ +uint32_t SG_NACV::si_assign(AVD_CL_CB *cb, AVD_SI *si) { TRACE_ENTER2("%u", si->sg_of_si->sg_fsm_state); /* If the SG FSM state is not stable just return success. */ @@ -2121,7 +2100,6 @@ done: */ void avd_sg_nacv_init(AVD_SG *sg) { - sg->si_func = avd_sg_nacvred_si_func; sg->si_admin_down = avd_sg_nacvred_si_admin_down; sg->sg_admin_down = avd_sg_nacvred_sg_admin_down; sg->su_insvc = avd_sg_nacvred_su_insvc_func; diff --git a/osaf/services/saf/amf/amfd/si.cc b/osaf/services/saf/amf/amfd/si.cc --- a/osaf/services/saf/amf/amfd/si.cc +++ b/osaf/services/saf/amf/amfd/si.cc @@ -809,7 +809,7 @@ static void si_admin_op_cb(SaImmOiHandle si->set_admin_state(SA_AMF_ADMIN_UNLOCKED); - err = si->sg_of_si->si_func(avd_cb, si); + err = si->sg_of_si->si_assign(avd_cb, si); if (si->list_of_sisu == NULL) LOG_NO("'%s' could not be assigned to any SU", si->name.value); diff --git a/osaf/services/saf/amf/amfd/si_dep.cc b/osaf/services/saf/amf/amfd/si_dep.cc --- a/osaf/services/saf/amf/amfd/si_dep.cc +++ b/osaf/services/saf/amf/amfd/si_dep.cc @@ -474,7 +474,7 @@ uint32_t sidep_sg_red_si_process_assignm if ((si->saAmfSIAdminState == SA_AMF_ADMIN_UNLOCKED) && (cb->init_state == AVD_APP_STATE)) { LOG_NO("Assigning due to dep '%s'",si->name.value); - if (si->sg_of_si->si_func(cb, si) != NCSCC_RC_SUCCESS) { + if (si->sg_of_si->si_assign(cb, si) != NCSCC_RC_SUCCESS) { goto done; } ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel