VOS_VOID NAS_RABM_RcvSmBearerModifyInd(
    SM_RABM_BEARER_MODIFY_IND_STRU     *pstSmBearerModifyInd
)
{
    RABM_ENTITY_PS_STRU                *pstPsEnt;
    VOS_UINT8                           ucEntId;

    /* 获取PS域RABM实体索引 */
    ucEntId = (VOS_UINT8)(pstSmBearerModifyInd->ulNsapi - RABM_NSAPI_OFFSET);

    /* 检查PS域RABM实体状态是否正确 */
    if (RABM_NULL == NAS_RABM_GetWPsEntState(ucEntId))
    {
        NAS_ERROR_LOG1(WUEPS_PID_RABM,
                       "NAS_RABM_RcvSmBearerModifyInd: Wrong state of RABM entity. NSAPI:",
                       pstSmBearerModifyInd->ulNsapi);
        return;
    }

    /* 获取PS域RABM实体指针 */
    pstPsEnt = NAS_RABM_GetWPsEntAddr(ucEntId);

    /* 更新QOS */
    pstPsEnt->QoS.ulQosLength = pstSmBearerModifyInd->stQos.ulLength;
    PS_MEM_CPY(pstPsEnt->QoS.aucQosValue,
               pstSmBearerModifyInd->stQos.aucQosValue,
               NAS_RABM_MAX_QOS_LEN);

    return;
}
VOS_VOID NAS_RABM_RcvCdsServiceInd(
    CDS_RABM_SERVICE_IND_STRU          *pstCdsServiceInd
)
{
    /* 检查RABID有效性 */
    if (!RAB_MAP_RAB_IS_VALID(pstCdsServiceInd->ucRabId))
    {
        NAS_ERROR_LOG1(WUEPS_PID_RABM,
                       "NAS_RABM_RcvCdsServiceInd: Invalid RABID. <RABID>", pstCdsServiceInd->ucRabId);
        return;
    }

    switch (NAS_RABM_GetWPsEntState(pstCdsServiceInd->ucRabId - RABM_NSAPI_OFFSET))
    {
    case RABM_NSAPI_ACTIVE_WITH_RAB:
        NAS_NORMAL_LOG1(WUEPS_PID_RABM,
                        "NAS_RABM_RcvCdsServiceInd: RABID is already active. <RABID>", pstCdsServiceInd->ucRabId);
        NAS_RABM_SndCdsSendBuffDataInd(pstCdsServiceInd->ucRabId, CDS_RABM_SEND_BUFF_DATA_ALLOWED_TYPE_SERVICE_SUCC);
        break;

    case RABM_NSAPI_ACTIVE_NO_RAB:
        if (VOS_TRUE == NAS_RABM_GetWPsEntRabReestFlg(pstCdsServiceInd->ucRabId - RABM_NSAPI_OFFSET))
        {
            NAS_NORMAL_LOG1(WUEPS_PID_RABM,
                            "NAS_RABM_RcvCdsServiceInd: Reestablish is in process. <RABID>", pstCdsServiceInd->ucRabId);
        }
        else if (VOS_TRUE == NAS_RABM_IsDataServiceRequestPending())
        {
            NAS_NORMAL_LOG1(WUEPS_PID_RABM,
                            "NAS_RABM_RcvCdsServiceInd: Data service request is sent, set reestablish flag. <RABID>", pstCdsServiceInd->ucRabId);
            NAS_RABM_SetWPsEntRabReestFlg(pstCdsServiceInd->ucRabId - RABM_NSAPI_OFFSET);
        }
        else if (VOS_TRUE == NAS_RABM_IsRabReestablishPending())
        {
            NAS_NORMAL_LOG1(WUEPS_PID_RABM,
                            "NAS_RABM_RcvCdsServiceInd: Start RB setup protect timer. <RABID>", pstCdsServiceInd->ucRabId);
            NAS_RABM_SetWPsEntRabReestFlg(pstCdsServiceInd->ucRabId - RABM_NSAPI_OFFSET);
            NAS_RABM_StartReestRabPendingTmr(pstCdsServiceInd->ucRabId);
        }
        else
        {
            NAS_NORMAL_LOG1(WUEPS_PID_RABM,
                            "NAS_RABM_RcvCdsServiceInd: Send data service request.  <RABID>", pstCdsServiceInd->ucRabId);
            NAS_RABM_SetWPsEntRabReestFlg(pstCdsServiceInd->ucRabId - RABM_NSAPI_OFFSET);
            NAS_RABM_SetRabRsestTimerFlg();
            RABM_TimerStart(RABM_REESTABLISH_REQ_SENT, RABM_RABM_REEST_PROT_TIMER_LEN);
            RABM_SndRabReestReq();
        }
        break;

    default:
        NAS_WARNING_LOG1(WUEPS_PID_RABM,
                         "NAS_RABM_RcvCdsServiceInd: Can't reestablish RAB. <RABID>", pstCdsServiceInd->ucRabId);
        NAS_RABM_SndCdsFreeBuffDataInd(pstCdsServiceInd->ucRabId);
        break;
    }

    return;
}
VOS_UINT32 NAS_RABM_VoicePreferIsPdpActive(VOS_VOID)
{
    VOS_UINT32                          ulEntId;
    VOS_UINT8                           ucState;

    for (ulEntId = 0; ulEntId < RABM_3G_PS_MAX_ENT_NUM; ulEntId++)
    {
        ucState = NAS_RABM_GetWPsEntState(ulEntId);
        if ( (RABM_NSAPI_ACTIVE_NO_RAB == ucState)
                || (RABM_NSAPI_ACTIVE_WITH_RAB == ucState) )
        {
            return VOS_TRUE;
        }
    }

    return VOS_FALSE;
}
RABM_RAB_STATUS_ENUM_UINT32 NAS_RABM_GetWRabIdStatus(
    VOS_UINT32                          ulEntId
)
{
    VOS_UINT8                           ucState;
    RABM_RAB_STATUS_ENUM_UINT32         enRabStatus;

    ucState = NAS_RABM_GetWPsEntState(ulEntId);

    switch (ucState)
    {
        case RABM_NULL:
            enRabStatus = RABM_RAB_STATUS_FAIL;
            break;
        case RABM_NSAPI_ACTIVE_PENDING:
            enRabStatus = RABM_RAB_STATUS_FAIL;
            break;
        case RABM_NSAPI_ACTIVE_NO_RAB:
            enRabStatus = RABM_RAB_STATUS_IDLE;
            break;
        case RABM_NSAPI_ACTIVE_WITH_RAB:
            enRabStatus = RABM_RAB_STATUS_ACTIVE;
            break;
        case RABM_DATA_TRANSFER_STOP:
            enRabStatus = RABM_RAB_STATUS_SUSPEND;
            break;
        case RABM_ACT_PENDING_WITH_RAB:
            enRabStatus = RABM_RAB_STATUS_FAIL;
            break;
        default:
            enRabStatus = RABM_RAB_STATUS_FAIL;
            break;
    }

    return enRabStatus;

}