VOS_VOID NAS_ERABM_SndErabmCdsRabReleaseInd( VOS_UINT32 ulEpsbId )
{
#if (VOS_OS_VER != VOS_WIN32)

    CDS_ERABM_RAB_RELEASE_IND_STRU  *pstRabReleaseInd = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstRabReleaseInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(CDS_ERABM_RAB_RELEASE_IND_STRU));
    if (VOS_NULL_PTR == pstRabReleaseInd)
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndErabmCdsRabReleaseInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(  NAS_ERABM_GET_MSG_ENTITY(pstRabReleaseInd),
                        NAS_ERABM_NULL,
                        NAS_ERABM_GET_MSG_LENGTH(pstRabReleaseInd));

    /*赋值 EpsbId*/
    pstRabReleaseInd->ucRabId = (VOS_UINT8)ulEpsbId;


    /*填写消息头*/
    NAS_ERABM_WRITE_CDS_MSG_HEAD(pstRabReleaseInd,ID_QOS_FC_ERABM_RAB_RELEASE_IND);

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstRabReleaseInd);
#endif
}
VOS_VOID NAS_ERABM_SndErabmCdsFreeBuffDataInd( VOS_VOID )
{

    ERABM_CDS_FREE_BUFF_DATA_IND_STRU  *pstFreeBuffDataInd = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstFreeBuffDataInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(ERABM_CDS_FREE_BUFF_DATA_IND_STRU));
    if (VOS_NULL_PTR == pstFreeBuffDataInd)
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndErabmCdsSndBuffDataInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(  NAS_ERABM_GET_MSG_ENTITY(pstFreeBuffDataInd),
                        NAS_ERABM_NULL,
                        NAS_ERABM_GET_MSG_LENGTH(pstFreeBuffDataInd));

    /*填写消息头*/
    NAS_ERABM_WRITE_CDS_MSG_HEAD(pstFreeBuffDataInd,ID_ERABM_CDS_FREE_BUFF_DATA_IND);

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstFreeBuffDataInd);

}
/*****************************************************************************
 Function Name   : NAS_ERABM_SndRabmEmmResumeRsp
 Description     : ESM模块回复ID_EMM_ERABM_RESUME_RSP消息
 Input           : EMM_ERABM_RSLT_TYPE_ENUM_UINT32       enRslt
 Output          : None
 Return          : VOS_VOID

 History         :
    1.lihong00150010      2011-05-03  Draft Enact

*****************************************************************************/
VOS_VOID NAS_ERABM_SndRabmEmmResumeRsp
(
    EMM_ERABM_RSLT_TYPE_ENUM_UINT32      enRslt
)
{
    EMM_ERABM_RESUME_RSP_STRU            *pstRabmEmmResumeRsp  = VOS_NULL_PTR;

    /*分配空间并检验分配是否成功*/
    pstRabmEmmResumeRsp = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(EMM_ERABM_RESUME_RSP_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstRabmEmmResumeRsp)
    {
        /*打印异常信息*/
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndRabmEmmResumeRsp:ERROR:Alloc Msg fail!");
        return ;
    }

    /*清空*/
    NAS_ERABM_MEM_SET( NAS_ERABM_GET_MSG_ENTITY(pstRabmEmmResumeRsp), 0, NAS_ERABM_GET_MSG_LENGTH(pstRabmEmmResumeRsp));

    /*填写消息头*/
    NAS_ERABM_WRITE_EMM_MSG_HEAD(pstRabmEmmResumeRsp, ID_EMM_ERABM_RESUME_RSP);

    /*填写响应结果*/
    pstRabmEmmResumeRsp->enRslt= enRslt;

    /*调用消息发送函数 */
    NAS_ERABM_SND_MSG(pstRabmEmmResumeRsp);
}
/*lint -e961*/
VOS_VOID NAS_ERABM_SndErabmCdsSndBuffDataInd
(
    CDS_ERABM_SEND_BUFF_DATA_ALLOWED_TYPE_ENUM_UINT32   enSndBuffDataAllowedType
)
{

    ERABM_CDS_SEND_BUFF_DATA_IND_STRU  *pstSndBuffDataInd = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstSndBuffDataInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(ERABM_CDS_SEND_BUFF_DATA_IND_STRU));
    if (VOS_NULL_PTR == pstSndBuffDataInd)
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndErabmCdsSndBuffDataInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(  NAS_ERABM_GET_MSG_ENTITY(pstSndBuffDataInd),
                        NAS_ERABM_NULL,
                        NAS_ERABM_GET_MSG_LENGTH(pstSndBuffDataInd));

    /*填写消息头*/
    NAS_ERABM_WRITE_CDS_MSG_HEAD(pstSndBuffDataInd,ID_ERABM_CDS_SEND_BUFF_DATA_IND);

    pstSndBuffDataInd->enSndBuffDataAllowedType = enSndBuffDataAllowedType;

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstSndBuffDataInd);

}
VOS_VOID NAS_ERABM_SndRabmEmmReestReq
(
    VOS_UINT32                          ulIsEmcType
)
{
    EMM_ERABM_REEST_REQ_STRU    *pstReestReq = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstReestReq = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(
                                        sizeof(EMM_ERABM_REEST_REQ_STRU));
    if ( VOS_NULL_PTR == pstReestReq )
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndRabmEmmReestReq:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(NAS_ERABM_GET_MSG_ENTITY(pstReestReq), NAS_ERABM_NULL,\
                     NAS_ERABM_GET_MSG_LENGTH(pstReestReq));

    /*填写消息头*/
    NAS_ERABM_WRITE_EMM_MSG_HEAD(pstReestReq, ID_EMM_ERABM_REEST_REQ);
	/* lihong00150010 emergency tau&service begin */
    pstReestReq->ulIsEmcType = ulIsEmcType;
	/* lihong00150010 emergency tau&service end */
    /* 调用消息发送函数 */
    NAS_ERABM_SND_MSG(pstReestReq);

}
/*lint -e960*/
VOS_VOID  NAS_ERABM_SndIpRabmDataInd
(
    VOS_UINT8                           ucEpsbId,
    const VOS_UINT8                    *pucIpMsg,
    VOS_UINT32                          ulIpMsgLen
)
{
    IP_RABM_DATA_IND_STRU              *pstDataInd  = VOS_NULL_PTR;
    VOS_UINT32                          ulTmpLength = NAS_ERABM_NULL;

    /*根据空口消息的长度分配空间*/
    if( NAS_ERABM_NULL == ulIpMsgLen)
    {
        NAS_ERABM_WARN_LOG("NAS_ERABM_SndIpRabmDataInd: WARNING: Msg Length is zero");
        return ;
    }
    else if(ulIpMsgLen > NAS_ERABM_MIN_SND_MSG_LEN)
    {
        ulTmpLength = ulIpMsgLen - NAS_ERABM_MIN_SND_MSG_LEN ;
        pstDataInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(IP_RABM_DATA_IND_STRU) + ulTmpLength);
    }
    else/*如果长度小于NAS_ERABM_MIN_SND_MSG_LEN,分配的空间等于NAS_ERABM_MIN_SND_MSG_LEN*/
    {
        pstDataInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(IP_RABM_DATA_IND_STRU));
    }

    if (VOS_NULL_PTR == pstDataInd)
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndIpRabmDataInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(   NAS_ERABM_GET_MSG_ENTITY(pstDataInd),
                        NAS_ERABM_NULL,
                        NAS_ERABM_GET_MSG_LENGTH(pstDataInd));

    /*填写消息头*/
    NAS_ERABM_WRITE_IP_MSG_HEAD(pstDataInd, ID_IP_RABM_DATA_IND);

    /* 填写消息内容 */
    pstDataInd->ucEpsbId = ucEpsbId;
    pstDataInd->stIpMsg.ulIpMsgSize = ulIpMsgLen;

    /*lint -e669*/
    NAS_ERABM_MEM_CPY(   pstDataInd->stIpMsg.aucIpMsg,
                        pucIpMsg,
                        ulIpMsgLen);
    /*lint +e669*/

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstDataInd);
}
VOS_VOID NAS_ERABM_SndErabmCdsRabCreatInd( VOS_UINT32 ulEpsbId )
{
#if (VOS_OS_VER != VOS_WIN32)

    CDS_ERABM_RAB_CREATE_IND_STRU  *pstRabCreatInd = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstRabCreatInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(CDS_ERABM_RAB_CREATE_IND_STRU));

    if (VOS_NULL_PTR == pstRabCreatInd)
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndErabmCdsRabCreatInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(  NAS_ERABM_GET_MSG_ENTITY(pstRabCreatInd),
                        NAS_ERABM_NULL,
                        NAS_ERABM_GET_MSG_LENGTH(pstRabCreatInd));

    /* 赋值QCI */
    pstRabCreatInd->enQci = NAS_ERABM_GetEpsbQCI(ulEpsbId);


    /*赋值 EpsbId及关联EPsbId */
    pstRabCreatInd->ucRabId = (VOS_UINT8)ulEpsbId;
    if (ESM_ERABM_BEARER_TYPE_DEDICATED == NAS_ERABM_GetEpsbBearerType(ulEpsbId))
    {
        pstRabCreatInd->ucLinkRabId = (VOS_UINT8)NAS_ERABM_GetEpsbLinkedEpsbId(ulEpsbId);
    }
    else
    {
        pstRabCreatInd->ucLinkRabId = pstRabCreatInd->ucRabId;
    }

    /*填写消息头*/
    NAS_ERABM_WRITE_CDS_MSG_HEAD(pstRabCreatInd,ID_QOS_FC_ERABM_RAB_CREATE_IND);

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstRabCreatInd);
#endif
}
VOS_VOID NAS_ERABM_SndRabmEmmRelReq( VOS_VOID)
{
    EMM_ERABM_REL_REQ_STRU    *pstRelReq  = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstRelReq = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(EMM_ERABM_REL_REQ_STRU));
    if ( VOS_NULL_PTR == pstRelReq )
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndRabmEmmRelReq:ERROR:Alloc msg fail!" );
        return;
    }

    NAS_ERABM_MEM_SET(NAS_ERABM_GET_MSG_ENTITY(pstRelReq), NAS_ERABM_NULL,\
                     NAS_ERABM_GET_MSG_LENGTH(pstRelReq));

    /*填写消息头*/
    NAS_ERABM_WRITE_EMM_MSG_HEAD(pstRelReq, ID_EMM_ERABM_REL_REQ);

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstRelReq);

}
/*****************************************************************************
 Function Name   : NAS_ERABM_SndRabmTcResumeInd
 Description     : ERABM模块向ETC发送ID_ETC_ERABM_RESUME_IND消息
 Input           : None
 Output          : None
 Return          : VOS_VOID

 History         :
    1.lihong00150010      2011-05-03  Draft Enact

*****************************************************************************/
VOS_VOID NAS_ERABM_SndRabmTcResumeInd( VOS_VOID )
{
    ETC_ERABM_RESUME_IND_STRU            *pstRabmTcResumeInd  = VOS_NULL_PTR;

    /*分配空间并检验分配是否成功*/
    pstRabmTcResumeInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(sizeof(ETC_ERABM_RESUME_IND_STRU));

    /*检测是否分配成功*/
    if (VOS_NULL_PTR == pstRabmTcResumeInd)
    {
        /*打印异常信息*/
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndRabmTcResumeInd:ERROR:Alloc Msg fail!");
        return ;
    }

    /*清空*/
    NAS_ERABM_MEM_SET( NAS_ERABM_GET_MSG_ENTITY(pstRabmTcResumeInd), 0, NAS_ERABM_GET_MSG_LENGTH(pstRabmTcResumeInd));

    /*填写消息头*/
    NAS_ERABM_WRITE_TC_MSG_HEAD(pstRabmTcResumeInd, ID_ETC_ERABM_RESUME_IND);

    /*调用消息发送函数 */
    NAS_ERABM_SND_MSG(pstRabmTcResumeInd);
}
VOS_VOID NAS_ERABM_SndRabmEmmDrbSetupInd( VOS_VOID )
{
    EMM_ERABM_DRB_SETUP_IND_STRU    *pstDrbSetInd = VOS_NULL_PTR;

    /*分配空间和检测是否分配成功*/
    pstDrbSetInd = (VOS_VOID*)NAS_ERABM_ALLOC_MSG(
                                        sizeof(EMM_ERABM_DRB_SETUP_IND_STRU));
    if ( VOS_NULL_PTR == pstDrbSetInd )
    {
        NAS_ERABM_ERR_LOG("NAS_ERABM_SndRabmEmmDrbSetupInd:ERROR:Alloc msg fail!" );
        return;
    }

    /*清空*/
    NAS_ERABM_MEM_SET(NAS_ERABM_GET_MSG_ENTITY(pstDrbSetInd), NAS_ERABM_NULL,\
                     NAS_ERABM_GET_MSG_LENGTH(pstDrbSetInd));

    /*填写消息头*/
    NAS_ERABM_WRITE_EMM_MSG_HEAD(pstDrbSetInd, ID_EMM_ERABM_DRB_SETUP_IND);

    /* 调用消息发送函数*/
    NAS_ERABM_SND_MSG(pstDrbSetInd);

}