Exemple #1
0
INTERNAL unsigned32     decr_assoc_count_action_rtn 
(
  pointer_t       spc_struct,
  pointer_t       event_param,
  pointer_t       sm 
)
{
    rpc_cn_assoc_grp_t          *assoc_grp;
    rpc_cn_assoc_t              *assoc;
    rpc_cn_sm_ctlblk_t		*sm_p;
    unsigned32			status;

    RPC_CN_DBG_RTN_PRINTF(SERVER decr_assoc_count_action_rtn);

    sm_p = (rpc_cn_sm_ctlblk_t *)sm; 
    assoc_grp = (rpc_cn_assoc_grp_t *) spc_struct; 
    assoc = (rpc_cn_assoc_t *) event_param;
   
    SERVER_ASSOC_COUNT_PRED( spc_struct, event_param, status);  
    if (status == 2)
    {    
	sm_p->cur_state = RPC_C_SERVER_ASSOC_GRP_CALL_WAIT; 
    }
    else if (status == 1)
    {
       sm_p->cur_state = RPC_C_ASSOC_GRP_CLOSED; 
    }
    else if (status == 0) 
    {
        sm_p->cur_state = RPC_C_ASSOC_GRP_ACTIVE; 
    }
    
    /*
     * Clear the group pointer in the association, decrement the
     * association count in the group and remove the association from
     * the group's association list.
     */
    if ( sm_p->cur_state != RPC_C_SERVER_ASSOC_GRP_CALL_WAIT)
        RPC_CN_LOCAL_ID_CLEAR (assoc->assoc_grp_id);
    
    /* 
     * Assoc_grp pointer receives a value within the SERVER_ASSOC_COUNT_PRED
     * macro.
     */  
    assoc_grp->grp_cur_assoc--;
    RPC_LIST_REMOVE (assoc_grp->grp_assoc_list, assoc);
    return(assoc_grp->grp_status); 
}
Exemple #2
0
INTERNAL unsigned32     decr_assoc_count_action_rtn
(
  pointer_t       spc_struct,
  pointer_t       event_param,
  pointer_t	  sm
)
{
    rpc_cn_assoc_grp_t          *assoc_grp;
    rpc_cn_assoc_t              *assoc;
    rpc_cn_sm_ctlblk_t 		*sm_p;
    unsigned32			status;

    assoc_grp = (rpc_cn_assoc_grp_t *) spc_struct;
    sm_p = (rpc_cn_sm_ctlblk_t *)sm;

    ASSOC_COUNT_PRED(spc_struct, event_param, status);
    if (status == 1)  /* (assoc_grp->grp_cur_assoc == 1) */
    {
	sm_p->cur_state = RPC_C_ASSOC_GRP_CLOSED;
    }
    else /* (assoc_grp->grp_cur_assoc > 1) */
    {
        /*
         * There is more than one association on the group.
         */
	sm_p->cur_state = RPC_C_ASSOC_GRP_ACTIVE;
    }

    RPC_CN_DBG_RTN_PRINTF(CLIENT decr_assoc_count_action_rtn);

    assoc = (rpc_cn_assoc_t *) event_param;

    /*
     * Clear the group pointer in the association, decrement the
     * association count in the group and remove the association from
     * the group's association list.
     */
    RPC_CN_LOCAL_ID_CLEAR (assoc->assoc_grp_id);
    assoc_grp->grp_cur_assoc--;
    RPC_LIST_REMOVE (assoc_grp->grp_assoc_list, assoc);

    return (assoc_grp->grp_status);
}