ack, minor comment, lots of whitespace changes/Regards HansN
On 06/03/14 07:24, Hans Feldt wrote:
>   osaf/libs/common/amf/d2nmsg.c             |  184 
> ------------------------------
>   osaf/libs/common/amf/include/amf_d2nmsg.h |    1 -
>   osaf/services/saf/amf/amfd/include/mds.h  |    1 -
>   osaf/services/saf/amf/amfd/include/msg.h  |    1 -
>   osaf/services/saf/amf/amfd/mds.cc         |  175 
> ++++++++++++----------------
>   osaf/services/saf/amf/amfd/ndmsg.cc       |   35 -----
>   6 files changed, 76 insertions(+), 321 deletions(-)
>
>
> This support is no longer needed. Was used when avd and avnd was collocated in
> the same process (ncs_scap).
>
> diff --git a/osaf/libs/common/amf/d2nmsg.c b/osaf/libs/common/amf/d2nmsg.c
> --- a/osaf/libs/common/amf/d2nmsg.c
> +++ b/osaf/libs/common/amf/d2nmsg.c
> @@ -51,50 +51,6 @@ static void free_d2n_su_msg_info(AVSV_DN
>       }
>   }
>   
> -/*****************************************************************************
> - * Function: cpy_d2n_su_msg
> - *
> - * Purpose:  This function makes a copy of the d2n SU message.
> - *
> - * Input: d_su_msg - Pointer to the SU message to be copied to.
> - *        s_su_msg - Pointer to the SU message to be copied.
> - *
> - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
> - *
> - * NOTES: none.
> - *
> - *
> - **************************************************************************/
> -
> -static uint32_t cpy_d2n_su_msg(AVSV_DND_MSG *d_su_msg, AVSV_DND_MSG 
> *s_su_msg)
> -{
> -     AVSV_SU_INFO_MSG *s_su_info, *d_su_info;
> -
> -     memset(d_su_msg, '\0', sizeof(AVSV_DND_MSG));
> -
> -     memcpy(d_su_msg, s_su_msg, sizeof(AVSV_DND_MSG));
> -     d_su_msg->msg_info.d2n_reg_su.su_list = NULL;
> -
> -     s_su_info = s_su_msg->msg_info.d2n_reg_su.su_list;
> -
> -     while (s_su_info != NULL) {
> -             d_su_info = malloc(sizeof(AVSV_SU_INFO_MSG));
> -             if (d_su_info == NULL) {
> -                     free_d2n_su_msg_info(d_su_msg);
> -                     return NCSCC_RC_FAILURE;
> -             }
> -
> -             memcpy(d_su_info, s_su_info, sizeof(AVSV_SU_INFO_MSG));
> -             d_su_info->next = d_su_msg->msg_info.d2n_reg_su.su_list;
> -             d_su_msg->msg_info.d2n_reg_su.su_list = d_su_info;
> -
> -             /* now go to the next su info in source */
> -             s_su_info = s_su_info->next;
> -     }
> -
> -     return NCSCC_RC_SUCCESS;
> -
> -}
>   
>   
> /*****************************************************************************
>    * Function: free_d2n_susi_msg_info
> @@ -127,62 +83,6 @@ static void free_d2n_susi_msg_info(AVSV_
>   }
>   
>   
> /*****************************************************************************
> - * Function: cpy_d2n_susi_msg
> - *
> - * Purpose:  This function makes a copy of the d2n SU SI message contents.
> - *
> - * Input: d_susi_msg - Pointer to the SU SI message to be copied to.
> - *        s_susi_msg - Pointer to the SU SI message to be copied.
> - *
> - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
> - *
> - * NOTES: It also allocates and copies the array of attributes, which are 
> sperately
> - * allocated and pointed to by AVSV_SUSI_ASGN structure.
> - *
> - **************************************************************************/
> -
> -static uint32_t cpy_d2n_susi_msg(AVSV_DND_MSG *d_susi_msg, AVSV_DND_MSG 
> *s_susi_msg)
> -{
> -     AVSV_SUSI_ASGN *s_compcsi_info, *d_compcsi_info;
> -
> -     memset(d_susi_msg, '\0', sizeof(AVSV_DND_MSG));
> -
> -     memcpy(d_susi_msg, s_susi_msg, sizeof(AVSV_DND_MSG));
> -     d_susi_msg->msg_info.d2n_su_si_assign.list = NULL;
> -
> -     s_compcsi_info = s_susi_msg->msg_info.d2n_su_si_assign.list;
> -
> -     while (s_compcsi_info != NULL) {
> -             d_compcsi_info = malloc(sizeof(AVSV_SUSI_ASGN));
> -             if (d_compcsi_info == NULL) {
> -                     free_d2n_susi_msg_info(d_susi_msg);
> -                     return NCSCC_RC_FAILURE;
> -             }
> -
> -             memcpy(d_compcsi_info, s_compcsi_info, sizeof(AVSV_SUSI_ASGN));
> -
> -             if ((s_compcsi_info->attrs.list != NULL) && 
> (s_compcsi_info->attrs.number > 0)) {
> -                     d_compcsi_info->attrs.list =
> -                             malloc(s_compcsi_info->attrs.number * 
> sizeof(*d_compcsi_info->attrs.list));
> -                     if (d_compcsi_info->attrs.list == NULL) {
> -                             free_d2n_susi_msg_info(d_susi_msg);
> -                             return NCSCC_RC_FAILURE;
> -                     }
> -                     memcpy(d_compcsi_info->attrs.list, 
> s_compcsi_info->attrs.list,
> -                            (s_compcsi_info->attrs.number * 
> sizeof(*d_compcsi_info->attrs.list)));
> -             }
> -             d_compcsi_info->next = 
> d_susi_msg->msg_info.d2n_su_si_assign.list;
> -             d_susi_msg->msg_info.d2n_su_si_assign.list = d_compcsi_info;
> -
> -             /* now go to the next su info in source */
> -             s_compcsi_info = s_compcsi_info->next;
> -     }
> -
> -     return NCSCC_RC_SUCCESS;
> -
> -}
> -
> -/*****************************************************************************
>    * Function: free_d2n_pg_msg_info
>    *
>    * Purpose:  This function frees the d2n PG track response message contents.
> @@ -207,49 +107,6 @@ static void free_d2n_pg_msg_info(AVSV_DN
>       info->mem_list.numberOfItems = 0;
>   }
>   
> -/*****************************************************************************
> - * Function: cpy_d2n_pg_msg
> - *
> - * Purpose:  This function makes a copy of the d2n PG track response message
> - *           contents.
> - *
> - * Input: d_pg_msg - Pointer to the PG message to be copied to.
> - *        s_pg_msg - Pointer to the PG message to be copied.
> - *
> - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
> - *
> - * NOTES: It also allocates and copies the array of attributes, which are 
> sperately
> - * allocated and pointed to by AVSV_SUSI_ASGN structure.
> - *
> - **************************************************************************/
> -
> -static uint32_t cpy_d2n_pg_msg(AVSV_DND_MSG *d_pg_msg, AVSV_DND_MSG 
> *s_pg_msg)
> -{
> -     AVSV_D2N_PG_TRACK_ACT_RSP_MSG_INFO *d_info = 
> &d_pg_msg->msg_info.d2n_pg_track_act_rsp;
> -     AVSV_D2N_PG_TRACK_ACT_RSP_MSG_INFO *s_info = 
> &s_pg_msg->msg_info.d2n_pg_track_act_rsp;
> -
> -     memset(d_pg_msg, '\0', sizeof(AVSV_DND_MSG));
> -
> -     /* copy the common contents */
> -     memcpy(d_pg_msg, s_pg_msg, sizeof(AVSV_DND_MSG));
> -
> -     if (!s_info->mem_list.numberOfItems)
> -             return NCSCC_RC_SUCCESS;
> -
> -     /* alloc the memory for the notify buffer */
> -     d_info->mem_list.notification = 0;
> -     d_info->mem_list.notification = (SaAmfProtectionGroupNotificationT *)
> -         malloc(sizeof(SaAmfProtectionGroupNotificationT) * 
> s_info->mem_list.numberOfItems);
> -     if (!d_info->mem_list.notification)
> -             return NCSCC_RC_FAILURE;
> -
> -     /* copy the mem-list */
> -     memcpy(d_info->mem_list.notification, s_info->mem_list.notification,
> -            sizeof(SaAmfProtectionGroupNotificationT) * 
> s_info->mem_list.numberOfItems);
> -
> -     return NCSCC_RC_SUCCESS;
> -}
> -
>   
> /****************************************************************************
>     Name          : avsv_dnd_msg_free
>    
> @@ -290,44 +147,3 @@ void avsv_dnd_msg_free(AVSV_DND_MSG *msg
>       /* free the message */
>       free(msg);
>   }
> -
> -/****************************************************************************
> -  Name          : avsv_dnd_msg_copy
> -
> -  Description   : This routine copies the Message structures and all its
> -                  contents used for communication between AvD and AvND.
> -
> -  Arguments     : dmsg - ptr to the dest DND message
> -                  smsg - ptr to the src DND message
> -
> -  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
> -
> -  Notes         : For : AVSV_D2N_REG_SU_MSG, AVSV_D2N_INFO_SU_SI_ASSIGN_MSG
> -                  and AVSV_D2N_PG_TRACK_ACT_RSP_MSG, this procedure calls the
> -                  corresponding copy function which copies the list 
> information
> -                  present in them also.
> -******************************************************************************/
> -uint32_t avsv_dnd_msg_copy(AVSV_DND_MSG *dmsg, AVSV_DND_MSG *smsg)
> -{
> -     if ((dmsg == NULL) || (smsg == NULL)) {
> -             return NCSCC_RC_FAILURE;
> -     }
> -
> -     /* these messages have information list in them copy them
> -      * along with copying the contents.
> -      */
> -     switch (smsg->msg_type) {
> -     case AVSV_D2N_REG_SU_MSG:
> -             return cpy_d2n_su_msg(dmsg, smsg);
> -     case AVSV_D2N_INFO_SU_SI_ASSIGN_MSG:
> -             return cpy_d2n_susi_msg(dmsg, smsg);
> -     case AVSV_D2N_PG_TRACK_ACT_RSP_MSG:
> -             return cpy_d2n_pg_msg(dmsg, smsg);
> -     default:
> -             /* copy only the contents */
> -             memcpy(dmsg, smsg, sizeof(AVSV_DND_MSG));
> -             break;
> -     }
> -
> -     return NCSCC_RC_SUCCESS;
> -}
> diff --git a/osaf/libs/common/amf/include/amf_d2nmsg.h 
> b/osaf/libs/common/amf/include/amf_d2nmsg.h
> --- a/osaf/libs/common/amf/include/amf_d2nmsg.h
> +++ b/osaf/libs/common/amf/include/amf_d2nmsg.h
> @@ -620,7 +620,6 @@ typedef uint32_t (*AVSV_COPY_DND_MSG) (A
>   
>   /* Extern Fuction Prototypes */
>   void avsv_dnd_msg_free(AVSV_DND_MSG *);
> -uint32_t avsv_dnd_msg_copy(AVSV_DND_MSG *, AVSV_DND_MSG *);
>   
>   #ifdef __cplusplus
>   }
> diff --git a/osaf/services/saf/amf/amfd/include/mds.h 
> b/osaf/services/saf/amf/amfd/include/mds.h
> --- a/osaf/services/saf/amf/amfd/include/mds.h
> +++ b/osaf/services/saf/amf/amfd/include/mds.h
> @@ -52,7 +52,6 @@ uint32_t avd_mds_set_vdest_role(struct c
>   uint32_t avd_mds_init(struct cl_cb_tag *cb);
>   void avd_mds_unreg(struct cl_cb_tag *cb);
>   
> -uint32_t avd_mds_cbk(struct ncsmds_callback_info *info);
>   uint32_t avd_avnd_mds_send(struct cl_cb_tag *cb, AVD_AVND *nd_node, 
> AVD_DND_MSG *snd_msg);
>   extern void avd_mds_avd_up_evh(AVD_CL_CB *cb, AVD_EVT *evt);
>   extern void avd_mds_avd_down_evh(AVD_CL_CB *cb, AVD_EVT *evt);
> 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
> @@ -79,7 +79,6 @@ struct avd_csi_tag;
>   uint32_t avd_d2n_msg_dequeue(struct cl_cb_tag *cb);
>   uint32_t avd_d2n_msg_snd(struct cl_cb_tag *cb, struct avd_avnd_tag 
> *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_mds_cpy(MDS_CALLBACK_COPY_INFO *cpy_info);
>   uint32_t avd_mds_enc(MDS_CALLBACK_ENC_INFO *enc_info);
>   uint32_t avd_mds_enc_flat(MDS_CALLBACK_ENC_FLAT_INFO *enc_info);
>   uint32_t avd_mds_dec(MDS_CALLBACK_DEC_INFO *dec_info);
> diff --git a/osaf/services/saf/amf/amfd/mds.cc 
> b/osaf/services/saf/amf/amfd/mds.cc
> --- a/osaf/services/saf/amf/amfd/mds.cc
> +++ b/osaf/services/saf/amf/amfd/mds.cc
> @@ -42,21 +42,21 @@
>   #include <msg.h>
>   #include "amfd.h"
>   
> -const MDS_CLIENT_MSG_FORMAT_VER avd_avnd_msg_fmt_map_table[] = {
> +static const MDS_CLIENT_MSG_FORMAT_VER avd_avnd_msg_fmt_map_table[] = {
>       AVSV_AVD_AVND_MSG_FMT_VER_1, AVSV_AVD_AVND_MSG_FMT_VER_2,
>       AVSV_AVD_AVND_MSG_FMT_VER_3, AVSV_AVD_AVND_MSG_FMT_VER_4,
>       AVSV_AVD_AVND_MSG_FMT_VER_5
>   };
>   
> -const MDS_CLIENT_MSG_FORMAT_VER avd_avd_msg_fmt_map_table[] = {
> +static const MDS_CLIENT_MSG_FORMAT_VER avd_avd_msg_fmt_map_table[] = {
>       AVD_AVD_MSG_FMT_VER_1, AVD_AVD_MSG_FMT_VER_2,
>       AVD_AVD_MSG_FMT_VER_3, AVD_AVD_MSG_FMT_VER_4,
>       AVD_AVD_MSG_FMT_VER_5};
>   
>   /* fwd decl */
> -
> -static uint32_t avd_mds_svc_evt(MDS_CALLBACK_SVC_EVENT_INFO *evt_info);
> -static uint32_t avd_mds_qsd_ack_evt(MDS_CALLBACK_QUIESCED_ACK_INFO 
> *evt_info);
> +static uint32_t mds_cbk(struct ncsmds_callback_info *info);
> +static uint32_t mds_svc_evt(MDS_CALLBACK_SVC_EVENT_INFO *evt_info);
> +static uint32_t mds_qsd_ack_evt(MDS_CALLBACK_QUIESCED_ACK_INFO *evt_info);
>   
>   
> /****************************************************************************
>     Name          : avd_mds_set_vdest_role
> @@ -144,7 +144,7 @@ uint32_t avd_mds_init(AVD_CL_CB *cb)
>       svc_to_mds_info.i_svc_id = NCSMDS_SVC_ID_AVD;
>       svc_to_mds_info.i_op = MDS_INSTALL;
>       svc_to_mds_info.info.svc_install.i_install_scope = NCSMDS_SCOPE_NONE;
> -     svc_to_mds_info.info.svc_install.i_svc_cb = avd_mds_cbk;
> +     svc_to_mds_info.info.svc_install.i_svc_cb = mds_cbk;
>       svc_to_mds_info.info.svc_install.i_mds_q_ownership = false;
>       svc_to_mds_info.info.svc_install.i_mds_svc_pvt_ver = 
> AVD_MDS_SUB_PART_VERSION;
>   
> @@ -194,7 +194,7 @@ uint32_t avd_mds_init(AVD_CL_CB *cb)
>       svc_to_mds_info.i_svc_id = NCSMDS_SVC_ID_AVD;
>       svc_to_mds_info.i_op = MDS_INSTALL;
>       svc_to_mds_info.info.svc_install.i_install_scope = NCSMDS_SCOPE_NONE;
> -     svc_to_mds_info.info.svc_install.i_svc_cb = avd_mds_cbk;
> +     svc_to_mds_info.info.svc_install.i_svc_cb = mds_cbk;
>       svc_to_mds_info.info.svc_install.i_mds_q_ownership = false;
>       svc_to_mds_info.info.svc_install.i_mds_svc_pvt_ver = 
> AVD_MDS_SUB_PART_VERSION;
>   
> @@ -228,7 +228,6 @@ uint32_t avd_mds_init(AVD_CL_CB *cb)
>   }
>   
>   
> /****************************************************************************
> -  Name          : avd_mds_cbk
>   
>     Description   : This is a callback routine invoked by MDS for delivering
>     messages and events. It also calls back for encoding or decoding messages
> @@ -240,8 +239,7 @@ uint32_t avd_mds_init(AVD_CL_CB *cb)
>    
>     Notes         : None.
>   
> ******************************************************************************/
> -
> -uint32_t avd_mds_cbk(struct ncsmds_callback_info *info)
> +static uint32_t mds_cbk(struct ncsmds_callback_info *info)
>   {
>       uint32_t rc = NCSCC_RC_SUCCESS;
>   
> @@ -251,7 +249,7 @@ uint32_t avd_mds_cbk(struct ncsmds_callb
>                * message to the director.
>                */
>               if ((info->info.receive.i_fr_svc_id == NCSMDS_SVC_ID_AVND) &&
> -                 (info->info.receive.i_to_svc_id == NCSMDS_SVC_ID_AVD)) {
> +                             (info->info.receive.i_to_svc_id == 
> NCSMDS_SVC_ID_AVD)) {
>                       NODE_ID node_id = 0;
>                       uint16_t msg_fmt_ver = 0;
>                       node_id = 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->info.receive.i_fr_dest);
> @@ -265,7 +263,7 @@ uint32_t avd_mds_cbk(struct ncsmds_callb
>                ** message to the director if not return error.
>                */
>               else if ((info->info.receive.i_fr_svc_id == NCSMDS_SVC_ID_AVD) 
> &&
> -                      (info->info.receive.i_to_svc_id == NCSMDS_SVC_ID_AVD)) 
> {
> +                             (info->info.receive.i_to_svc_id == 
> NCSMDS_SVC_ID_AVD)) {
>                       rc = avd_d2d_msg_rcv((AVD_D2D_MSG 
> *)info->info.receive.i_msg);
>                       info->info.receive.i_msg = (NCSCONTEXT)0;
>                       if (rc != NCSCC_RC_SUCCESS)
> @@ -276,108 +274,89 @@ uint32_t avd_mds_cbk(struct ncsmds_callb
>               }
>               break;
>       case MDS_CALLBACK_SVC_EVENT:
> -             {
> -                     rc = avd_mds_svc_evt(&info->info.svc_evt);
> -                     if (rc != NCSCC_RC_SUCCESS) {
> -                             return rc;
> -                     }
> -             }
> -             break;
> -     case MDS_CALLBACK_COPY:
> -             {
> -                     info->info.cpy.o_msg_fmt_ver =
> -                         
> avd_avnd_msg_fmt_map_table[info->info.cpy.i_rem_svc_pvt_ver - 1];
> -
> -                     rc = avd_mds_cpy(&info->info.cpy);
> -                     if (rc != NCSCC_RC_SUCCESS)
> -                             return rc;
> +             rc = mds_svc_evt(&info->info.svc_evt);
> +             if (rc != NCSCC_RC_SUCCESS) {
> +                     return rc;
>               }
>               break;
>       case MDS_CALLBACK_ENC:
>       case MDS_CALLBACK_ENC_FLAT:
> -             {
> +             if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD) &&
> +                             (info->info.enc.i_to_svc_id == 
> NCSMDS_SVC_ID_AVD)) {
> +                     info->info.enc.o_msg_fmt_ver = 
> m_NCS_ENC_MSG_FMT_GET(info->info.enc.i_rem_svc_pvt_ver,
> +                                     AVD_AVD_SUBPART_VER_MIN,
> +                                     AVD_AVD_SUBPART_VER_MAX,
> +                                     avd_avd_msg_fmt_map_table);
> +                     if (info->info.enc.i_rem_svc_pvt_ver == 
> AVD_MDS_SUB_PART_VERSION_4) {
> +                             /* If the peer version is 
> AVD_MDS_SUB_PART_VERSION_4, then set the
> +                              * msg_fmt_ver to AVD_AVD_MSG_FMT_VER_3. This 
> is to fix switch over
> +                              * issue btw 4.2 GA & 4.2.1 release
> +                              */
> +                             info->info.enc.o_msg_fmt_ver  = 
> AVD_AVD_MSG_FMT_VER_3;
> +                     }
>   
> -                     if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD) &&
> -                         (info->info.enc.i_to_svc_id == NCSMDS_SVC_ID_AVD)) {
> -                             info->info.enc.o_msg_fmt_ver = 
> m_NCS_ENC_MSG_FMT_GET(info->info.enc.i_rem_svc_pvt_ver,
> -                                                                             
>      AVD_AVD_SUBPART_VER_MIN,
> -                                                                             
>      AVD_AVD_SUBPART_VER_MAX,
> -                                                                             
>      avd_avd_msg_fmt_map_table);
> -                             if (info->info.enc.i_rem_svc_pvt_ver == 
> AVD_MDS_SUB_PART_VERSION_4) {
> -                                     /* If the peer version is 
> AVD_MDS_SUB_PART_VERSION_4, then set the
> -                                      * msg_fmt_ver to 
> AVD_AVD_MSG_FMT_VER_3. This is to fix switch over
> -                                      * issue btw 4.2 GA & 4.2.1 release
> -                                      */
> -                                     info->info.enc.o_msg_fmt_ver  = 
> AVD_AVD_MSG_FMT_VER_3;
> -                             }
> -
> -                             if (info->info.enc.o_msg_fmt_ver < 
> AVD_AVD_MSG_FMT_VER_1) {
> -                                     LOG_ER("%s: wrong msg fmt ver %u, %u.", 
> __FUNCTION__, info->info.enc.o_msg_fmt_ver,info->info.enc.i_rem_svc_pvt_ver);
> -                                     return NCSCC_RC_FAILURE;
> -                             }
> -
> -                             avd_mds_d_enc(&info->info.enc);
> -                     } else if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD) &&
> -                                (info->info.enc.i_to_svc_id == 
> NCSMDS_SVC_ID_AVND)) {
> -                             info->info.enc.o_msg_fmt_ver = 
> m_NCS_ENC_MSG_FMT_GET(info->info.enc.i_rem_svc_pvt_ver,
> -                                                                             
>      AVD_AVND_SUBPART_VER_MIN,
> -                                                                             
>      AVD_AVND_SUBPART_VER_MAX,
> -                                                                             
>      avd_avnd_msg_fmt_map_table);
> -
> -                             if (info->info.enc.o_msg_fmt_ver < 
> AVSV_AVD_AVND_MSG_FMT_VER_1) {
> -                                     LOG_ER("%s: wrong msg fmt ver %u, %u", 
> __FUNCTION__, info->info.enc.o_msg_fmt_ver,info->info.enc.i_rem_svc_pvt_ver);
> -                                     return NCSCC_RC_FAILURE;
> -                             }
> -
> -                             rc = avd_mds_enc(&info->info.enc);
> -                             if (rc != NCSCC_RC_SUCCESS)
> -                                     return rc;
> -                     } else {
> -                             LOG_ER("%s: svc id %u %u", __FUNCTION__, 
> info->i_yr_svc_id, info->info.enc.i_to_svc_id);
> +                     if (info->info.enc.o_msg_fmt_ver < 
> AVD_AVD_MSG_FMT_VER_1) {
> +                             LOG_ER("%s: wrong msg fmt ver %u, %u.", 
> __FUNCTION__, info->info.enc.o_msg_fmt_ver,info->info.enc.i_rem_svc_pvt_ver);
>                               return NCSCC_RC_FAILURE;
>                       }
> +
> +                     avd_mds_d_enc(&info->info.enc);
> +             } else if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD) &&
> +                             (info->info.enc.i_to_svc_id == 
> NCSMDS_SVC_ID_AVND)) {
> +                     info->info.enc.o_msg_fmt_ver = 
> m_NCS_ENC_MSG_FMT_GET(info->info.enc.i_rem_svc_pvt_ver,
> +                                     AVD_AVND_SUBPART_VER_MIN,
> +                                     AVD_AVND_SUBPART_VER_MAX,
> +                                     avd_avnd_msg_fmt_map_table);
> +
> +                     if (info->info.enc.o_msg_fmt_ver < 
> AVSV_AVD_AVND_MSG_FMT_VER_1) {
> +                             LOG_ER("%s: wrong msg fmt ver %u, %u", 
> __FUNCTION__, info->info.enc.o_msg_fmt_ver,info->info.enc.i_rem_svc_pvt_ver);
> +                             return NCSCC_RC_FAILURE;
> +                     }
> +
> +                     rc = avd_mds_enc(&info->info.enc);
> +                     if (rc != NCSCC_RC_SUCCESS)
> +                             return rc;
> +             } else {
> +                     LOG_ER("%s: svc id %u %u", __FUNCTION__, 
> info->i_yr_svc_id, info->info.enc.i_to_svc_id);
> +                     return NCSCC_RC_FAILURE;
>               }
>   
>               break;
>       case MDS_CALLBACK_DEC:
>       case MDS_CALLBACK_DEC_FLAT:
> -             {
> -                     if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD)
> -                         && (info->info.dec.i_fr_svc_id == 
> NCSMDS_SVC_ID_AVD)) {
> -                             if 
> (!m_NCS_MSG_FORMAT_IS_VALID(info->info.dec.i_msg_fmt_ver,
> -                                                            
> AVD_AVD_SUBPART_VER_MIN,
> -                                                            
> AVD_AVD_SUBPART_VER_MAX, avd_avd_msg_fmt_map_table)) {
> -                                     LOG_ER("%s: wrong msg fmt not valid 
> %u", __FUNCTION__, info->info.dec.i_msg_fmt_ver);
> -                                     return NCSCC_RC_FAILURE;
> -                             }
> -
> -                             avd_mds_d_dec(&info->info.dec);
> -                     } else if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD)
> -                                && (info->info.dec.i_fr_svc_id == 
> NCSMDS_SVC_ID_AVND)) {
> -                             if 
> (!m_NCS_MSG_FORMAT_IS_VALID(info->info.dec.i_msg_fmt_ver,
> -                                                            
> AVD_AVND_SUBPART_VER_MIN,
> -                                                            
> AVD_AVND_SUBPART_VER_MAX, avd_avnd_msg_fmt_map_table)) {
> -                                     LOG_ER("%s: wrong msg fmt not valid 
> %u", __FUNCTION__, info->info.dec.i_msg_fmt_ver);
> -                                     return NCSCC_RC_FAILURE;
> -                             }
> -
> -                             rc = avd_mds_dec(&info->info.dec);
> -                     } else {
> -                             LOG_ER("%s: svc id %u %u", __FUNCTION__, 
> info->i_yr_svc_id, info->info.dec.i_fr_svc_id);
> +             if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD)
> +                             && (info->info.dec.i_fr_svc_id == 
> NCSMDS_SVC_ID_AVD)) {
> +                     if 
> (!m_NCS_MSG_FORMAT_IS_VALID(info->info.dec.i_msg_fmt_ver,
> +                                     AVD_AVD_SUBPART_VER_MIN,
> +                                     AVD_AVD_SUBPART_VER_MAX, 
> avd_avd_msg_fmt_map_table)) {
> +                             LOG_ER("%s: wrong msg fmt not valid %u", 
> __FUNCTION__, info->info.dec.i_msg_fmt_ver);
>                               return NCSCC_RC_FAILURE;
>                       }
>   
> -                     if (rc != NCSCC_RC_SUCCESS)
> -                             return rc;
> +                     avd_mds_d_dec(&info->info.dec);
> +             } else if ((info->i_yr_svc_id == NCSMDS_SVC_ID_AVD)
> +                             && (info->info.dec.i_fr_svc_id == 
> NCSMDS_SVC_ID_AVND)) {
> +                     if 
> (!m_NCS_MSG_FORMAT_IS_VALID(info->info.dec.i_msg_fmt_ver,
> +                                     AVD_AVND_SUBPART_VER_MIN,
> +                                     AVD_AVND_SUBPART_VER_MAX, 
> avd_avnd_msg_fmt_map_table)) {
> +                             LOG_ER("%s: wrong msg fmt not valid %u", 
> __FUNCTION__, info->info.dec.i_msg_fmt_ver);
> +                             return NCSCC_RC_FAILURE;
> +                     }
> +
> +                     rc = avd_mds_dec(&info->info.dec);
> +             } else {
> +                     LOG_ER("%s: svc id %u %u", __FUNCTION__, 
> info->i_yr_svc_id, info->info.dec.i_fr_svc_id);
> +                     return NCSCC_RC_FAILURE;
>               }
>   
> +             if (rc != NCSCC_RC_SUCCESS)
> +                     return rc;
> +
>               break;
>       case MDS_CALLBACK_QUIESCED_ACK:
> -             {
> -                     rc = avd_mds_qsd_ack_evt(&info->info.quiesced_ack);
> -                     if (rc != NCSCC_RC_SUCCESS)
> -                             return rc;
> -             }
> +             rc = mds_qsd_ack_evt(&info->info.quiesced_ack);
> +             if (rc != NCSCC_RC_SUCCESS)
> +                     return rc;
>               break;
>       default:
>               LOG_WA("%s: unknown op %u", __FUNCTION__, info->i_op);
> @@ -389,7 +368,6 @@ uint32_t avd_mds_cbk(struct ncsmds_callb
>   }
>   
>   
> /****************************************************************************
> -  Name          : avd_mds_svc_evt
>    
>     Description   : This routine is invoked to inform AvD of MDS events. AvD
>                     had subscribed to these events during MDS registration.
> @@ -400,7 +378,7 @@ uint32_t avd_mds_cbk(struct ncsmds_callb
>    
>     Notes         : None.
>   
> ******************************************************************************/
> -static uint32_t avd_mds_svc_evt(MDS_CALLBACK_SVC_EVENT_INFO *evt_info)
> +static uint32_t mds_svc_evt(MDS_CALLBACK_SVC_EVENT_INFO *evt_info)
>   {
>       uint32_t rc = NCSCC_RC_SUCCESS;
>       AVD_CL_CB *cb = avd_cb;
> @@ -472,7 +450,6 @@ static uint32_t avd_mds_svc_evt(MDS_CALL
>   }
>   
>   
> /****************************************************************************
> -  Name          : avd_mds_qsd_ack_evt
>    
>     Description   : This routine is invoked to inform AvD of MDS quiesce ack
>                     events.
> @@ -485,7 +462,7 @@ static uint32_t avd_mds_svc_evt(MDS_CALL
>                     ack from mds. This new event will not have any info
>                     part, only the msg type is enough
>   
> ******************************************************************************/
> -static uint32_t avd_mds_qsd_ack_evt(MDS_CALLBACK_QUIESCED_ACK_INFO *evt_info)
> +static uint32_t mds_qsd_ack_evt(MDS_CALLBACK_QUIESCED_ACK_INFO *evt_info)
>   {
>       AVD_EVT *evt = AVD_EVT_NULL;
>       AVD_CL_CB *cb = avd_cb;
> diff --git a/osaf/services/saf/amf/amfd/ndmsg.cc 
> b/osaf/services/saf/amf/amfd/ndmsg.cc
> --- a/osaf/services/saf/amf/amfd/ndmsg.cc
> +++ b/osaf/services/saf/amf/amfd/ndmsg.cc
> @@ -93,41 +93,6 @@ uint32_t avd_mds_enc_flat(MDS_CALLBACK_E
>   }
>   
>   
> /****************************************************************************
> -  Name          : avd_mds_cpy
> -
> -  Description   : This is a callback routine that is invoked to copy
> -                  AvND-AvD messages.
> -
> -  Arguments     : cpy_info - ptr to the MDS copy info
> -
> -  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
> -
> -  Notes         : None.
> -******************************************************************************/
> -uint32_t avd_mds_cpy(MDS_CALLBACK_COPY_INFO *cpy_info)
> -{
> -     AVD_DND_MSG *dst_msg;
> -
> -     TRACE_ENTER();
> -
> -     if (cpy_info->i_msg == NULL) {
> -             LOG_ER("%s: no msg", __FUNCTION__);
> -             return NCSCC_RC_FAILURE;
> -     }
> -
> -     dst_msg = new AVD_DND_MSG;
> -
> -     if (NCSCC_RC_SUCCESS != avsv_dnd_msg_copy(dst_msg, (AVSV_DND_MSG 
> *)cpy_info->i_msg)) {
> -             LOG_ER("%s: copy failed", __FUNCTION__);
> -             delete dst_msg;
> -             return NCSCC_RC_FAILURE;
> -     }
> -
> -     cpy_info->o_cpy = (NCSCONTEXT)dst_msg;
> -     return NCSCC_RC_SUCCESS;
> -}
> -
> -/****************************************************************************
>     Name          : avd_mds_dec
>    
>     Description   : This is a callback routine that is invoked to decode


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to