uns32 mbcstm_ckpt_send_purpose(uns32 svc_index, uns32 ssn_index,uns32 asys,
                               uns32 send_index, uns32 send_count,
                               NCS_MBCSV_ACT_TYPE action, 
                               NCS_MBCSV_MSG_TYPE send_type,
                               MBCSTM_CB_TEST sync)
{
  uns32 index;
  uns32  test_result = NCSCC_RC_FAILURE;
  
  if(mbcstm_cb.sys == MBCSTM_SVC_INS3 || mbcstm_cb.sys == MBCSTM_SVC_INS4)
    {
      if(mbcstm_sync_point() != NCSCC_RC_SUCCESS)
        goto final;
      goto final;
    }
  
  if(mbcstm_cb.sys ==  MBCSTM_SVC_INS1)
    if(sync !=  MBCSTM_CB_NO_TEST)
      mbcstm_cb.svces[svc_index].ssns[ssn_index].cb_test = sync;
  
  if(mbcstm_cb.sys == asys)
    {
      mbcstm_cb.svces[svc_index].ssns[ssn_index].csi_role = SA_AMF_HA_ACTIVE;
      mbcstm_cb.svces[svc_index].ssns[ssn_index].dest_role = V_DEST_RL_ACTIVE;
    }
  
  if(mbcstm_svc_registration(svc_index) != NCSCC_RC_SUCCESS)
    goto final;
  sleep(1);
  if(mbcstm_ssn_open(svc_index,ssn_index) != NCSCC_RC_SUCCESS)
    goto final;
  sleep(4);
  
  if(mbcstm_cb.sys ==  MBCSTM_SVC_INS1)
    for(index = send_index; index <= send_count; index++)
      {
        if(mbcstm_svc_cp_send(svc_index,ssn_index,action, NORMAL_DATA,index, 
                              send_type) != NCSCC_RC_SUCCESS)
          goto final;
      }
  
  test_result = NCSCC_RC_SUCCESS;
  
 final:
  
  if(mbcstm_sync_point() != NCSCC_RC_SUCCESS)
uint32_t mbcstm_event_purposes(uint32_t svc_index, uint32_t ssn_index, uint32_t asys,
                            uint32_t bsys, MBCSTM_TEST_ACTION action,
                            uint32_t act_on_sys,uint32_t act_val,
                            MBCSTM_CB_TEST cb_check,uint32_t wait,
                            uint32_t peer_count,uint64_t peer_anchor, 
                            MBCSTM_FSM_STATES state_check)
{
  uint32_t test_result = NCSCC_RC_FAILURE;
  MBCSTM_PEERS_DATA peers;
  MBCSTM_PEER_INST       *pr;
  /*change*/
  uint32_t mbcstm_check_inv(MBCSTM_CHECK , uint32_t , uint32_t , void *);
  
  memset(&peers, '\0', sizeof(MBCSTM_PEERS_DATA));
  
  if(asys == mbcstm_cb.sys)
    {
      mbcstm_cb.svces[svc_index].ssns[ssn_index].csi_role = SA_AMF_HA_ACTIVE;
      mbcstm_cb.svces[svc_index].ssns[ssn_index].dest_role = V_DEST_RL_ACTIVE;
    }
  
  if(bsys == mbcstm_cb.sys)
    if(mbcstm_sync_point() != NCSCC_RC_SUCCESS)
      goto final;    
  
  if(mbcstm_svc_registration(svc_index) != NCSCC_RC_SUCCESS)
    goto final;
  sleep(2);
  if(mbcstm_ssn_open(svc_index,ssn_index) != NCSCC_RC_SUCCESS)
    goto final;
  sleep(2);
  if(bsys != mbcstm_cb.sys)
    if(mbcstm_sync_point() != NCSCC_RC_SUCCESS)
      goto final;
  sleep(2);
  if(mbcstm_sync_point() != NCSCC_RC_SUCCESS)
    goto final;

  /* on flag to check in call back here */
  if(MBCSTM_SVC_INS1 ==  mbcstm_cb.sys)
    mbcstm_cb.svces[svc_index].ssns[ssn_index].cb_test = cb_check;
    
  sleep(2);
  if(act_on_sys == mbcstm_cb.sys)
    {
      switch(action)
        {
        case MBCSTM_TEST_ACTION_NO :
          break;
        case MBCSTM_TEST_ACTION_ROLE :
          if(mbcstm_cb.svces[svc_index].ssns[ssn_index].csi_role == 
             SA_AMF_HA_ACTIVE && act_val == SA_AMF_HA_STANDBY )
            {
              mbcstm_cb.svces[svc_index].ssns[ssn_index].csi_role = 
                SA_AMF_HA_QUIESCED;
              if(mbcstm_ssn_set_role(svc_index,ssn_index) != NCSCC_RC_SUCCESS)
                goto final;
            } 
          sleep(1);    
          mbcstm_cb.svces[svc_index].ssns[ssn_index].csi_role = act_val;
          mbcstm_cb.svces[svc_index].ssns[ssn_index].dest_role = act_val;
          if(mbcstm_ssn_set_role(svc_index,ssn_index) != NCSCC_RC_SUCCESS)
            goto final;
          break;
        case MBCSTM_TEST_ACTION_CLOSE :
          if( mbcstm_ssn_close(svc_index, ssn_index) != NCSCC_RC_SUCCESS)
            goto final;    
          break;
          /*change*/
        case MBCSTM_TEST_ACTION_GET:
          break;
        case MBCSTM_TEST_ACTION_SET:
          break;
          
        }
        
    }