osaf/services/saf/amf/amfd/include/sg.h      |  18 ++++++++++++++----
 osaf/services/saf/amf/amfd/sg_2n_fsm.cc      |  23 ++---------------------
 osaf/services/saf/amf/amfd/sg_nored_fsm.cc   |  22 +---------------------
 osaf/services/saf/amf/amfd/sg_npm_fsm.cc     |  22 +---------------------
 osaf/services/saf/amf/amfd/sg_nway_fsm.cc    |  19 +------------------
 osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc |  22 +---------------------
 6 files changed, 20 insertions(+), 106 deletions(-)


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
@@ -205,10 +205,15 @@ public:
                                      use.*/
 
 
-       // Function pointers to redundancy model specific handlers
-
-       // Handle node failure and fail over assignments
-       void (*node_fail)(AVD_CL_CB *cb, AVD_SU *su);
+       /**
+        * Handle node failure and fail over assignments
+        * Called when the node hosting the SU has already failed and the SIs
+        * assigned to the specified SU needs to be failed over.
+        *
+        * @param cb
+        * @param su
+        */
+       virtual void node_fail(AVD_CL_CB *cb, AVD_SU *su) = 0;
 
        // Handle SG realign
        uint32_t (*realign)(AVD_CL_CB *cb, AVD_SG *sg);
