osaf/services/saf/amf/amfd/include/proc.h | 10 -------- osaf/services/saf/amf/amfd/include/sg.h | 35 +++++++++++++++++++++++++-- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 34 +------------------------- osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 35 +-------------------------- osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 34 +------------------------- osaf/services/saf/amf/amfd/sg_nway_fsm.cc | 31 +----------------------- osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 35 +-------------------------- 7 files changed, 42 insertions(+), 172 deletions(-)
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,30 +53,20 @@ 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_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, - AVSV_SUSI_ACT act, SaAmfHAStateT state); 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_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, - AVSV_SUSI_ACT act, SaAmfHAStateT state); void avd_sg_nway_init(AVD_SG *sg); /* The following are for N+M redundancy model */ -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); void avd_sg_npm_init(AVD_SG *sg); /* The following are for No redundancy model */ -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); 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_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, - AVSV_SUSI_ACT act, SaAmfHAStateT state); 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 @@ -300,9 +300,28 @@ public: virtual uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state) = 0; - // Handle failed SUSI assignment - uint32_t (*susi_failed)(AVD_CL_CB *cb, AVD_SU *su, - struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + /** + * Handle failed SUSI assignment + * + * Called when a SU SI ack function is received from the ND with some error + * value. The message may be an ack for a particular SU SI or for the entire + * SU. Since if a CSI set callback returns error it is considered as + * failure of the component, ND would have updated that info for each of + * the components that failed and also for the SU an operation state + * message would be sent the processing will be done in that event context. + * For faulted SU this event would be considered as completion of action, + * for healthy SU no SUSI state change will be done. + * + * @param cb + * @param su + * @param susi + * @param act + * @param state + * @return + */ + virtual uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, + SaAmfHAStateT state) = 0; private: // disallow copy and assign, TODO(hafe) add common macro for this @@ -329,6 +348,8 @@ public: uint32_t su_admin_down(AVD_CL_CB *cb, AVD_SU *su, struct avd_avnd_tag *avnd); uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); }; /** @@ -347,6 +368,8 @@ public: uint32_t su_admin_down(AVD_CL_CB *cb, AVD_SU *su, struct avd_avnd_tag *avnd); uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); }; /** @@ -365,6 +388,8 @@ public: uint32_t su_admin_down(AVD_CL_CB *cb, AVD_SU *su, struct avd_avnd_tag *avnd); uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); }; /** @@ -383,6 +408,8 @@ public: uint32_t su_admin_down(AVD_CL_CB *cb, AVD_SU *su, struct avd_avnd_tag *avnd); uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); }; /** @@ -401,6 +428,8 @@ public: uint32_t su_admin_down(AVD_CL_CB *cb, AVD_SU *su, struct avd_avnd_tag *avnd); uint32_t susi_success(AVD_CL_CB *cb, AVD_SU *su, struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); + uint32_t susi_failed(AVD_CL_CB *cb, AVD_SU *su, + struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); }; 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 @@ -2530,37 +2530,8 @@ done: return rc; } -/***************************************************************************** - * Function: avd_sg_2n_susi_fail_func - * - * Purpose: This function is called when a SU SI ack function is - * received from the AVND with some error value. The message may be an - * ack for a particular SU SI or for the entire SU. It will log an event - * about the failure. Since if a CSI set callback returns error it is - * considered as failure of the component, AvND would have updated that - * info for each of the components that failed and also for the SU an - * operation state message would be sent the processing will be done in that - * event context. For faulted SU this event would be considered as - * completion of action, for healthy SU no SUSI state change will be done. - * - * - * Input: cb - the AVD control block - * su - In case of entire SU related operation the SU for - * which the ack is received. - * susi - The pointer to the service unit service instance relationship. - * act - The action received in the ack message. - * state - The HA state in the message. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a 2N redundancy model specific function. - * - * - **************************************************************************/ - -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 SG_2N::susi_failed(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, + AVSV_SUSI_ACT act, SaAmfHAStateT state) { AVD_SU_SI_REL *s_susi, *o_susi, *l_susi; AVD_SU *a_su; bool flag; @@ -3976,7 +3947,6 @@ AVD_SU *get_other_su_from_oper_list(AVD_ */ void avd_sg_2n_init(AVD_SG *sg) { - sg->susi_failed = avd_sg_2n_susi_fail_func; } SG_2N::~SG_2N() { 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 @@ -638,38 +638,8 @@ uint32_t SG_NORED::susi_success(AVD_CL_C return NCSCC_RC_SUCCESS; } -/***************************************************************************** - * Function: avd_sg_nored_susi_fail_func - * - * Purpose: This function is called when a SU SI ack function is - * received from the AVND with some error value. The message may be an - * ack for a particular SU SI or for the entire SU. It will log an event - * about the failure. Since if a CSI set callback returns error it is - * considered as failure of the component, AvND would have updated that - * info for each of the components that failed and also for the SU an - * operation state message would be sent the processing will be done in that - * event context. For faulted SU this event would be considered as - * completion of action, for healthy SU no SUSI state change will be done. - * - * - * Input: cb - the AVD control block - * su - In case of entire SU related operation the SU for - * which the ack is received. - * susi - The pointer to the service unit service instance relationship. - * act - The action received in the ack message. - * state - The HA state in the message. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a No redundancy model specific function. - * - * - **************************************************************************/ - -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 SG_NORED::susi_failed(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, + AVSV_SUSI_ACT act, SaAmfHAStateT state) { bool flag; AVD_AVND *su_node_ptr = NULL; @@ -1253,7 +1223,6 @@ uint32_t SG_NORED::sg_admin_down(AVD_CL_ */ void avd_sg_nored_init(AVD_SG *sg) { - sg->susi_failed = avd_sg_nored_susi_fail_func; } SG_NORED::~SG_NORED() { 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 @@ -2895,37 +2895,8 @@ uint32_t SG_NPM::susi_success(AVD_CL_CB return NCSCC_RC_SUCCESS; } -/***************************************************************************** - * Function: avd_sg_npm_susi_fail_func - * - * Purpose: This function is called when a SU SI ack function is - * received from the AVND with some error value. The message may be an - * ack for a particular SU SI or for the entire SU. It will log an event - * about the failure. Since if a CSI set callback returns error it is - * considered as failure of the component, AvND would have updated that - * info for each of the components that failed and also for the SU an - * operation state message would be sent the processing will be done in that - * event context. For faulted SU this event would be considered as - * completion of action, for healthy SU no SUSI state change will be done. - * - * - * Input: cb - the AVD control block - * su - In case of entire SU related operation the SU for - * which the ack is received. - * susi - The pointer to the service unit service instance relationship. - * act - The action received in the ack message. - * state - The HA state in the message. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a N+M redundancy model specific function. - * - * - **************************************************************************/ - -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 SG_NPM::susi_failed(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, + AVSV_SUSI_ACT act, SaAmfHAStateT state) { AVD_SU_SI_REL *o_susi; bool flag; AVD_AVND *su_node_ptr = NULL; @@ -4434,7 +4405,6 @@ uint32_t SG_NPM::sg_admin_down(AVD_CL_CB */ void avd_sg_npm_init(AVD_SG *sg) { - sg->susi_failed = avd_sg_npm_susi_fail_func; } SG_NPM::~SG_NPM() { 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 @@ -300,34 +300,8 @@ done: return rc; } -/***************************************************************************** - * Function: avd_sg_nway_susi_fail_func - * - * Purpose: This function is called when a SU SI ack function is - * received from the AVND with some error value. The message may be an - * ack for a particular SU SI or for the entire SU. It will log an event - * about the failure. Since if a CSI set callback returns error it is - * considered as failure of the component, AvND would have updated that - * info for each of the components that failed and also for the SU an - * operation state message would be sent the processing will be done in that - * event context. For faulted SU this event would be considered as - * completion of action, for healthy SU no SUSI state change will be done. - * - * - * Input: cb - the AVD control block - * su - In case of entire SU related operation the SU for - * which the ack is received. - * susi - The pointer to the service unit service instance relationship. - * act - The action received in the ack message. - * state - The HA state in the message. - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * Notes: This is a N-Way redundancy model specific function. - * - **************************************************************************/ -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 SG_NWAY::susi_failed(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, + AVSV_SUSI_ACT act, SaAmfHAStateT state) { AVD_SU_SI_REL *curr_susi = 0; AVD_SG *sg = su->sg_of_su; bool is_eng = false; @@ -3535,7 +3509,6 @@ void avd_sg_nway_node_fail_sg_realign(AV */ void avd_sg_nway_init(AVD_SG *sg) { - sg->susi_failed = avd_sg_nway_susi_fail_func; } SG_NWAY::~SG_NWAY() { 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 @@ -1004,38 +1004,8 @@ uint32_t SG_NACV::susi_success(AVD_CL_CB return NCSCC_RC_SUCCESS; } -/***************************************************************************** - * Function: avd_sg_nacvred_susi_fail_func - * - * Purpose: This function is called when a SU SI ack function is - * received from the AVND with some error value. The message may be an - * ack for a particular SU SI or for the entire SU. It will log an event - * about the failure. Since if a CSI set callback returns error it is - * considered as failure of the component, AvND would have updated that - * info for each of the components that failed and also for the SU an - * operation state message would be sent the processing will be done in that - * event context. For faulted SU this event would be considered as - * completion of action, for healthy SU no SUSI state change will be done. - * - * - * Input: cb - the AVD control block - * su - In case of entire SU related operation the SU for - * which the ack is received. - * susi - The pointer to the service unit service instance relationship. - * act - The action received in the ack message. - * state - The HA state in the message. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: This is a N-way active redundancy model specific function. - * - * - **************************************************************************/ - -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 SG_NACV::susi_failed(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, + AVSV_SUSI_ACT act, SaAmfHAStateT state) { bool flag; AVD_AVND *su_node_ptr = NULL; @@ -1976,7 +1946,6 @@ done: */ void avd_sg_nacv_init(AVD_SG *sg) { - sg->susi_failed = avd_sg_nacvred_susi_fail_func; } SG_NACV::~SG_NACV() { ------------------------------------------------------------------------------ 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