osaf/services/saf/amf/amfd/comptype.cc    |   1 +
 osaf/services/saf/amf/amfd/dmsg.cc        |   1 +
 osaf/services/saf/amf/amfd/hlt.cc         |   1 +
 osaf/services/saf/amf/amfd/include/msg.h  |  26 +-----------
 osaf/services/saf/amf/amfd/include/role.h |  39 ++++++++++++++++++
 osaf/services/saf/amf/amfd/include/util.h |  66 ++----------------------------
 osaf/services/saf/amf/amfd/role.cc        |   1 +
 7 files changed, 49 insertions(+), 86 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/comptype.cc 
b/osaf/services/saf/amf/amfd/comptype.cc
--- a/osaf/services/saf/amf/amfd/comptype.cc
+++ b/osaf/services/saf/amf/amfd/comptype.cc
@@ -25,6 +25,7 @@
 #include <amf_util.h>
 #include <comp.h>
 #include <imm.h>
+#include "util.h"
 
 /* Global variable for the singleton object used by comp class */
 AVD_COMP_GLOBALATTR avd_comp_global_attrs;
diff --git a/osaf/services/saf/amf/amfd/dmsg.cc 
b/osaf/services/saf/amf/amfd/dmsg.cc
--- a/osaf/services/saf/amf/amfd/dmsg.cc
+++ b/osaf/services/saf/amf/amfd/dmsg.cc
@@ -39,6 +39,7 @@
 
 #include "amfd.h"
 #include "logtrace.h"
+#include "role.h"
 
 /*****************************************************************************
  * Function: avd_mds_d_enc
diff --git a/osaf/services/saf/amf/amfd/hlt.cc 
b/osaf/services/saf/amf/amfd/hlt.cc
--- a/osaf/services/saf/amf/amfd/hlt.cc
+++ b/osaf/services/saf/amf/amfd/hlt.cc
@@ -26,6 +26,7 @@
 #include <csi.h>
 #include <hlt.h>
 #include <comp.h>
+#include "util.h"
 
 static SaAisErrorT ccb_completed_modify_hdlr(CcbUtilOperationData_t *opdata)
 {
diff --git a/osaf/services/saf/amf/amfd/include/msg.h 
b/osaf/services/saf/amf/amfd/include/msg.h
--- a/osaf/services/saf/amf/amfd/include/msg.h
+++ b/osaf/services/saf/amf/amfd/include/msg.h
@@ -35,6 +35,7 @@
 #define AVD_MSG_H
 
 #include <amf_d2nmsg.h>
+#include "role.h"
 
 typedef enum {
        AVD_D2D_CHANGE_ROLE_REQ = AVSV_DND_MSG_MAX,
@@ -42,11 +43,6 @@ typedef enum {
        AVD_D2D_MSG_MAX,
 } AVD_D2D_MSG_TYPE;
 
-typedef enum avd_rol_chg_cause_type {
-        AVD_SWITCH_OVER,
-        AVD_FAIL_OVER
-} AVD_ROLE_CHG_CAUSE_T;
-
 typedef AVSV_DND_MSG AVD_DND_MSG;
 #define AVD_DND_MSG_NULL ((AVD_DND_MSG *)0)
 #define AVD_D2D_MSG_NULL ((AVD_D2D_MSG *)0)
@@ -86,26 +82,6 @@ uint32_t avd_mds_dec(MDS_CALLBACK_DEC_IN
 uint32_t avd_mds_dec_flat(MDS_CALLBACK_DEC_FLAT_INFO *dec_info);
 uint32_t avd_d2n_msg_bcast(struct cl_cb_tag *cb, AVD_DND_MSG *bcast_msg);
 
-uint32_t avd_snd_node_ack_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id);
-uint32_t avd_snd_node_data_verify_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-uint32_t avd_snd_node_info_on_fover_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-uint32_t avd_snd_node_update_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-uint32_t avd_snd_node_up_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id_ack);
-uint32_t avd_snd_presence_msg(struct cl_cb_tag *cb, AVD_SU *su, bool 
term_state);
-uint32_t avd_snd_oper_state_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id_ack);
-uint32_t avd_snd_op_req_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, 
AVSV_PARAM_INFO *param_info);
-uint32_t avd_snd_su_msg(struct cl_cb_tag *cb, AVD_SU *su);
-uint32_t avd_snd_susi_msg(struct cl_cb_tag *cb, AVD_SU *su, struct 
avd_su_si_rel_tag *susi,
-                               AVSV_SUSI_ACT actn, SaBoolT single_csi, struct 
avd_comp_csi_rel_tag*);
-uint32_t avd_snd_set_leds_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-
-uint32_t avd_snd_pg_resp_msg(struct cl_cb_tag *, AVD_AVND *, AVD_CSI *,
-                                  AVSV_N2D_PG_TRACK_ACT_MSG_INFO *);
-uint32_t avd_snd_pg_upd_msg(struct cl_cb_tag *, AVD_AVND *, struct 
avd_comp_csi_rel_tag *,
-                                 SaAmfProtectionGroupChangesT, SaNameT *);
-uint32_t avd_snd_hb_msg(struct cl_cb_tag *);
-uint32_t avd_snd_comp_validation_resp(struct cl_cb_tag *cb, AVD_AVND *avnd,
-                                           AVD_COMP *comp_ptr, AVD_DND_MSG 
*n2d_msg);
 void avsv_d2d_msg_free(AVD_D2D_MSG *);
 void avd_mds_d_enc(MDS_CALLBACK_ENC_INFO *);
 void avd_mds_d_dec(MDS_CALLBACK_DEC_INFO *);
diff --git a/osaf/services/saf/amf/amfd/include/role.h 
b/osaf/services/saf/amf/amfd/include/role.h
new file mode 100644
--- /dev/null
+++ b/osaf/services/saf/amf/amfd/include/role.h
@@ -0,0 +1,39 @@
+/*      -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2016 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson
+ *
+ */
+
+#ifndef ROLE_H
+#define ROLE_H
+
+#include "cb.h"
+
+typedef enum avd_rol_chg_cause_type {
+        AVD_SWITCH_OVER,
+        AVD_FAIL_OVER
+} AVD_ROLE_CHG_CAUSE_T;
+
+extern void amfd_switch(AVD_CL_CB *cb);
+extern uint32_t avd_post_amfd_switch_role_change_evt(AVD_CL_CB *cb, 
SaAmfHAStateT role);
+extern uint32_t avd_d2d_chg_role_rsp(AVD_CL_CB *cb, uint32_t status, 
SaAmfHAStateT role);
+extern uint32_t avd_d2d_chg_role_req(AVD_CL_CB *cb, AVD_ROLE_CHG_CAUSE_T 
cause, SaAmfHAStateT role);
+
+extern uint32_t amfd_switch_qsd_stdby(AVD_CL_CB *cb);
+extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb);
+extern uint32_t amfd_switch_qsd_actv(AVD_CL_CB *cb);
+extern uint32_t amfd_switch_actv_qsd(AVD_CL_CB *cb);
+
+#endif /* ROLE_H */
+
diff --git a/osaf/services/saf/amf/amfd/include/util.h 
b/osaf/services/saf/amf/amfd/include/util.h
--- a/osaf/services/saf/amf/amfd/include/util.h
+++ b/osaf/services/saf/amf/amfd/include/util.h
@@ -31,8 +31,8 @@
 /*
  * Module Inclusion Control...
  */
