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
PRIVATE void rpc__cn_binding_reset
(
  rpc_binding_rep_p_t     binding_r,
  unsigned32              *st
)
{
    CODING_ERROR (st);

    /*
     * The endpoint in the binding is being reset. Since we assume
     * endpoints are tied to address spaces and an association group
     * id identifies an address space we should reset the group ID.
     * When the endpoint is added to the binding
     * rpc__cn_binding_init should be called again to set the group id.
     */
    RPC_CN_LOCAL_ID_CLEAR (((rpc_cn_binding_rep_t *)binding_r)->grp_id);

    *st = rpc_s_ok;
}
Exemple #3
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);
}
Exemple #4
0
INTERNAL unsigned32     rundown_handles_action_rtn
(
  pointer_t       spc_struct,
  pointer_t       event_param,
  pointer_t       sm 
)
{
    rpc_cn_assoc_grp_t          *assoc_grp;
    rpc_cn_sm_ctlblk_t		*sm_p;
    rpc_cn_assoc_t              *assoc;
    unsigned32			status;

    RPC_CN_DBG_RTN_PRINTF(SERVER rundown_handles_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;

    RPC_CN_LOCAL_ID_CLEAR (assoc->assoc_grp_id);
    SERVER_REFS_PRED(spc_struct, event_param, status); 

    if (status == 0)
    {
    	sm_p->cur_state = RPC_C_ASSOC_GRP_CLOSED;
        return(status);
    }
    /*
     * Call the rundown routine registered in the group passing it
     * the group id.
     * 
     * Assoc_grp is assigned within the SERVER_REFS_PRED
     * macro.
     */  
    if (assoc_grp->grp_liveness_mntr != NULL)
    {
        (*assoc_grp->grp_liveness_mntr) ((rpc_client_handle_t) assoc_grp->grp_id.all);
    }

    sm_p->cur_state = RPC_C_ASSOC_GRP_CLOSED;
    return (assoc_grp->grp_status); 
}