/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
#include "cuupTest.h"
INT32 printfPduSessionCfgType(UpcCfgType_e type)
{
- VOS_Printf("cfg type : ");
- switch(type)
- {
- case PDU_SESSION_ADD:
- VOS_Printf("PDU_SESSION_ADD\n");
- break;
-
- case PDU_SESSION_MOD:
- VOS_Printf("PDU_SESSION_MOD\n");
- break;
-
- case PDU_SESSION_DEL:
- VOS_Printf("PDU_SESSION_DEL\n");
- break;
-
- case DRB_DEL:
- VOS_Printf("DRB_DEL\n");
- break;
-
- default:
- break;
- }
-
return VOS_OK;
}
INT32 printfTransLayerAddr(TransLayerAddr_t *pAddr)
{
- NULL_CHECK(pAddr);
-
- VOS_Printf("addr size: %d bytes ",pAddr->bitStringSize);
-
- UINT8 i = 0;
- for(i=0; i<pAddr->bitStringSize; i++)
- {
- VOS_Printf("%d ",pAddr->transLayerAddress[i]);
- }
- VOS_Printf("\n");
return VOS_OK;
}
INT32 printfNguInstance(NguInstance_t *pNguInstance)
{
- NULL_CHECK(pNguInstance);
- VOS_Printf("\n");
- VOS_Printf("#################################\n");
- VOS_Printf(" ngu instance parameters \n");
- VOS_Printf("#################################\n");
- VOS_Printf("ueE1apId: %d\n",pNguInstance->ueE1apId);
- VOS_Printf("ueIdx: %d\n",pNguInstance->ueIdx);
- VOS_Printf("pduSessionId: %d\n",pNguInstance->pduSessionId);
- VOS_Printf("ownTeid: 0x%08x\n",pNguInstance->ownTeid);
return VOS_OK;
}
INT32 printfNguCfgResult(NguCfgResult_t *pCfg)
{
- NULL_CHECK(pCfg);
- VOS_Printf("\n");
- VOS_Printf("##########################\n");
- VOS_Printf(" ngu config result \n");
- VOS_Printf("##########################\n");
- printfPduSessionCfgType(pCfg->cfgType);
- VOS_Printf("pduSessionId: %d\n",pCfg->pduSessionId);
- VOS_Printf("nggtpuTeid: 0x%08x\n",pCfg->nggtpuTeid);
- printfTransLayerAddr(&pCfg->nggtpuAddr);
- VOS_Printf("failureCause: %d\n",pCfg->failureCause);
return VOS_OK;
}
INT32 printfSecuResult(SecuResult_t *pResult)
{
- NULL_CHECK(pResult);
-
- if(CP_RESULT_PERFORMED == pResult->confidentialityProtectionResult)
- {
- VOS_Printf("cipher is performed\n");
-
- }else if(CP_RESULT_NOT_PERFORMED == pResult->confidentialityProtectionResult)
- {
- VOS_Printf("cipher is not performed\n");
-
- }else
- {
- VOS_Printf("ciper result is wrong!\n");
- }
-
- if(IP_RESULT_PERFORMED == pResult->integrityProtectionResult)
- {
- VOS_Printf("integrity is performed\n");
-
- }else if(IP_RESULT_NOT_PERFORMED == pResult->integrityProtectionResult)
- {
- VOS_Printf("integrity is not performed\n");
-
- }else
- {
- VOS_Printf("integrity result is wrong!\n");
- }
-
return VOS_OK;
}
INT32 printfPdcpRlcMode(PdcpRlcMode_e mode)
{
- if(TM_MODE == mode)
- {
- VOS_Printf("rlc mode: TM_MODE\n");
-
- }else if(UM_MODE == mode)
- {
- VOS_Printf("rlc mode: UM_MODE\n");
-
- }else if(AM_MODE == mode)
- {
- VOS_Printf("rlc mode: AM_MODE\n");
-
- }else
- {
- VOS_Printf("rlc mode: wrong\n");
- }
return VOS_OK;
}
INT32 printfDrbEntity(PdcpDrbEntity_t *pEntity)
-{
- NULL_CHECK(pEntity);
- VOS_Printf("\n");
- VOS_Printf("#####################\n");
- VOS_Printf(" pdcpu entity \n");
- VOS_Printf("#####################\n");
- VOS_Printf("ueE1apId: %d\n", pEntity->ueE1apId);
- VOS_Printf("ueIdx: %d\n", pEntity->ueIdx);
- VOS_Printf("pduSessionId: %d\n", pEntity->pduSessionId);
- VOS_Printf("drbId: %d\n", pEntity->drbId);
- printfPdcpRlcMode(pEntity->rlcMode);
- VOS_Printf("sdapUlHeadLen: %d\n", pEntity->sdapUlHeadLen);
- VOS_Printf("sdapDlHeadLen: %d\n", pEntity->sdapDlHeadLen);
- VOS_Printf("pdcpSnSizeUl: %d bits\n", pEntity->pdcpSnSizeUl);
- VOS_Printf("pdcpSnSizeDl: %d bits\n", pEntity->pdcpSnSizeDl);
-
- if(pEntity->tDiscardActive)
- {
- VOS_Printf("discard timer is active, ");
- }else
- {
- VOS_Printf("discard timer is not active, ");
- }
-
- if(pEntity->tDiscardRun)
- {
- VOS_Printf("running, ");
- }else
- {
- VOS_Printf("not running, ");
- }
-
- VOS_Printf("period:%d ms\n", pEntity->tDiscard);
-
- if(pEntity->tReorderActive)
- {
- VOS_Printf("reorder timer is active, ");
- }else
- {
- VOS_Printf("reorder timer is not active, ");
- }
-
- if(pEntity->tReorderRun)
- {
- VOS_Printf("running, ");
- }else
- {
- VOS_Printf("not running, ");
- }
-
- VOS_Printf("period:%d ms\n", pEntity->tReorder);
-
- if(TRUE == pEntity->integrityProtection)
- {
- VOS_Printf("integrityProtection: enabled\n");
-
- }else if(FALSE == pEntity->integrityProtection)
- {
- VOS_Printf("integrityProtection: disabled\n");
- }else
- {
- vos_err_print("integrityProtection: enable flag is wrong\n");
- }
-
- if(TRUE == pEntity->ciperingEnabled)
- {
- VOS_Printf("cipher: enabled\n");
-
- }else if(FALSE == pEntity->ciperingEnabled)
- {
- VOS_Printf("cipher: disabled\n");
- }else
- {
- vos_err_print("cipher: enable flag is wrong\n");
- }
-
- if(TRUE == pEntity->outOfOrderDelivery)
- {
- VOS_Printf("outOfOrderDelivery: enabled\n");
-
- }else
- {
- VOS_Printf("outOfOrderDelivery: disabled\n");
- }
-
- if(TRUE == pEntity->headerCompress.notUsed)
- {
- VOS_Printf("headerCompress: not used\n");
-
- }else
- {
- VOS_Printf("headerCompress: used\n");
- }
-
- VOS_Printf("stateVar.rxCount: %d\n", pEntity->stateVar.rxCount);
- VOS_Printf("stateVar.txNext: %d\n", pEntity->stateVar.txNext);
- VOS_Printf("stateVar.rxDelivery: %d\n", pEntity->stateVar.rxDelivery);
- VOS_Printf("stateVar.rxNext: %d\n", pEntity->stateVar.rxNext);
- VOS_Printf("stateVar.rxReorder: %d\n", pEntity->stateVar.rxReorder);
-
+{
return VOS_OK;
}
INT32 printfDrbFailedCause(DrbFailedCause_t *p)
{
- VOS_Printf("drb id: %d, failed cause: %d\n", p->drbId, p->cause);
-
return VOS_OK;
}
INT32 printfPdcpuCfgResult(PdcpuCfgResult_t *pResult)
{
- UINT8 i = 0;
-
- NULL_CHECK(pResult);
- VOS_Printf("\n");
- VOS_Printf("##########################\n");
- VOS_Printf(" pdcpu cfg result \n");
- VOS_Printf("##########################\n");
- VOS_Printf("pdu Session Id: %d\n", pResult->pduSessionId);
- printfPduSessionCfgType(pResult->cfgType);
-
- if(pResult->secResPresent)
- {
- VOS_Printf("there is security result\n");
- printfSecuResult(&pResult->secuResult);
- }else
- {
- VOS_Printf("there is no security result\n");
- }
-
- VOS_Printf("drbSetupSuccessNum: %d\ndrb id list: ", pResult->drbSetupSuccessNum);
- for(i=0; i<pResult->drbSetupSuccessNum; i++)
- {
- VOS_Printf("%d ", pResult->drbSetupSuccessArray[i]);
- }
-
- VOS_Printf("\ndrbSetupFailNum: %d\ndrb id list: ", pResult->drbSetupFailNum);
- for(i=0; i<pResult->drbSetupFailNum; i++)
- {
- printfDrbFailedCause(&pResult->drbSetupFailedArray[i]);
- }
-
- VOS_Printf("\ndrbModifySuccessNum: %d\ndrb id list: ", pResult->drbModifySuccessNum);
- for(i=0; i<pResult->drbModifySuccessNum; i++)
- {
- VOS_Printf("%d ", pResult->drbModifySuccessArray[i]);
- }
-
- VOS_Printf("\ndrbModifyFailNum: %d\ndrb id list: ", pResult->drbModifyFailNum);
- for(i=0; i<pResult->drbModifyFailNum; i++)
- {
- printfDrbFailedCause(&pResult->drbModifyFailedArray[i]);
- }
- VOS_Printf("\n");
-
return VOS_OK;
}
INT32 printfCuf1uInstance(Cuf1uInstance_t *pF1u)
{
- NULL_CHECK(pF1u);
- VOS_Printf("\n");
- VOS_Printf("##########################\n");
- VOS_Printf(" cuf1u instance \n");
- VOS_Printf("##########################\n");
- VOS_Printf("ueE1apId: %d\n", pF1u->ueE1apId);
- VOS_Printf("ueIdx: %d\n", pF1u->ueIdx);
- VOS_Printf("pduSessionId: %d\n", pF1u->pduSessionId);
- VOS_Printf("drbId: %d\n", pF1u->drbId);
- if(LEN_12_BITS == pF1u->pdcpSnSize)
- {
- VOS_Printf("pdcpSnSize: 12 bits\n", pF1u->pdcpSnSize);
-
- }else if(LEN_18_BITS == pF1u->pdcpSnSize)
- {
- VOS_Printf("pdcpSnSize: 18 bits\n", pF1u->pdcpSnSize);
-
- }else{
- VOS_Printf("pdcpSnSize: wrong!\n");
- }
-
- VOS_Printf("ownTeid: 0X%08X\n", pF1u->ownTeid);
- VOS_Printf("nextSubmitSn: %d\n", pF1u->nextSubmitSn);
-
return VOS_OK;
}
INT32 printfCuf1uSetupInfo(Cuf1uSetupInfo_t *pInfo)
{
- NULL_CHECK(pInfo);
-
- VOS_Printf("setup info-->drbId: %02x\n", pInfo->drbId);
- VOS_Printf("setup info-->f1gtpuTeid: %08x\n", pInfo->f1gtpuTeid);
- VOS_Printf("setup info-->");
- printfTransLayerAddr(&pInfo->gtpuAddr);
-
return VOS_OK;
}
INT32 printfCuf1uCfgResult(Cuf1uCfgResult_t *pResult)
{
- UINT8 i = 0;
-
- NULL_CHECK(pResult);
- VOS_Printf("\n");
- VOS_Printf("##########################\n");
- VOS_Printf(" cuf1u cfg result \n");
- VOS_Printf("##########################\n");
- VOS_Printf("pdu Session Id: %d\n", pResult->pduSessionId);
- printfPduSessionCfgType(pResult->cfgType);
-
- VOS_Printf("drbSetupSuccessNum: %d\ndrb id list:", pResult->drbSetupSuccessNum);
- for(i=0; i<pResult->drbSetupSuccessNum; i++)
- {
- printfCuf1uSetupInfo(&pResult->drbSetupSuccessArray[i]);
- }
-
- VOS_Printf("\ndrbSetupFailNum: %d\n", pResult->drbSetupFailNum);
- for(i=0; i<pResult->drbSetupFailNum; i++)
- {
- printfDrbFailedCause(&pResult->drbSetupFailedArray[i]);
- }
-
- VOS_Printf("\ndrbModifySuccessNum: %d\n", pResult->drbModifySuccessNum);
- for(i=0; i<pResult->drbModifySuccessNum; i++)
- {
- VOS_Printf("%d ", pResult->drbModifySuccessArray[i]);
- }
-
- VOS_Printf("\ndrbModifyFailNum: %d\n", pResult->drbModifyFailNum);
- for(i=0; i<pResult->drbModifyFailNum; i++)
- {
- printfDrbFailedCause(&pResult->drbModifyFailedArray[i]);
- }
-
- VOS_Printf("pduSessionFailCause: %d\n",pResult->pduSessionCause);
-
return VOS_OK;
}
INT32 printfPdcpuSecInfo(PdcpuSecInfo_t *pSec)
{
- NULL_CHECK(pSec);
-
- UINT8 i = 0;
-
- VOS_Printf("\n");
- VOS_Printf("#################################################\n");
- VOS_Printf(" pdcpu set security info successful \n");
- VOS_Printf("#################################################\n");
- VOS_Printf("ueE1apId: 0X%x\n",pSec->ueE1apId);
- VOS_Printf("ueIdx: 0X%04x\n",pSec->ueIdx);
-
- VOS_Printf("kUpEnc:");
- for(i=0; i<4; i++)
- {
- VOS_Printf("%08x ",pSec->kUpEnc[i]);
- }
- VOS_Printf("\n");
-
- VOS_Printf("kUpInt:");
- for(i=0; i<4; i++)
- {
- VOS_Printf("%08x ",pSec->kUpInt[i]);
- }
- VOS_Printf("\n");
-
- /*VOS_Printf("nh:");
- for(i=0; i<8; i++)
- {
- VOS_Printf("%08x ",pSec->nh[i]);
- }
- VOS_Printf("\n");
-
- VOS_Printf("ncc: 0X%02x\n",pSec->ncc);*/
-
- //打印加密算法
- if(NEA0 == pSec->encAlgorithm)
- {
- VOS_Printf("encAlgorithm: NEA0\n");
-
- }else if(NEA1 == pSec->encAlgorithm)
- {
- VOS_Printf("encAlgorithm: NEA1\n");
-
- }else if(NEA2 == pSec->encAlgorithm)
- {
- VOS_Printf("encAlgorithm: NEA2\n");
-
- }else
- {
- VOS_Printf("encAlgorithm: %d error!\n",pSec->encAlgorithm);
- }
-
- //打印完保算法
- if(NIA0 == pSec->intAlgorithm)
- {
- VOS_Printf("intAlgorithm: NIA0\n");
-
- }else if(NIA1 == pSec->intAlgorithm)
- {
- VOS_Printf("intAlgorithm: NIA1\n");
-
- }else if(NIA2 == pSec->intAlgorithm)
- {
- VOS_Printf("intAlgorithm: NIA2\n");
-
- }else
- {
- VOS_Printf("intAlgorithm: %d error!\n",pSec->intAlgorithm);
- }
-
- //打印加密是否激活
- if(0 == pSec->encActiveFlag)
- {
- VOS_Printf("enc status: inactive\n");
- }else
- {
- VOS_Printf("enc status: active\n");
- }
-
- //打印完保是否激活
- if(0 == pSec->intActiveFlag)
- {
- VOS_Printf("int status: inactive\n");
- }else
- {
- VOS_Printf("int status: active\n");
- }
-
- if(0 == pSec->nhInd)
- {
- VOS_Printf("nhInd: not exist\n");
- }else
- {
- VOS_Printf("nhInd: exist\n");
- }
-
return VOS_OK;
}
INT32 printfVosSockAddr(vos_sockaddr_t *pAddr)
{
- NULL_CHECK(pAddr);
-
- UINT8 *temp = NULL;
- UINT8 i = 0;
-
- if(AF_INET == pAddr->sa.sa_family)
- {
- VOS_Printf("IP type : IPV4\n");
- VOS_Printf("IP addr : ");
- for(i=0; i<4; i++)
- {
- temp = (UINT8 *)&pAddr->sin.sin_addr + i;
- VOS_Printf("%d ",*temp);
- }
- VOS_Printf("\n");
- }else if(AF_INET6 == pAddr->sa.sa_family)
- {
- VOS_Printf("IP type : IPV6\n");
- VOS_Printf("IP addr : ");
- for(i=0; i<16; i++)
- {
- temp = (UINT8 *)&pAddr->sin6.sin6_addr + i;
- VOS_Printf("%d ",*temp);
- }
- VOS_Printf("\n");
- }else
- {
- VOS_Printf("addr type is wrong!\n");
- }
-
return VOS_OK;
}
INT32 printfTun(Tun_t *pTun)
{
- NULL_CHECK(pTun);
-
- VOS_Printf("\n");
- VOS_Printf("##############################\n");
- VOS_Printf(" tunnel info \n");
- VOS_Printf("##############################\n");
-
- if(0 == pTun->tunState)
- {
- VOS_Printf("tun state is inactive\n");
- }else
- {
- VOS_Printf("tun state is active\n");
- }
-
- VOS_Printf("seq: %d\n",pTun->seq);
- VOS_Printf("tunId: 0x%08x\n",pTun->tunId);
- VOS_Printf("ownTeid: 0x%08x\n",pTun->ownTeid);
- VOS_Printf("remTeid: 0x%08x\n",pTun->remTeid);
- printfVosSockAddr(&pTun->tunOpval.addr);
-
return VOS_OK;
}
INT32 printfPdcpuSecEnableInfo(PdcpuSecEnableInfo_t *pInfo)
{
- NULL_CHECK(pInfo);
-
- VOS_Printf("\n");
- VOS_Printf("######################################\n");
- VOS_Printf(" security enable info \n");
- VOS_Printf("######################################\n");
- VOS_Printf("pduSessionId: %d\n",pInfo->pduSessionId);
-
- //加密
- if(TRUE == pInfo->cipherEnableFlag)
- {
- VOS_Printf("cipher : enabled\n");
- }else
- {
- VOS_Printf("cipher : disabled\n");
- }
-
- //完整性保护
- if(TRUE == pInfo->integrityEnableFlag)
- {
- VOS_Printf("integrity : enabled\n");
- }else
- {
- VOS_Printf("integrity : disabled\n");
- }
-
- //完保速率
- VOS_Printf("maxIPDataRate: %d\n",pInfo->maxIPDataRate);
-
return VOS_OK;
}
INT32 printfCuupUeIdxTable(CuupUeIdxTable_t *pTable)
{
- UINT8 i = 0;
- VOS_Printf("0 is used, 1 is not used, else is wrong\n");
- for(i=0; i<MAX_UE_NUM; i++)
- {
- VOS_Printf("i is %d ",i);
- VOS_Printf("usedFlag: %d ",pTable->ueIdxInfo[i].isUsed);
- VOS_Printf("ueE1apId: %d ",pTable->ueIdxInfo[i].ueE1apId);
- VOS_Printf("ueIdx: %04x\n",pTable->ueIdxInfo[i].ueIdx);
- }
- VOS_Printf("at end i = %d\n",i);
-
return VOS_OK;
}
INT32 printfMsgbBuff(MsgbBuff_t *pMsgBuff)
{
- NULL_CHECK(pMsgBuff);
-
- UINT8 *pMsgHead = msgbData(pMsgBuff);
- UINT32 pduLen = msgbDataUsedLen(pMsgBuff);
-
- /*VOS_Printf("msgb maxDataLen:%d maxHeadLen:%d headSpareLen:%d tailOffset:%d ",
- pMsgBuff->msgbInfo.maxDataLen,
- pMsgBuff->msgbInfo.maxHeadLen,
- pMsgBuff->msgbInfo.headSpareLen,
- pMsgBuff->msgbInfo.tailOffset);*/
-
- VOS_Printf(VOS_COLOR_BLUE"data len:%d\n"VOS_COLOR_NONE,pduLen);
-
- UINT32 j = 0;
- for(j=0; j<pduLen; j++)
- {
- VOS_Printf("%02x ",*(pMsgHead+j));
- }
- VOS_Printf("\n");
-
return VOS_OK;
}
INT32 printfExPduInfo(ExPduInfo_t *pPdu)
-{
- NULL_CHECK(pPdu);
-
- VOS_Printf("exHdrLen:%d Byteslen:%d exHdrType:0x%02x\n",
- pPdu->exHdrLen,pPdu->len,pPdu->exHdrType);
-
- UINT8 i = 0;
- for(i=0; i<pPdu->len; i++)
- {
- VOS_Printf("%02x ",*((UINT8 *)(pPdu->pPdu)+i));
- }
- VOS_Printf("\n");
-
+{
return VOS_OK;
}
INT32 printfSdapNewInstance(SdapGlobalDtat_t *pGlobalData)
{
- VOS_Printf("\n**sdapCreateNewInstance**\n");
- VOS_Printf("upE1apId:%d\n",pGlobalData->upE1apId);
- VOS_Printf("sessNum:%d\n",pGlobalData->sessNum);
- UINT8 i = 0;
- UINT8 m = 0;
- UINT8 n = 0;
- VOS_Printf("sessId list:");
- for(i=0; i<pGlobalData->sessNum; i++)
- {
- VOS_Printf("%d,",pGlobalData->sessId[i]);
- }
- VOS_Printf("\n");
-
- UINT8 pduId = 0;
- for(i=0; i<pGlobalData->sessNum; i++)
- {
- pduId = pGlobalData->sessId[i];
- VOS_Printf("i:%d, sessId:%d, sessNum:%d\n",i,pduId,pGlobalData->sessNum);
- VOS_Printf("drbNum:%d\n",pGlobalData->sdapInstance[pduId].drbNum);
- VOS_Printf("drbId list:");
- for(m=0; m<pGlobalData->sdapInstance[pduId].drbNum; m++)
- {
- VOS_Printf("%d,",pGlobalData->sdapInstance[pduId].drbId[m]);
- }
- VOS_Printf("\n");
-
- VOS_Printf("\n******drbCfg*******\n");
-
- UINT8 j=0;
- UINT8 drbId = 0;
- UINT8 qfiNum = 0;
- for(n=0; n<pGlobalData->sdapInstance[pduId].drbNum; n++)
- {
- drbId = pGlobalData->sdapInstance[pduId].drbId[n];
- VOS_Printf("drbId:%d \n",drbId);
- VOS_Printf("drbCfg.drbId:%d\n",pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].drbId);
- VOS_Printf("drbCfg.sdapUlHead:%d\n",pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].sdapCfg.sdapUlHeaderInd);
- VOS_Printf("drbCfg.sdapDlHead:%d\n",pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].sdapCfg.sdapDlHeaderInd);
- VOS_Printf("drbCfg.defaultDrbInd:%d\n",pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].sdapCfg.defaultDrbInd);
- qfiNum = pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].qfiNum;
- VOS_Printf("drbCfg.qfiNum:%d\nqfi list:",qfiNum);
- for(j=0; j<qfiNum; j++)
- {
- VOS_Printf("%d ",pGlobalData->sdapInstance[pduId].drbCfg[drbId-1].qfi[j]);
- }
- VOS_Printf("\n");
- }
- }
-
return VOS_OK;
}
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "vos_types.h"
#include "vos_string.h"
#include "vos_linklist.h"
/* not used at the moment */
/*void pdcpuSetLessCountFun(const void* cpv_first, const void* cpv_second, void* pv_output)
-{
+{
assert(cpv_first != NULL && cpv_second != NULL && pv_output != NULL);
-
+
*(bool_t*)pv_output = (((PdcpuDataBuffNode_t *)cpv_first)->count) < (((PdcpuDataBuffNode_t *)cpv_second)->count) ? true : false;
}*/
}
VOS_Free(p);
p = NULL;
-
+
return ;
}
/*******************************************************************************
- * discard all stored PDCP PDUs in the transmitting buffer
+ * discard all stored PDCP PDUs in the transmitting buffer
* INPUT:
* pTxPduList: transmitting buffer list
* OUTPUT:
}
/*******************************************************************************
- * transmit or retransmit all stored PDCP PDUs in the transmitting buffer
+ * transmit or retransmit all stored PDCP PDUs in the transmitting buffer
* INPUT:
* pTxPduList: transmitting buffer list
* OUTPUT:
}
/*******************************************************************************
- * deliver the PDCP SDUs stored in the receiving buffer to upper layers
- * in ascending order of associated COUNT values
+ * deliver the PDCP SDUs stored in the receiving buffer to upper layers
+ * in ascending order of associated COUNT values
* INPUT:
* pTxPduList: transmitting buffer list
* OUTPUT:
/*******************************************************************************
- * To construct and send a PDCP status report
+ * To construct and send a PDCP status report
* INPUT:
* pPdcpuEntity: pdcpu entity
* OUTPUT:
}
/*******************************************************************************
- * To perform PDCP data recovery
+ * To perform PDCP data recovery
* INPUT:
* ueE1apId: UE E1AP ID
* drbId : DRB ID
if(PDCP_SN_SIZE_S12 == snCfg)
{
*pSn = LEN12BITS;
-
+
}else if(PDCP_SN_SIZE_S18 == snCfg)
{
*pSn = LEN18BITS;
-
+
}else
{
pdcpuLog(LOG_ERR,"[PDCPU] input sn size is wrong!\n");
return VOS_ERROR;
}
-
+
return VOS_OK;
}
case RLCMODE_TM:
pdcpuLog(LOG_ERR,"[PDCPU] input-TM MODE is wrong!\n");
return VOS_ERROR;
-
+
case RLCMODE_AM:
*pRlcMode = AM_MODE;
return VOS_OK;
}
/*******************************************************************************
- * To get SDAP DATA PDU header length configuration
+ * To get SDAP DATA PDU header length configuration
* INPUT:
- * sdapHeadInd :
- * sdapHeadLen :
+ * sdapHeadInd :
+ * sdapHeadLen :
* OUTPUT:
* none
*******************************************************************************/
if(SDAP_HEADER_PRESENT == sdapHeadInd)
{
*sdapHeadLen = 1; /*Data PDU with SDAP header*/
-
+
}else if(SDAP_HEADER_ABSENT == sdapHeadInd)
{
*sdapHeadLen = 0; /*Data PDU without SDAP header*/
-
+
}else
- {
+ {
pdcpuLog(LOG_ERR,"[PDCPU] sdap head cfg is wrong\n");
return VOS_ERROR;
}
-
+
return VOS_OK;
}
/*******************************************************************************
- * To create PDCP-U entity
+ * To create PDCP-U entity
* INPUT:
* ueE1apId: UE E1AP ID
* pDrbItem : DRB to setup item
* -1:failed
*******************************************************************************/
INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcTempDrbInfo_t *pDrbItem)
-{
- UINT8 drbId = pDrbItem->drbId;
+{
+ UINT8 drbId = pDrbItem->drbId;
PdcpuUeInfo_t *pPdcpUeInfo = NULL;
PdcpDrbEntity_t *pPdcpuEntity = NULL;
INT8 ret = 0;
pdcpuCheckUeIdx(ueIdx);
pdcpuCheckDrbId(drbId);
-
- /* examine ue info */
+
+ /* examine ue info */
if(NULL == gPdcpuUeInfo[ueIdx])
{
pPdcpUeInfo = VOS_Malloc(sizeof(PdcpuUeInfo_t), gPdcpuModuleId);
pdcpuNullCheck(pPdcpUeInfo);
VOS_MemZero(pPdcpUeInfo, sizeof(PdcpuUeInfo_t));
- gPdcpuUeInfo[ueIdx] = pPdcpUeInfo;
+ gPdcpuUeInfo[ueIdx] = pPdcpUeInfo;
}else
{
pPdcpUeInfo = gPdcpuUeInfo[ueIdx];
}
-
+
/* examine drb info */
if(NULL != pPdcpUeInfo->pdcpDrbEntity[drbId])
{
pPdcpuEntity = pPdcpUeInfo->pdcpDrbEntity[drbId];
- }
- pPdcpuEntity = VOS_Malloc(sizeof(PdcpDrbEntity_t), gPdcpuModuleId);
+ }
+ pPdcpuEntity = VOS_Malloc(sizeof(PdcpDrbEntity_t), gPdcpuModuleId);
pdcpuNullCheck(pPdcpuEntity);
VOS_MemZero(pPdcpuEntity, sizeof(PdcpDrbEntity_t));
pPdcpUeInfo->pdcpDrbEntity[drbId] = pPdcpuEntity;
-
+
PDCPConfiguration_t *pPdcpCfg = &(pDrbItem->pdcpConfig);
pPdcpuEntity->ueE1apId = ueE1apId;
pPdcpuEntity->ueIdx = ueIdx;
pdcpuLog(LOG_ERR,"[PDCPU] input parameter is wrong\n");
VOS_Free(pPdcpuEntity);
pPdcpUeInfo->pdcpDrbEntity[drbId] = NULL;
- return VOS_ERROR;
+ return VOS_ERROR;
}
-
+
/* set security enable information */
PdcpuSecEnableInfo_t *pEnableInfo = gPdcpuUeInfo[ueIdx]->secEnableInfo[pduSessionId];
- pdcpuNullCheck(pEnableInfo);
+ pdcpuNullCheck(pEnableInfo);
pPdcpuEntity->integrityProtection = pEnableInfo->integrityEnableFlag;
pPdcpuEntity->ciperingEnabled = pEnableInfo->cipherEnableFlag;
return VOS_OK;
}
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include <sys/time.h>
#include "vos_types.h"
#include "vos_linklist.h"
{
pduHeadLen = PDCP_SN_18_HEAD_LEN;
}else
- {
+ {
pdcpuLog(LOG_ERR,"[PDCPU] sn size is wrong!\n");
return VOS_ERROR;
}
packBits(&bit, 1, 1);
skipBits(&bit, 3, BIT_PACKED);
packBits(&bit, 4, ((sn & 0xf00)>>8));
- packBits(&bit, 8, sn & 0x0ff);
+ packBits(&bit, 8, sn & 0x0ff);
}else if(snSize == LEN18BITS)
{
if(sn >= MAX_PDCP_SN_18)
pdcpuLog(LOG_ERR,"[PDCPU] msgbHeadPush failed!\n");
return VOS_ERROR;
}
-
+
if(NULL != pPduHead)
- {
+ {
VOS_Free(pPduHead);
pPduHead= NULL;
}
-
+
return pduHeadLen;
}
* -1:failed
*******************************************************************************/
INT32 pdcpuDlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff, UINT8 sdapPduType)
-{
+{
UINT32 sn = 0;
INT8 pduHeadLen = 0;
PdcpSnSize_e snSize;
PdcpRlcMode_e rlcMode;
PdcpDrbEntity_t *pPdcpDrbEntity = NULL;
-
- UINT16 ueIdx;
+
+ UINT16 ueIdx;
if(VOS_ERROR == cuupGetUeIdx(ueE1apId, &ueIdx, &gPdcpuUeIdxTable))
{
pdcpuLog(LOG_ERR,"[PDCPU] get ueIdx failed,ueE1apId:%d\n",ueE1apId);
}
pdcpuCheckUeIdx(ueIdx);
pdcpuCheckDrbId(drbId);
-
+
pdcpuGetEntity(ueIdx, drbId, pPdcpDrbEntity);
pdcpuNullCheck(pPdcpDrbEntity);
rlcMode = pPdcpDrbEntity->rlcMode;
-
+
//1.check data
pdcpuNullCheck(pMsgBuff);
-
- //2.assign the sn
+
+ //2.assign the sn
UINT32 count = pPdcpDrbEntity->stateVar.txNext++;
// check out count wrapping around whether or not
pdcpuLog(LOG_ERR,"[PDCPU] count value is going to wrap around!\n");
return VOS_ERROR;
}
-
+
snSize = pPdcpDrbEntity->pdcpSnSizeDl;
if(snSize == LEN12BITS)
{
pdcpuLog(LOG_ERR,"[PDCPU] pack pdcp pdu head failed!\n");
return VOS_ERROR;
}
-
+
//8. 否则:cuf1u将数据发送成功后,释放
if(VOS_OK == cuf1uDlDataProc(ueE1apId, drbId, pMsgBuff, NULL))
{
pdcpuLog(LOG_ERR,"[PDCPU] cuf1u send failed\n");
return VOS_ERROR;
}
-
-}
+}
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "vos_types.h"
#include "vos_linklist.h"
#include "vos_module.h"
INT32 pdcpuUlInit(ULONG userModuleId)
{
gPdcpuUlModuleId = userModuleId;
-
+
return VOS_OK;
}
-INT32 pdcpuUnpackPduHead(MsgbBuff_t *pMsgBuff, PdcpSnSize_e snSize,
+INT32 pdcpuUnpackPduHead(MsgbBuff_t *pMsgBuff, PdcpSnSize_e snSize,
UINT8 *pPdutype, UINT32 *pSn)
-{
+{
BitOpt_t bit;
UINT8 *pMsgHead = msgbData(pMsgBuff);
UINT16 pduLen = msgbDataUsedLen(pMsgBuff);
initBits(&bit, pMsgHead, pduLen, 0);
*pPdutype = unpackBits(&bit, 1);
if(PDCP_CTRL_PDU == *pPdutype)
- {
+ {
//*pCtrlPduType = unpackBits(&bit, 3);
return 0;
-
+
}else if(PDCP_DATA_PDU == *pPdutype)
- {
+ {
if(LEN12BITS == snSize)
{
/*************D/C + 3R + PDCP SN = 16bits*************/
skipBits(&bit, 3, BIT_UNPACKED);
*pSn = unpackBits(&bit, LEN12BITS);
-
+
return PDCP_SN_12_HEAD_LEN;
-
+
}else if(LEN18BITS == snSize)
{
/*************D/C + 5R + PDCP SN =24bits*************/
skipBits(&bit, 5, BIT_UNPACKED);
*pSn = unpackBits(&bit, LEN18BITS);
-
+
return PDCP_SN_18_HEAD_LEN;
-
+
}else
{
pdcpuLog(LOG_ERR,"[PDCPU] sn size is wrong!\n");
UINT32 rcvdHFN = 0;
UINT32 rxDeliv = pStateVar->rxDelivery;
INT32 tmp = 0;
-
+
if(LEN12BITS == snSize)
{
tmp = GET_SN_12_SN(rxDeliv) - SN_12_WINDOW_SIZE;
rcvdHFN = GET_HFN_12_SN(rxDeliv);
}
pStateVar->rxCount = GET_COUNT_12_SN(rcvdHFN, rcvdSn);
-
+
}else if(LEN18BITS == snSize)
{
tmp = GET_SN_18_SN(rxDeliv) - SN_18_WINDOW_SIZE;
if(rcvdSn < tmp)
{
rcvdHFN = GET_HFN_18_SN(rxDeliv) + 1;
-
+
}else if(rcvdSn >= GET_SN_18_SN(rxDeliv) + SN_18_WINDOW_SIZE)
{
- rcvdHFN = GET_HFN_18_SN(rxDeliv) - 1;
+ rcvdHFN = GET_HFN_18_SN(rxDeliv) - 1;
}else
{
rcvdHFN = GET_HFN_18_SN(rxDeliv);
}
- pStateVar->rxCount = GET_COUNT_18_SN(rcvdHFN, rcvdSn);
+ pStateVar->rxCount = GET_COUNT_18_SN(rcvdHFN, rcvdSn);
}else
{
pdcpuLog(LOG_ERR,"[PDCPU] sn size is wrong!\n");
return VOS_ERROR;
}
-
+
return VOS_OK;
}
{
pdcpuMsgbFree(pMsgBuff);
- return VOS_OK;
+ return VOS_OK;
}
INT32 pdcpuDelivUldata(PdcpDrbEntity_t *pDrbEntity)
{
- /* traverse list and send data to SDAP */
+ /* traverse list and send data to SDAP */
struct cl_lib_listnode *pNode = NULL;
PdcpuDataBuffNode_t *pDataInBuff1 = NULL;
PdcpuDataBuffNode_t *pDataInBuff2 = NULL;
UINT32 count = 0;
-
- pNode = cl_lib_listhead(pDrbEntity->pRxSduList);
+
+ pNode = cl_lib_listhead(pDrbEntity->pRxSduList);
if(NULL == pNode)
{
/* There is no data in buffer */
VOS_Printf("there is no data in buffer\n");
return VOS_OK;
}
- pDataInBuff1 = (PdcpuDataBuffNode_t *)cl_lib_getdata(pNode);
+ pDataInBuff1 = (PdcpuDataBuffNode_t *)cl_lib_getdata(pNode);
if(pDataInBuff1->count == pDrbEntity->stateVar.rxDelivery)
- {
+ {
while(pNode)
- {
+ {
cl_lib_nextnode (pNode);
count = pDataInBuff1->count;
-
- /*+++++++++++++++++++++++++++test+++++++++++++++++++++++++++*/
+
+ /*+++++++++++++++++++++++++++test+++++++++++++++++++++++++++*/
//VOS_Printf("\n[pdcp ul data] pdcpuDelivUldata ueIdx:%d ueE1apId:%d drbId:%d count:%d \n",
// pDrbEntity->ueIdx,pDrbEntity->ueE1apId,pDrbEntity->drbId,count);
- //printfMsgbBuff(pDataInBuff1->pData);
+ //printfMsgbBuff(pDataInBuff1->pData);
/*---------------------------test----------------------------*/
-
+
/* delivery to sdap,if sdapUlDataProc return VOS_OK,free the data
else, also free the data */
sdapUlDataProc(pDrbEntity->ueE1apId,pDrbEntity->pduSessionId,pDrbEntity->drbId,pDataInBuff1->pData);
-
+
/* update stateVar */
pDrbEntity->stateVar.rxDelivery = count + 1;
-
+
/* delete rx buffer */
cl_lib_listnode_delete(pDrbEntity->pRxSduList, pDataInBuff1);
pdcpuFreeDataBuffNode(pDataInBuff1);
-
+
if(NULL == pNode)
{
/* There is no more data in buffer */
return VOS_OK;
}
- pDataInBuff2 = (PdcpuDataBuffNode_t *)cl_lib_getdata(pNode);
+ pDataInBuff2 = (PdcpuDataBuffNode_t *)cl_lib_getdata(pNode);
if(NULL == pDataInBuff2)
{
/* There is no more data in buffer */
pdcpuLog(LOG_ERR,"[PDCPU] data is null\n");
return VOS_ERROR;
}
-
+
if(pDataInBuff2->count == count + 1)
{
/* The data is continuously */
pDataInBuff1 = pDataInBuff2;
-
+
}else if(pDataInBuff2->count > count + 1)
- {
+ {
/* The data is not continuously */
- return VOS_OK;
+ return VOS_OK;
}else
- {
+ {
pdcpuLog(LOG_ERR,"[PDCPU] out of order in receiving buffer!\n");
return VOS_ERROR;
}
-
+
}
return VOS_OK;
pdcpuLog(LOG_ERR,"[PDCPU] rxbuff is wrong!\n");
return VOS_ERROR;
}
-
+
return VOS_OK;
}
* -1:failed
*******************************************************************************/
INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff)
-{
+{
UINT8 pduType = 0;
UINT32 rcvdSn = 0;
UINT32 count = 0;
PdcpSnSize_e snSize;
PdcpDrbEntity_t *pPdcpDrbEntity = NULL;
PdcpStateVar_t *pStateVar = NULL;
-
+
pdcpuNullCheck(pMsgBuff);
UINT8 *pMsgHead = msgbData(pMsgBuff);
UINT16 pduLen = msgbDataUsedLen(pMsgBuff);
pdcpuLog(LOG_ERR,"[PDCPU] data len is too small!\n");
return VOS_ERROR;
}
-
+
if(VOS_ERROR == cuupGetUeIdx(ueE1apId, &ueIdx, &gPdcpuUeIdxTable))
{
pdcpuLog(LOG_ERR,"[PDCPU] add ueE1apId failed\n");
pdcpuNullCheck(pPdcpDrbEntity);
snSize = pPdcpDrbEntity->pdcpSnSizeUl;
pStateVar = &pPdcpDrbEntity->stateVar;
-
+
/* get pdcp pdu type */
BitOpt_t bit;
initBits(&bit, pMsgHead, pduLen, 0);
pdcpuMsgbFree(pMsgBuff);
return VOS_ERROR;
}
-
+
//make sure received HFN and received Count
if(VOS_ERROR == pdcpuDecideCountAndHFN(pStateVar, rcvdSn, snSize))
{
pdcpuMsgbFree(pMsgBuff);
return VOS_ERROR;
}
-
+
count = pStateVar->rxCount;
-
+
//2.deciphering : except pdcp pdu head, the SDAP header and the SDAP Control PDU
//get sdap pdu type
BitOpt_t SdapHeadbit;
pdcpuLog(LOG_ERR,"[PDCPU] ul proc failed\n");
return VOS_ERROR;
}
-
-
+
+
}
return VOS_OK;
}
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "vos_types.h"
#include "vos_string.h"
#include "vos_lib.h"
/*******************************************************************************
-* To
+* To
* INPUT:
-* :
+* :
* OUTPUT:
* 0:success
* -1:fail
-*******************************************************************************/
+*******************************************************************************/
INT32 pdcpuInit(ULONG userModuleId)
-{
+{
/* get pdcpu moduleId */
gPdcpuModuleId = userModuleId;
{
gPdcpuUeInfo[i] = NULL;
}
-
+
return VOS_OK;
}
VOS_Free(pDrbSecInfo);
gPdcpuUeInfo[ueIdx]->secInfo = NULL;
}
-
+
return VOS_OK;
}
/*******************************************************************************
* To deal with security indication
-* Security Result indicates whether the security policy indicated as "preferred"
+* Security Result indicates whether the security policy indicated as "preferred"
* in the Security Indication IE is performed or not.
* INPUT:
* ueE1apId : UE E1AP ID
* OUTPUT:
* 0:success
* -1:fail
-*******************************************************************************/
+*******************************************************************************/
INT32 pdcpuDealSecurityInd(PdcpuSecInfo_t *pSec, PdcpuSecEnableInfo_t *pEnableInfo, SecuInd_t *pSecInd, PdcpuCfgResult_t *pResult)
{
/* get security enable information global variable */
pdcpuNullCheck(pSec);
pdcpuNullCheck(pEnableInfo);
pdcpuNullCheck(pSecInd);
-
+
/* for integrity protection */
if(ACTIVE_INT_STATE == pSec->intActiveFlag)
{
pEnableInfo->integrityEnableFlag = TRUE;
pEnableInfo->maxIPDataRate = pSecInd->maxIPdataRate;
pResult->secResPresent = FALSE;
-
+
}else if(IP_PREFERRED == pSecInd->IPIndication)
- {
+ {
pEnableInfo->integrityEnableFlag = TRUE;
pEnableInfo->maxIPDataRate = pSecInd->maxIPdataRate;
pResult->secResPresent = TRUE;
pResult->secuResult.integrityProtectionResult= IP_RESULT_PERFORMED;
-
+
}else
{
pEnableInfo->integrityEnableFlag = FALSE;
pResult->secResPresent = FALSE;
-
+
}
-
+
}else
- {
+ {
/* integrity protection is inactive for the UE */
- pEnableInfo->integrityEnableFlag = FALSE;
+ pEnableInfo->integrityEnableFlag = FALSE;
if(IP_PREFERRED == pSecInd->IPIndication)
- {
+ {
pResult->secResPresent = TRUE;
- pResult->secuResult.integrityProtectionResult= IP_RESULT_NOT_PERFORMED;
+ pResult->secuResult.integrityProtectionResult= IP_RESULT_NOT_PERFORMED;
}
}
-
+
/* for ciphering */
if(ACTIVE_ENC_STATE == pSec->encActiveFlag)
{
/* ciphering is active for the UE, apply the indication */
if(CP_REQUIRED == pSecInd->CPIndication)
{
- pEnableInfo->cipherEnableFlag = TRUE;
+ pEnableInfo->cipherEnableFlag = TRUE;
pResult->secResPresent = FALSE;
-
+
}else if(CP_PREFERRED == pSecInd->CPIndication)
{
pEnableInfo->cipherEnableFlag = TRUE;
pResult->secResPresent = TRUE;
pResult->secuResult.confidentialityProtectionResult = CP_RESULT_PERFORMED;
-
+
}else
{
pEnableInfo->cipherEnableFlag = FALSE;
pResult->secResPresent = FALSE;
-
+
}
-
+
}else
- {
+ {
/* ciphering is inactive for the UE */
- pEnableInfo->cipherEnableFlag = FALSE;
+ pEnableInfo->cipherEnableFlag = FALSE;
if(CP_PREFERRED == pSecInd->CPIndication)
- {
+ {
pResult->secResPresent = TRUE;
- pResult->secuResult.confidentialityProtectionResult= CP_RESULT_NOT_PERFORMED;
+ pResult->secuResult.confidentialityProtectionResult= CP_RESULT_NOT_PERFORMED;
}
}
-
+
return VOS_OK;
}
}
pResult->drbSetupFailNum = pCfgInfo->drbSetupNum;
pResult->pduSessionCause = RNL_UNSPECIFIED;
-
+
}
-
+
return VOS_ERROR;
}
/*******************************************************************************
-* To deal with PDU session to setup config
+* To deal with PDU session to setup config
* INPUT:
* ueE1apId : UE E1AP ID
* pPduSessionCfg : PDU session to setup config
* pResult : PDU session to setup result
* OUTPUT:
* none
-*******************************************************************************/
+*******************************************************************************/
INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pResult)
{
upcTempSessInfo_t *pSetupInfo = (upcTempSessInfo_t *)pCfgInfo;
PdcpuSecEnableInfo_t *pEnableInfo = NULL;
UINT16 pduSessionId = pSetupInfo->pduSessId;
- pResult->pduSessionId = pduSessionId;
+ pResult->pduSessionId = pduSessionId;
/* get ueIdx */
- UINT16 ueIdx;
+ UINT16 ueIdx;
if(VOS_ERROR == cuupAddUeE1apid(ueE1apId, &ueIdx, &gPdcpuUeIdxTable))
{
pdcpuLog(LOG_ERR,"[PDCPU] add ueE1apId failed\n");
/* check ue and security context block */
if((NULL == gPdcpuUeInfo[ueIdx]) || (NULL == gPdcpuUeInfo[ueIdx]->secInfo))
- {
+ {
pdcpuLog(LOG_ERR,"[PDCPU] ue and security context block not exist\n");
return pdcpuRetFailResult(PDU_SESSION_ADD,pCfgInfo,pResult);
}
pSec = gPdcpuUeInfo[ueIdx]->secInfo;
-
+
/* alloc pdu session information */
pEnableInfo = gPdcpuUeInfo[ueIdx]->secEnableInfo[pduSessionId];
if(NULL == pEnableInfo)
}
pEnableInfo->pduSessionId = pduSessionId;
- /* deal with security indication */
+ /* deal with security indication */
if(VOS_ERROR == pdcpuDealSecurityInd(pSec, pEnableInfo, &pSetupInfo->secuIndi, pResult))
{
pdcpuLog(LOG_ERR,"[PDCPU] deal security indication failed\n");
return pdcpuRetFailResult(PDU_SESSION_ADD,pCfgInfo,pResult);
}
-
+
/* create pdcp entity */
- UINT8 i = 0;
+ UINT8 i = 0;
for(i = 0; i < pSetupInfo->drbSetupNum; i++)
{
pDrbTemp = &pSetupInfo->pTempDrbSetupList[i];
-
+
if((NULL == pDrbTemp) || (FALSE == pDrbTemp->drbSetupAllowed))
{
continue;
}
-
+
if(VOS_OK == pdcpuCreateEntity(ueE1apId, ueIdx, pduSessionId, pDrbTemp))
{
pResult->drbSetupSuccessArray[pResult->drbSetupSuccessNum] = pDrbTemp->drbId;
pResult->drbSetupSuccessNum += 1;
}else
- {
+ {
pResult->drbSetupFailedArray[pResult->drbSetupFailNum].drbId = pDrbTemp->drbId;
pResult->drbSetupFailedArray[pResult->drbSetupFailNum].cause = RNL_PDCP_CONFIG_NOT_SUPPORT;
pResult->drbSetupFailNum += 1;
-
+
}
}
}
/*******************************************************************************
- * To manage pdcp-u entity
+ * To manage pdcp-u entity
* INPUT:
* ueE1apId : UE E1AP ID
* pPduSessionCfg : PDU Session Resource to setup item
* result: PDCP config result
*******************************************************************************/
INT32 pdcpuConfig(UINT64 ueE1apId, VOID *pCfgInfo, UpcCfgType_e cfgType, PdcpuCfgResult_t *pResult)
-{
+{
switch(cfgType)
{
case PDU_SESSION_ADD:
VOS_MemZero(pResult, sizeof(PdcpuCfgResult_t));
pResult->cfgType = cfgType;
return pdcpuSessionAddProc(ueE1apId, pCfgInfo, pResult);
- }
+ }
default:
{
pdcpuLog(LOG_ERR,"[PDCPU] cfgType error\n");
*******************************************************************************/
PdcpuSecInfo_t *pdcpuAllocUeSecInfo(UINT16 ueIdx)
{
- PdcpuSecInfo_t *pSecInfo = NULL;
+ PdcpuSecInfo_t *pSecInfo = NULL;
PdcpuUeInfo_t *pPdcpUeInfo = NULL;
//check ue
if(NULL == gPdcpuUeInfo[ueIdx])
- {
+ {
pPdcpUeInfo = VOS_Malloc(sizeof(PdcpuUeInfo_t), gPdcpuModuleId);
pdcpuNullCheckRp(pPdcpUeInfo);
VOS_MemZero(pPdcpUeInfo, sizeof(PdcpuUeInfo_t));
}
//check secInfo
if(NULL == pPdcpUeInfo->secInfo)
- {
+ {
pSecInfo = VOS_Malloc(sizeof(PdcpuSecInfo_t), gPdcpuModuleId);
pdcpuNullCheckRp(pSecInfo);
VOS_MemZero(pSecInfo, sizeof(PdcpuSecInfo_t));
}
VOS_MemZero(pSecInfo, sizeof(PdcpuSecInfo_t));
-
+
return pSecInfo;
}
/*******************************************************************************
- * To set ue security parameters. When receiving security information,
- * pdcp-u shall save AS keys, AS algorithm and active integrity and ciphering.
+ * To set ue security parameters. When receiving security information,
+ * pdcp-u shall save AS keys, AS algorithm and active integrity and ciphering.
* INPUT:
* ueE1apId: UE E1AP ID
* secInfo: security information
INT32 pdcpuSetSecParam(UINT64 ueE1apId, SecuInfo_t *secInfo)
{
pdcpuNullCheck(secInfo);
-
- UINT16 ueIdx;
+
+ UINT16 ueIdx;
if(VOS_ERROR == cuupAddUeE1apid(ueE1apId, &ueIdx, &gPdcpuUeIdxTable))
{
pdcpuLog(LOG_ERR,"[PDCPU] add ueE1apId failed\n");
return VOS_ERROR;
}
-
+
/* find ue security struct */
PdcpuSecInfo_t *pDrbSecInfo = pdcpuAllocUeSecInfo(ueIdx);
pdcpuNullCheck(pDrbSecInfo);
-
+
/* activate integrity */
if(secInfo->secuAlgorithm.bitMask & SECURITY_ALGORITHM_INTERGRITY_PROTECTION_ALGORITHM)
- {
+ {
UINT8 intAlgorithm = secInfo->secuAlgorithm.integrityProtectionAlgorithm;
UINT8 *pIntKey = secInfo->upSecukey.integrityProtectionKey.buffer;
UINT8 intKeyLen = secInfo->upSecukey.integrityProtectionKey.size; /* 128 bits */
pdcpuFreeSecInfo(ueIdx);
return VOS_ERROR;
}
-
+
pDrbSecInfo->intActiveFlag = ACTIVE_INT_STATE; /* 0-inactive, 1-active */
if(intAlgorithm == NIA0 || intAlgorithm == NIA1 || intAlgorithm == NIA2)
{
pDrbSecInfo->intActiveFlag = INACTIVE_INT_STATE;
pdcpuLog(LOG_INFO,"[PDCPU] integrity is not config\n");
}
-
- /* activate encryption */
+
+ /* activate encryption */
UINT8 encAlgorithm = secInfo->secuAlgorithm.cipheringAlgorithm;
UINT8 *pEncKey = secInfo->upSecukey.encryptionKey.buffer;
UINT8 encKeyLen = secInfo->upSecukey.encryptionKey.size; /* 128 bits */
pDrbSecInfo->encActiveFlag = ACTIVE_ENC_STATE; /* 0-inactive, 1-active */
if(encAlgorithm == NEA0 || encAlgorithm == NEA1 || encAlgorithm == NEA2)
- {
- pDrbSecInfo->encAlgorithm = encAlgorithm;
+ {
+ pDrbSecInfo->encAlgorithm = encAlgorithm;
VOS_MemCpy(pDrbSecInfo->kUpEnc, pEncKey, AS_KEY_LEN); /* 128 bits */
}else
{
- pDrbSecInfo->encActiveFlag = INACTIVE_ENC_STATE;
+ pDrbSecInfo->encActiveFlag = INACTIVE_ENC_STATE;
pdcpuLog(LOG_ERR,"[PDCPU] encryption algorithm:%d, is not supported!\n", encAlgorithm);
pdcpuFreeSecInfo(ueIdx);
return VOS_ERROR;
pDrbSecInfo->ueE1apId = ueE1apId;
pDrbSecInfo->ueIdx = ueIdx;
pDrbSecInfo->nhInd = FALSE;
-
+
return VOS_OK;
}
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "sdapCore.h"
SdapGlobalDtat_t s_SdapGlobalData[UPC_MAX_UE_NUM] = {{0}};
{
int i = 0;
int j = 0;
-
+
for(i = 0; i < pGlobalData->sessNum; i++)
{
if(i == idx)
{
continue;
}
-
+
qosFlowId = pTempQos->qosFlowId;
- pDrbCfg->qfi[pDrbCfg->qfiNum] = qosFlowId;
+ pDrbCfg->qfi[pDrbCfg->qfiNum] = qosFlowId;
pDrbCfg->qosFlowInfo[qosFlowId].qosFlowLevelQosPar = pTempQos->qosPara;
if(pTempQos->qosMapFlag)
{
{
return VOS_ERROR;
}
-
+
return VOS_OK;
}
{
continue;
}
-
+
drbId = pTempDrb->drbId;
if(VOS_OK != sdapCreateQosInfo(&pInstance->drbCfg[drbId - 1], pTempDrb, &pCfgRet->actDrbCfg[drbId - 1]))
VOS_MemCpy(&pInstance->drbCfg[drbId - 1].sdapCfg, &pTempDrb->sdapConfig, sizeof(SdapCfg_t));
- pInstance->drbCfg[drbId - 1].drbId = drbId;
+ pInstance->drbCfg[drbId - 1].drbId = drbId;
pInstance->drbId[pInstance->drbNum] = drbId;
pInstance->drbNum++;
}
if(0 == pCfgRet->actDrbNum)
- {
+ {
pCfgRet->sessFailCause = RNL_UNSPECIFIED;
return VOS_ERROR;
}
INT32 sdapCreateNewInstance
(
- SdapGlobalDtat_t *pGlobalData,
- UINT64 upE1apId,
- upcTempSessInfo_t *pSessTempInfo,
+ SdapGlobalDtat_t *pGlobalData,
+ UINT64 upE1apId,
+ upcTempSessInfo_t *pSessTempInfo,
sdapSessCfgRet_t *pCfgRet
)
{
int idx = 0;
UINT64 sessId = 0;
-
+
pGlobalData->upE1apId = upE1apId;
sessId = pSessTempInfo->pduSessId;
idx = pGlobalData->sessNum;
pGlobalData->sessId[idx] = sessId;
pGlobalData->sessNum++;
- printfSdapNewInstance(pGlobalData);
-
+ printfSdapNewInstance(pGlobalData);
+
return VOS_OK;
}
if(sessId == pGlobalData->sessId[i])
{
sdapDeleteDrbInfo(&pGlobalData->sdapInstance[sessId], drbId);
-
+
return VOS_OK;
}
}
return VOS_OK;
}
#endif
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "sdapCore.h"
#include "msgb.h"
#include "bitsPack.h"
for(i = 0; i < pSdapInstance->drbNum; i++)
{
drbId = pSdapInstance->drbId[i];
-
+
VOS_MemCpy(&sdapDrbCfg, &pSdapInstance->drbCfg[drbId - 1], sizeof(SdapDrbCfg_t));
for(j = 0; j < sdapDrbCfg.qfiNum; j++)
for(i = 0; i < pSdapInstance->drbNum; i++)
{
drbId = pSdapInstance->drbId[i];
-
+
/* 一个实例,即一个会话内,有且只有一个默认的DRB */
if(DEFAULT_DRB_TRUE == pSdapInstance->drbCfg[drbId - 1].sdapCfg.defaultDrbInd)
{
*pFlag = 1;
break;
}
- }
+ }
}
return VOS_OK;
p = msgbHeadPush(pMsgBuff, pduHeadLen);
VOS_MemCpy(p, &sdapHeader, pduHeadLen);
-
+
return pduHeadLen;
}
SdapGlobalDtat_t *pGlobalData = NULL;
SdapInstance_t *pSdapInstance = NULL;
UINT8 *pMsgHead = NULL;
-
+
if(NULL == pMsgBuff)
{
return VOS_ERROR;
{
return VOS_ERROR;
}
-
+
/*传递到PDCP-U*/
pdcpuDlDataProc(upE1apId, drbId, pMsgBuff, 1);
{
BitOpt_t bit;
UINT32 bitSize = 0;
-
+
UINT8 *pMsgHead = msgbData(pMsgBuff);
UINT16 pduLen = msgbDataUsedLen(pMsgBuff);
sdapUlHeader_t *pHead = NULL;
UINT8 qosFlowId = 0xff;
UINT8 pduType = 0;
-
+
SdapGlobalDtat_t *pGlobalData = NULL;
SdapInstance_t *pSdapInstance = NULL;
SdapDrbCfg_t *pDrbCfgInfo = NULL;
{
return VOS_ERROR;
}
-
+
/* Get Instance */
pGlobalData = sdapGetUeGlobalData(upE1apId, &flag);
/* get instance */
for(i = 0; i < pGlobalData->sessNum; i++)
- {
+ {
if(sessId == pGlobalData->sessId[i])
{
pSdapInstance = &pGlobalData->sdapInstance[sessId];
/* qfi not found */
return VOS_ERROR;
}
-
+
}
-
+
/* 调用NG-U的上行数据处理接口 */
return nguUlDataProc(upE1apId, sessId, qosFlowId, pMsgBuff);
}
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv)
{
UCHAR *pInt = NULL;
-
+
struct option long_options[] =
{
{"startup-item", required_argument, 0, 'i' },
{"help", no_argument, 0, 'h' },
{0, 0, 0, 0 }
};
-
+
while (1)
{
int option_index = 0;
{
break;
}
-
+
switch (c)
{
case 'i':
pInt = (UCHAR *)cuupUnSocketPath;
break;
- case 'v':
+ case 'v':
exit(0);
break;
case 'h':
default:
return VOS_OK;
}
-
+
if (pInt && optarg)
{
sscanf(optarg, "%s", pInt);
VOS_Printf("unSocketPath: %s\n", cuupUnSocketPath);
}
}
-
+
return VOS_OK;
}
void cuupAppSigHandler(int sig)
-{
+{
VOS_Printf("\r\nReceive signal:%d\r\n",sig);
-
+
if(SIGSEGV == sig)
{
if(shm_unlink(CUUP_SHM_FILE) < 0)
{
VOS_Printf("Du_shm Delete CUUP_SHM_FILE shared memory failed !\n ");
return;
- }
+ }
}
return;
}
INT32 main(int argc,INT8 **argv)
{
/*check para*/
-
+
CHECK_FUNCTION_RET(cuupGetSetUpPara(argc,argv));
/*init cucp global var*/
CHECK_FUNCTION_RET(cuupAppGlobalVarInit());
-
+
/*platform init*/
CHECK_FUNCTION_RET(cuupAppPlatformInit(argv));
-
+
/*register signal*/
CHECK_FUNCTION_RET(cuupAppregisterSignal());
/*VOS_TaskInfoAttach 必须在main函数里调用*/
-
+
/*omadp vos task create*/
CHECK_FUNCTION_RET(cuupAppOmadpModuleInit());
-
+
while(1)
{
sleep(5000);
- }
+ }
return 0;
}
-
-
-
-
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __BITS_PACK_H__
#define packBits(pBit,n,value) packBitsWithdebug(pBit, n, value,(UCHAR *)__func__,__LINE__)
#endif
-
-
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
extern int opt_debug;
fprintf(stderr, " (%s:%d)\n", \
__FILE__, __LINE__); \
} while(0)
-
-/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+/******************************************************************************
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef _CU_COMMON_H_
#define _CU_COMMON_H_
typedef enum
{
MODULE_OM,
- MODULE_CUCP_E1,
+ MODULE_CUCP_E1,
MODULE_CUUP_E1 ,
MODULE_NG,
MODULE_Xn,
- MODULE_F1_C,
+ MODULE_F1_C,
MODULE_CUC,
MODULE_RRC,
MODULE_PDCP_C,
MODULE_SDAP,
MODULE_F1_U,
MODULE_F1_GTPU,
-
+
}CuModule_e;
typedef enum CuCpVosTask
{
- CUCP_OMADP_VOS_TASK,
+ CUCP_OMADP_VOS_TASK,
CUC_VOS_TASK,
CUCP_NG_C_VOS_TASK,
CUCP_F1_C_VOS_TASK,
#ifdef AMF_TEST
AMF_VOS_TASK,
#endif
- CP_MAX_VOS_TASK
+ CP_MAX_VOS_TASK
}CuCpVosTask_e;
typedef enum CuUpVosTask
{
- UP_OMADP_VOS_TASK,
+ UP_OMADP_VOS_TASK,
UP_DL_VOS_TASK,
UP_UL_VOS_TASK,
UP_GTPU_VOS_TASK,
- UP_MAX_VOS_TASK
+ UP_MAX_VOS_TASK
}CuUpVosTask_e;
typedef enum
CUUP_F1GTPU_UL_TASK,
/*注意:请新增任务定义在注释中间*/
CUUP_GTPU_USER_TASK,
- CUUP_PDCPU_USER_TASK,
- CUUP_SDAP_USER_TASK,
-
-
+ CUUP_PDCPU_USER_TASK,
+ CUUP_SDAP_USER_TASK,
+
+
/*注意:请新增任务定义在注释中间*/
CUUP_END_USER_TASK=400,
}CuupUserTask_e;
-typedef struct
+typedef struct
{
UINT8 cuName[MAX_CU_NAME_LEN]; /* CU Name */
UINT32 nodeID;
IpAddress_t amfIpAddr;
IpAddress_t umfIpAddr;
-
+
IpAddress_t cucpF1SctpIpAddr;
IpAddress_t cuupF1GtpuIpAddr;
IpAddress_t duF1SctpIpAddr;
IpAddress_t duF1GtpuIpAddr;
-
+
IpAddress_t cucpE1SctpIpAddr;
IpAddress_t cuupE1SctpIpAddr;
-
+
IpAddress_t cucpNgSctpIpAddr;
- IpAddress_t cuupNgGtpuIpAddr;
+ IpAddress_t cuupNgGtpuIpAddr;
IpAddress_t cuXnSctpIpAddr;
}CuCommCfg_t;
-typedef struct
+typedef struct
{
UINT8 NodeBName[MAX_CU_NAME_LEN];
UINT32 procId;
CuCommCfg_t commCfg;
UINT8 cuStackState;
UINT8 omState;
-
+
UINT8 printDebug;
UINT8 printLevel;
UINT8 interLogFlag;
-
+
} CuCtrlBlock_t;
typedef struct
NrCellId_t CellId[MAX_CELL_NUM];
}CellIdList_t;
-typedef struct oamCuUpNetElementActReq
+typedef struct oamCuUpNetElementActReq
{
UINT8 actCellNum;
- CellIdList_t cellIdList;
+ CellIdList_t cellIdList;
} OamCuUpNetElementActReq_t;
-typedef struct oamCuUpCellActRsp
+typedef struct oamCuUpCellActRsp
{
UINT8 successCellNum;
UINT8 failCellNum;
NrCellId_t failCellId[MAX_CELL_NUM];
} OamCuUpCellActRsp_t;
-typedef struct oamCuCpNetElementActReq
+typedef struct oamCuCpNetElementActReq
{
- UINT8 cuCpNetElementAct[MAX_CELL_NUM];
+ UINT8 cuCpNetElementAct[MAX_CELL_NUM];
} OamCuCpNetElementActReq_t;
-typedef struct oamCuCpCellActRsp
+typedef struct oamCuCpCellActRsp
{
- UINT8 cuCpCellActFlag[MAX_CELL_NUM];
+ UINT8 cuCpCellActFlag[MAX_CELL_NUM];
} OamCuCpCellActRsp_t;
typedef enum
SRB1 = 1,
SRB2 = 2,
SRB3 = 3,
-
+
}SRB_e;
-
+
#ifdef __cplusplus
}
#endif
-
-#endif /* _CU_COMMON_H_*/
-
-
+#endif /* _CU_COMMON_H_*/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __CUMODULECOMMONH__
/* gNB Identity */
typedef UINT32 gNBId_t;
-typedef struct
+typedef struct
{
PlmnId_t plmnId;
gNBId_t gNBId;
UINT8 bitStringSize; /* bit string size in bytes */
}TransLayerAddr_t;
-typedef struct secuResult
+typedef struct secuResult
{
IPResult_e integrityProtectionResult;
CPResult_e confidentialityProtectionResult;
} SecuResult_t;
-typedef struct gtpTunnel
+typedef struct gtpTunnel
{
TransLayerAddr_t transLayerAddr;
GtpTeid_t gtpTeid;
} GtpTunnel_t;
-typedef struct upTransLayerInfo
+typedef struct upTransLayerInfo
{
GtpTunnel_t gtpTunnel;
} UpTransLayerInfo_t;
}SecuInd_t;
#define PRIORITY_LEVEL_QOS_PRESENT (1 << 0)
-#define NON_DYNAMIC_AVERAGING_WINDOW_PRESENT (1 << 1)
-#define NON_DYNAMIC_MAX_DATA_BURST_VOLUME (1 << 2)
-typedef struct nonDynamic5QIDescr
+#define NON_DYNAMIC_AVERAGING_WINDOW_PRESENT (1 << 1)
+#define NON_DYNAMIC_MAX_DATA_BURST_VOLUME (1 << 2)
+typedef struct nonDynamic5QIDescr
{
UINT16 bitMask;
INT64 fiveQI;
INT64 perScalar;
INT64 perExponent;
}PackErrorRate_t;
-
+
#define FIVEQI_PRESENT (1 << 0)
#define DELAY_CRITICAL_PRESENT (1 << 1)
#define DYNAMIC_AVERAGING_WINDOW_PRESENT (1 << 2)
#define DYNAMIC_MAX_DATA_BURST_VOLUME (1 << 3)
-typedef struct dynamic5QIDescr
+typedef struct dynamic5QIDescr
{
UINT16 bitMask;
INT64 priorityLevelQos;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __CUMODULEENUMH__
#define __CUMODULEENUMH__
NEW_SECURITY_CONTEXT_IND_TRUE = 0
}NewSecurityCtxInd_e;
-typedef enum
+typedef enum
{
TIME_WAIT_1S = 0,
TIME_WAIT_2S = 1,
CRITICALITY_NOTIFY = 2
} Criticality_e;
-typedef enum
+typedef enum
{
ERROR_NOT_UNDERSTOOD = 0,
ERROR_MISSING = 1
} ErrorType_e;
-typedef enum
+typedef enum
{
CN_SUPPORT_EPC = 0,
CN_SUPPORT_5GC = 1,
Pdu_Session_Type_unstructured = 4
} PduSessType_e;
-typedef enum iPIndication
+typedef enum iPIndication
{
IP_REQUIRED = 0,
IP_PREFERRED = 1,
IP_NOT_NEEDED = 2
} IPIndication_e;
-typedef enum cPIndication
+typedef enum cPIndication
{
CP_REQUIRED = 0,
CP_PREFERRED = 1,
CP_NOT_NEEDED = 2
} CPIndication_e;
-typedef enum maxIpDataRate
+typedef enum maxIpDataRate
{
BITRATE_64K = 0,
MAX_UE_RATE = 1
} MaxIpDataRate_e;
-typedef enum iPResult
+typedef enum iPResult
{
IP_RESULT_PERFORMED = 0,
IP_RESULT_NOT_PERFORMED = 1
} IPResult_e;
-typedef enum cPResult
+typedef enum cPResult
{
CP_RESULT_PERFORMED = 0,
CP_RESULT_NOT_PERFORMED = 1
} CPResult_e;
-typedef enum
+typedef enum
{
Dynamic5QIDelayCritical_delay_critical = 0,
Dynamic5QIDelayCritical_non_delay_critical = 1
} Dynamic5QIDelayCritical_e;
-typedef enum
+typedef enum
{
PreEmptionCapability_shall_not_trigger_pre_emption = 0,
PreEmptionCapability_may_trigger_pre_emption = 1
} PreEmptionCapability_e;
-typedef enum
+typedef enum
{
PreEmptionVulnerability_not_pre_emptable = 0,
PreEmptionVulnerability_pre_emptable = 1
typedef enum
{
- QOS_CHARACTER_PR_NOTHING,
+ QOS_CHARACTER_PR_NOTHING,
QOS_CHARACTER_PR_NON_DINAMIC_5QI,
QOS_CHARACTER_PR_DYNAMIC_5QI,
QOS_CHARACTER_PR_CHOICE_EXTENSION
***********************************************************************************/
typedef enum ngapCause_s
-{
+{
NG_START,
Ng_RNL_UNSPECIFIED,
Ng_RNL_TXnRELOCOverallExpiry,
NG_RNL_NO_RADIO_RESOURCES_AVAILABLE_IN_TARGET_CELL,
NG_RNL_UNKNOWN_LOCAL_UE_NGAP_ID,
NG_RNL_INCONSISTENT_REMOTE_UE_NGAP_ID,
- NG_RNL_HANDOVER_DESIRABLE_FOR_RADIO_REASONS,
+ NG_RNL_HANDOVER_DESIRABLE_FOR_RADIO_REASONS,
NG_RNL_TIME_CRITICAL_HANDOVER,
NG_RNL_RESOURCE_OPTIMISATION_HANDOVER,
NG_RNL_REDUCE_LOAD_IN_SERVING_CELL,
NG_RNL_RELEASE_DUE_TO_CN_DETECTED_MOBILITY,
NG_RNL_N26_INTERFACE_NOT_AVAILABLE,
NG_RNL_RELEASE_DUE_TO_PRE_EMPTION,
- NG_RNL_END,
+ NG_RNL_END,
NG_TL_TRANSPORT_RESOURCE_UNAVAILABLE,
NG_TL_UNSPECIFIED,
NG_TL_END,
NG_PC_ABSTRACT_SYNTAX_ERROR,
NG_PC_UNSPECIFIED,
NG_PC_END,
- NG_MISC_CONTROL_PROCESSING_OVERLOAD,
+ NG_MISC_CONTROL_PROCESSING_OVERLOAD,
NG_MISC_NOT_ENOUGH_USER_PLANE_PROCESSING_RESOURCES,
NG_MISC_HARDWARE_FAILURE,
NG_MISC_OM_INTERVENTION,
NG_MISC_UNSPECIFIED,
NG_MISC_END,
NG_END
-}NgapCause_e;
+}NgapCause_e;
-typedef enum ngapProcCode
+typedef enum ngapProcCode
{
Ng_AMFConfigurationUpdate = 0,
Ng_AMFStatusIndication = 1,
Ng_SecondaryRATDataUsageReport = 52
} NgapProcCode_e;
-typedef enum ngapProtocolIeId
+typedef enum ngapProtocolIeId
{
Ngap_AllowedNSSAI = 0,
Ngap_AMFName = 1,
CONTEXT_REQUESTED = 0
} ueContextRequest_e;
-typedef enum
+typedef enum
{
amfPging_None,
amfPging_gNBId,
BOTH_AMF_RAN_NGAPID
}NgapIdType_e;
-typedef enum
+typedef enum
{
Paging_DRX_v32 = 0,
Paging_DRX_v64 = 1,
PAGING_PRIORITY_LEVEL8 = 7,
}PagingPriority_e;
-typedef enum
+typedef enum
{
UE_RETEN_INFO_UES_RETAINED = 0
} UERetentionInformation_e;
-typedef enum
+typedef enum
{
EMERGENCY_FALLBACK_REQUESTED = 0
} EmergencyFallbackRequestIndicator_e;
-typedef enum
+typedef enum
{
EMERGENCY_SERVICE_TARGET_5GC = 0,
EMERGENCY_SERVICE_TARGET_epc
} EmergencyServiceTargetCN_e;
-typedef enum
+typedef enum
{
BEHAVIOUR_INFO_SUBSCRIPTION_INFORMATION = 0,
BEHAVIOUR_INFO_STATISTICS = 1
} SourceOfUEActivityBehaviourInformation_e;
-typedef enum
+typedef enum
{
NotificationControl_requested = 0
} NotificationControl_e;
***********************************************************************************
***********************************************************************************/
-typedef enum e1apCausePr
+typedef enum e1apCausePr
{
E1apCause_PR_NOTHING,
E1apCause_PR_radioNetwork,
E1Reset_PR_choice_extension
} E1apResetPr_e;
-typedef enum e1apCauseRadioNetwork
+typedef enum e1apCauseRadioNetwork
{
E1apCauseRadioNetwork_unspecified = 0,
E1apCauseRadioNetwork_unknown_or_already_allocated_gnb_cu_cp_ue_e1ap_id = 1,
E1apCauseRadioNetwork_release_due_to_pre_emption = 27
} E1apCauseRadioNetwork_e;
-typedef enum e1apCauseTransport
+typedef enum e1apCauseTransport
{
E1apCauseTransport_unspecified = 0,
E1apCauseTransport_transport_resource_unavailable = 1
} E1apCauseTransport_e;
-typedef enum e1apCauseProtocol
+typedef enum e1apCauseProtocol
{
E1apCauseProtocol_transfer_syntax_error = 0,
E1apCauseProtocol_abstract_syntax_error_reject = 1,
E1apCauseProtocol_unspecified = 6
} E1apCauseProtocol_e;
-typedef enum e1apCauseMisc
+typedef enum e1apCauseMisc
{
E1apCauseMisc_control_processing_overload = 0,
E1apCauseMisc_not_enough_user_plane_processing_resources = 1,
MISC_CAUSE_MAX_VALUE
}E1apCause_e;
-typedef enum e1apProcCode
+typedef enum e1apProcCode
{
E1_e1reset = 0,
E1_e1errorIndication = 1,
E1_mRDC_DataUsageReport = 19
} E1apProcCode_e;
-typedef enum e1apProtocolIeId
+typedef enum e1apProtocolIeId
{
E1ap_E1Cause = 0,
E1ap_E1CriticalityDiagnostics = 1,
typedef enum
{
BEARER_CXT_STATUS_CHANGE_SUSPEND,
- BEARER_CXT_STATUS_CHANGE_RESUME
+ BEARER_CXT_STATUS_CHANGE_RESUME
} BearCxtStatusChange_e;
typedef enum
IpAlgorithm_NIA3
}IpAlgorithm_e;
-typedef enum
+typedef enum
{
PRIORITY_LEVEL_SPARE = 0,
PRIORITY_LEVEL_HIGHEST = 1,
DL_TX_STOP_STOP = 0,
DL_TX_STOP_RESUME = 1
} DlTXStop_e;
-
+
typedef enum
{
RAT_TYPE_NR = 0,
typedef enum
{
- ROHC_PARA_PR_NOTHING,
+ ROHC_PARA_PR_NOTHING,
ROHC_PARA_PR_ROHC,
ROHC_PARA_PR_UL_ONLY_ROHC,
ROHC_PARA_PR_CHOICE_ECTENSION
OUTOFORDER_DELIVERY_TRUE = 0
} OutOfOrderDelivery_e;
-typedef enum pdcpSNStatusRequest
+typedef enum pdcpSNStatusRequest
{
PDCP_SN_Status_Request = 0
} PdcpSNStatusRequest_e;
-typedef enum newUlTnlInfoRequire
+typedef enum newUlTnlInfoRequire
{
New_UL_TNL_Info_Required = 0
} NewUlTnlInfoRequire_e;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __CUMODULEINTERFACEH__
#define UE_RADIO_CAPABILITY_PAGING_NR_PRESENT (1 << 0)
#define UE_RADIO_CAPABILITY_PAGING_EUTRA_PRESENT (1 << 1)
-typedef struct UeRadioCapaForPag
+typedef struct UeRadioCapaForPag
{
UINT16 bitMask;
UeRadioCapaForPagOfNr_t ueRadioCapabilityForPagingOfNr; /* OPTIONAL */
UINT8 buffer[MAX_SIZE_OF_OCTET_STRING];
}UeRadioCapability_t;
-typedef struct ngRanTraceId
+typedef struct ngRanTraceId
{
UINT32 size;
UINT8 buffer[MAX_SIZE_OF_OCTET_STRING];
typedef UINT8 InterToTrace_t;
-typedef struct traceActiv
+typedef struct traceActiv
{
NgRanTraceId_t ngRanTraceId;
InterToTrace_t interfacesToTrace;
CuTac_t notAllowedTac[ngap_maxnoofEPLMNsPlusOne][ngap_maxnoofAllowedAreas];
}MobiRestrInfo_t;
-typedef struct ueSecurCapa
+typedef struct ueSecurCapa
{
UINT16 nrEncryptionAlgorithms;
UINT16 nrIntegrityProtectionAlgorithms;
#define EXPECTED_ACTIVITY_PERIOD_PRESENT (1 << 0)
#define EXPECTED_IDLE_PERIOD_PRESENT (1 << 1)
#define SOURCEOF_UE_ACTIVITY_BEHAVIOUR_INFORMATION_PRESENT (1 << 2)
-typedef struct expectedUeActivityBehaviour
+typedef struct expectedUeActivityBehaviour
{
UINT16 bitMask;
INT64 expectedActivityPeriod; /* OPTIONAL */
} ExpectedUeActivityBehaviour_t;
#define EXPECTEDUEMOVINGTRAJECTORYITEM_TIME_STAYED_IN_CELL_PRESENT (1 << 0)
-typedef struct expectedUeMovingTrajectoryItem
+typedef struct expectedUeMovingTrajectoryItem
{
UINT16 bitMask;
CuNrCgi_t nrCgi;
#define NOTIFICATION_CONTROL_PRESENT (1 << 0)
#define MAX_PACKET_LOSSRATE_DL_PRESENT (1 << 1)
-#define MAX_PACKET_LOSSRATE_UL_PRESENT (1 << 2)
+#define MAX_PACKET_LOSSRATE_UL_PRESENT (1 << 2)
typedef struct gbrQosInfo
{
UINT16 bitMask;
} QosFlowSetupReqItem_t;
#define MAX_INTERITY_PROTECTED_DATARATE_PRESENT (1 << 0)
-typedef struct securIndic
+typedef struct securIndic
{
UINT16 bitMask;
INT64 integrityProtectionIndication;
PagingAttemptInfo_t pagingAttemptInfo;//Optional
}AssistDataForPaging_t;
#define QOSFLOW_MAPPING_INDICATION_PRESENT (1 << 0)
-typedef struct AssocQosFlowItem
+typedef struct AssocQosFlowItem
{
UINT16 bitMask;
INT64 qosFlowId;
{
UpTransLayerInfo_t upTransLayerInfo;
UINT8 assocQosFlowNum;
- AssocQosFlowItem_t assocQosItem[ngap_maxnoofQosFlows];
+ AssocQosFlowItem_t assocQosItem[ngap_maxnoofQosFlows];
}QosFlowPerTnlInfo_t;
-typedef struct qosFlowIte
+typedef struct qosFlowIte
{
INT64 qosFlowId;
NgapCause_e cause;
typedef struct
{
- NgapCause_e cause;
+ NgapCause_e cause;
}PathSwitchReqUnsuccTransfer_t;
{
UINT8 areaIntItemNum;
AreaInterestItem_t areaIntItem[ngap_maxnoofAoI];
- UINT8 locaReportReferenceId;
+ UINT8 locaReportReferenceId;
}AreaInterestListItem_t;
typedef struct
ReportArea_e reportArea;
UINT8 areaIntListItemNum;
AreaInterestListItem_t areaIntListItem[ngap_maxnoofAoI];
- UINT8 locaReportReferenceIdTobeCancel;//Condition
+ UINT8 locaReportReferenceIdTobeCancel;//Condition
}LocationReportRequestType_t;
/**********************************************************************************
PagingDRX_e ranDefaPagDrx;
UINT8 ueRetInfoFlag;
UERetentionInformation_e ueRetenInfo;
- RegisterAmf_t registerAmfInfo;
+ RegisterAmf_t registerAmfInfo;
}NgapRegistergNBReq_t;
/* First NAS Request (Initial Ue Message)*/
#define FIRST_UL_NAS_FIVEG_STMSI_PRESENT (1 << 1)
#define FIRST_UL_NAS_LOCATION_INFO_TIMESTAMP_PRESENT (1 << 2)
#define FIRST_UL_NAS_UE_CONTEXT_REQ_PRESENT (1 << 3)
-typedef struct ngapFirstNasReq
+typedef struct ngapFirstNasReq
{
UINT16 bitMask;
NrCellId_t nrCellId;
/* UL NAS Transfer */
#define UL_NAS_LOCATION_INFO_TIMESTAMP_PRESENT (1 << 0)
-typedef struct ngapULNas
+typedef struct ngapULNas
{
UINT16 bitMask;
Instance_t instance;
}NgapUeRadioCapaInfoIndication_t;
/* Initial Context Setup Response */
-typedef struct ngapInitialContextSetupResp
+typedef struct ngapInitialContextSetupResp
{
Instance_t instance;
AmfUeNgapId_t amfUeNgapId;
}NgapPduSessSetupRsp_t;
/* Ue Context Release Request */
-typedef struct ngapUeCxtReleaseReq
+typedef struct ngapUeCxtReleaseReq
{
Instance_t instance;
UINT64 ranUeNgapId;
/* Ue Context Release Complete */
#define UE_CONTEXT_RELEASE_COMPLETE_USERLOCATION_TIMESTAMP_PRESENT (1 << 0)
-typedef struct ngapUeReleaseComplete
+typedef struct ngapUeReleaseComplete
{
UINT16 bitMask;
Instance_t instance;
RecommCellforPag_t recomCellInfo;
RecommRanforPag_t recomRanInfo;
UINT8 rlsSessNum;
- PduSessResourceItem_t sessResourceItem[NG_MAX_SESSION_NUM];
+ PduSessResourceItem_t sessResourceItem[NG_MAX_SESSION_NUM];
UINT8 allSessRlsFlag;
} NgapUeReleaseComplete_t;
***********************************************************************************
***********************************************************************************/
/* Register Confirm (NG Setup Response)*/
-typedef struct ngapRegistergNBCnf
+typedef struct ngapRegistergNBCnf
{
Instance_t instance;
UINT8 numAmf; /* Number of AMF connected */
{
UINT16 bitMask;
Instance_t instance;
- AmfUeNgapId_t amfUeNgapId;
+ AmfUeNgapId_t amfUeNgapId;
UINT64 ranUeNgapId;
UeRadioCapability_t ueRadioCapability;//Optional
}NgapUeRadioCapaCheckReq_t;
{
UINT16 bitMask;
Instance_t instance;
- AmfUeNgapId_t amfUeNgapId;
+ AmfUeNgapId_t amfUeNgapId;
UINT64 ranUeNgapId;
AmfName_t oldAmfName;
INT64 ranPagPriority;
{
/* UE_NGAP_IDs_PR */
Instance_t instance;
- NgapIdType_e ngapIdType;
+ NgapIdType_e ngapIdType;
INT64 ranUeNgapId;
AmfUeNgapId_t amfUeNgapId;
NgapCause_e cause;
-}NgapUeReleaseCommand_t;
+}NgapUeReleaseCommand_t;
/* Handover Command */
#define HANDOVER_COMMAND_NAS_SECURITY_PARAM_FROM_NGRAN_PRESENT (1 << 0)
#define HANDOVER_REQUEST_MOBILITY_RESTRICTION_INFO_PRESENT (1 << 4)
#define HANDOVER_REQUEST_LOCATION_REPORT_REQUEST_TYPE_PRESENT (1 << 5)
#define HANDOVER_REQUEST_RRC_INACTIVE_TRANS_REPORT_REQUEST_PRESNET (1 << 6)
-#define HANDOVER_REQUEST_REDIRECT_VOICE_FB_PRESNET (1 << 7)
+#define HANDOVER_REQUEST_REDIRECT_VOICE_FB_PRESNET (1 << 7)
typedef struct ngapHandoverRequest
{
UINT16 bitMask;
AmfUeNgapId_t amfUeNgapId;
UINT64 ranUeNgapId;
UINT8 rlsSessNum;
- PathSwitchRlsPduSessItem_t rlsPduSessItem[NG_MAX_SESSION_NUM];
+ PathSwitchRlsPduSessItem_t rlsPduSessItem[NG_MAX_SESSION_NUM];
}NgapPathSwitchRequestFailure_t;
/**********************************************************************************
***********************************************************************************
#define GBR_QOS_FLOW_INFO_MAX_PACKET_LOSSRATE_DOWNLINK_PRESENT (1 << 0)
#define GBR_QOS_FLOW_INFO_MAX_PACKET_LOSSRATE_UPLINK_PRESENT (1 << 1)
-typedef struct gbrQoSFlowInformation
+typedef struct gbrQoSFlowInformation
{
UINT16 bitMask;
UINT64 maxFlowBitRateDownlink;
/* QoS_Characteristics_PR */
QosCharact_t qosCharacter;
AllocAndRetenPriority_t ngRanAllAndRetentionPriority;
- GBRQoSFlowInformation_t gbrQoSFlowInformation;/* OPTIONAL */
+ GBRQoSFlowInformation_t gbrQoSFlowInformation;/* OPTIONAL */
/* e_ReflectiveQosAttribute */
- ReflectiveQosAttribute_e reflectiveQosAttribute;/* OPTIONAL */
+ ReflectiveQosAttribute_e reflectiveQosAttribute;/* OPTIONAL */
/* e_AdditionalQosFlowInformation */
AddQosFlowInfo_e addiQosFlowInfo;/* OPTIONAL */
INT64 pagingPolicyInd;/* OPTIONAL */
UINT64 hFN;
}PdcpCount_t;
-#define PDCP_SN_STATUS_INFORMATION_RECEIVE_PDCP_SDU_STATUSPRESENT (1 << 0)
+#define PDCP_SN_STATUS_INFORMATION_RECEIVE_PDCP_SDU_STATUSPRESENT (1 << 0)
typedef struct
-{
+{
UINT16 bitMask;
UINT64 receivePdcpSDUBitNum;/* OPTIONAL */
UINT64 receiveStatusofPdcpSDU[2048]; /*Length: 1 - 131072 */
UINT16 bitMask;
UpTransLayerInfo_t ulDataForwarding;/*optional*/
UpTransLayerInfo_t dlDataForwarding;/*optional*/
-} DFIResponse_t;
+} DFIResponse_t;
#define DRB_TO_MODIFY_ITEM_SDAP_CONFIG_PRESENT (1 << 0)
#define DRB_TO_MODIFY_ITEM_PDCP_CONFIG_PRESENT (1 << 1)
typedef struct ieCriticalityDiagnostics
{
Criticality_e ieCriticality;
- E1apProtocolIeId_e protocolIEId;
+ E1apProtocolIeId_e protocolIEId;
ErrorType_e typeOfError;
}E1IECriticalityDiagnostics_t;
-#define PROCEDURE_CODE_PRESENT (1 << 0)
-#define TRIGGER_MESSAGE_TYPE_PRESENT (1 << 1)
-#define PROCDURE_CRITICALITY_PRESENT (1 << 2)
-#define TRANSACTION_ID_PRESENT (1 << 3)
-#define IE_CRITICALITY_DIAGNOSTICS_PRESENT (1 << 4)
+#define PROCEDURE_CODE_PRESENT (1 << 0)
+#define TRIGGER_MESSAGE_TYPE_PRESENT (1 << 1)
+#define PROCDURE_CRITICALITY_PRESENT (1 << 2)
+#define TRANSACTION_ID_PRESENT (1 << 3)
+#define IE_CRITICALITY_DIAGNOSTICS_PRESENT (1 << 4)
typedef struct criticalitydiagnostics
{
UINT16 bitMask;
typedef struct e1apCause
{
E1apCausePr_e present;
- union E1apCause_u
+ union E1apCause_u
{
E1apCauseRadioNetwork_e e1apRadioNetwork;
E1apCauseTransport_e e1apTransport;
} choice;
} E1apCause_t;
-#define PART_E1_INTERFACE_GNBCUCPUEID_PRESENT (1 << 0)
-#define PART_E1_INTERFACE_GNBCUUPUEID_PRESENT (1 << 1)
+#define PART_E1_INTERFACE_GNBCUCPUEID_PRESENT (1 << 0)
+#define PART_E1_INTERFACE_GNBCUUPUEID_PRESENT (1 << 1)
typedef struct partE1InterfaceItem
{
typedef struct e1apResetType
{
E1apResetPr_e present;
- union E1apReset_u
+ union E1apReset_u
{
INT64 resetAll;
PartE1InterfaceList_t PartE1InterfaceList;
{
UINT16 bitMask;
UINT64 transactionId;
- PartE1InterfaceList_t PartE1InterfaceList;/*optional*/
+ PartE1InterfaceList_t PartE1InterfaceList;/*optional*/
E1Criticalitydiagnostics_t criticalDiagnostics;/*optional*/
} IfmE1apResetAck_t;
UINT64 ueDlMaxIPDR;/*optional*/
PlmnId_t servPlmnId;
/* e_ActivityNotificationLevel */
- ActNotiLevel_e actNotiLevel;
+ ActNotiLevel_e actNotiLevel;
/* Inactivity_Timer_t */
INT64 inactTimer;/*optional*/
/* e_BearerContextStatusChange */
typedef struct e1apBearerContextModReq
{
UINT16 bitMask;
- NrCellId_t cellId;
+ NrCellId_t cellId;
UINT32 gnbCucpUeE1apId;
UINT32 gnbCuupUeE1apId;
SecuInfo_t secuInfo; ///< Optional field
typedef struct gnbCuupName
{
char gnbCuupName[MAX_LENGTH_GNBCUUP_NAME];
-
+
}GnbCuupName_t;
#define DATA_FORWARDING_INFO_UL_DATA_FORWARD_PRESENT (1 << 0)
-#define DATA_FORWARDING_INFO_DL_DATA_FORWARD_PRESENT (1 << 1)
+#define DATA_FORWARDING_INFO_DL_DATA_FORWARD_PRESENT (1 << 1)
typedef struct qosFlowItemIEs
{
UINT8 qosFlowIndicator;
UINT8 drId;
DFIResponse_t dataForwardInfoRsp;/*optional*/
UPParametersList_t upPara;
- QoSFlowList_t flowSetupList;
+ QoSFlowList_t flowSetupList;
FlowFailedlist_t flowFailedlist;/*optional*/
} DRBSetupItem_t;
typedef struct drbSetupList
{
UINT8 drbSetupNum;
- DRBSetupItem_t drbSetupItem[e1ap_maxnoofDRBs];
+ DRBSetupItem_t drbSetupItem[e1ap_maxnoofDRBs];
} DRBSetupList_t;
typedef struct
}DRBFailItem_t;
typedef struct drbFailedList
-{
+{
UINT8 drbFailNum;
DRBFailItem_t drbFailItem[e1ap_maxnoofDRBs];
} DRBFailedList_t;
typedef struct dRBModifyList
{
UINT8 drbModifyItemNum;
- DRBModifyItem_t drbModifyItem[e1ap_maxnoofDRBs];
+ DRBModifyItem_t drbModifyItem[e1ap_maxnoofDRBs];
} DRBModifyList_t;
#define PDU_SESSION_RESOURCE_MODIFY_DL_UP_TNL_INFO_PRESENT (1 << 0)
{
Instance_t instance;
UINT8 state;
- GnbCuupName_t gnbCuupName;
+ GnbCuupName_t gnbCuupName;
}E1apRegistergNBReq_t;
-/* ¸ÃÏûÏ¢½á¹¹Ó¦¸ÃŲµ½ CUUP/INC Ŀ¼Ï TBD */
-typedef struct e1apRegistergNBCnf
+/* ����Ϣ�ṹӦ��Ų�� CUUP/INC Ŀ¼�� TBD */
+typedef struct e1apRegistergNBCnf
{
Instance_t instance;
UINT8 state;
/* Deregister Indication */
typedef struct e1apDeregisteredgNBInd
{
- Instance_t instance;
+ Instance_t instance;
} E1apDeregisteredgNBInd_t;
typedef struct UpbPlmnCfgInfolist
{
UINT32 bPlmnNum;
- E1apUpbPlmnCfgInfo_t bPlmnCfgInfo[e1ap_maxnoofSPLMNs];
+ E1apUpbPlmnCfgInfo_t bPlmnCfgInfo[e1ap_maxnoofSPLMNs];
} E1apUpbPlmnCfgInfoList_t;
#define E1AP_REGISTER_REQ_UPNAME_PRESENT (1 << 0)
typedef struct dRBSetupModList
{
UINT8 drbSetupModItemNum;
- DRBSetupModItem_t drbSetupModItem[e1ap_maxnoofDRBs];
+ DRBSetupModItem_t drbSetupModItem[e1ap_maxnoofDRBs];
} DRBSetupModList_t;
#define PDU_SESSION_RESOURCE_SETUP_MOD_SECURITY_RESULT_PRESENT (1 << 0)
#endif /* __CUMODULEINTERFACEH__*/
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef CU_UP_COMMON_H
#define CU_UP_COMMON_H
extern INT32 ifmUpcBearerCxtInactiveNotification(BearerCxtInactive_t *bearerCxtInactive);
extern INT32 ifmUpcDlDataNotification(UINT64 ueE1apId, UINT8 PPI);
#endif /* CU_UP_COMMON_H */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __CUUPPROTOCOLPARA_H__
#define CUUP_NAME_MAX_LEN 32
typedef struct CuupBasicInfoCfg_s
-{
+{
UINT64 gnbCuupId;
UCHAR gnbCuupName[CUUP_NAME_MAX_LEN];
UINT8 cnSupportType;//ENUMERATED (EPC,5GC,both)
typedef struct CuupIpAddrList_s
{
- UINT8 ipType;
+ UINT8 ipType;
UINT32 port;
char ipv4Address[MAX_CUUP_IPV4_ADDR_LEN];
char ipv6Address[MAX_CUUP_IPV6_ADDR_LEN];
#define MAX_NROF_NG_RAN_QOS_PARAMETER 1//256协议规定
typedef struct qosSupportInfo_s
{
- UINT8 plmnIdx;
+ UINT8 plmnIdx;
UINT8 fiveQI;//取值范围:0~255
UINT8 qoSPrirotyLevel_presence;//qoSPrirotyLevel配置标志位
UINT8 qoSPrirotyLevel;//取值范围:0~127
typedef struct SliceSupportInfo_s
{
UINT8 PlmnIdx;
- UINT8 SST; //为了支持网络切片,与SD字段可以组成S-NSSAI
+ UINT8 SST; //为了支持网络切片,与SD字段可以组成S-NSSAI
UINT8 SD_presence;//SD配置标志位
UINT32 SD:24;
}sliceSupportInfo_t;
#pragma pack()
#endif
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2019] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef CUUP_TEST_H
#define CUUP_TEST_H
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef CUUP_UE_INFO_H
#define CUUP_UE_INFO_H
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef F1U_COMMON_H
#define F1U_COMMON_H
LEN_12_BITS = 0,
LEN_18_BITS = 1
}PDCPSnSize_e;
-
+
/* CU-F1-U instance */
typedef struct {
UINT64 ueE1apId;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef _GNB_COMMON_H_
#define _GNB_COMMON_H_
#define MAX_TASK_NUM 60
-#define MAX_TASK_NAME_LEN 256
+#define MAX_TASK_NAME_LEN 256
#define MAX_QUEUE_NUM 20
#define MAX_QUEUE_MSG_NUM 256
#define MAX_IP_ADDR_STRING_LEN 256
/*MAX IPV6 ADDR LEN*/
#define MAX_IPV6ADDR_LEN (16)
-#define MAX_ENTITY_MANAGE_MSG_NUM 100
+#define MAX_ENTITY_MANAGE_MSG_NUM 100
#define CHECK_FUNCTION_RET(ret) \
do { \
if (VOS_OK != (ret)) { \
/***********************************************************************************************************
********************************************* enum define*************************************************
************************************************************************************************************/
-
+
/* IP Type */
typedef enum ipAddrType
{
- IPv4,
- IPv6,
- IPTypeMax,
+ IPv4,
+ IPv6,
+ IPTypeMax,
}IpAddrType_e;
typedef enum
/** log level */
typedef enum gnbLogLevel
{
- LOG_CRIT = 1, ///< critical conditions
- LOG_ERR, ///< error conditions
- LOG_WARNING, ///< warning conditions
- LOG_INFO, ///< informational
+ LOG_CRIT = 1, ///< critical conditions
+ LOG_ERR, ///< error conditions
+ LOG_WARNING, ///< warning conditions
+ LOG_INFO, ///< informational
LOG_DEBUG, ///< debug info
} gnbLogLevel_e;
************************************************************************************************************/
/* IPV4 Address */
-typedef struct
+typedef struct
{
UINT16 port;
UINT32 address;
/* IP Address */
typedef struct ipAddress
-{
+{
IpAddrType_e ipType; /* type of transport address */
union
{
}NgapRanName_t;
/* user task info */
-typedef struct
+typedef struct
{
UINT32 userTaskId;
UINT32 hostTaskId;
} UserTaskInfo_t;
/* Host task info */
-typedef struct
+typedef struct
{
UINT32 hostTaskId;
UINT32 procId;
/* user task table info */
typedef struct
-{
+{
UINT32 userTaskId;
UINT32 hostTaskId;
CHAR userTaskName[MAX_TASK_NAME_LEN];/*线程名称*/
- ULONG userModuleID;
+ ULONG userModuleID;
UINT32 userTaskPriority;/*优先级*/
USER_TASK_INIT_FUNCPTR userTaskInitPtr;
USER_TASK_FUNCPTR userTaskEntry;/*线程执行函数*/
{
UINT8 vosTaskId;
vos_module_t vosModule;
- VOS_HANDLE taskHandle;
+ VOS_HANDLE taskHandle;
}MoudleInfo_t;
typedef struct
{
- UCHAR ipAddrStr[MAX_IP_ADDR_STRING_LEN];
+ UCHAR ipAddrStr[MAX_IP_ADDR_STRING_LEN];
UINT32 port;
}IpAddrStr_t;
{
UINT32 vosTaskId;
SockAddrStr_t ipAddrStr;
-
+
SockAddrStr_t clientAddrInfo;
}TaskSockAddrInfo_t;
typedef struct
{
-
+
}UdpSocketMsg_t;
typedef struct
{
-
+
}TcpSocketMsg_t;
typedef struct
struct sctp_sndrcvinfo sri;/*收到的SCTP消息信息*/
LONG msg_flags;/*链路信息*/
UINT32 assocState;/*链路状态*/
-
+
}SctpSocketMsg_t;
typedef struct
{
-
+
}UnixUdpSocketMsg_t;
typedef struct
{
-
+
}UnixTcpSocketMsg_t;
/*
SOCKET msg
-*/
+*/
typedef struct
{
UINT32 socketMsgType;
/*
1.非SOCKET msg 格式化为接口数据
2.SOCKET msg格式化为:SocketMsg_t数据+接口数据
-*/
+*/
typedef struct
{
UINT32 srcModuleId;
UINT32 dstModuleId;
- UINT32 msgSap;
- UINT32 msgCode;
- UINT32 msgLen;
- UINT8 msgBuf[MSG_MAX_BUFFER_LEN];
+ UINT32 msgSap;
+ UINT32 msgCode;
+ UINT32 msgLen;
+ UINT8 msgBuf[MSG_MAX_BUFFER_LEN];
} ModuleMsg_t;
/** 采用非VOS通信方式的模块需要提供的额外参数 */
typedef struct
{
- module_comm_type_t type; ///< 通信方式
+ module_comm_type_t type; ///< 通信方式
union{
vos_sockaddr_t addr; ///< socket 通信
sctp_para_t sctp; ///< sctp 通信
}u;
- receive_handler recv_handle; ///< 接收函数
+ receive_handler recv_handle; ///< 接收函数
LONG maxClient; ///< tcp server 允许的连接数
BOOL soloMode; ///< 如果为真,则单独创建接收线程;如果为假,则由 VOS socket代理任务负责接收
LONG fdIdx; ///< 无需关心
************************************************************************************************************/
/*********************************** Mib_t ***************************************/
-typedef enum mibSubCarrierSpacingCommon
+typedef enum mibSubCarrierSpacingCommon
{
MIB_subCarrierSpacingCommon_scs15or60 = 0,
MIB_subCarrierSpacingCommon_scs30or120 = 1
} MibSubCarrierSpacingCommon_e;
-typedef enum mibDmrsTypeaPosition
+typedef enum mibDmrsTypeaPosition
{
MIB_dmrs_TypeA_Position_pos2 = 0,
MIB_dmrs_TypeA_Position_pos3 = 1
} MibDmrsTypeaPosition_e;
-typedef enum mibCellBarred
+typedef enum mibCellBarred
{
MIB_cellBarred_barred = 0,
MIB_cellBarred_notBarred = 1
} MibCellBarred_e;
-typedef enum mibIntraFreqReselection
+typedef enum mibIntraFreqReselection
{
MIB_intraFreqReselection_allowed = 0,
MIB_intraFreqReselection_notAllowed = 1
mibCellBarredNotBarred = 1
} CellBarred_e;
-typedef enum
+typedef enum
{
mibIntraFreqReselectionAllowed = 0,
mibIntraFreqReselectionNotAllowed = 1
} IntraFreqReselection_e;
-typedef struct PDCCHConfigSIB1
+typedef struct PDCCHConfigSIB1
{
UINT8 controlResourceSetZero;
UINT8 searchSpaceZero;
}PDCCHConfigSIB1_t;
-typedef struct mib
+typedef struct mib
{
UINT8 systemFrameNumber;
MibSubCarrierSpacingCommon_e subCarrierSpacingCommon;
}macCellCfgPara_t;
/*********************************** SIB1_t ***************************************/
-typedef enum connEstFailureControlCount
+typedef enum connEstFailureControlCount
{
NR_ConnEstFailureControl__connEstFailCount_n1 = 0,
NR_ConnEstFailureControl__connEstFailCount_n2 = 1,
NR_ConnEstFailureControl__connEstFailCount_n4 = 3
} ConnEstFailureControlCount_e;
-typedef enum connEstFailureControlOffsetValidity
+typedef enum connEstFailureControlOffsetValidity
{
NR_ConnEstFailureControl__connEstFailOffsetValidity_s30 = 0,
NR_ConnEstFailureControl__connEstFailOffsetValidity_s60 = 1,
UINT8 connEstFailOffset; /*option*/
} ConnEstFailCtrl_t;
-typedef enum timerT300
+typedef enum timerT300
{
NR_UE_TimersAndConstants__t300_ms100 = 0,
NR_UE_TimersAndConstants__t300_ms200 = 1,
NR_UE_TimersAndConstants__t300_ms1500 = 6,
NR_UE_TimersAndConstants__t300_ms2000 = 7
} TimerT300_e;
-
-typedef enum timerT301
+
+typedef enum timerT301
{
NR_UE_TimersAndConstants__t301_ms100 = 0,
NR_UE_TimersAndConstants__t301_ms200 = 1,
NR_UE_TimersAndConstants__t301_ms1500 = 6,
NR_UE_TimersAndConstants__t301_ms2000 = 7
} TimerT301_e;
-
-typedef enum timerT310
+
+typedef enum timerT310
{
NR_UE_TimersAndConstants__t310_ms0 = 0,
NR_UE_TimersAndConstants__t310_ms50 = 1,
NR_UE_TimersAndConstants__t310_ms1000 = 5,
NR_UE_TimersAndConstants__t310_ms2000 = 6
} TimerT310_e;
-
-typedef enum timerN310
+
+typedef enum timerN310
{
NR_UE_TimersAndConstants__n310_n1 = 0,
NR_UE_TimersAndConstants__n310_n2 = 1,
NR_UE_TimersAndConstants__n310_n10 = 6,
NR_UE_TimersAndConstants__n310_n20 = 7
} TimerN310_e;
-
-typedef enum timerT311
+
+typedef enum timerT311
{
NR_UE_TimersAndConstants__t311_ms1000 = 0,
NR_UE_TimersAndConstants__t311_ms3000 = 1,
NR_UE_TimersAndConstants__t311_ms20000 = 5,
NR_UE_TimersAndConstants__t311_ms30000 = 6
} TimerT311_e;
-
-typedef enum timerN311
+
+typedef enum timerN311
{
NR_UE_TimersAndConstants__n311_n1 = 0,
NR_UE_TimersAndConstants__n311_n2 = 1,
NR_UE_TimersAndConstants__n311_n8 = 6,
NR_UE_TimersAndConstants__n311_n10 = 7
} TimerN311_e;
-
-typedef enum timerT319
+
+typedef enum timerT319
{
NR_UE_TimersAndConstants__t319_ms100 = 0,
NR_UE_TimersAndConstants__t319_ms200 = 1,
typedef struct cellAccessInfo
{
UINT16 bitMask;
- UINT16 plmnInfoNum;
+ UINT16 plmnInfoNum;
PlmnInformation_t plmnInfo[MAX_PLMN];
BOOL cellReservedForOtherUse; /*option*/
-
+
} CellAccessInfo_t;
#define RA_ASSOCIATION_PERIOD_INDEX (1<<0)
UINT8 raPreambleStartIndex;
UINT8 raAssociationPeriodIndex; /*option*/
UINT8 raSsbOccasionMaskIndex; /*option*/
-
+
} SiReqRes_t;
#define PRACH_CONFIGURATION_INDEX (1<<0)
UINT8 preambleTransMax; /*option*/
UINT8 powerRampingStep; /*option*/
UINT8 raResponseWindow; /*option*/
- UINT8 ssbPerRachOccasion;
+ UINT8 ssbPerRachOccasion;
UINT8 siRequestPeriod; /*option*/
- UINT16 siRequestResourcesNum;
+ UINT16 siRequestResourcesNum;
SiReqRes_t siRequestResources[MAX_SI_MESSAGE];
} SiRequestConfig_t;
-typedef enum schInfoSiPeriod
+typedef enum schInfoSiPeriod
{
NR_SchedulingInfo__si_Periodicity_rf8 = 0,
NR_SchedulingInfo__si_Periodicity_rf16 = 1,
NR_SchedulingInfo__si_Periodicity_rf512 = 6
} SchInfoSiPeriod_e;
-typedef enum sibType
+typedef enum sibType
{
NR_SIB_TypeInfo__type_sibType2 = 0,
NR_SIB_TypeInfo__type_sibType3 = 1,
NR_SIB_TypeInfo__type_sibType9 = 7
} SibType_e;
-typedef enum sibAreaScope
+typedef enum sibAreaScope
{
NR_SIB_TypeInfo__areaScope_true = 0
} SibAreaScope_e;
typedef struct sibTypeInfo
{
UINT16 bitMask;
- SibType_e type;
+ SibType_e type;
UINT8 valueTag; /*option*/
SibAreaScope_e areaScope; /*option*/
} SibTypeInfo_t;
BOOL siBroadcastStatus;
SchInfoSiPeriod_e siPeriodicity;
- UINT16 sibMappingNum;
+ UINT16 sibMappingNum;
SibTypeInfo_t sibMapping[MAX_SIB];
} SiSchInfo_t;
UINT64 frequencyDomainResources;
long duration;
NrControlResourceSet_cce_REG_MappingType_PR present;
- union ControlResourceSet_cce_REG_MappingType_u
+ union ControlResourceSet_cce_REG_MappingType_u
{
struct ControlResourceSet_cce_REG_MappingType_interleaved
{
long pdcch_DMRS_ScramblingID; /* OPTIONAL */
} NrControlResourceSet_t;
-typedef struct nrofCandidates
+typedef struct nrofCandidates
{
long aggregationLevel1;
long aggregationLevel2;
#define NrSearchSpaceTypeCommonDci_Format2_1_Presence 4
#define NrSearchSpaceTypeCommonDci_Format2_2_Presence 8
#define NrSearchSpaceTypeCommonDci_Format2_3_Presence 16
-typedef struct nrSearchSpaceType
+typedef struct nrSearchSpaceType
{
NrSearchSpace_searchSpaceType_PR present;
- union SearchSpace_searchSpaceType_u
+ union SearchSpace_searchSpaceType_u
{
- struct SearchSpace_searchSpaceType_common
+ struct SearchSpace_searchSpaceType_common
{
UINT16 bitMask;
struct SearchSpace_searchSpaceType_common_dci_Format0_0_AndFormat1_0
{
} dci_Format0_0_AndFormat1_0;//option
-
- struct SearchSpace_searchSpaceType_common_dci_Format2_0
+
+ struct SearchSpace_searchSpaceType_common_dci_Format2_0
{
#define NrSearchSpaceTypeAggLevel1Chosen 1
#define NrSearchSpaceTypeAggLevel2Chosen 2
struct SearchSpace_searchSpaceType_common_dci_Format2_1
{
} dci_Format2_1;//optional
-
+
struct SearchSpace_searchSpaceType_common_dci_Format2_2
{
} dci_Format2_2;//optional
long dummy2;
} dci_Format2_3;//optional
} common;
- struct SearchSpace_searchSpaceType_specific
+ struct SearchSpace_searchSpaceType_specific
{
long dci_Formats;
}specific;
-
+
} choice;
}NrSearchSpaceType_t;
UINT16 bitmask;
long searchSpaceId;
long controlResourceSetId; /* OPTIONAL */
-
- struct SearchSpaceMonitoringSlotPeriodicityAndOffset
+
+ struct SearchSpaceMonitoringSlotPeriodicityAndOffset
{
NrSearchSpaceMonitoringSlotPeriodicityAndOffset_PR present;
- union SearchSpaceMonitoringSlotPeriodicityAndOffset_u
+ union SearchSpaceMonitoringSlotPeriodicityAndOffset_u
{
int sl1;
long sl2;
long sl2560;
} choice;
} monitoringSlotPeriodicityAndOffset;/* OPTIONAL */
-
+
long duration; /* OPTIONAL */
UINT16 monitoringSymbolsWithinSlot; /* OPTIONAL */
NrofCandidates_t nrofCandidates;
long searchSpaceZero; /* OPTIONAL */
UINT8 searchSpaceNum;
NrSearchSpace_t searchSpace[MAX_SEARCHSPACE_NUM];
-
+
long searchSpaceSIB1; /* OPTIONAL */
long searchSpaceOtherSystemInformation; /* OPTIONAL */
long pagingSearchSpace; /* OPTIONAL */
union Setup_Release_PDCCH_PR_u {
UINT32 release;
Pdcch_Cfg_Common_t setup;
-
+
}choice;
-
+
} PdcchCfgCommon_t;
/* PUCCH-ConfigCommon */
NrPucchCfgCommon_PR_setup
}NrPucchCfgCommon_PR;
-typedef struct nrPucchCfgCommon
+typedef struct nrPucchCfgCommon
{
NrPucchCfgCommon_PR present;
#define MAX_TIME_DOMAIN_NUM 16
#define PdschTimeDomainAllocationChose (1 << 0)
typedef struct pdsch_Cfg_Common_t
-{
+{
UINT16 bitmask;
UINT8 timeDomainNum;
PdschTimeDomainAlloc_t pdschTimeDomainAllocation[MAX_TIME_DOMAIN_NUM]; /* OPTIONAL */
union Setup_Release_PDSCH_PR_u {
UINT32 release;
Pdsch_Cfg_Common_t setup;
-
+
}choice;
} PdschCfgCommon_t;
typedef struct freqInfoUlSib
{
UINT16 bitMask;
- UINT16 nrMulBandNum;
+ UINT16 nrMulBandNum;
NrMultiBand_t nrMulBand[MAX_MULTI_BANDS];
UINT32 absoluteFrequencyPointA; /*option*/
- UINT16 speCarrierNum;
+ UINT16 speCarrierNum;
SpecificCarrier_t speCarrier[MAX_SCS];
INT8 pMax; /*option*/
/*UINT8 frequencyShift7p5khz; extension*/
long ra_ResponseWindow;
} NrRachCfgGeneric_t;
-typedef enum nrRachCfgCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB
+typedef enum nrRachCfgCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB
{
NrRACH_ConfigCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_NOTHING, /* No components present */
NrRACH_ConfigCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth,
UINT16 bitmask;
NrRachCfgGeneric_t rachCfgGeneric;
long totalNumberOfRA_Preambles; /* OPTIONAL */
- struct RACH_ConfigCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB
+ struct RACH_ConfigCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB
{
NrRachCfgCommon_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_e present;
union ssbPerRachOccAndCBPreamblesPerSSB_u
long sixteen;
} choice;
} ssbPerRachOccAndCBPreamblesPerSSB;
-
+
struct rachCfgCommonGroupBconfigured
{
long ra_Msg3SizeGroupA;
long messagePowerOffsetGroupB;
long numberOfRA_PreamblesGroupA;
} groupBconfigured;/* OPTIONAL */
-
+
long ra_ContentionResolutionTimer;
long rsrp_ThresholdSSB; /* OPTIONAL */
long rsrp_ThresholdSSB_SUL; /* OPTIONAL */
- struct rachCfgCommonPrachRootSequenceIndex
+ struct rachCfgCommonPrachRootSequenceIndex
{
NrRachCfgCommonPrachRootSequenceIndex_e present;
union rachCfgCommonPrachRootSequenceIndex_u
}NrPusch_ConfigCommon_t;
-typedef enum
+typedef enum
{
NrPuschCfgCommon_PR_NOTHING, /* No components present */
NrPuschCfgCommon_PR_release,
NrPuschCfgCommon_PR_setup
}NrPuschCfgCommon_PR;
-typedef struct nrPuschCfgCommon
+typedef struct nrPuschCfgCommon
{
NrPuschCfgCommon_PR present;
union NrPuschCfgCommon_u {
typedef struct sCS30KHZoneT_SCS15KHZhalfT_s
{
-
+
UINT16 poNum;
UINT16 firstMonitorOccasionOfPO[MAX_PDCCH_MONITORING_OCCASION];
{
UINT16 bitMask;
UINT8 defaultPagingCycle;
-
+
struct PagingFrameOffset
{ PagingFrameOffset_e present;
union PagingFrame {
struct FirstPDCCH_MonitoringOccasionOfPO
{ FirstPDCCH_MonitoringOccasionOfPO_e present;
union PDCCH_MonitoringOccasion {
-
+
SCS15KHZoneT_t SCS15KHZoneT;
sCS30KHZoneT_SCS15KHZhalfT_t sCS30KHZoneT_SCS15KHZhalfT;
sCS60KHZoneT_SCS30KHZhalfT_SCS15KHZquarterT_t sCS60KHZoneT_SCS30KHZhalfT_SCS15KHZquarterT;
sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT_t sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT;
- sCS120KHZhalfT_SCS60KHZquarterT_SCS30KHZoneEighthT_SCS15KHZoneSixteenthT_t sCS120KHZhalfT_SCS60KHZquarterT_SCS30KHZoneEighthT_SCS15KHZoneSixteenthT;
+ sCS120KHZhalfT_SCS60KHZquarterT_SCS30KHZoneEighthT_SCS15KHZoneSixteenthT_t sCS120KHZhalfT_SCS60KHZquarterT_SCS30KHZoneEighthT_SCS15KHZoneSixteenthT;
sCS120KHZquarterT_SCS60KHZoneEighthT_SCS30KHZoneSixteenthT_t sCS120KHZquarterT_SCS60KHZoneEighthT_SCS30KHZoneSixteenthT;
sCS120KHZoneEighthT_SCS60KHZoneSixteenthT_t sCS120KHZoneEighthT_SCS60KHZoneSixteenthT;
sCS120KHZoneSixteenthT_t sCS120KHZoneSixteenthT;
typedef struct servingCellCfg
{
UINT16 bitMask;
- DlCfgCommonSIB_t downlinkConfigCommon;
+ DlCfgCommonSIB_t downlinkConfigCommon;
UlCfgCommonSIB_t uplinkConfigCommon; /*option*/
UlCfgCommonSIB_t supplementaryUplink; /*option*/
UINT8 nTimingAdvanceOffset; /*option*/
typedef struct uACBarringPerPLMN
{
UINT16 bitMask;
- UINT8 plmnIdentityIndex;
+ UINT8 plmnIdentityIndex;
UINT16 BarringListNum;
UacImplicitACBarringList_UacExplicitAcBarringList_PR present;
union UacAcBarringListType_u {
UINT16 uacBarringPerPLMNListNUM;
UACBarringPerPLMN_t uacBarringPerPLMNList[MAX_PLMN]; /*option*/
UINT16 uacBarringInfoSetListNUM;
- UACBarringInfoSet_t uacBarringInfoSetList[MAX_BARRING_SET];
+ UACBarringInfoSet_t uacBarringInfoSetList[MAX_BARRING_SET];
Uac_AccessCategory1_SelectionAssistanceInfo_PR present;
UINT16 individualPLMNListNUM;
union uac_AccessCategory1_SelectionAssistanceInfo
{
UINT8 plmnCommon;
- UINT8 individualPLMNList[MAX_PLMN];
+ UINT8 individualPLMNList[MAX_PLMN];
}choice; /*option*/
-
+
} Sib1UacBarringInfo_t;
#define USEFULL_RESUMEID (1 << 15)
-typedef struct sib1
+typedef struct sib1
{
UINT16 bitMask;
- INT8 qRxLevMin;
+ INT8 qRxLevMin;
UINT8 qRxLevMinOffsetd; /*option*/
- INT8 qRxLevMinSUL; /*option*/
- INT8 qQualMin; /*option*/
+ INT8 qRxLevMinSUL; /*option*/
+ INT8 qQualMin; /*option*/
UINT8 qQualMinOffset; /*option*/
CellAccessInfo_t cellAccessRelateInfo;
ConnEstFailCtrl_t connEstFailureCtrl; /*option*/
UINT16 siNum;
SiSchInfo_t siSchedulInfo[MAX_SI_MESSAGE]; /*option*/
SiRequestConfig_t siReqCfg; /*option*/
- SiRequestConfig_t siReqCfgSul; /*option*/
+ SiRequestConfig_t siReqCfgSul; /*option*/
UINT32 systemInformationAreaID; /*option*/
ServingCellCfg_t servingCellCfgCommon; /*option*/
BOOL ims_EmergencySupport; /*option*/
typedef enum cmSib2QHyst
{
qHystdB0 = 0,
- qHystdB1 = 1,
- qHystdB2 = 2,
+ qHystdB1 = 1,
+ qHystdB2 = 2,
qHystdB3 = 3,
qHystdB4 = 4,
qHystdB5 = 5,
}CmSib2QHyst_e;
-typedef enum cmSib2SfMedium
+typedef enum cmSib2SfMedium
{
qHystSFdBMedium0 = 0,
- qHystSFdBMedium2 = 1,
- qHystSFdBMedium4 = 2,
+ qHystSFdBMedium2 = 1,
+ qHystSFdBMedium4 = 2,
qHystSFdBMedium6 = 3
}CmSib2SfMedium_e;
-typedef enum cmSib2SfHigh
+typedef enum cmSib2SfHigh
{
qHystSFdBHigh0 = 0,
- qHystSFdBHigh2 = 1,
- qHystSFdBHigh4 = 2,
+ qHystSFdBHigh2 = 1,
+ qHystSFdBHigh4 = 2,
qHystSFdBHigh6 = 3
}CmSib2SfHigh_e;
-
-typedef struct cmSib2QHystSf
+
+typedef struct cmSib2QHystSf
{
CmSib2SfMedium_e sfMedium;
- CmSib2SfHigh_e sfHigh;
+ CmSib2SfHigh_e sfHigh;
}CmSib2QHystSf_t;
-typedef enum cmSib2TEvaluation
+typedef enum cmSib2TEvaluation
{
tEvaluationS30 = 0,
tEvaluationS60 = 1,
tEvaluationSpare1 = 7
}CmSib2TEvaluation_e;
-typedef enum cmSib2THystNormal
+typedef enum cmSib2THystNormal
{
tHystNormalS30 = 0,
tHystNormalS60 = 1,
}CmSib2THystNormal_e;
-typedef struct cmSib2MobilityStateParameters
+typedef struct cmSib2MobilityStateParameters
{
CmSib2TEvaluation_e tEvaluation;
CmSib2THystNormal_e tHystNormal;
}CmSib2MobilityStateParameters_t;
-typedef struct cmSib2SpeedStateReselectionPars
+typedef struct cmSib2SpeedStateReselectionPars
{
CmSib2MobilityStateParameters_t mobilityStateParameters;
CmSib2QHystSf_t qHystSF;
}CmSib2SpeedStateReselectionPars_t;
#define THRESHOLD_RSRP_PRESENT (1 << 0)
-#define THRESHOLD_PSRQ_PRESENT (1 << 1)
-#define THRESHOLD_SINR_PRESENT (1 << 2)
-typedef struct cmSib2ThresholdNr
+#define THRESHOLD_PSRQ_PRESENT (1 << 1)
+#define THRESHOLD_SINR_PRESENT (1 << 2)
+typedef struct cmSib2ThresholdNr
{
UINT16 bitMask;
UINT8 thresholdRSRP; /*0-127 OPTIONAL*/
UINT8 thresholdSINR; /*0-127 OPTIONAL*/
}CmSib2ThresholdNr_t;
-typedef enum cmSib2QOffsetRange
+typedef enum cmSib2QOffsetRange
{
sib2qOffsetRangeMinus24 = 0,
sib2qOffsetRangeMinus22 = 1,
sib2qOffsetRangePlus24 = 30,
}CmSib2QOffsetRange_e;
-
+
#define NROF_SS_BLOCKS_TO_AVERAGE_PRESENT (1 << 0)
-#define ABS_THRESH_SS_BLOCKS_CONSOLIDATION_PRESENT (1 << 1)
-#define RANGE_TO_BEST_CELL_PRESENT (1 << 2)
-#define SPEED_STATE_RESELECTION_PARS_PRESENT (1 << 3)
+#define ABS_THRESH_SS_BLOCKS_CONSOLIDATION_PRESENT (1 << 1)
+#define RANGE_TO_BEST_CELL_PRESENT (1 << 2)
+#define SPEED_STATE_RESELECTION_PARS_PRESENT (1 << 3)
typedef struct cmSib2CellReselectionInfoCommon
{
UINT16 bitMask;
UINT8 nrofSsBlocksToAverage; /*2-16 OPTIONAL*/
- CmSib2ThresholdNr_t absThreshSsBlocksConsolidation; /*OPTIONAL*/
+ CmSib2ThresholdNr_t absThreshSsBlocksConsolidation; /*OPTIONAL*/
CmSib2QOffsetRange_e rangeToBestCell; /*OPTIONAL*/
CmSib2QHyst_e qHyst;
CmSib2SpeedStateReselectionPars_t speedStateReselectionPars;
} CmSib2CellReselectionInfoCommon_t;
-typedef enum cmSib2CellReselectionSubPriority
+typedef enum cmSib2CellReselectionSubPriority
{
cellReselectionSubPriorityoDot2 = 0,
cellReselectionSubPriorityoDot4 = 1,
}CmSib2CellReselectionSubPriority_e;
#define CM_SIB2_RESELECT_SERV_FREQ_SNON_INTRA_SEARCH_P (1 << 0)
-#define CM_SIB2_RESELECT_SERV_FREQ_SNON_INTRA_SEARCH_Q (1 << 1)
-#define CM_SIB2_RESELECT_SERV_FREQ_THRESH_SERV_LOWQ (1 << 2)
-#define CM_SIB2_RESELECT_SERV_FREQ_SUB_PRIORITY (1 << 3)
+#define CM_SIB2_RESELECT_SERV_FREQ_SNON_INTRA_SEARCH_Q (1 << 1)
+#define CM_SIB2_RESELECT_SERV_FREQ_THRESH_SERV_LOWQ (1 << 2)
+#define CM_SIB2_RESELECT_SERV_FREQ_SUB_PRIORITY (1 << 3)
typedef struct cmSib2CellReselectionServingFreqInfo
{
UINT16 bitMask;
typedef struct cmSib2NrNsPmaxList
{
- CmSib2NrNsPmaxValue_t nRNsPmaxList[MAX_NR_NS_PMAX];
+ CmSib2NrNsPmaxValue_t nRNsPmaxList[MAX_NR_NS_PMAX];
} CmSib2NrNsPmaxList_t;
typedef struct cmSib2MultiFrequencyBandListNrSib
{
CmSib2NrMultiBandInfo_t multiFrequencyBandListNrSib[MAX_MULTI_BANDS];
-
+
} CmSib2MultiFrequencyBandListNrSib_t;
-typedef enum cmSib2Duration
+typedef enum cmSib2Duration
{
durationSf1 = 0,
durationSf2 = 1,
durationSf3 = 2,
- durationSf4 = 3,
- durationSf5 = 4,
+ durationSf4 = 3,
+ durationSf5 = 4,
}CmSib2Duration_e;
-typedef enum cmSib2SsMtcPresent
+typedef enum cmSib2SsMtcPresent
{
CM_SIB2_SSB_MTC_NOTHING = 0,
CM_SIB2_SSB_MTC_SF5 = 1,
CM_SIB2_SSB_MTC_SF10 = 2,
- CM_SIB2_SSB_MTC_SF20 = 3,
- CM_SIB2_SSB_MTC_SF40 = 4,
- CM_SIB2_SSB_MTC_SF80 = 5,
- CM_SIB2_SSB_MTC_SF160 = 6,
+ CM_SIB2_SSB_MTC_SF20 = 3,
+ CM_SIB2_SSB_MTC_SF40 = 4,
+ CM_SIB2_SSB_MTC_SF80 = 5,
+ CM_SIB2_SSB_MTC_SF160 = 6,
}CmSib2SsMtcPresent_e;
-
+
typedef struct cmSib2SsbMtc //choice sf5-sf160
{
CmSib2SsMtcPresent_e present;
UINT8 sf80; //0-79
UINT8 sf160; //0-159
CmSib2Duration_e duration;
-
+
} CmSib2SsbMtc_t;
-typedef enum cmSib2SsbToMeasurePresent
+typedef enum cmSib2SsbToMeasurePresent
{
CM_SIB2_SSB_TO_MEASURE_NOTHING = 0,
CM_SIB2_SSB_TO_MEASURE_SHORT_BITMAP = 1,
CM_SIB2_SSB_TO_MEASURE_MEDIUM_BITMAP = 2,
- CM_SIB2_SSB_TO_MEASURE_LONG_BITMAP = 3,
+ CM_SIB2_SSB_TO_MEASURE_LONG_BITMAP = 3,
}CmSib2SsbToMeasurePresent_e;
-
-typedef struct cmSib2SsbToMeasure
+
+typedef struct cmSib2SsbToMeasure
{
CmSib2SsbToMeasurePresent_e present;
UINT8 shortBitmap; //BIT STRING SIZE(4)
UINT8 mediumBitmap; //BIT STRING SIZE(8)
UINT64 longBitmap; //BIT STRING SIZE(64)
-
+
} CmSib2SsbToMeasure_t;
#define CM_INTRA_FREQ_CELL_RESELECT_QRX_LEV_MIN_SUL_PRESENT (1 << 0)
-#define CM_INTRA_FREQ_CELL_RESELECT_QUAL_MIN_PRESENT (1 << 1)
-#define CM_INTRA_FREQ_CELL_RESELECT_SINTRA_SEARCH_Q_PRESENT (1 << 2)
-#define CM_INTRA_FREQ_CELL_RESELECT_FREQUENCY_BAND_LIST_PRESENT (1 << 3)
-#define CM_INTRA_FREQ_CELL_RESELECT_FREQUENCY_BAND_LIST_SUL_PRESENT (1 << 4)
-#define CM_INTRA_FREQ_CELL_RESELECT_PMAX_PRESENT (1 << 5)
-#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SSB_MTC_PRSENT (1 << 6)
-#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SS_RSSI_MEASUREMENT_PRSENT (1 << 7)
-#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SSB_TO_MEASURE_PRSENT (1 << 8)
+#define CM_INTRA_FREQ_CELL_RESELECT_QUAL_MIN_PRESENT (1 << 1)
+#define CM_INTRA_FREQ_CELL_RESELECT_SINTRA_SEARCH_Q_PRESENT (1 << 2)
+#define CM_INTRA_FREQ_CELL_RESELECT_FREQUENCY_BAND_LIST_PRESENT (1 << 3)
+#define CM_INTRA_FREQ_CELL_RESELECT_FREQUENCY_BAND_LIST_SUL_PRESENT (1 << 4)
+#define CM_INTRA_FREQ_CELL_RESELECT_PMAX_PRESENT (1 << 5)
+#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SSB_MTC_PRSENT (1 << 6)
+#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SS_RSSI_MEASUREMENT_PRSENT (1 << 7)
+#define CM_INTRA_FREQ_CELL_RESELECT_CM_SIB2_SSB_TO_MEASURE_PRSENT (1 << 8)
typedef struct cmSib2IntraFreqCellReselectionInfo
{
UINT16 bitMask;
BOOL deriveSSBIndexFromCell;
} CmSib2IntraFreqCellReselectionInfo_t;
-typedef struct sib2
+typedef struct sib2
{
CmSib2CellReselectionInfoCommon_t cellReselectionCommon;
CmSib2CellReselectionServingFreqInfo_t cellReselectionServingFreq;
}Sib2_t;
/********************** Sib3_t ************************/
-typedef enum cmSib3QOffsetRange
+typedef enum cmSib3QOffsetRange
{
sib3qOffsetRangeMinus24 = 0,
sib3qOffsetRangeMinus22 = 1,
sib3qOffsetRangePlus22 = 29,
sib3qOffsetRangePlus24 = 30
}CmSib3QOffsetRange_e;
-
+
#define CM_INTRA_FREQ_NEIGH_CELL_QRX_LEV_MIN_OFFSET_CELL (1 << 0)
-#define CM_INTRA_FREQ_NEIGH_CELL_QRX_LEV_MIN_OFFSET_SUL_CELL (1 << 1)
-#define CM_INTRA_FREQ_NEIGH_CELL_QUAL_MIN_OFFSET_CELL (1 << 2)
-typedef struct cmSib3IntraFreqNeighCellInfo
+#define CM_INTRA_FREQ_NEIGH_CELL_QRX_LEV_MIN_OFFSET_SUL_CELL (1 << 1)
+#define CM_INTRA_FREQ_NEIGH_CELL_QUAL_MIN_OFFSET_CELL (1 << 2)
+typedef struct cmSib3IntraFreqNeighCellInfo
{
UINT32 bitMask;
UINT16 physCellId; //0-1007
} CmSib3IntraFreqNeighCellInfo_t;
-typedef struct cmSib3IntraFreqNeighCellList
+typedef struct cmSib3IntraFreqNeighCellList
{
UINT32 neighNum;
CmSib3IntraFreqNeighCellInfo_t intraFrequenceNeighCellList[MAXCELLINTRA];
} CmSib3IntraFreqNeighCellList_t;
-typedef enum cmSib3Range
+typedef enum cmSib3Range
{
rangeN4 = 0,
rangeN8 = 1,
}CmSib3Range_e;
#define CM_SIB3_PCI_RANGE (1 << 0)
-typedef struct cmSib3PciRange
+typedef struct cmSib3PciRange
{
UINT32 bitMask;
UINT16 physCellId; //0-1007
- CmSib3Range_e range;
+ CmSib3Range_e range;
} CmSib3PciRange_t;
-typedef struct cmSib3IntraFreqBlackCellList
+typedef struct cmSib3IntraFreqBlackCellList
{
UINT32 blackNum;
CmSib3PciRange_t intraFrequenceBlackCellList[MAXCELLBLACK];
#define CM_SIB3_INTRA_FREQ_NEIGH_CELL_LIST (1 << 0)
#define CM_SIB3_INTRA_FREQ_BLACK_CELL_LIST (1 << 1)
-typedef struct sib3
+typedef struct sib3
{
UINT16 bitMask;
CmSib3IntraFreqNeighCellList_t intraFreqNeighCell;
}Sib3_t;
/********************** SystemInfo_t ************************/
-typedef struct systemInfo
+typedef struct systemInfo
{
Sib2_t siSib2;
Sib3_t siSib3;
-#if 0
+#if 0
Sib4_t siSib4;
Sib5_t siSib5;
Sib6_t siSib6;
}SystemInfo_t;
/********************** SiConfig_t ************************/
-typedef struct siConfig
+typedef struct siConfig
{
Mib_t mibCfg;
Sib1_t sib1Cfg;
#endif
} SiConfig_t;
-typedef struct ngapConfig
+typedef struct ngapConfig
{
UINT32 gNBId; /* Global Ran Node ID of one gNB */
NgapRanName_t ranNodeName; /* name of one gNB */
} NGAPConfig_t;
/********************** OamCuCpConfig_t ************************/
typedef struct
-{
+{
UINT64 gnbDuId;
IpAddress_t gnbDuIp;/* IP Address of DU */
- UCHAR gnbDuName[MAX_GNB_DU_NAME];
+ UCHAR gnbDuName[MAX_GNB_DU_NAME];
}F1apDuInfo_t;
-typedef struct f1apConfig
+typedef struct f1apConfig
{
UINT32 gNBId;
/**
* @struct Transmission BandWidth
- This structure is the Transmission BandWidth of Cell Configuration
+ This structure is the Transmission BandWidth of Cell Configuration
*/
typedef struct transBandWidth
{
/**
* @struct SULInfo
- This structure is the sul Info of Cell Configuration
+ This structure is the sul Info of Cell Configuration
*/
typedef struct sulInfo
{
/**
* @struct FreqBand
- This structure is the freq Band of Cell Configuration
+ This structure is the freq Band of Cell Configuration
*/
typedef struct freqBand
{
/**
* @struct FreqInfo
- This structure is the freq Info of Cell Configuration
+ This structure is the freq Info of Cell Configuration
*/
#define FreqInfoSulInfoChosen 0x01
typedef struct freqInfo
/**
* @struct FDDInfo
- This structure is the FDD Mode Config Info of Cell Configuration
+ This structure is the FDD Mode Config Info of Cell Configuration
*/
typedef struct fddInfo
{
/**
* @struct TDDInfo
- This structure is the TDD Mode Config Info of Cell Configuration
+ This structure is the TDD Mode Config Info of Cell Configuration
*/
typedef struct tddInfo
{
/**
* @struct oamActCellInfo
- This structure is oam send this message to Du act cell
+ This structure is oam send this message to Du act cell
*/
typedef struct oamActCellInfo
{
/**
* @struct oamActCellRsp
- This structure is DU send reponse message to OAM
+ This structure is DU send reponse message to OAM
*/
typedef struct oamActCellRsp
{
/** 从原始消息中获取SOCKET msg */
#define GNB_GET_SOCKET_MSG(src,dst) VOS_MemCpy((CHAR*)dst,(CHAR*)src,sizeof(vos_sock_info_t))
-
+
/** 从原始消息中拷贝消息到dst中 */
#define GNB_GET_DATA(src,dst,len) if(len > sizeof(vos_sock_info_t)) \
{ \
printf("msg len invalid, len = %d \r\n",len);\
VOS_ASSERT(0); \
return VOS_ERROR;\
- }
-/*获取msgBuf中消息地址*/
+ }
+/*获取msgBuf中消息地址*/
#define GNB_GET_MODULE_MSG_DATA_PTR(dataType,pData,buf) do{ \
ULONG ulBufAddr = 0; \
VOS_MemCpy((CHAR*)&ulBufAddr,(CHAR*)buf,sizeof(ULONG));\
pData =(dataType*)(ULONG*)ulBufAddr; \
}while(0)
-/*设置msgBuf中消息地址*/
+/*设置msgBuf中消息地址*/
#define GNB_SET_MODULE_MSG_DATA_PTR(src,dst) do{ \
ULONG ulBufAddr = 0; \
ulBufAddr= (ULONG)((ULONG*)src); \
VOS_MemCpy(dst, &ulBufAddr, sizeof(ULONG)); \
}while(0)
-/*填充数据地址到msgBuf中*/
+/*填充数据地址到msgBuf中*/
#define GNB_SET_MODULE_MSG(msg,pModuleMsg) do{ \
CHAR* bufPtr = NULL; \
ULONG ulBufAddr = 0; \
((uint32_t)((buf)[1]) << 8) | \
((uint32_t)((buf)[2]) << 16) | \
((uint32_t)((buf)[3]) << 24); \
-} while(0)
+} while(0)
#define INT32_TO_BUFFER(x, buf) \
do { \
extern FILE *open_file(const char *path, const char *flag);
extern INT32 close_file(FILE *file_p);
extern INT32 read_file(void *buf, INT32 size, INT32 count, FILE *file_p);
-
+
extern VOID sctpMsgNotifyProc(vos_sock_info_t* opval,VOID* buffer);
void gnbPrintRrcMsg(int direction, int msgType, UINT8 *buf, INT32 size);
#ifdef __cplusplus
}
#endif
-
-#endif /* _CU_COMMON_H_*/
-
-
+#endif /* _CU_COMMON_H_*/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __GNB_COMM_TYPE_H__
#define __GNB_COMM_TYPE_H__
{
CELL_ACTIVE_STATE,
CELL_INACTIVE_STATE,
-
+
}CellState_e;
typedef struct plmnInformation
{
UINT16 bitMask;
- UINT8 plmnIdNum;
+ UINT8 plmnIdNum;
PlmnId_t plmnId[MAX_PLMN_ID_NUM];
UINT32 trackingAreaCode; /*option*/
UINT8 ranac; /*option*/
#endif
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef GTPU_COMMON_H
#define GTPU_COMMON_H
#include "msgb.h"
-#define GTP_MAX_TUN_NUM 100
+#define GTP_MAX_TUN_NUM 100
#define GTPU_MODULE 1 /* just for compile */
#define GTP_MAX_DATA_LEN 8000
#define GTP_HEADER_SIZE_SHORT 8
#define GTP_ERROR 26 /* Error Indication */
#define GTP_SUPP_EXT_HEADER 31 /* Supported Extension Headers Notification */
#define GTP_GPDU 255 /* G-PDU */
-#define GTP_END_MARKER 254
+#define GTP_END_MARKER 254
/* for f1u pdu */
#define GTP_DLUSERDATA_EX_LEN 2
UINT32 tei; /* 05 - 08 Tunnel Endpoint ID */
} GtpHeadShort_t;
-typedef struct
+typedef struct
{ /* Descriptions from 3GPP 29060 */
UINT8 pn :1; /* .......0 PN: N-PDU Number flag */
UINT8 s :1; /* ......0. Sequence number flag: 0 */
/* GTP-U packet */
typedef struct
{
- GtpHeadShort_t h;
+ GtpHeadShort_t h;
UINT8 p[GTP_MAX_DATA_LEN]; /* store data */
}GtpPacketShort_t;
typedef struct gtpMsg
{
UINT16 seq; /* The sequence number */
- UINT8 type; /* The type of packet */
+ UINT8 type; /* The type of packet */
UINT32 l; /* Length of the packet */
union gtpPacket p; /* The packet stored */
vos_sock_info_t *pOpval; /* Address packet was sent to / received from */
{
GtpType_e gtpId;
ULONG userModuleID;
-
+
/* Parameters related to the network INT32erface */
vos_sockaddr_t localAddr; /* Local IP address for signaling and G-PDU */
-
+
/* Parameters related to signaling messages */
UINT16 seq_next; /* Next sequence number to use */
UINT8 restart_counter; /* Increment on restart. */
plist pReqMsgList; /* list header */
Tun_t *tuns[GTP_MAX_TUN_NUM]; /* store memory,use TEID_OWN assignment */
-
+
/* Counters ,some of them may not be used. */
UINT32 err_socket; /* Number of socket errors */
UINT32 err_readfrom; /* Number of readfrom errors */
} Gtp_t;
-typedef struct
+typedef struct
{
UINT8 *pPdu; /* length, content, next extension type */
UINT16 len; /* len = exHeaderLen * 4 */
/* log level */
typedef enum gtpuLogLevel
{
- GTPULOG_CRIT = 1, ///< critical conditions
- GTPULOG_ERR, ///< error conditions
- GTPULOG_WARNING, ///< warning conditions
- GTPULOG_INFO, ///< informational
+ GTPULOG_CRIT = 1, ///< critical conditions
+ GTPULOG_ERR, ///< error conditions
+ GTPULOG_WARNING, ///< warning conditions
+ GTPULOG_INFO, ///< informational
GTPULOG_DEBUG, ///< debug info
} GtpuLogLevel_e;
#endif /* GTPU_COMMON_H */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef MSGB_H
#define MSGB_H
extern ULONG gMsgbFreeCount;
-typedef struct
+typedef struct
{
UINT16 maxHeadLen; /* Head域预留的长度 */
UINT16 maxDataLen; /* Data域预留的长度 */
#define msgbAlloc( dataLen, maxHeadLen, moduleId) msgbAllocWithDebug( dataLen, maxHeadLen, moduleId,(UCHAR *)__func__,__LINE__)
-
+
#define msgbData(pMsgBuff) msgbDataWithDebug(pMsgBuff,(UCHAR *)__func__,__LINE__)
#define msgbTailPull(pMsgBuff, len) msgbTailPullWithDebug(pMsgBuff, len,(UCHAR *)__func__,__LINE__)
#endif /* MSGB_H */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef NG_U_H
#define NG_U_H
UINT64 ueE1apId;
UINT16 ueIdx;
UINT16 pduSessionId;
- UINT32 ownTeid;
-}NguInstance_t;
+ UINT32 ownTeid;
+}NguInstance_t;
typedef struct
-{
+{
UINT16 ueIdx;
UINT64 ueE1apId;
CuupBearerStatus_e ueStatus;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef NGU_UL_DATA_PROC_H
#define NGU_UL_DATA_PROC_H
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __OMCUUPAPI_H__
/*结构体id*/
typedef enum{
- id_cuupBasicInfoCf = 1,
+ id_cuupBasicInfoCf = 1,
id_cuupIpInfoList,
id_cuupPlmnInfo,
id_qosSupportList,
id_sliceSupportList,
id_cellIdSupportList,
}OM_CuUp_para_struct_id;
-
+
/////CPUP配置信息
#pragma pack(1)
#endif
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef NR_PDCP_COMMON_H
#define NR_PDCP_COMMON_H
typedef enum
{
UPLINK = 0,
- DOWNLINK = 1
+ DOWNLINK = 1
}PdcpDirection_e;
/* pdcp pdu type */
-typedef enum
+typedef enum
{
PDCP_CTRL_PDU = 0, /* control pdu */
PDCP_DATA_PDU = 1 /* data pdu */
REORDER_SPARE22 = PDCP_SPARED,
REORDER_SPARE21 = PDCP_SPARED,
REORDER_SPARE20 = PDCP_SPARED,
- REORDER_SPARE19 = PDCP_SPARED,
+ REORDER_SPARE19 = PDCP_SPARED,
REORDER_SPARE18 = PDCP_SPARED,
REORDER_SPARE17 = PDCP_SPARED,
REORDER_SPARE16 = PDCP_SPARED,
REORDER_SPARE12 = PDCP_SPARED,
REORDER_SPARE11 = PDCP_SPARED,
REORDER_SPARE10 = PDCP_SPARED,
- REORDER_SPARE09 = PDCP_SPARED,
+ REORDER_SPARE09 = PDCP_SPARED,
REORDER_SPARE08 = PDCP_SPARED,
REORDER_SPARE07 = PDCP_SPARED,
REORDER_SPARE06 = PDCP_SPARED,
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include <errno.h>
#include <signal.h>
#include <netdb.h>
#include <ucontext.h>
#include <stdlib.h>
#include <net/if.h>
-#include <netinet/ip.h>
-#include <netinet/if_ether.h>
-#include <netinet/udp.h>
-#include <arpa/inet.h>
+#include <netinet/ip.h>
+#include <netinet/if_ether.h>
+#include <netinet/udp.h>
+#include <arpa/inet.h>
#include <sys/ioctl.h>
-#include <execinfo.h>
+#include <execinfo.h>
#include <getopt.h>
#include <pthread.h>
-#include <memory.h>
-#include <regex.h>
+#include <memory.h>
+#include <regex.h>
#include <stdio.h> /* for the printf() function */
-
+
/* includes required to create a fake IP packet */
#include <netinet/ip.h> /* for the IPv4 header */
#include <string.h> /* for the strlen() */
#include <rohc/rohc_buf.h> /* for the rohc_buf_*() functions */
-
+
/* includes required to use the compression part of the ROHC library */
#include <time.h> /* required by time() */
#include <rohc/rohc_comp.h> /* for rohc_comp_*() functions */
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef PDCP_U_H
#define PDCP_U_H
}PdcpTimer_e;
-typedef struct
+typedef struct
{
UINT32 count;
UINT32 f1uSn; /* Not used in receiving buffer */
typedef struct
-{
- UINT16 notUsed;
+{
+ UINT16 notUsed;
RohcParaPR_e rohcType;
union
{
UINT16 pduSessionId;
UINT64 ueE1apId;
UINT16 ueIdx;
- UINT32 rlcState;
- PdcpRlcMode_e rlcMode;
+ UINT32 rlcState;
+ PdcpRlcMode_e rlcMode;
UINT8 sdapUlHeadLen;
UINT8 sdapDlHeadLen;
- PdcpSnSize_e pdcpSnSizeUl;
+ PdcpSnSize_e pdcpSnSizeUl;
PdcpSnSize_e pdcpSnSizeDl;
- HeaderCompression_t headerCompress;
-
+ HeaderCompression_t headerCompress;
+
UINT8 tDiscardActive; /* TRUE/FALSE */
UINT8 tDiscardRun; /* TRUE/FALSE */
- UINT16 tDiscard; /* ms */
- ModuleMsg_t *pDiscardMsg;
+ UINT16 tDiscard; /* ms */
+ ModuleMsg_t *pDiscardMsg;
UINT8 tReorderActive; /* TRUE/FALSE */
UINT8 tReorderRun; /* TRUE/FALSE */
- UINT16 tReorder; /* ms */
+ UINT16 tReorder; /* ms */
ModuleMsg_t *pReorderMsg;
LONG tReorderId;
-
- MoreThanOneRLCContext moreThanOneRLCContext;
+
+ MoreThanOneRLCContext moreThanOneRLCContext;
UINT8 integrityProtection; /* TRUR: used, FALSE: not used */
- UINT8 outOfOrderDelivery;
+ UINT8 outOfOrderDelivery;
UINT8 ciperingEnabled; /* TRUR: used, FALSE: not used */
PdcpStateVar_t stateVar;
-
- plist pTxPduList; /* transmitting buffer */
+
+ plist pTxPduList; /* transmitting buffer */
ULONG txListLock; /* txListLock */
-
+
plist pRxSduList; /* receiving buffer */
ULONG rxListLock; /* rxListLock */
}PdcpDrbEntity_t;
CuupBearerStatus_e ueStatus;
PdcpuSecInfo_t *secInfo;
PdcpuSecEnableInfo_t *secEnableInfo[CUUP_MAX_SESSION_NUM];
- PdcpDrbEntity_t *pdcpDrbEntity[MAX_DRB_NUM];
+ PdcpDrbEntity_t *pdcpDrbEntity[MAX_DRB_NUM];
}PdcpuUeInfo_t;
typedef struct
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef PDCPU_CORE_H
#define PDCPU_CORE_H
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef PDCPU_DL_DATA_PROC_H
#define PDCPU_DL_DATA_PROC_H
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __PLAT_ALARM_H__
UCHAR reserved[2]; ///< 保留字段
} __attribute__((packed)) alm_status_t;
-/**
+/**
* 通用告警上报API,使用变长参数,变长参数只支持ULONG 和char * 字符串。
* 设备索引和上报参数依次排列,不能乱序。
* @param[in] alarmType 告警类型
LONG alarm_commonReport( LONG alarmType, LONG alarmId, ... );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 TrapOid。
* @param[in ] alarmType 告警类型
* @param[in ] alarmId 告警ID
* @param[out] pTrapOid 存放oid 的数组
* @param[out] pOidLen oid长度
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_TrapOid_get( ULONG alarmType, ULONG alarmId, ULONG pTrapOid[TRAP_OID_LEN], LONG *pOidLen );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 level。
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
- * @return 成功返回告警 level,失败返回 0
+ * @return 成功返回告警 level,失败返回 0
*/
ULONG alarm_Level_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 trap使能。
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
ULONG alarm_TrapEnable_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 index个数。
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
ULONG alarm_IndexNum_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 参数个数。
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
ULONG alarm_ParaNum_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 index打印格式。
* @param[in ] alarmType 告警类型
* @param[in ] alarmId 告警ID
* @param[out] fmt index打印格式
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_IndexFormat_get( ULONG alarmType, ULONG alarmId ,CHAR *fmt);
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 参数打印格式。
* @param[in ] alarmType 告警类型
* @param[in ] alarmId 告警ID
* @param[out] fmt 参数打印格式
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_ParaFormat_get( ULONG alarmType, ULONG alarmId ,CHAR *fmt);
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 priority
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
- * @return 成功返回告警 priority,失败返回 0
+ * @return 成功返回告警 priority,失败返回 0
*/
ULONG alarm_Priority_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 根据 alarmType 和 alarmId 获取告警 PartnerId
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
- * @return 成功返回告警 PartnerId,失败返回 0
+ * @return 成功返回告警 PartnerId,失败返回 0
*/
ULONG alarm_PartnerId_get( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 判断该告警是否为事件
* @param[in] alarmType 告警类型
* @param[in] alarmId 告警ID
- * @return 为事件返回真,为告警返回false
+ * @return 为事件返回真,为告警返回false
*/
BOOL alarm_is_event( ULONG alarmType, ULONG alarmId );
-/**
+/**
* 将告警数据转换成字符串
* @param[in] pAlmMsg 告警数据
* @param[in] logDesc 存放转换后的结果
* @param[in] size logDesc 的大小,建议大小512字节
- * @return 返回指向转换结果的指针(同logDesc)
+ * @return 返回指向转换结果的指针(同logDesc)
*/
CHAR *alarmDataToStrings( alarmMsg_t *pAlmMsg, CHAR *logDesc,LONG size );
-/**
+/**
* 获取当前告警的第一条。
* @param[out] pItem 告警条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_cur_list_get_first(alm_status_t *pItem);
-/**
+/**
* 获取当前告警的下一条。
* @param[in ] pItem 当前条目
* @param[out] pItem 下一条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_cur_list_get_next(alm_status_t *pItem);
-/**
+/**
* 获取历史告警的第一条。
* @param[out] pItem 告警条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_hist_list_get_first(alm_status_t *pItem);
-/**
+/**
* 获取历史告警的下一条。
* @param[in ] pItem 当前条目
* @param[out] pItem 下一条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_hist_list_get_next(alm_status_t *pItem);
-/**
+/**
* 获取事件的第一条。
* @param[in ] pItem 当前条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_event_list_get_first(alm_status_t *pItem);
-/**
+/**
* 获取事件的下一条。
* @param[in ] pItem 当前条目
* @param[out] pItem 下一条目
- * @return 成功返回 VOS_OK ,失败返回 其他
+ * @return 成功返回 VOS_OK ,失败返回 其他
*/
LONG alarm_alm_event_list_get_next(alm_status_t *pItem);
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#define DB_FILTER_SUB_VAL_NUM 8
/** INTEGER类型数据长度 */
-#define DB_INTEGER_LEN 8
+#define DB_INTEGER_LEN 8
/** TIME类型数据长度 */
-#define DB_TIME_LEN 16
+#define DB_TIME_LEN 16
/** 时间字符串数据长度 */
-#define DB_TIME_STR_MAX_LEN 22
+#define DB_TIME_STR_MAX_LEN 22
/** MAC地址类型数据长度 */
-#define DB_MAC_ADDR_STR_MAX_LEN 18
+#define DB_MAC_ADDR_STR_MAX_LEN 18
/** IPV4地址类型数据长度 */
-#define DB_IPV4_ADDR_STR_MAX_LEN 16
+#define DB_IPV4_ADDR_STR_MAX_LEN 16
/** IPV6地址类型数据长度 */
-#define DB_IPV6_ADDR_STR_MAX_LEN 40
+#define DB_IPV6_ADDR_STR_MAX_LEN 40
#define DB_FILTER_OP_STR_LEN 10
/** 数据库的数据类型 */
typedef enum DB_data_type_e{
- DB_DATA_TYPE_INTEGER = 1L, ///< 数值型
- DB_DATA_TYPE_STR , ///< 字符串型
- DB_DATA_TYPE_DATETIME , ///< 时间型
- DB_DATA_TYPE_MAC , ///< MAC地址型
- DB_DATA_TYPE_IPV4_ADDR , ///< IPv4地址型
- DB_DATA_TYPE_IPV6_ADDR , ///< IPv6地址型
- DB_DATA_TYPE_BUFFER , ///< buffer型
+ DB_DATA_TYPE_INTEGER = 1L, ///< 数值型
+ DB_DATA_TYPE_STR , ///< 字符串型
+ DB_DATA_TYPE_DATETIME , ///< 时间型
+ DB_DATA_TYPE_MAC , ///< MAC地址型
+ DB_DATA_TYPE_IPV4_ADDR , ///< IPv4地址型
+ DB_DATA_TYPE_IPV6_ADDR , ///< IPv6地址型
+ DB_DATA_TYPE_BUFFER , ///< buffer型
DB_DATA_TYPE_MAX
}DB_data_type_t;
/** 数据库的查询的比较类型 */
typedef enum DB_filter_sub_type_e{
- DB_FILTER_SUB_TYPE_EQUAL = 1, ///< 相等
- DB_FILTER_SUB_TYPE_N_EQUAL , ///< 不相等
- DB_FILTER_SUB_TYPE_GREAT , ///< 大于
- DB_FILTER_SUB_TYPE_LESS , ///< 小于
- DB_FILTER_SUB_TYPE_GREAT_EQ , ///< 大于等于
- DB_FILTER_SUB_TYPE_LESS_EQ , ///< 小于等于
- DB_FILTER_SUB_TYPE_INCLUDE , ///< 包含
- DB_FILTER_SUB_TYPE_EXCLUDE , ///< 不包含
+ DB_FILTER_SUB_TYPE_EQUAL = 1, ///< 相等
+ DB_FILTER_SUB_TYPE_N_EQUAL , ///< 不相等
+ DB_FILTER_SUB_TYPE_GREAT , ///< 大于
+ DB_FILTER_SUB_TYPE_LESS , ///< 小于
+ DB_FILTER_SUB_TYPE_GREAT_EQ , ///< 大于等于
+ DB_FILTER_SUB_TYPE_LESS_EQ , ///< 小于等于
+ DB_FILTER_SUB_TYPE_INCLUDE , ///< 包含
+ DB_FILTER_SUB_TYPE_EXCLUDE , ///< 不包含
DB_FILTER_SUB_TYPE_MAX
}DB_filter_sub_type_t;
/** filter的组合方式 */
typedef enum DB_filter_option_e{
- DB_FILTER_OPTION_AND = 1, ///< 与
- DB_FILTER_OPTION_OR , ///< 或
+ DB_FILTER_OPTION_AND = 1, ///< 与
+ DB_FILTER_OPTION_OR , ///< 或
DB_filter_TYPE_MAX
}DB_filter_option_t;
/** 排序方式 */
typedef enum DB_order_type_e{
DB_ORDER_TYPE_ASCEND = 0, ///< 升序(默认)
- DB_ORDER_TYPE_DESCEND = 1, ///< 降序
+ DB_ORDER_TYPE_DESCEND = 1, ///< 降序
DB_ORDER_TYPE_MAX
}DB_order_type_t;
#define DB_ORDER_TYPE_DESCEND_STR "DESC"
/** 列信息 */
typedef struct DB_column_info_s{
- CHAR name[DB_COLUMN_NAME_LEN]; ///< 列名
- LONG type; ///< 数据的类型
- LONG size; ///< 对于BUFFER和STR 类型,代表BUFFER 和 STR(包含字符串结尾 '\0') 占用的字节数
- LONG pkey; ///< 主键标志
- CHAR fkey[DB_FKEY_LEN]; ///< 外键,表名+.+列名的字符串,格式为 table(column),字符串长度为 0 则表示不是外键
+ CHAR name[DB_COLUMN_NAME_LEN]; ///< 列名
+ LONG type; ///< 数据的类型
+ LONG size; ///< 对于BUFFER和STR 类型,代表BUFFER 和 STR(包含字符串结尾 '\0') 占用的字节数
+ LONG pkey; ///< 主键标志
+ CHAR fkey[DB_FKEY_LEN]; ///< 外键,表名+.+列名的字符串,格式为 table(column),字符串长度为 0 则表示不是外键
DB_data_val_t defaultVal; ///< 默认值
}VOS_PACKED DB_column_info_t;
/** 数据库句柄 */
typedef struct DB_database_s{
- CHAR path[FILE_PATH_MAX]; ///< 文件路径
- VOID *handle; ///< 被打开的数据库
+ CHAR path[FILE_PATH_MAX]; ///< 文件路径
+ VOID *handle; ///< 被打开的数据库
LONG seqID;
}DB_database_t;
CHAR name[DB_TABLE_NAME_LEN]; ///< name 表名
LONG max_row; ///< 静态表标志,1为静态表,0为动态表
DB_table_init_func_t table_init_func; ///< 表初始化函数,可以为空
- CHAR table_init_func_name[DB_TABLE_INIT_FUNC_NAME_LEN];
+ CHAR table_init_func_name[DB_TABLE_INIT_FUNC_NAME_LEN];
}DB_table_info_t;
/** filer子元素 */
DB_RET_CODE_table_full , ///< 表已满,无法在添加数据
DB_RET_CODE_error, ///< 其他错误
- DB_RET_CODE_max, ///<
+ DB_RET_CODE_max, ///<
}DB_ret_code_t;
-/**
+/**
* 打开平台数据库
* @param[out] db 成功时返回被打开的数据
* @return 成功返回 VOS_OK,失败则返回其他
- */
+ */
LONG DB_open_plat_db(DB_database_t *db);
-/**
+/**
* 关闭平台数据库
* @param[in ] db 要操作的数据库
* @return 成功返回 VOS_OK,失败则返回其他
- */
+ */
LONG DB_close_plat_db(DB_database_t *db);
-/**
+/**
* 查看表是否存在
* @param[in ] db 要操作的数据库
* @param[in ] table_name 表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
- */
+ */
BOOL DB_table_exist(DB_database_t *db,const CHAR *table_name,
LONG *retCode,LONG timeout);
-/**
+/**
* 在指定数据库中创建表
* @param[in ] db 要操作的数据库
* @param[in ] table 表信息
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
- */
+ */
LONG DB_table_create(DB_database_t *db,DB_table_info_t *table,DB_column_info_t cols[],
LONG *retCode,LONG timeout);
-/**
+/**
* 在指定数据库中删除表
* @param[in ] db 要操作的数据库
* @param[in ] name 表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
- */
+ */
LONG DB_table_delete(DB_database_t *db,const CHAR name[DB_TABLE_NAME_LEN],
LONG *retCode,LONG timeout);
-/**
+/**
* 向表中插入一行数据
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
- */
+ */
LONG DB_table_row_add(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],VOID *data,
LONG *retCode,LONG timeout);
-/**
+/**
* 查询数据
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_query(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],DB_row_handle_t *row_handle,
DB_query_filter_t filter[],LONG filter_num,DB_order_t order[],LONG order_num,
LONG *retCode,LONG timeout);
-/**
+/**
* 获取行句柄当前行数据,并自动指向下一行,当没下一行数据时,句柄会被销毁,不可再用
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_data_pop(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],
DB_row_handle_t *row_handle,VOID *data,
LONG *retCode,LONG timeout);
-/**
+/**
* 销毁行句柄
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_handle_destroy(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],DB_row_handle_t *row_handle,
LONG *retCode,LONG timeout);
-/**
+/**
* 删除行
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_delete(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],
DB_query_filter_t filter[],LONG filter_num,
LONG *retCode,LONG timeout);
-/**
+/**
* 更新行
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_update(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],VOID *newData,
DB_query_filter_t filter[],LONG filter_num,DB_column_info_t col[],LONG col_num,
LONG *retCode,LONG timeout);
-/**
+/**
* 计算行数
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_row_count(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],LONG *row_count,
DB_query_filter_t filter[],LONG filter_num,
LONG *retCode,LONG timeout);
-/**
+/**
* 覆盖最早插入的数据,用于表行数到达上限的覆盖操作
* @param[in ] db 要操作的数据库
* @param[in ] table_name 要操作的表名
* @param[out] retCode 数据库执行结果,如果不关心可以填 NULL,如果关心需要传入timeout,等待时间
* @param[in ] timeout 等待执行结果的时间,单位 秒
* @return 返回向数据库模块发送消息的结果,成功返回 VOS_OK,失败则返回其他,
-*/
+*/
LONG DB_table_overwrite_first_row( DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN],VOID *newData,
LONG *retCode,LONG timeout);
-/**
+/**
* 将DB 的error code转换成字符串
* @param[in ] code 错误码
* @return 返回错误码对应的字符串
-*/
+*/
const CHAR *DB_err_msg(LONG code);
#endif /* end of __cplusplus */
#endif /* end of __PLAT_DB_H__ */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef PLATFORM_INCLUDE_PLAT_SYSLOG_H_
/** 日志等级 */
typedef enum _tag_SYSLOG_LEVEL
{
- SYSLOG_CRIT = 1, ///< critical conditions
- SYSLOG_ERR, ///< error conditions
- SYSLOG_WARNING, ///< warning conditions
- SYSLOG_INFO, ///< informational
+ SYSLOG_CRIT = 1, ///< critical conditions
+ SYSLOG_ERR, ///< error conditions
+ SYSLOG_WARNING, ///< warning conditions
+ SYSLOG_INFO, ///< informational
SYSLOG_DEBUG, ///< debug info
- VOS_SYSLOGLEVELS_NUM ///< max
+ VOS_SYSLOGLEVELS_NUM ///< max
}SYSLOG_LEVEL;
-/**
+/**
* 日志记录
* @param[in] module_id 模块ID
* @param[in] iLog_Level Log等级
VOS_SysLog(module_id, iLog_Level, __FILE__, __LINE__, __func__, content,##__VA_ARGS__);
-/**
+/**
* 指定参数日志记录,只支持打印 %d 类型,传参必须为INT
* @param[in] module_id 模块ID
* @param[in] iLog_Level Log等级
VOS_NsysLog(module_id, iLog_Level, __FILE__, __LINE__, __func__, para_no, content,##__VA_ARGS__);
-/**
+/**
* 指定参数日志记录,只支持打印 %ld %lu %lx 类型,传参必须为LONG ULONG
* @param[in] module_id 模块ID
* @param[in] iLog_Level Log等级
VOS_NsysLog_2(module_id, iLog_Level, __FILE__, __LINE__, __func__, para_no, content,##__VA_ARGS__);
-/**
+/**
* 指定参数日志记录,只支持打印 %ld %lu %lx %d %u %x %s 类型
* @param[in] module_id 模块ID
* @param[in] iLog_Level Log等级
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __PLATFORM_MODULE_NAMES_H__
#endif /* __cplusplus */
#endif /* __PLATFORM_MODULE_NAMES_H__ */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __SDAPCORE_H__
#define __SDAPCORE_H__
}SdapActivityNotify_t;
-/* 1、每个实体内的Session ID、drbID、QosFlowId,都是连续的
+/* 1、每个实体内的Session ID、drbID、QosFlowId,都是连续的
2、Session和Qos相关的信息都是以ID作为下标保存的
3、DRB是以DRB ID - 1 保存的*/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __SYS_MAIN_API_H__
/********************* local板卡工作模式、主备状态相关 ****** *****************/
#define SYS_LOCAL_MODULE_SLOTNO_GET (sys_local_module_slotno_get()) /*本板槽位号*/
-#define SYS_LOCAL_MODULE_WORKMODE_ISMASTER SYS_MODULE_WORKMODE_ISMASTER(SYS_LOCAL_MODULE_SLOTNO_GET) /*本板是否工作在master*/
+#define SYS_LOCAL_MODULE_WORKMODE_ISMASTER SYS_MODULE_WORKMODE_ISMASTER(SYS_LOCAL_MODULE_SLOTNO_GET) /*本板是否工作在master*/
#define SYS_LOCAL_MODULE_WORKMODE_ISSLAVE SYS_MODULE_WORKMODE_ISSLAVE(SYS_LOCAL_MODULE_SLOTNO_GET) /*本板是否工作在slave*/
#define SYS_LOCAL_MODULE_ISMASTERACTIVE SYS_MODULE_ISMASTERACTIVE(SYS_LOCAL_MODULE_SLOTNO_GET) /*本板是否是主用主控*/
#define SYS_LOCAL_MODULE_ISMASTERSTANDBY SYS_MODULE_ISMASTERSTANDBY(SYS_LOCAL_MODULE_SLOTNO_GET) /*本板是否是备用主控*/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __UPCCOMMON_H__
INT32 upcSendE1apMsg(void *pMsg, UINT64 msgLen);
extern INT32 vosAdpSendAsynMsg2ModuleEx( CHAR src_moduleName[MODULE_NAME_LEN],
- CHAR dst_moduleName[MODULE_NAME_LEN],
+ CHAR dst_moduleName[MODULE_NAME_LEN],
VOID *msgData,
LONG msgDataLen);
INT32 upcConstructAndSendOamUpActRsp(int actNum, int failNum, CellIdList_t failCellList);
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __UPCCONTEXT_H__
#define __UPCCONTEXT_H__
/* QOS Info Begin */
QosFlowLevelQosPar_t qosPara;
-
+
UINT8 qosMapFlag;
QosFlowMapInd_e qosFlowMapInd;
/* QOS Info End */
UINT8 dlAMBRFlag;
UINT64 sessDlAMBR;
-
+
UINT8 DFIReqFlag;
DFIRequest_t DFIInfoReq;
UINT8 DFIRspFlag;/* Only Mod Optional */
upcTempSessInfo_t *pTempSessSetupList;
upcTempSessInfo_t *pTempSessModList;
-
+
/* Content --Begin */
UINT8 secuInfoFlag;/* Only Mod Optional */
SecuInfo_t secuInfo;
UINT8 dlAmbrFlag;/* Only Mod Optional */
UINT64 ueDlAMBR;
-
+
PlmnId_t servPlmnId;
- ActNotiLevel_e actNotiLevel;
-
+ ActNotiLevel_e actNotiLevel;
+
UINT8 dlIPDRFlag;
UINT64 ueDlMaxIPDR;
{
UINT8 useFlag;
INT64 drbId;
-
+
SdapCfg_t sdapConfig;
PDCPConfiguration_t pdcpConfig;
UPParametersList_t f1UlUpPara;
DFIRequest_t dataForInfoReq;
-
+
INT64 networkInstance;
-
+
UINT8 drbNum;
UpDrbCb_t *pDrbCb[UPC_MAX_DRB_NUM];
UINT64 ueDlAMBR;
UINT64 ueDlMaxIPDR;
PlmnId_t plmnId;
-
+
INT64 inActTimer;
-
+
UINT16 sessNum;/* current session num */
UpSessCb_t *pSessCb[UPC_MAX_SESSION_NUM];
struct upInstance *pUpInstance;
IpAddress_t upAddr[UPC_MAX_IP_NUM];
INT8 cpAddrNum;
IpAddress_t cpAddr[UPC_MAX_IP_NUM];
-
+
INT64 upCapa;
UINT32 bPlmnNum;
E1apUpbPlmnCfgInfo_t bPlmnCfgInfo[e1ap_maxnoofSPLMNs];
#endif
#endif
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef VOS_NTOHL /* 4字节 */
#if 0
#define VOS_NTOHL(x) ((((x) & 0xFF000000)>>24) | (((x) & 0x00FF0000)>>8) | \
- (((x) & 0x0000FF00)<<8 ) | (((x) & 0x000000FF)<<24))
+ (((x) & 0x0000FF00)<<8 ) | (((x) & 0x000000FF)<<24))
#endif
#define VOS_NTOHL(x) ntohl(x)
#endif
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_CLI_H__
/** VOS 预定义的节点 */
enum node_type
{
- VOS_CLI_VIEW_NODE, ///< View node. Default mode of vty interface.
- VOS_CLI_CONFIG_NODE, ///< Config node. Default mode of config file.
- VOS_CLI_DEBUG_HIDDEN_NODE, ///< Debug hidden node.
+ VOS_CLI_VIEW_NODE, ///< View node. Default mode of vty interface.
+ VOS_CLI_CONFIG_NODE, ///< Config node. Default mode of config file.
+ VOS_CLI_DEBUG_HIDDEN_NODE, ///< Debug hidden node.
VOS_CLI_CONFIRM_ACTION_NODE, ///< Confirm action.
VOS_CLI_RESV_MAX_NODE ///< Vos max reserved node ID
};
/* vty 接入类型console,telnet, telnet IPv6 */
int conn_type;
-
+
/* vty 接入用户名 */
char *user_name;
/* vty 会话任务 */
struct cl_lib_thread_master *sub_thread_master;
-
+
/* vty 会话任务handle */
VOS_HANDLE sub_task_id;
/* vty 调试标志位 */
- unsigned short debug_monitor;
+ unsigned short debug_monitor;
/************************************
- frozen vty in and(or) out
+ frozen vty in and(or) out
used for if a command can't return immediately
then call frozen to freeze vty's in and(or) out
call unfrozen when finished.
/** cl_vector 动态数组指针 */
-struct _cl_vector
+struct _cl_vector
{
- unsigned int max; ///< 当前最大索引加1
+ unsigned int max; ///< 当前最大索引加1
unsigned int alloced; ///< 数组大小 */
void **index; ///< 指针数组
};
int (*func) (struct cmd_element *, struct vty *, int, char **); ///< 命令回调函数
char *doc; ///< 命令说明,对命令字符串中的每个单词进行说明
int msg_flag; ///< 命令类型标识,当前只有 DEFUN_FLAG 类型
- cl_vector strvec; ///< 将 string和doc 拆分后放入该数组中 ,存放struct desc
+ cl_vector strvec; ///< 将 string和doc 拆分后放入该数组中 ,存放struct desc
int cmdsize; ///< string 中单词个数
- cl_vector subconfig; ///< 将 string中可以重复的单词的重复位置和重复次数等
+ cl_vector subconfig; ///< 将 string中可以重复的单词的重复位置和重复次数等
};
#define DEFUN_FLAG 0
-/**
+/**
* 命令行定义宏
* @param[in] funcname 回调函数的函数名
* @param[in] cmdname 命令变量的变量名
int funcname (struct cmd_element *self, struct vty *vty, int argc, char **argv)
-/**
+/**
* 命令行回调函数中的标准输出函数,
* 注意 LONG 输出时,要用%ld,或%lx
* @param[in] vty vty
*/
INT vty_out ( struct vty * vty, const CHAR * format, ... );
-/**
+/**
* 创建并安装命令节点
* @param[in] prompt 节点提示符,用于命令行提示符的显示
* @return 成功返回 一个新节点的指针,失败返回NULL
struct cmd_node *VOS_cli_create_node(char prompt[VTY_CMD_PROMPT_MAX]);
-/**
+/**
* 把命令安装到指定节点
* @param[in] node_id 节点ID
* @param[in] cmd 命令
VOID VOS_cli_install_element( enum node_type node_id, struct cmd_element * cmd );
-/**
+/**
* 在进入节点函数中调用,用于进入节点
* @param[in] vty vty
* @param[in] newnode 要进入的节点ID
LONG vty_enter_node(struct vty *vty,enum node_type newnode);
-/**
+/**
* 在进入节点函数中调用,用于自定义要进入节点的命令行提示符,
* 调用vty_enter_node后调用
* @param[in] vty vty
mac_match,
slot_port_match,
slot_subport_match,
-
+
time_match,
range_match,
/*其余的匹配类型在此之前*/
register_match,
-
+
exact_match
};
CHAR IsCapital ; ///< 是否包含大写字母 0 - 全小写; 1 - 含有大写字母
}CMD_NOTIFY_REFISTER_S;
-/**
+/**
* 添加自定义命令行参数解析函数
* @param[in] pNotifyRegister 自定义解析函数信息
* @return 成功返回 register_match,失败返回no_match
*/
enum match_type cmd_rugular_register(CMD_NOTIFY_REFISTER_S * pNotifyRegister);
-/**
+/**
* 配置/获取 vty超时时间
* @param[in ] vty vty
* @param[in ] newTime 新的超时时间,大于等于0时有效,0表示不会超时
* @param[out] oldTime 如果不为NULL 返回配置前的超时时间
* @return 成功返回 VOS_OK,失败则返回其他
- */
+ */
LONG vty_timeout_config ( struct vty * vty, LONG newTime, LONG *oldTime);
-/**
- * 要使用vty_very_big_out 函数必须先调用此初始化函数
+/**
+ * 要使用vty_very_big_out 函数必须先调用此初始化函数
* @param[in ] vty vty
*/
void vty_very_big_out_init ( struct vty *vty );
-/**
- * 用于长字符串打印
+/**
+ * 用于长字符串打印
* @param[in] vty vty
* @param[in] format 格式字符串
* @param[in] ... 要输出的变量
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
- ******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef _VOS_COMMON_H_
#define _VOS_COMMON_H_
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef _VOS_LIB_H_
#define _VOS_LIB_H_
#define FILE_PATH_MAX 4096
-/**
+/**
* VOS 平台初始化
* @param[in] appPath APP文件路径
* @param[in] cfgPath vos config 文件路径
* @param[in] mods 定义已存在模块的数组
* @param[in] num mods数组大小
* @return 成功时返回申请内存的地址,失败则返回NULL。
- */
+ */
LONG VOS_Init(const CHAR *appPath,const CHAR *cfgPath,vos_module_t * mods,INT num);
-/**
+/**
* 分配内存
* @param[in] ulSize 申请内存的大小
* @param[in] ulModuleId 申请模块的模块ID
* @return 成功时返回申请内存的地址,失败则返回NULL。
- */
+ */
#define VOS_Malloc(ulSize,ulModuleId) VOS_MallocWithDebug(ulSize,ulModuleId,(UCHAR *)__FILE__,__LINE__)
-/**
+/**
* 释放内存
* @param[in] ptr 释放内存的指针
- */
+ */
#define VOS_Free(ptr) VOS_Free_Debug(ptr,(UCHAR *)__FILE__,__LINE__)
-/**
+/**
* 根据bExp判断是否打印调用栈
* @param[in] exp 当bExp为假时打印调用栈
- */
+ */
#define VOS_ASSERT(exp) VOS_ASSERT_X( (LONG)(exp), __FILE__, __LINE__ , 0)
-/**
- * 格式化输出到默认输出
+/**
+ * 格式化输出到默认输出
* 注意 LONG 输出时,要用%ld,或%lx
* @param[in] format 格式字符串
* @param[in] ... 要输出的变量
* @return 返回输出的字节数
- */
+ */
ULONG VOS_Printf(const CHAR *format ,...);
-/**
+/**
* 格式化输出到指定字符串中
* @param[in] buf 输出位置
* @param[in] fmt 格式字符串
* @param[in] ... 要输出的变量
* @return 返回输出的字节数
- */
+ */
ULONG VOS_Sprintf(CHAR *buf ,CHAR *fmt, ...);
-/**
+/**
* 格式化输出到指定字符串中
* @param[in] buf 输出位置
* @param[in] size buf的大小
* @param[in] fmt 格式字符串
* @param[in] ... 要输出的变量
* @return 返回输出的字节数
- */
+ */
ULONG VOS_Snprintf(CHAR *buf, ULONG size, CHAR *fmt, ...);
-/**
+/**
* 读取格式化的字符串中的数据
* @param[in] buf 要读取的字符串
* @param[in] fmt 读取格式
* @param[in] ... 存储数据的指针
* @return 返回成功读取的字段个数
- */
+ */
ULONG VOS_Sscanf(const CHAR * buf, const CHAR * fmt,...);
/** 同 vsprintf */
ULONG VOS_Vsprintf(CHAR * buf, const CHAR * fmt, va_list args);
-/**
+/**
* 判断文件是否存在
* @param[in] path 文件路径
* @return path存在返回TURE,不存在则返回FALSE
- */
+ */
BOOL VOS_file_exist(const CHAR *path);
#define NUM_LIST_MAX 4096
-/**
+/**
* 将数值list字符串(1-6,8,13)转换为,数组
* @param[in ] list 数值字符串
* @param[out] numList 解析后的数值数组
* @return 成功解析的个数
- */
+ */
LONG parseNumList(const CHAR * list,ULONG numList[NUM_LIST_MAX]);
-/**
+/**
* 将数值list字符串(1-6,8,13)转换为一个ULONG bitmap
* @param[in ] list 数值字符串
* @param[out] map 解析后的bitmap
* @return 成功返回VOS_OK,失败返回其他
- */
+ */
LONG parseNumList2BitMap(const CHAR * list,ULONG *map);
-/**
+/**
* 延时
* @param[in ] seconds 延时的秒数
*/
typedef VOID( *VOS_SIGNAL_FUNC ) ( int signal);
-/**
+/**
* vos信号处理回调函数注册
* @param[in ] sig 信号
* @param[in ] sig_handler 回调函数
* @return 成功返回VOS_OK,失败返回VOS_ERROR
- */
+ */
LONG Vos_Signal(int sig, VOS_SIGNAL_FUNC sig_handler);
-/**
+/**
* product信号处理回调函数注册
* @param[in ] sig 信号
* @param[in ] status 是否退出
* @param[in ] sig_handler 回调函数
* @return 成功返回VOS_OK,失败返回VOS_ERROR
- */
+ */
LONG Product_Signal(int sig, ULONG status, VOS_SIGNAL_FUNC sig_handler);
-/**
+/**
* product最后处理的信号回调函数注册
* @param[in ] sig 信号
* @param[in ] status 是否退出
* @param[in ] sig_handler 回调函数
* @return 成功返回VOS_OK,失败返回VOS_ERROR
- */
+ */
LONG Product_Signal_Last(int sig, ULONG status, VOS_SIGNAL_FUNC sig_handler);
-/**
+/**
* 信号处理模块初始化
* @param[in ] signal 信号
* @return 成功返回VOS_OK,失败返回VOS_ERROR
- */
+ */
LONG Vos_SignalInit();
//信号最小值
/*=========================================================================================================================*/
/* ###### 下面的函数不要直接调用,使用上面提供的宏 ###### */
-/**
+/**
* 分配内存,不要直接调用该API,通过宏 VOS_Malloc 调用
* @param[in] size 申请内存的大小
* @param[in] moduleId 申请内存的模块ID
* @param[in] file 申请内存处的文件名
* @param[in] line 申请内存处的行号
* @return 成功时返回申请内存的地址,失败则返回NULL。
- */
+ */
void* VOS_MallocWithDebug(unsigned long size, unsigned long moduleId, unsigned char *file, unsigned long line);
-/**
+/**
* 释放内存,不要直接调用该API,通过宏 VOS_Free 调用
* @param[in] ptr 释放内存的地址
* @param[in] file 释放内存处的文件名
* @param[in] line 释放内存处的行号
* @return
- */
+ */
void VOS_Free_Debug(const void *ptr, UCHAR *file, ULONG line);
-/**
+/**
* 打印断言,根据bExp判断是否打印调用栈,不要直接调用该API,通过宏 VOS_ASSERT 调用
* @param[in] bExp 当bExp为假时打印调用栈
* @param[in] szFileName 打印处的文件名
* @param[in] iLine 打印处的行号
* @param[in] bOutConsole 输出fd
- */
+ */
VOID VOS_ASSERT_X( BOOL bExp, CHAR *szFileName, INT iLine , INT bOutConsole);
/******计算某个函数运行时间******/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
/** 获得节点中的数据 */
#define cl_lib_getdata(X) ((X)->data)
-/**
+/**
* 创建一个linklist
* @param[in] name list名 最大长度 LIST_NAME_LEN
* @param[in] moduleID 创建list的模块ID
* @return 成功时返回新list地址,失败则返回NULL。
- */
+ */
struct cl_lib_list *cl_lib_list_new (char *name,unsigned long moduleID);
-/**
+/**
* free并删除linklist中的所有节点,然后free该list
* !!!注意,如果data也需要free,则需要实现list的del成员
* @param[in] plist1 要删除的list
*/
void cl_lib_list_delete ( struct cl_lib_list * plist1 );
-/**
+/**
* 将数据添加到链表尾,直接传入要添加的数据,该API会自动创建节点
* @param[in] plist1 待添加的list
* @param[in] val 待添加的数据
void cl_lib_listnode_add ( struct cl_lib_list * plist1, void * val );
-/**
+/**
* 将数据添加到链表头,直接传入要添加的数据,该API会自动创建节点
* @param[in] plist1 待添加的list
* @param[in] val 待添加的数据
*/
void cl_lib_listnode_add_toHead ( struct cl_lib_list * plist1, void * val );
-/**
+/**
* 删除数据等于val的节点,!!!不会free 数据
* @param[in] plist1 待删除的list
* @param[in] val 待删除的数据
*/
void cl_lib_listnode_delete ( struct cl_lib_list * plist1, void * val );
-/**
+/**
* 根据注册的cmp函数删除节点,cmd 返回值为0 时删除,!!!不会free 数据
* @param[in] plist1 待删除的list
* @param[in] val cmp 函数参数
*/
void *cl_lib_listnode_cmp_delete ( struct cl_lib_list * plist1, void * val );
-/**
+/**
* 在当前节点前插入数据
* @param[in] plist1 待插入数据的list
* @param[in] currentnode 当前节点
*/
void cl_lib_list_add_node_prev ( plist plist1, plistnode currentnode, void *val );
-/**
+/**
* 在当前节点后插入数据
* @param[in] plist1 待插入数据的list
* @param[in] currentnode 当前节点
*/
void cl_lib_list_add_node_next ( plist plist1, plistnode currentnode, void *val );
-/**
+/**
* 节点查找 API,根据给定val查找
* !!!用此API 需要确保 plist->cmp 成员已赋值,否则无法查找
* !!!不可修改获得节点的 prev 和 next指针
plistnode cl_lib_listnode_lookup_by_val( plist plist1, void *data );
-/**
+/**
* 节点查找 API,根据给定val和cmp方法查找
* !!!不可修改获得节点的 prev 和 next指针
* !!!不可释放获得节点
plistnode cl_lib_listnode_lookup_by_func( plist plist1, int (*cmp)(void *val1, void *val2),void *data);
-/**
+/**
* 查找到的节点,如果想要从链表中删除,必须使用该接口
* !!!注意,如果data也需要free,则需要实现list的del成员
* @param[in] plist1 list
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
-
-
-#ifndef __VOS_MODULE_H__
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
+
+
+#ifndef __VOS_MODULE_H__
#define __VOS_MODULE_H__
#include "vos_types.h"
VOS_MOD_T_HOST, ///< host task
VOS_MOD_T_USER, ///< user task
VOS_MOD_T_EXTERN, ///< 外部模块 (不是 vos app 中的模块,其他的进程 )
- VOS_MOD_T_MAX, ///<
+ VOS_MOD_T_MAX, ///<
}module_type_t;
/** 模块通信类型 */
typedef struct vos_module_s{
module_type_t modType; ///< 模块类型
LONG commType; ///< 当前的通信类型
- ULONG moduleID; ///< 模块ID
- CHAR name[MODULE_NAME_LEN]; ///< 模块名
- ULONG queueID; ///< 模块消息队列,用于接收从其他模块发送过来的消息
+ ULONG moduleID; ///< 模块ID
+ CHAR name[MODULE_NAME_LEN]; ///< 模块名
+ ULONG queueID; ///< 模块消息队列,用于接收从其他模块发送过来的消息
LONG paraCount; ///< 无需关心, (添加的额外参数个数)
void *pPara; ///< 无需关心, (vos_mod_com_para_cb_t)
LONG paraLock; ///< 无需关心,
/** 采用非VOS通信方式的模块需要提供的handle函数,用于接收数据
* buf 用于消息接收的缓冲区
* size buf 大小
-* opval 额外信息,类型为 vos_mod_com_op_t
+* opval 额外信息,类型为 vos_mod_com_op_t
* opvalLen opval的大小
-*
+*
*/
typedef LONG (*receive_handler)(VOID *buf,LONG size,VOID *opval,LONG opvalLen);
-/**
- * 模块注册 API
+/**
+ * 模块注册 API
* 向VOS 模块管理中注册模块 。
* @param[in ] name 模块名,大小为 MODULE_NAME_LEN
* @param[in] module 模块管理信息
* module.name
* module.moduleID
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_module_register(const CHAR *name,vos_module_t *module);
-/**
- * 模块注销 API
+/**
+ * 模块注销 API
* 向VOS 模块管理中注册模块 。
* @param[in ] name 模块名,大小为 MODULE_NAME_LEN
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_module_deregister(const CHAR *name);
-/**
- * 根据模块ID获得模块名
+/**
+ * 根据模块ID获得模块名
* @param[in ] id 模块ID
* @param[out] name 模块名,大小为 MODULE_NAME_LEN
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_module_get_name(ULONG id,CHAR name[MODULE_NAME_LEN]);
-/**
- * 根据模块名获得模块ID
+/**
+ * 根据模块名获得模块ID
* @param[in ] name 模块名,大小为 MODULE_NAME_LEN
* @return 成功返回模块ID,失败返回 0
- */
+ */
ULONG VOS_module_get_Id(CHAR *name);
-/**
- * 向某个模块发送异步消息
+/**
+ * 向某个模块发送异步消息
* @param[in ] dst_slot 目的槽位号
* @param[in ] dst_moduleName 目的模块名,大小为 MODULE_NAME_LEN
* @param[in ] src_moduleName 源模块名,大小为 MODULE_NAME_LEN
* @param[in ] msgData 消息数据
* @param[in ] msgDataLen 消息数据长度
* @return 成功返回 VOS_OK,失败返回 其他
- */
+ */
LONG VOS_SendAsynMsg2Module(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],CHAR src_moduleName[MODULE_NAME_LEN],
LONG msgCode,VOID *msgData,LONG msgDataLen);
-/**
- * 向某个模块发送同步消息
+/**
+ * 向某个模块发送同步消息
* @param[in ] dst_slot 目的槽位号
* @param[in ] dst_moduleName 目的模块名,大小为 MODULE_NAME_LEN
* @param[in ] src_moduleName 源模块名,大小为 MODULE_NAME_LEN
* @param[out] ackDataLen 输出:buf的有效长度
* @param[in ] timeout 等待接收的时间,单位毫秒,调用者自行判断需要等待时间,一般等待 5秒
* @return 成功返回 VOS_OK,失败返回 其他
- */
+ */
LONG VOS_SendSynMsg2Module(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],CHAR src_moduleName[MODULE_NAME_LEN],
LONG msgCode,VOID *msgData,LONG msgDataLen,VOID *ackData,LONG *ackDataLen,LONG timeout);
-/**
- * 向某个模块发送异步消息,支持非VOS通信方式
+/**
+ * 向某个模块发送异步消息,支持非VOS通信方式
* @param[in ] dst_slot 目的槽位号
* @param[in ] dst_moduleName 目的模块名,大小为 MODULE_NAME_LEN
* @param[in ] src_moduleName 源模块名,大小为 MODULE_NAME_LEN
* @param[in ] optval 可选参数,不需要则填NULL
* @param[in ] optlen 可选参数长度
* @return 成功返回 VOS_OK,失败返回 其他
- */
+ */
LONG VOS_SendAsynMsg2ModuleEx(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],CHAR src_moduleName[MODULE_NAME_LEN],
LONG msgCode,VOID *msgData,LONG msgDataLen,
module_comm_type_t commType,VOID *optval,LONG optlen);
-/**
- * 向某个模块发送同步消息,仅支持VOS通信方式
+/**
+ * 向某个模块发送同步消息,仅支持VOS通信方式
* @param[in ] dst_slot 目的槽位号
* @param[in ] dst_moduleName 目的模块名,大小为 MODULE_NAME_LEN
* @param[in ] src_moduleName 源模块名,大小为 MODULE_NAME_LEN
* @param[in ] optval 可选参数,不需要则填NULL
* @param[in ] optlen 可选参数长度
* @return 成功返回 VOS_OK,失败返回 其他
- */
+ */
LONG VOS_SendSynMsg2ModuleEx(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],CHAR src_moduleName[MODULE_NAME_LEN],
LONG msgCode,VOID *msgData,LONG msgDataLen,VOID *ackData,LONG *ackDataLen,LONG timeout,
module_comm_type_t commType,VOID *optval,LONG optlen);
-/**
-* 回复同步消息
+/**
+* 回复同步消息
* @param[in ] aulMsg VOS_QueReceive 收到的原始消息
* @param[in ] ackData 返回数据的buf
* @param[in ] ackDataLen 返回数据buf的长度
* @return 成功返回 VOS_OK,失败返回 其他
-*/
+*/
LONG VOS_SendSynAckMsg(ULONG aulMsg[VOS_QUEUE_MSG_SIZE],VOID *ackData,LONG ackDataLen);
-/**
-* 注册timer 消息
+/**
+* 注册timer 消息
* @param[in ] module_ID 要注册timer msg的模块号
* @param[in ] msg_code 消息码
* @param[in ] interval 发送间隔,毫秒
* @param[in ] type 类型,循环或者只执行一次
* @param[in ] pArg 附加参数,一般为一个指针
* @return 成功返回 VOS_OK,失败返回 其他
-*/
+*/
LONG VOS_RegTimerMsg(LONG module_ID,LONG msg_code,LONG interval,VOS_TIMER_TYPE_EN type,VOID *pArg);
-/**
-* 注销timer 消息
+/**
+* 注销timer 消息
* @param[in ] module_ID 要注销timer msg的模块号
* @param[in ] msg_code 消息码
* @return 成功返回 VOS_OK,失败返回 其他
-*/
+*/
LONG VOS_DeregTimerMsg(LONG module_ID,LONG msg_code);
/** 用于模块间通信的code 和 handler的map */
typedef struct msg_code_handle_map_s
{
- LONG msg_code; ///< 消息码
+ LONG msg_code; ///< 消息码
VOS_msg_code_handler_ptr handler; ///< 消息码的处理函数
}VOS_msg_code_handle_map_t;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_QUE_H__
}VOS_msgq_pri_t;
-/**
+/**
* 创建消息队列
* @param[in] lMaxMsgs 消息队列中最大消息数目
* @param[in] lOptions 选项,VOS_msgq_type_t 类型,linux中支持MSG_Q_FIFO和MSG_Q_PRIORITY
* @return 成功返回队列ID,失败则返回 0
- */
+ */
ULONG VOS_QueCreate(LONG lMaxMsgs, LONG lOptions);
-/**
+/**
* 删除队列
* @param[in] msgQId 消息队列ID
* @return 成功返回队列ID,失败则返回 0
- */
+ */
LONG VOS_QueDelete(ULONG msgQId);
-/**
+/**
* 向消息队列发消息
* @param[in] msgQId 消息队列ID
* @param[in] aulMsg 发送的消息,含有VOS_QUEUE_MSG_SIZE个ULONG的数组
* @param[in] lPriority 消息的优先级。分为MSG_PRI_NORMAL和MSG_PRI_URGENT两种。
* @return VOS_OK - 成功,其他 - 失败
* @note WINDOWS中存在Bug,队列满了后,不能等待,只能返回失败
- */
+ */
LONG VOS_QueSend(ULONG msgQId, ULONG aulMsg[VOS_QUEUE_MSG_SIZE], LONG lMsec, LONG lPriority);
-/**
+/**
* 从消息队列接受
* @param[in] msgQId 消息队列ID
* @param[in] aulMsg 接收的消息,含有VOS_QUEUE_MSG_SIZE个ULONG的数组
* @return 失败为VOS_ERROR;成功时如果消息队列中消息数为0 则返回VOS_NO_MSG,
* 如果消息队列中消息数不为0 ,则返回VOS_HAVE_MSG。
* @note 一般任务的入口函数就阻塞在VOS_QueReceive。
- */
+ */
LONG VOS_QueReceive(ULONG msgQId, ULONG aulMsg[VOS_QUEUE_MSG_SIZE], LONG lMsec);
-/**
+/**
* 将队列和任务绑定,用于队列管理,一般创建完队列和任务后调用
* @param[in] hTask 任务句柄
* @param[in] ulQId 消息队列ID
VOID VOS_QueBindTask(VOS_HANDLE hTask, ULONG ulQId);
-/**
+/**
* 获得队列中消息的数目
* @param[in] msgQId 消息队列ID
* @return 成功则返回消息队列中消息的数目,失败则VOS_ERROR。
*/
LONG VOS_QueNum(ULONG msgQId);
-/**
+/**
* 删除所有创建的消息队列
* @return 成功VOS_OK
*/
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
*
* The protocol parameters used to initialize and bound retransmission
* timeout (RTO) are tunable. See [SCTP] for more information on how
- * these parameters are used in RTO calculation.
+ * these parameters are used in RTO calculation.
*/
struct sctp_rtoinfo {
sctp_assoc_t srto_assoc_id;
* 8.3, 8.5 get all peer/local addresses in an association.
* This parameter struct is used by SCTP_GET_PEER_ADDRS and
* SCTP_GET_LOCAL_ADDRS socket options used internally to implement
- * sctp_getpaddrs() and sctp_getladdrs() API.
+ * sctp_getpaddrs() and sctp_getladdrs() API.
*/
struct sctp_getaddrs_old {
sctp_assoc_t assoc_id;
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+/******************************************************************************
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
}VOS_sem_option_t;
-/**
+/**
* 创建Bianary类型的信号量,linux中 与Count类型 一致
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @param[in] enInitialState 初始化状态,VOS_SEM_B_STATE 类型的枚举值
* @return 返回SEM_ID,失败则返回 0
- */
+ */
#define VOS_SemBCreate(lOption, enInitialState) __VOS_SemBCreate(lOption, enInitialState, __FUNCTION__, __LINE__)
-/**
+/**
* 创建Count类型的信号量
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @param[in] enInitialState 初始化状态,VOS_SEM_B_STATE 类型的枚举值
* @return 返回SEM_ID,失败则返回 0
- */
+ */
#define VOS_SemCCreate(lOption, enInitialState) __VOS_SemCCreate(lOption, enInitialState, __FUNCTION__, __LINE__)
-/**
+/**
* 创建互斥锁
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @return 返回SEM_ID,失败则返回 0
- */
+ */
#define VOS_SemMCreate(lOption) __VOS_SemMCreate(lOption, __FUNCTION__, __LINE__)
-/**
+/**
* 获取信号量
* @param[in] semID 信号量ID
* @param[in] lMsec 超时等待的时间,单位毫秒,也可以为VOS_WAIT_FOREVER或VOS_NO_WAIT
* @return VOS_OK - 成功,其他 - 失败/超时
- */
+ */
LONG VOS_SemTake(ULONG semID, LONG lMsec);
-/**
+/**
* 释放信号量
* @param[in] semID 信号量ID
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_SemGive(ULONG semID);
-/**
+/**
* 删除信号量
* @param[in] semID 信号量ID
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_SemDelete(ULONG semID);
/* ###### 下面的函数不要直接调用,使用上面提供的宏 ###### */
-/**
+/**
* 不要直接调用该API,通过宏 VOS_SemBCreate 使用
* 创建Bianary类型的信号量,linux中 与Count类型 一致
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @param[in] pFunc 调用该API的文件名
* @param[in] iLine 调用该API的行号
* @return 返回SEM_ID,失败则返回 0
- */
+ */
ULONG __VOS_SemBCreate(LONG lOption, VOS_SEM_B_STATE enInitialState,const CHAR *pFunc, INT iLine);
-/**
+/**
* 不要直接调用该API,通过宏 VOS_SemCCreate 使用
* 创建Count类型的信号量,linux中 与Count类型 一致
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @param[in] pFunc 调用该API的文件名
* @param[in] iLine 调用该API的行号
* @return 返回SEM_ID,失败则返回 0
- */
+ */
ULONG __VOS_SemCCreate(LONG lOption, LONG lInitialCount,const CHAR *pFunc, INT iLine);
-/**
+/**
* 不要直接调用该API,通过宏 VOS_SemMCreate 使用
* 创建互斥锁
* @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO
* @param[in] pFunc 调用该API的文件名
* @param[in] iLine 调用该API的行号
* @return 返回SEM_ID,失败则返回 0
- */
+ */
ULONG __VOS_SemMCreate(LONG lOption,const CHAR *pFunc, INT iLine);
#ifdef __cplusplus
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
-#ifndef __VOS_SOCKMGR_H__
+#ifndef __VOS_SOCKMGR_H__
#define __VOS_SOCKMGR_H__
#include "vos_types.h"
#define COMM_SCTP_ADDR_MAX 5
-#define VOS_SOCKET_MSG_MAX 9000
+#define VOS_SOCKET_MSG_MAX 9000
/** 采用socket mgr 需要提供的handle函数,用于接收数据
* @param[in ] buf 用于消息接收的缓冲区
* @param[in ] size buf 大小
- * @param[in ] opval 额外信息,类型为 vos_mod_com_op_t
+ * @param[in ] opval 额外信息,类型为 vos_mod_com_op_t
* @param[in ] opvalLen opval的大小
*
*/
/** 创建socket需要提供的参数 */
typedef struct vos_sock_para_s
{
- module_comm_type_t type; ///< 通信方式
+ module_comm_type_t type; ///< 通信方式
union{
vos_sockaddr_t addr; ///< socket 通信
sctp_para_t sctp; ///< sctp 通信
}u;
___addr_u client_bind_addr; ///< 创建客户端时如果也需要绑定地址,填写该变量
- receive_handler recv_handle; ///< 接收函数
- accept_handler accept_handle; ///< 接收accept 事件
+ receive_handler recv_handle; ///< 接收函数
+ accept_handler accept_handle; ///< 接收accept 事件
LONG maxClient; ///< tcp server 允许的连接数
BOOL soloMode; ///< 如果为真,则单独创建接收线程;如果为假,则由 VOS socket代理任务负责接收
LONG fdIdx; ///< 无需关心
}vos_sock_para_t;
typedef struct vos_sock_info_s{
- module_comm_type_t type; ///< 通信方式
+ module_comm_type_t type; ///< 通信方式
LONG fd; ///< socket
LONG fdIdx; ///< 无需关心
LONG c_flag; ///< 无需关心
}vos_sock_info_t;
-/**
+/**
* 创建socket通信
* @param[in ] name 模块名,大小为 MODULE_NAME_LEN
* @param[in ] pPara 额外参数数组
* @param[in ] size 数组大小
* @param[out] info socket 相关信息,用于发送消息和删除该socket
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_SOCKET_create(const CHAR *name,vos_sock_para_t *pPara,LONG size,vos_sock_info_t *info);
-/**
+/**
* 删除 socket
* @param[in ] info 创建时获得的socket 相关信息
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_SOCKET_delete(vos_sock_info_t *info);
-/**
+/**
* 判断是否连接成功(只判断tcp 和sctp one-to-one 是否connect成功)
* @param[in ] info 创建时获得的socket 相关信息
* @return 连接正常返回 VOS_TRUE,否则返回 VOS_FALSE
- */
+ */
BOOL VOS_SOCKET_isLink(vos_sock_info_t *info);
-/**
+/**
* socket 发送数据
* @param[in ] info socket 相关信息
* @param[in ] msgData 数据
* @param[in ] msgDataLen 数据长度
* @return 成功返回 发送的字节数 ,失败则返回 VOS_ERROR
- */
+ */
LONG VOS_SOCKET_send(vos_sock_info_t *info,VOID *msgData,LONG msgDataLen);
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
*/
typedef union vos_sockaddr_u
{
- struct sockaddr sa; ///< 通用结构
- struct sockaddr_in sin; ///< IPv4 结构
+ struct sockaddr sa; ///< 通用结构
+ struct sockaddr_in sin; ///< IPv4 结构
struct sockaddr_in6 sin6; ///< IPv6 结构
- struct sockaddr_un un; ///< unix 结构
+ struct sockaddr_un un; ///< unix 结构
struct sockaddr_ll raw; ///< raw 结构
}vos_sockaddr_t;
* 如果 sock 参数为 IPv6 套接字,则传送给 sctp_bindx() 函数的地址可以为 IPv4 或 IPv6 地址。
* @param[in ] sockfd 要绑定的socket
* @param[in ] family 协议族,VOS_AF_INET 和 VOS_AF_INET6 有效
- * @param[in ] port 端口号
+ * @param[in ] port 端口号
* @param[in ] addrStr 地址字符串数组
* @param[in ] addrcnt 地址个数
* @param[in ] flags 有如下取值:
#endif /* end of __cplusplus */
#endif /* end of __VOS_SOCKET_H__ */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_STRING_H__
CHAR *VOS_StrToUpper(CHAR *src);
-/**
+/**
* 复制字符串,申请大小为strlen(src)+1内存,然后将字符串拷入,并返回
* @param[in] src 源字符串
* @param[in] mod_id 模块ID
CHAR *VOS_StrDup (const CHAR *src,INT mod_id);
-/**
+/**
* 复制字符串,并转换为小写,申请大小为strlen(src)+1内存,然后将字符串拷入,并返回
* @param[in] src 源字符串
* @param[in] mod_id 模块ID
CHAR *VOS_StrDupToLower (const CHAR *src,INT mod_id);
-/**
+/**
* 计算从左侧第一个不是空白字符起到字符串结尾的长度
* @param[in] szStr 字符串
* @return 字符串长度
ULONG VOS_StrLeftTrimLen(const CHAR *szStr);
-/**
+/**
* 将str 中的old字符替换成new字符
* @param[in] src 字符串
* @param[in] old 要替换的字符
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
extern "C"{
#endif
-typedef struct
+typedef struct
{
USHORT usMessageType; /*用于指示发送或接收*/
- USHORT usPririty; /*优先级(用户自己定义),支持4个优先级 */
+ USHORT usPririty; /*优先级(用户自己定义),支持4个优先级 */
ULONG ulSrcModuleID; /*源模块号*/
ULONG ulDstModuleID; /*目标模块号*/
- ULONG ulSequence; /*发送序号,RPC专用*/
+ ULONG ulSequence; /*发送序号,RPC专用*/
ULONG ulSrcSlotID; /*源槽位号*/
ULONG ulDstSlotID; /*目的槽位号*/
UCHAR ucMsgBodyStyle; /*用于指明消息头和消息体是否是一体的*/
USHORT usMsgCode; /*消息码,具体消息类型的细分*/
LONG ulUserCode; /* usertask user code */
-
+
USHORT usResponseType; /*是否要求接收方用户应答:ACK/ NOACK/NEGACK*/
USHORT usFrameLen; /*frame content 的长度 ,用户数据区长度*/
VOID * ptrMsgBody; /*消息体指针*/
#endif
#endif /*__SYSDEF_H__*/
-
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_TASK_H__
/** 用户任务结构体 */
typedef struct VOS_user_task_s
{
- CHAR userTaskName[VOS_NAME_MAX_LENGTH]; ///< 用户任务名
- VOS_user_task_entry userTaskEntry; ///< 用户任务入口
+ CHAR userTaskName[VOS_NAME_MAX_LENGTH]; ///< 用户任务名
+ VOS_user_task_entry userTaskEntry; ///< 用户任务入口
ULONG moduleID; ///< 用于 VOS_Malloc 的第二个参数
}VOS_user_task_t;
ULONG pArg7, ULONG pArg8, ULONG pArg9,
ULONG pArg10 );
-/**
+/**
* 任务创建 宏,
* 该宏 会创建一个线程,栈大小为 VOS_DEFAULT_STACKSIZE 。
- * @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
+ * @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] lPriority 优先级,使用 VOS_task_pri_t 枚举值
* @param[in] pfEntry 任务入口函数, 原型为VOS_TASK_ENTRY,10个ULONG 参数,无返回值
定义时使用宏DECLARE_VOS_TASK定义,eg:DECLARE_VOS_TASK(task1){ .... }
- * @param[in] lTaskArg 传给任务入口函数的参数,类型为ULONG pArgs[10]
+ * @param[in] lTaskArg 传给任务入口函数的参数,类型为ULONG pArgs[10]
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
- */
+ */
#define VOS_TaskCreate( taskName, lPriority, pfEntry, lTaskArg )\
VOS_TaskCreate_Ex_X( taskName, pfEntry, #pfEntry, (ULONG)(lPriority), VOS_DEFAULT_STACKSIZE, (ULONG *)(lTaskArg) )
-/**
+/**
* 任务创建 宏,
* 该宏 会创建一个线程。
- * @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
+ * @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] pfEntry 任务入口函数, 原型为VOS_TASK_ENTRY,10个ULONG 参数,无返回值
定义时使用宏DECLARE_VOS_TASK定义,eg:DECLARE_VOS_TASK(task1){ .... }
* @param[in] lPriority 优先级,使用 VOS_task_pri_t 枚举值
* @param[in] ulStackSize 栈大小
- * @param[in] lTaskArg 传给任务入口函数的参数,类型为ULONG pArgs[10]
+ * @param[in] lTaskArg 传给任务入口函数的参数,类型为ULONG pArgs[10]
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
- */
+ */
#define VOS_TaskCreateEx( taskName, pfEntry, lPriority, ulStackSize, lTaskArg )\
VOS_TaskCreate_Ex_X( taskName, pfEntry, #pfEntry, lPriority, ulStackSize, lTaskArg )
-/**
+/**
* 任务延时 宏,
* 当前任务睡眠一定的时间.
* @param[in] lMsec 延时时间,毫秒
(LONG)VOS_TaskDelay_Ex_X( (lMsec), __FILE__, __LINE__ )
-/**
+/**
* 任务删除 API,
* 将指定任务删除 。
* @param[in] hTaskHandle 任务创建时返回的任务句柄
* @param[in] ulExitCode 任务退出码,仅在windows系统中有效,其他传 0 即可
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskTerminate( VOS_HANDLE hTaskHandle, ULONG ulExitCode );
-/**
+/**
* 将任务信息注册到vos task,在任务入口的最开始调用。main函数则在调用VOS_init()后调用
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskInfoAttach(void);
-/**
+/**
* 得到当前VOS任务句柄
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
*/
VOS_HANDLE VOS_GetCurrentTask( VOID );
-/**
+/**
* 获得任务优先级
- *
+ *
* @param[in] hTaskHandle 任务创建时返回的任务句柄
* @param[out] pPrio 任务优先级
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskGetPriority( VOS_HANDLE hTaskHandle, ULONG *pPrio );
-/**
+/**
* 设置任务优先级
- *
+ *
* @param[in] hTaskHandle 任务创建时返回的任务句柄
* @param[in] ulnewPrio 任务优先级
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskSetPriority( VOS_HANDLE hTaskHandle, ULONG ulnewPrio );
-/**
+/**
* 获取当前任务的名字.
- *
+ *
* @param[out] szTaskName 任务名,长度 VOS_NAME_MAX_LENGTH
* @return VOS_OK - 成功,其他 - 失败
*/
LONG VOS_GetCurrentTaskName( CHAR szTaskName[VOS_NAME_MAX_LENGTH] );
-/**
+/**
* 判断任务句柄是否有效.
- *
+ *
* @param[in] hTaskHandle 任务句柄
* @return 有效返回真,否则返回假
*/
BOOL VOS_TaskHandleVerify( VOS_HANDLE hTaskHandle );
-/**
+/**
* 创建宿主任务,宿主任务可以绑定多个用户任务(回调函数),栈大小为 VOS_DEFAULT_STACKSIZE。
* @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] lPriority 优先级,使用 VOS_task_pri_t 枚举值
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
- */
+ */
#define VOS_TaskHostCreate( taskName, lPriority )\
VOS_TaskHostCreate_Ex_X( taskName, lPriority, VOS_DEFAULT_STACKSIZE)
-/**
+/**
* 创建宿主任务,宿主任务可以绑定多个用户任务(回调函数)。
* @param[in] taskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] lPriority 优先级,使用 VOS_task_pri_t 枚举值
-/**
+/**
* 删除宿主任务,同时该宿主任务下的用户任务将被全部删除
- *
+ *
* @param[in ] szTaskName 宿主任务名
* @param[in ] ulExitCode 退出码(暂未使用,填0即可)
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskHostTerminate(CHAR szTaskName[VOS_NAME_MAX_LENGTH], ULONG ulExitCode);
-/**
+/**
* 向宿主任务中添加用户任务(回调函数)。
- *
+ *
* @param[in ] hostTaskName 宿主任务名
* @param[in ] userTask 用户任务
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_UserTaskAttach(CHAR hostTaskName[VOS_NAME_MAX_LENGTH],VOS_user_task_t *userTask);
-/**
+/**
* 从宿主任务中删除用户任务(回调函数)。
- *
+ *
* @param[in ] hostTaskName 宿主任务名
* @param[in ] userTaskName 用户任务
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_UserTaskDetach(CHAR hostTaskName[VOS_NAME_MAX_LENGTH],CHAR userTaskName[VOS_NAME_MAX_LENGTH]);
-/**
+/**
* 设置任务的CPU亲和性
- *
+ *
* @param[in ] taskName 任务名(包含宿主任务,不包含用户任务)
* @param[in ] size CPU个数
* @param[in ] cpus CPU ID 数组
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskAffinitySet(CHAR taskName[VOS_NAME_MAX_LENGTH],LONG size,LONG cpus[]);
-/**
+/**
* 获取任务的CPU亲和性,如果实际CPU个数超过cpus数组大小,则只返回size个cpu ID,返回值为 VOS_ERROR_BAD_ARGUMENTS
- *
+ *
* @param[in ] taskName 任务名(包含宿主任务,不包含用户任务)
* @param[in ] size cpus数组大小
* @param[out] size cpus数组有效值个数
* @param[in ] cpus CPU ID 数组
* @return VOS_OK - 成功,其他 - 失败
- */
+ */
LONG VOS_TaskAffinityGet(CHAR taskName[VOS_NAME_MAX_LENGTH],LONG *size,LONG cpus[]);
/*=========================================================================================================================*/
/* ###### 下面的函数不要直接调用,使用上面提供的宏 ###### */
-/**
+/**
* 任务创建 API,不要直接使用,通过 VOS_TaskCreate 宏使用
* 该API会创建一个线程,栈大小为 VOS_DEFAULT_STACKSIZE 。
-* @param[in] szTaskName 任务名,长度为 VOS_NAME_MAX_LENGTH
+* @param[in] szTaskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] pfnFunc 任务入口函数, 原型为VOS_TASK_ENTRY,10个ULONG 参数,无返回值
* @param[in] szFuncName 任务入口函数名
* @param[in] ulStartPriority 优先级,使用 VOS_task_pri_t 枚举值
* @param[in] ulStackSize 栈大小
-* @param[in] pArgs 传给任务入口函数的参数,类型为ULONG pArgs[10]
+* @param[in] pArgs 传给任务入口函数的参数,类型为ULONG pArgs[10]
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
-*/
+*/
VOS_HANDLE VOS_TaskCreate_Ex_X( CHAR szTaskName[VOS_NAME_MAX_LENGTH],
VOS_TASK_ENTRY pfnFunc,
CHAR *szFuncName,
ULONG ulStackSize,
ULONG pArgs[VOS_MAX_TASK_ARGS]);
-/**
+/**
* 任务延时 API,不要直接使用,通过 VOS_TaskDelay 宏使用
* 当前任务睡眠一定的时间.
* @param[in] lMsec 延时时间,毫秒
LONG VOS_TaskDelay_Ex_X( ULONG lMsec, CHAR *szFileName, INT iLine );
-/**
+/**
* 创建宿主任务,不要直接使用,通过 VOS_TaskHostCreate 宏使用,宿主任务可以绑定多个用户任务(回调函数)。
- *
- * @param[in] szTaskName 任务名,长度为 VOS_NAME_MAX_LENGTH
+ *
+ * @param[in] szTaskName 任务名,长度为 VOS_NAME_MAX_LENGTH
* @param[in] ulStartPriority 优先级,使用 VOS_task_pri_t 枚举值
* @param[in] ulStackSize 栈大小
* @return 成功返回VOS_HANDLE 类型的任务句柄,失败返回NULL
ULONG ulStackSize);
-/**
+/**
* 获得当前任务的进程ID(PID)
- *
+ *
* @return 返回进程ID(PID)
*/
ULONG VOS_TaskSelfGetPID(void);
-/**
+/**
* 获得当前任务的线程ID(SPID)
- *
+ *
* @return 返回线程ID(SPID)
*/
ULONG VOS_TaskSelfGetSPID(void);
-/**
+/**
* 获得当前任务的线程ID(thread ID)
- *
+ *
* @return 返回线程ID(thread ID)
*/
ULONG VOS_TaskSelfThreadID(void);
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_TIME_H__
-/**
+/**
* 获取当前时间
* @param[in] vos_time 存储时间的指针
* @return 成功返回 VOS_OK,失败则返回其他
- */
+ */
LONG VOS_local_time( VOS_LOCAL_TIME *vos_time );
-/**
+/**
* 获取当前时间
* @param[out] sys_time 时间
* @return 返回值同 sys_time
- */
+ */
LONG VOS_time( LONG *sys_time );
-/**
+/**
* 时间转换,local time 转成秒数
* @param[out] sys_time 时间
* @return 返回 sys_time 对应的秒数
- */
+ */
LONG VOS_mkTime(const VOS_LOCAL_TIME *sys_time );
-/**
+/**
* 时间转换,秒数 转成local time
* @param[out] sys_time 时间
* @param[in ] time 时间秒数
* @return 成功返回 VOS_OK,失败则返回其他
- */
+ */
LONG VOS_mkLocalTime( VOS_LOCAL_TIME *sys_time ,LONG time);
-/**
+/**
* 获得时间字符串 YYYY-MM-DD hh:mm:ss
* 如果sys_time非空则根据sys_time转换,否则根据time转换,time为0时取当前时间转换,
* 转换完成后存入str中
CHAR *VOS_mkLocalTimeStr( VOS_LOCAL_TIME *sys_time ,LONG time,CHAR str[VOS_TIME_STR_LEN]);
-/**
+/**
* 将时间字符串 YYYY-MM-DD hh:mm:ss 转换,为VOS_LOCAL_TIME 和 LONG型
* sys_time和time不为空则填入转换后的值,某一项不需要可以使用NULL
* @param[in ] str 时间字符串
LONG VOS_StrmkLocalTime( CHAR str[VOS_TIME_STR_LEN],VOS_LOCAL_TIME *sys_time ,LONG *time);
-/**
+/**
* 将时间秒数转换成 snmp 时间
* @param[in ] sys_time 时间秒数
* @param[out] snmpTime 时间
#endif /* end of __cplusplus */
#endif /* end of __VOS_TIME_H__ */
-
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#ifndef __VOS_TIMER_H__
/** VOS Timer 类型枚举值 */
typedef enum
{
- VOS_TIMER_LOOP, ///< 循环执行的timer
- VOS_TIMER_NO_LOOP, ///< 执行一次的timer
+ VOS_TIMER_LOOP, ///< 循环执行的timer
+ VOS_TIMER_NO_LOOP, ///< 执行一次的timer
}VOS_TIMER_TYPE_EN;
-/**
+/**
* 创建定时器
* @param[in] ulModuleId 模块ID
* @param[in] msgQId 如果pfTimerFunc非空则无效;如果pfTimerFunc为NULL,则向msgQId队列发送定时器超时消息
VOID (*pfTimerFunc)(VOID *), VOID *pArg, VOS_TIMER_TYPE_EN enType);
-/**
+/**
* 改变定时器时间,不能在超时回调函数中调用
* @param[in] ulModuleId 模块ID
* @param[in] ulTimerId 定时器Id
LONG VOS_TimerChange(ULONG ulModuleId, ULONG ulTimerId, LONG lMillSec);
-/**
+/**
* 删除定时器
* @param[in] ulModuleId 模块ID
* @param[in] ulTimerId 定时器Id
LONG VOS_TimerDelete(ULONG ulModuleId, ULONG ulTimerId);
-/**
+/**
* 创建微秒定时器,必须绑核
* @param[in] ulModuleId 模块ID
* @param[in] luSec 定时器的时间,微妙
-/**
+/**
* 创建微秒定时器,必须绑核
* @param[in] ulModuleId 模块ID
* @param[in] ulTimerId Timer ID
/******************************************************************************
-###############################################################################
-# Copyright (c) [2017-2020] [ICT/CAS] #
-# Licensed under the ORAN Software License v1.0 (License) #
-###############################################################################
-******************************************************************************/
+*
+* Copyright (c) 2020 ICT/CAS.
+*
+* Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.o-ran.org/software
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*******************************************************************************/
+
#include "vos_sys_diff.h"
#endif
#if OS_LINUX
-#define inline
-#define _inline
-#define __inline__
+#define inline
+#define _inline
+#define __inline__
#define __const__ const
#define __signed__ signed
#define __const__ const
/** IPv4 addr */
UINT ip4;
/** IPv6 addr structure */
- union
+ union
{
UCHAR addr8[16];
USHORT addr16[8];