-#ifndef AVD_MSG_H
-#define AVD_MSG_H
+#ifndef AVD_UTIL_H
+#define AVD_UTIL_H
 
 #include <string>
 
@@ -40,45 +40,11 @@
 #include <cb.h>
 #include <amf_util.h>
 #include <immutil.h>
+#include "msg.h"
+#include "role.h"
 
 class AVD_SU;
 
-typedef enum {
-       AVD_D2D_CHANGE_ROLE_REQ = AVSV_DND_MSG_MAX,
-       AVD_D2D_CHANGE_ROLE_RSP,
-       AVD_D2D_MSG_MAX,
-} AVD_D2D_MSG_TYPE;
-
-typedef enum avd_rol_chg_cause_type {
-        AVD_SWITCH_OVER,
-        AVD_FAIL_OVER
-} AVD_ROLE_CHG_CAUSE_T;
-
-typedef AVSV_DND_MSG AVD_DND_MSG;
-#define AVD_DND_MSG_NULL ((AVD_DND_MSG *)0)
-#define AVD_D2D_MSG_NULL ((AVD_D2D_MSG *)0)
-
-/* Message structure used by AVD for communication between
- * the active and standby AVD.
- */
-typedef struct avd_d2d_msg {
-       AVD_D2D_MSG_TYPE msg_type;
-       union {
-               struct {
-                       SaClmNodeIdT node_id;
-                       SaAmfHAStateT avail_state;
-               } d2d_hrt_bt;
-               struct {
-                       AVD_ROLE_CHG_CAUSE_T cause;
-                       SaAmfHAStateT role;
-               } d2d_chg_role_req;
-               struct {
-                       SaAmfHAStateT role;
-                       uint32_t status ; 
-               } d2d_chg_role_rsp;
-       } msg_info;
-} AVD_D2D_MSG;
-
 extern const SaNameT *amfSvcUsrName;
 extern const char *avd_adm_state_name[];
 extern const char *avd_pres_state_name[];