@@ -257,6 +262,7 @@ extern AmfDb<std::string, AVD_SG> *sg_db
 class SG_2N : public AVD_SG {
 public:
        ~SG_2N();
+       void node_fail(AVD_CL_CB*, AVD_SU*);
 };
 
 /**
@@ -265,6 +271,7 @@ public:
 class SG_NORED : public AVD_SG {
 public:
        ~SG_NORED();
+       void node_fail(AVD_CL_CB*, AVD_SU*);
 };
 
 /**
@@ -273,6 +280,7 @@ public:
 class SG_NPM : public AVD_SG {
 public:
        ~SG_NPM();
+       void node_fail(AVD_CL_CB*, AVD_SU*);
 };
 
 /**
@@ -281,6 +289,7 @@ public:
 class SG_NACV : public AVD_SG {
 public:
        ~SG_NACV();
+       void node_fail(AVD_CL_CB*, AVD_SU*);
 };
 
 /**
@@ -289,6 +298,7 @@ public:
 class SG_NWAY : public AVD_SG {
 public:
        ~SG_NWAY();
+       void node_fail(AVD_CL_CB*, AVD_SU*);
 };
 
 
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
@@ -3375,26 +3375,8 @@ static void avd_sg_2n_node_fail_si_oper(
 
        TRACE_LEAVE();
 }
-/*****************************************************************************
- * Function: avd_sg_2n_node_fail_func
- *
- * Purpose:  This function is called when the node has already failed and
- *           the SIs have to be failed over. It does the functionality 
- *           specified in the design.
- *
- * Input: cb - the AVD control block
- *        su - The SU that has faulted because of the node failure.
- *        
- *
- * Returns: None.
- *
- * NOTES: This is a 2N redundancy model specific function.
- *
- * 
- **************************************************************************/
-
-void avd_sg_2n_node_fail_func(AVD_CL_CB *cb, AVD_SU *su)
-{
+
+void SG_2N::node_fail(AVD_CL_CB *cb, AVD_SU *su) {
        AVD_SU_SI_REL *a_susi, *s_susi;
        AVD_SU *o_su, *i_su;
        bool flag;
@@ -4173,7 +4155,6 @@ AVD_SU *get_other_su_from_oper_list(AVD_
  */
 void avd_sg_2n_init(AVD_SG *sg)
 {
-       sg->node_fail = avd_sg_2n_node_fail_func;
        sg->realign = avd_sg_2n_realign_func;
        sg->si_func = avd_sg_2n_si_func;
        sg->si_admin_down = avd_sg_2n_si_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
@@ -948,26 +948,7 @@ uint32_t avd_sg_nored_realign_func(AVD_C
        return NCSCC_RC_SUCCESS;
 }
 
-/*****************************************************************************
- * Function: avd_sg_nored_node_fail_func
- *
- * Purpose:  This function is called when the node has already failed and
- *           the SIs have to be failed over. It does the functionality 
- *           specified in the design.
- *
- * Input: cb - the AVD control block
- *        su - The SU that has faulted because of the node failure.
- *        
- *
- * Returns: None.
- *
- * NOTES: This is a No redundancy model specific function.
- *
- * 
- **************************************************************************/
-
-void avd_sg_nored_node_fail_func(AVD_CL_CB *cb, AVD_SU *su)
-{
+void SG_NORED::node_fail(AVD_CL_CB *cb, AVD_SU *su) {
 
        bool flag;
        AVD_SI *l_si;
@@ -1441,7 +1422,6 @@ uint32_t avd_sg_nored_sg_admin_down(AVD_
  */
 void avd_sg_nored_init(AVD_SG *sg)
 {
-       sg->node_fail = avd_sg_nored_node_fail_func;
        sg->realign = avd_sg_nored_realign_func;
        sg->si_func = avd_sg_nored_si_func;
        sg->si_admin_down = avd_sg_nored_si_admin_down;
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
@@ -4167,26 +4167,7 @@ static void avd_sg_npm_node_fail_si_oper
 
 }
 
-/*****************************************************************************
- * Function: avd_sg_npm_node_fail_func
- *
- * Purpose:  This function is called when the node has already failed and
- *           the SIs have to be failed over. It does the functionality 
- *           specified in the design.
- *
- * Input: cb - the AVD control block
- *        su - The SU that has faulted because of the node failure.
- *        
- *
- * Returns: None.
- *
- * NOTES: This is a N+M redundancy model specific function.
- *
- * 
- **************************************************************************/
-
-void avd_sg_npm_node_fail_func(AVD_CL_CB *cb, AVD_SU *su)
-{
+void SG_NPM::node_fail(AVD_CL_CB *cb, AVD_SU *su) {
        AVD_SU *o_su;
        AVD_SU_SI_REL *o_susi;
 
@@ -4621,7 +4602,6 @@ uint32_t avd_sg_npm_sg_admin_down(AVD_CL
  */
 void avd_sg_npm_init(AVD_SG *sg)
 {
-       sg->node_fail = avd_sg_npm_node_fail_func;
        sg->realign = avd_sg_npm_realign_func;
        sg->si_func = avd_sg_npm_si_func;
        sg->si_admin_down = avd_sg_npm_si_admin_down;
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
@@ -595,23 +595,7 @@ uint32_t avd_sg_nway_realign_func(AVD_CL
        return NCSCC_RC_SUCCESS;
 }
 
-/*****************************************************************************
- * Function: avd_sg_nway_node_fail_func
- *
- * Purpose:  This function is called when the node has already failed and
- *           the SIs have to be failed over. It does the functionality 
- *           specified in the design.
- *
- * Input: cb - the AVD control block
- *        su - The SU that has faulted because of the node failure.
- *        
- * Returns: None.
- *
- * Notes: This is a N-Way redundancy model specific function.
- * 
- **************************************************************************/
-void avd_sg_nway_node_fail_func(AVD_CL_CB *cb, AVD_SU *su)
-{
+void SG_NWAY::node_fail(AVD_CL_CB *cb, AVD_SU *su) {
        TRACE_ENTER2("%u", su->sg_of_su->sg_fsm_state);
 
        if (!su->list_of_susi)
@@ -3683,7 +3667,6 @@ void avd_sg_nway_node_fail_sg_realign(AV
  */
 void avd_sg_nway_init(AVD_SG *sg)
 {
-       sg->node_fail = avd_sg_nway_node_fail_func;
        sg->realign = avd_sg_nway_realign_func;
        sg->si_func = avd_sg_nway_si_func;
        sg->si_admin_down = avd_sg_nway_si_admin_down;
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
@@ -1376,26 +1376,7 @@ uint32_t avd_sg_nacvred_realign_func(AVD
        return NCSCC_RC_SUCCESS;
 }
 
-/*****************************************************************************
- * Function: avd_sg_nacvred_node_fail_func
- *
- * Purpose:  This function is called when the node has already failed and
- *           the SIs have to be failed over. It does the functionality 
- *           specified in the design.
- *
- * Input: cb - the AVD control block
- *        su - The SU that has faulted because of the node failure.
- *        
- *
- * Returns: None.
- *
- * NOTES: This is a N-way active redundancy model specific function.
- *
- * 
- **************************************************************************/
-
-void avd_sg_nacvred_node_fail_func(AVD_CL_CB *cb, AVD_SU *su)
-{
+void SG_NACV::node_fail(AVD_CL_CB *cb, AVD_SU *su) {
        bool flag;
        AVD_AVND *su_node_ptr = NULL;
 
@@ -2162,7 +2143,6 @@ done:
  */
 void avd_sg_nacv_init(AVD_SG *sg)
 {
-       sg->node_fail = avd_sg_nacvred_node_fail_func;
        sg->realign = avd_sg_nacvred_realign_func;
        sg->si_func = avd_sg_nacvred_si_func;
        sg->si_admin_down = avd_sg_nacvred_si_admin_down;

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to