@@ -101,23 +67,15 @@ int get_child_dn_from_ass_dn(const SaNam
 void avd_d2n_reboot_snd(AVD_AVND *node);
 bool admin_op_is_valid(SaImmAdminOperationIdT opId, AVSV_AMF_CLASS_ID 
class_id);
 void amflog(int priority, const char *format, ...);
-void d2n_msg_free(AVD_DND_MSG *msg);
-uint32_t avd_d2n_msg_dequeue(struct cl_cb_tag *cb);
-uint32_t avd_d2n_msg_snd(struct cl_cb_tag *cb, AVD_AVND *nd_node, AVD_DND_MSG 
*snd_msg);
-uint32_t avd_n2d_msg_rcv(AVD_DND_MSG *rcv_msg, NODE_ID node_id, uint16_t 
msg_fmt_ver);
-uint32_t avd_d2n_msg_bcast(struct cl_cb_tag *cb, AVD_DND_MSG *bcast_msg);
 
 uint32_t avd_snd_node_ack_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id);
 uint32_t avd_snd_node_data_verify_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-uint32_t avd_snd_node_info_on_fover_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
-uint32_t avd_snd_node_update_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
 uint32_t avd_snd_node_up_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id_ack);
 uint32_t avd_snd_presence_msg(struct cl_cb_tag *cb, AVD_SU *su, bool 
term_state);
 uint32_t avd_snd_oper_state_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, uint32_t 
msg_id_ack);
 uint32_t avd_snd_op_req_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, 
AVSV_PARAM_INFO *param_info);
 uint32_t avd_snd_su_reg_msg(struct cl_cb_tag *cb, AVD_AVND *avnd, bool 
fail_over);
 uint32_t avd_snd_su_msg(struct cl_cb_tag *cb, AVD_SU *su);
-uint32_t avd_snd_comp_msg(struct cl_cb_tag *cb, AVD_COMP *comp);
 uint32_t avd_snd_susi_msg(struct cl_cb_tag *cb, AVD_SU *su, struct 
avd_su_si_rel_tag *susi,
                                AVSV_SUSI_ACT actn, bool single_csi, struct 
avd_comp_csi_rel_tag*);
 uint32_t avd_snd_set_leds_msg(struct cl_cb_tag *cb, AVD_AVND *avnd);
@@ -126,30 +84,16 @@ uint32_t avd_snd_pg_resp_msg(struct cl_c
                                   AVSV_N2D_PG_TRACK_ACT_MSG_INFO *);
 uint32_t avd_snd_pg_upd_msg(struct cl_cb_tag *, AVD_AVND *, struct 
avd_comp_csi_rel_tag *,
                                  SaAmfProtectionGroupChangesT, SaNameT *);
-uint32_t avd_snd_hb_msg(struct cl_cb_tag *);
 uint32_t avd_snd_comp_validation_resp(struct cl_cb_tag *cb, AVD_AVND *avnd,
                                            AVD_COMP *comp_ptr, AVD_DND_MSG 
*n2d_msg);
-void avsv_d2d_msg_free(AVD_D2D_MSG *);
-uint32_t avd_d2d_msg_snd(struct cl_cb_tag *, AVD_D2D_MSG *);
-
 std::string to_string(const SaNameT &s);
-
 extern int avd_admin_state_is_valid(SaAmfAdminStateT state, const 
CcbUtilOperationData_t *opdata);
 extern SaAisErrorT avd_object_name_create(SaNameT *rdn_attr_value, SaNameT 
*parentName, SaNameT *object_name);
 int amfd_file_dump(const char* filename);
-
 extern int avd_admin_op_msg_snd(const SaNameT *dn, AVSV_AMF_CLASS_ID class_id,
        SaAmfAdminOperationIdT opId, AVD_AVND *node);
+extern void d2n_msg_free(AVSV_DND_MSG *msg);
 extern const char* avd_getparent(const char* dn);
-extern void amfd_switch(AVD_CL_CB *cb);
-extern uint32_t avd_post_amfd_switch_role_change_evt(AVD_CL_CB *cb, 
SaAmfHAStateT role);
-extern uint32_t avd_d2d_chg_role_rsp(AVD_CL_CB *cb, uint32_t status, 
SaAmfHAStateT role);
-extern uint32_t avd_d2d_chg_role_req(AVD_CL_CB *cb, AVD_ROLE_CHG_CAUSE_T 
cause, SaAmfHAStateT role);
-
-extern uint32_t amfd_switch_qsd_stdby(AVD_CL_CB *cb);
-extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb);
-extern uint32_t amfd_switch_qsd_actv(AVD_CL_CB *cb);
-extern uint32_t amfd_switch_actv_qsd(AVD_CL_CB *cb);
 extern bool object_exist_in_imm(const SaNameT *dn);
 extern const char *admin_op_name(SaAmfAdminOperationIdT opid);
 #endif
diff --git a/osaf/services/saf/amf/amfd/role.cc 
b/osaf/services/saf/amf/amfd/role.cc
--- a/osaf/services/saf/amf/amfd/role.cc
+++ b/osaf/services/saf/amf/amfd/role.cc
@@ -45,6 +45,7 @@
 #include <clm.h>
 #include <si_dep.h>
 #include "osaf_utility.h"
+#include "role.h"
 
 extern pthread_mutex_t imm_reinit_mutex;
 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to