From: YCJict Date: Fri, 19 Jun 2020 03:04:35 +0000 (+0800) Subject: Modify licenses X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=scp%2Focu%2F5gnr.git;a=commitdiff_plain;h=e93798699eccb72af04938fc9b0d7a836e284488 Modify licenses Signed-off-by: YCJict Change-Id: I4b966fd503c1be197563dd5529b99507d9702fdd --- diff --git a/Cu/CuUp/Pdcp/Common/Src/cuupTest.c b/Cu/CuUp/Pdcp/Common/Src/cuupTest.c index 50c9136..0766f16 100644 --- a/Cu/CuUp/Pdcp/Common/Src/cuupTest.c +++ b/Cu/CuUp/Pdcp/Common/Src/cuupTest.c @@ -1,82 +1,41 @@ /****************************************************************************** -############################################################################### -# 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; ibitStringSize; 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; } @@ -84,610 +43,84 @@ INT32 printfNguCfgResult(NguCfgResult_t *pCfg) 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; idrbSetupSuccessNum; i++) - { - VOS_Printf("%d ", pResult->drbSetupSuccessArray[i]); - } - - VOS_Printf("\ndrbSetupFailNum: %d\ndrb id list: ", pResult->drbSetupFailNum); - for(i=0; idrbSetupFailNum; i++) - { - printfDrbFailedCause(&pResult->drbSetupFailedArray[i]); - } - - VOS_Printf("\ndrbModifySuccessNum: %d\ndrb id list: ", pResult->drbModifySuccessNum); - for(i=0; idrbModifySuccessNum; i++) - { - VOS_Printf("%d ", pResult->drbModifySuccessArray[i]); - } - - VOS_Printf("\ndrbModifyFailNum: %d\ndrb id list: ", pResult->drbModifyFailNum); - for(i=0; idrbModifyFailNum; 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; idrbSetupSuccessNum; i++) - { - printfCuf1uSetupInfo(&pResult->drbSetupSuccessArray[i]); - } - - VOS_Printf("\ndrbSetupFailNum: %d\n", pResult->drbSetupFailNum); - for(i=0; idrbSetupFailNum; i++) - { - printfDrbFailedCause(&pResult->drbSetupFailedArray[i]); - } - - VOS_Printf("\ndrbModifySuccessNum: %d\n", pResult->drbModifySuccessNum); - for(i=0; idrbModifySuccessNum; i++) - { - VOS_Printf("%d ", pResult->drbModifySuccessArray[i]); - } - - VOS_Printf("\ndrbModifyFailNum: %d\n", pResult->drbModifyFailNum); - for(i=0; idrbModifyFailNum; 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; iueIdxInfo[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; jexHdrLen,pPdu->len,pPdu->exHdrType); - - UINT8 i = 0; - for(i=0; ilen; 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; isessNum; i++) - { - VOS_Printf("%d,",pGlobalData->sessId[i]); - } - VOS_Printf("\n"); - - UINT8 pduId = 0; - for(i=0; isessNum; 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; msdapInstance[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; nsdapInstance[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; jsdapInstance[pduId].drbCfg[drbId-1].qfi[j]); - } - VOS_Printf("\n"); - } - } - return VOS_OK; } - - diff --git a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c index ecb6656..1499d32 100644 --- a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c +++ b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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" @@ -20,9 +32,9 @@ extern ULONG gPdcpuModuleId; /* 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; }*/ @@ -44,12 +56,12 @@ VOID pdcpuFreeDataBuffNode(VOID *p) } 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: @@ -62,7 +74,7 @@ INT32 pdcpuDiscardTransmitBuff(plist pTxPduList) } /******************************************************************************* - * 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: @@ -75,8 +87,8 @@ INT32 pdcpuDeliverTransmitBuff(PdcpDrbEntity_t *pPdcpuEntity) } /******************************************************************************* - * 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: @@ -90,7 +102,7 @@ INT32 pdcpuDeliverRecvBuff(PdcpDrbEntity_t *pPdcpuEntity) /******************************************************************************* - * To construct and send a PDCP status report + * To construct and send a PDCP status report * INPUT: * pPdcpuEntity: pdcpu entity * OUTPUT: @@ -103,7 +115,7 @@ INT32 pdcpuConstructStatusReport(PdcpDrbEntity_t *pPdcpuEntity) } /******************************************************************************* - * To perform PDCP data recovery + * To perform PDCP data recovery * INPUT: * ueE1apId: UE E1AP ID * drbId : DRB ID @@ -128,17 +140,17 @@ INT32 pdcpuSetSn(PdcpSnSize_e *pSn, PdcpSNSize_e snCfg) 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; } @@ -149,7 +161,7 @@ INT32 pdcpuSetRlcMode(PdcpRlcMode_e *pRlcMode, CuRlcMode_e rlcCfg) 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; @@ -167,10 +179,10 @@ INT32 pdcpuSetRlcMode(PdcpRlcMode_e *pRlcMode, CuRlcMode_e rlcCfg) } /******************************************************************************* - * To get SDAP DATA PDU header length configuration + * To get SDAP DATA PDU header length configuration * INPUT: - * sdapHeadInd : - * sdapHeadLen : + * sdapHeadInd : + * sdapHeadLen : * OUTPUT: * none *******************************************************************************/ @@ -179,23 +191,23 @@ INT32 pdcpuGetSdapHeadLen(SdapHeader_e sdapHeadInd, UINT8 *sdapHeadLen) 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 @@ -204,38 +216,38 @@ INT32 pdcpuGetSdapHeadLen(SdapHeader_e sdapHeadInd, UINT8 *sdapHeadLen) * -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; @@ -266,13 +278,13 @@ INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcT 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; @@ -294,4 +306,3 @@ INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcT return VOS_OK; } - diff --git a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuDlDataProc.c b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuDlDataProc.c index b0bca8b..27dfc93 100644 --- a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuDlDataProc.c +++ b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuDlDataProc.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 #include "vos_types.h" #include "vos_linklist.h" @@ -44,7 +56,7 @@ INT32 pdcpuPackPduHead(PdcpRlcMode_e rlc_mode,PdcpSnSize_e snSize, UINT32 sn, Ms { pduHeadLen = PDCP_SN_18_HEAD_LEN; }else - { + { pdcpuLog(LOG_ERR,"[PDCPU] sn size is wrong!\n"); return VOS_ERROR; } @@ -63,7 +75,7 @@ INT32 pdcpuPackPduHead(PdcpRlcMode_e rlc_mode,PdcpSnSize_e snSize, UINT32 sn, Ms 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) @@ -92,13 +104,13 @@ INT32 pdcpuPackPduHead(PdcpRlcMode_e rlc_mode,PdcpSnSize_e snSize, UINT32 sn, Ms pdcpuLog(LOG_ERR,"[PDCPU] msgbHeadPush failed!\n"); return VOS_ERROR; } - + if(NULL != pPduHead) - { + { VOS_Free(pPduHead); pPduHead= NULL; } - + return pduHeadLen; } @@ -114,15 +126,15 @@ INT32 pdcpuPackPduHead(PdcpRlcMode_e rlc_mode,PdcpSnSize_e snSize, UINT32 sn, Ms * -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); @@ -130,15 +142,15 @@ INT32 pdcpuDlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff, UINT8 } 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 @@ -147,7 +159,7 @@ INT32 pdcpuDlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff, UINT8 pdcpuLog(LOG_ERR,"[PDCPU] count value is going to wrap around!\n"); return VOS_ERROR; } - + snSize = pPdcpDrbEntity->pdcpSnSizeDl; if(snSize == LEN12BITS) { @@ -168,7 +180,7 @@ INT32 pdcpuDlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff, UINT8 pdcpuLog(LOG_ERR,"[PDCPU] pack pdcp pdu head failed!\n"); return VOS_ERROR; } - + //8. 否则:cuf1u将数据发送成功后,释放 if(VOS_OK == cuf1uDlDataProc(ueE1apId, drbId, pMsgBuff, NULL)) { @@ -181,6 +193,5 @@ INT32 pdcpuDlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff, UINT8 pdcpuLog(LOG_ERR,"[PDCPU] cuf1u send failed\n"); return VOS_ERROR; } - -} +} diff --git a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUlDataProc.c b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUlDataProc.c index 2bff55f..aad8be6 100644 --- a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUlDataProc.c +++ b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUlDataProc.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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" @@ -28,13 +40,13 @@ extern INT32 sdapUlDataProc(UINT64 upE1apId, UINT64 sessId, UINT64 drbId, MsgbBu 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); @@ -42,29 +54,29 @@ INT32 pdcpuUnpackPduHead(MsgbBuff_t *pMsgBuff, PdcpSnSize_e snSize, 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"); @@ -81,7 +93,7 @@ INT32 pdcpuDecideCountAndHFN(PdcpStateVar_t *pStateVar, INT32 rcvdSn, PdcpSnSize UINT32 rcvdHFN = 0; UINT32 rxDeliv = pStateVar->rxDelivery; INT32 tmp = 0; - + if(LEN12BITS == snSize) { tmp = GET_SN_12_SN(rxDeliv) - SN_12_WINDOW_SIZE; @@ -96,28 +108,28 @@ INT32 pdcpuDecideCountAndHFN(PdcpStateVar_t *pStateVar, INT32 rcvdSn, PdcpSnSize 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; } @@ -126,81 +138,81 @@ INT32 pdcpuCtrlPduProc(MsgbBuff_t *pMsgBuff, PdcpCtrlPduType_e ctrlPduType, Pdcp { 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; @@ -213,7 +225,7 @@ INT32 pdcpuDelivUldata(PdcpDrbEntity_t *pDrbEntity) pdcpuLog(LOG_ERR,"[PDCPU] rxbuff is wrong!\n"); return VOS_ERROR; } - + return VOS_OK; } @@ -229,7 +241,7 @@ INT32 pdcpuDelivUldata(PdcpDrbEntity_t *pDrbEntity) * -1:failed *******************************************************************************/ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) -{ +{ UINT8 pduType = 0; UINT32 rcvdSn = 0; UINT32 count = 0; @@ -239,7 +251,7 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) PdcpSnSize_e snSize; PdcpDrbEntity_t *pPdcpDrbEntity = NULL; PdcpStateVar_t *pStateVar = NULL; - + pdcpuNullCheck(pMsgBuff); UINT8 *pMsgHead = msgbData(pMsgBuff); UINT16 pduLen = msgbDataUsedLen(pMsgBuff); @@ -249,7 +261,7 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *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"); @@ -260,7 +272,7 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) pdcpuNullCheck(pPdcpDrbEntity); snSize = pPdcpDrbEntity->pdcpSnSizeUl; pStateVar = &pPdcpDrbEntity->stateVar; - + /* get pdcp pdu type */ BitOpt_t bit; initBits(&bit, pMsgHead, pduLen, 0); @@ -276,7 +288,7 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) pdcpuMsgbFree(pMsgBuff); return VOS_ERROR; } - + //make sure received HFN and received Count if(VOS_ERROR == pdcpuDecideCountAndHFN(pStateVar, rcvdSn, snSize)) { @@ -284,9 +296,9 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) 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; @@ -306,10 +318,9 @@ INT32 pdcpuUlDataProc(UINT64 ueE1apId, UINT8 drbId, MsgbBuff_t *pMsgBuff) pdcpuLog(LOG_ERR,"[PDCPU] ul proc failed\n"); return VOS_ERROR; } - - + + } return VOS_OK; } - diff --git a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUpc.c b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUpc.c index 36ba83b..6def3a9 100644 --- a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUpc.c +++ b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuUpc.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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" @@ -23,15 +35,15 @@ CuupUeIdxTable_t gPdcpuUeIdxTable; /******************************************************************************* -* To +* To * INPUT: -* : +* : * OUTPUT: * 0:success * -1:fail -*******************************************************************************/ +*******************************************************************************/ INT32 pdcpuInit(ULONG userModuleId) -{ +{ /* get pdcpu moduleId */ gPdcpuModuleId = userModuleId; @@ -47,7 +59,7 @@ INT32 pdcpuInit(ULONG userModuleId) { gPdcpuUeInfo[i] = NULL; } - + return VOS_OK; } @@ -60,13 +72,13 @@ INT32 pdcpuFreeSecInfo(UINT16 ueIdx) 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 @@ -76,14 +88,14 @@ INT32 pdcpuFreeSecInfo(UINT16 ueIdx) * 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) { @@ -93,65 +105,65 @@ INT32 pdcpuDealSecurityInd(PdcpuSecInfo_t *pSec, PdcpuSecEnableInfo_t *pEnableIn 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; } @@ -170,22 +182,22 @@ INT32 pdcpuRetFailResult(UpcCfgType_e cfgType, upcTempSessInfo_t *pCfgInfo, Pdcp } 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; @@ -194,10 +206,10 @@ INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pRe 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"); @@ -206,12 +218,12 @@ INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pRe /* 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) @@ -227,34 +239,34 @@ INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pRe } 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; - + } } @@ -271,7 +283,7 @@ INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pRe } /******************************************************************************* - * To manage pdcp-u entity + * To manage pdcp-u entity * INPUT: * ueE1apId : UE E1AP ID * pPduSessionCfg : PDU Session Resource to setup item @@ -281,7 +293,7 @@ INT32 pdcpuSessionAddProc(UINT64 ueE1apId, VOID *pCfgInfo, PdcpuCfgResult_t *pRe * result: PDCP config result *******************************************************************************/ INT32 pdcpuConfig(UINT64 ueE1apId, VOID *pCfgInfo, UpcCfgType_e cfgType, PdcpuCfgResult_t *pResult) -{ +{ switch(cfgType) { case PDU_SESSION_ADD: @@ -291,7 +303,7 @@ INT32 pdcpuConfig(UINT64 ueE1apId, VOID *pCfgInfo, UpcCfgType_e cfgType, PdcpuCf VOS_MemZero(pResult, sizeof(PdcpuCfgResult_t)); pResult->cfgType = cfgType; return pdcpuSessionAddProc(ueE1apId, pCfgInfo, pResult); - } + } default: { pdcpuLog(LOG_ERR,"[PDCPU] cfgType error\n"); @@ -311,12 +323,12 @@ INT32 pdcpuConfig(UINT64 ueE1apId, VOID *pCfgInfo, UpcCfgType_e cfgType, PdcpuCf *******************************************************************************/ 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)); @@ -327,7 +339,7 @@ PdcpuSecInfo_t *pdcpuAllocUeSecInfo(UINT16 ueIdx) } //check secInfo if(NULL == pPdcpUeInfo->secInfo) - { + { pSecInfo = VOS_Malloc(sizeof(PdcpuSecInfo_t), gPdcpuModuleId); pdcpuNullCheckRp(pSecInfo); VOS_MemZero(pSecInfo, sizeof(PdcpuSecInfo_t)); @@ -338,14 +350,14 @@ PdcpuSecInfo_t *pdcpuAllocUeSecInfo(UINT16 ueIdx) } 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 @@ -356,21 +368,21 @@ PdcpuSecInfo_t *pdcpuAllocUeSecInfo(UINT16 ueIdx) 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 */ @@ -381,7 +393,7 @@ INT32 pdcpuSetSecParam(UINT64 ueE1apId, SecuInfo_t *secInfo) pdcpuFreeSecInfo(ueIdx); return VOS_ERROR; } - + pDrbSecInfo->intActiveFlag = ACTIVE_INT_STATE; /* 0-inactive, 1-active */ if(intAlgorithm == NIA0 || intAlgorithm == NIA1 || intAlgorithm == NIA2) { @@ -399,8 +411,8 @@ INT32 pdcpuSetSecParam(UINT64 ueE1apId, SecuInfo_t *secInfo) 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 */ @@ -414,12 +426,12 @@ INT32 pdcpuSetSecParam(UINT64 ueE1apId, SecuInfo_t *secInfo) 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; @@ -428,7 +440,6 @@ INT32 pdcpuSetSecParam(UINT64 ueE1apId, SecuInfo_t *secInfo) pDrbSecInfo->ueE1apId = ueE1apId; pDrbSecInfo->ueIdx = ueIdx; pDrbSecInfo->nhInd = FALSE; - + return VOS_OK; } - diff --git a/Cu/CuUp/Sdap/sdap/Src/sdapCore.c b/Cu/CuUp/Sdap/sdap/Src/sdapCore.c index b01a751..8b8ec8c 100644 --- a/Cu/CuUp/Sdap/sdap/Src/sdapCore.c +++ b/Cu/CuUp/Sdap/sdap/Src/sdapCore.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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}}; @@ -29,7 +41,7 @@ void sdapResortSessionId(SdapGlobalDtat_t *pGlobalData, int idx) { int i = 0; int j = 0; - + for(i = 0; i < pGlobalData->sessNum; i++) { if(i == idx) @@ -81,9 +93,9 @@ INT32 sdapCreateQosInfo(SdapDrbCfg_t *pDrbCfg, upcTempDrbInfo_t *pTempDrb, SdapD { continue; } - + qosFlowId = pTempQos->qosFlowId; - pDrbCfg->qfi[pDrbCfg->qfiNum] = qosFlowId; + pDrbCfg->qfi[pDrbCfg->qfiNum] = qosFlowId; pDrbCfg->qosFlowInfo[qosFlowId].qosFlowLevelQosPar = pTempQos->qosPara; if(pTempQos->qosMapFlag) { @@ -99,7 +111,7 @@ INT32 sdapCreateQosInfo(SdapDrbCfg_t *pDrbCfg, upcTempDrbInfo_t *pTempDrb, SdapD { return VOS_ERROR; } - + return VOS_OK; } @@ -121,7 +133,7 @@ INT32 sdapCreateDrbInfo(SdapInstance_t *pInstance, upcTempSessInfo_t *pSessTempI { continue; } - + drbId = pTempDrb->drbId; if(VOS_OK != sdapCreateQosInfo(&pInstance->drbCfg[drbId - 1], pTempDrb, &pCfgRet->actDrbCfg[drbId - 1])) @@ -137,13 +149,13 @@ INT32 sdapCreateDrbInfo(SdapInstance_t *pInstance, upcTempSessInfo_t *pSessTempI 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; } @@ -157,15 +169,15 @@ extern INT32 sdapInactiveDetectSet(UINT64 ueE1apId); 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; @@ -179,8 +191,8 @@ INT32 sdapCreateNewInstance pGlobalData->sessId[idx] = sessId; pGlobalData->sessNum++; - printfSdapNewInstance(pGlobalData); - + printfSdapNewInstance(pGlobalData); + return VOS_OK; } @@ -249,7 +261,7 @@ INT32 sdapDeleteDrbInfoOfInstance(UINT64 upE1apId, UINT8 sessId, UINT8 drbId) if(sessId == pGlobalData->sessId[i]) { sdapDeleteDrbInfo(&pGlobalData->sdapInstance[sessId], drbId); - + return VOS_OK; } } @@ -285,4 +297,3 @@ INT32 sdapDeleteInstance(UINT64 upE1apId, UINT16 sessId) return VOS_OK; } #endif - diff --git a/Cu/CuUp/Sdap/sdap/Src/sdapDataProc.c b/Cu/CuUp/Sdap/sdap/Src/sdapDataProc.c index ab4cb52..2ebec7e 100644 --- a/Cu/CuUp/Sdap/sdap/Src/sdapDataProc.c +++ b/Cu/CuUp/Sdap/sdap/Src/sdapDataProc.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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" @@ -22,7 +34,7 @@ INT8 sdapMatchQosFlowId(SdapInstance_t *pSdapInstance, INT64 qosFlowId, UINT64 * 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++) @@ -41,7 +53,7 @@ INT8 sdapMatchQosFlowId(SdapInstance_t *pSdapInstance, INT64 qosFlowId, UINT64 * for(i = 0; i < pSdapInstance->drbNum; i++) { drbId = pSdapInstance->drbId[i]; - + /* 一个实例,即一个会话内,有且只有一个默认的DRB */ if(DEFAULT_DRB_TRUE == pSdapInstance->drbCfg[drbId - 1].sdapCfg.defaultDrbInd) { @@ -49,7 +61,7 @@ INT8 sdapMatchQosFlowId(SdapInstance_t *pSdapInstance, INT64 qosFlowId, UINT64 * *pFlag = 1; break; } - } + } } return VOS_OK; @@ -95,7 +107,7 @@ INT8 sdapPackPduHead(SdapInstance_t *pSdapInstance, INT64 qosFlowId, UINT64 *pDr p = msgbHeadPush(pMsgBuff, pduHeadLen); VOS_MemCpy(p, &sdapHeader, pduHeadLen); - + return pduHeadLen; } @@ -114,7 +126,7 @@ INT32 sdapDlDataProc(UINT64 upE1apId, UINT64 sessId, INT64 qosFlowId, MsgbBuff_t SdapGlobalDtat_t *pGlobalData = NULL; SdapInstance_t *pSdapInstance = NULL; UINT8 *pMsgHead = NULL; - + if(NULL == pMsgBuff) { return VOS_ERROR; @@ -156,7 +168,7 @@ INT32 sdapDlDataProc(UINT64 upE1apId, UINT64 sessId, INT64 qosFlowId, MsgbBuff_t { return VOS_ERROR; } - + /*传递到PDCP-U*/ pdcpuDlDataProc(upE1apId, drbId, pMsgBuff, 1); @@ -167,7 +179,7 @@ INT8 sdapUnPackPduHead(MsgbBuff_t *pMsgBuff) { BitOpt_t bit; UINT32 bitSize = 0; - + UINT8 *pMsgHead = msgbData(pMsgBuff); UINT16 pduLen = msgbDataUsedLen(pMsgBuff); @@ -193,7 +205,7 @@ INT32 sdapUlDataProc(UINT64 upE1apId, UINT64 sessId, UINT64 drbId, MsgbBuff_t *p sdapUlHeader_t *pHead = NULL; UINT8 qosFlowId = 0xff; UINT8 pduType = 0; - + SdapGlobalDtat_t *pGlobalData = NULL; SdapInstance_t *pSdapInstance = NULL; SdapDrbCfg_t *pDrbCfgInfo = NULL; @@ -202,7 +214,7 @@ INT32 sdapUlDataProc(UINT64 upE1apId, UINT64 sessId, UINT64 drbId, MsgbBuff_t *p { return VOS_ERROR; } - + /* Get Instance */ pGlobalData = sdapGetUeGlobalData(upE1apId, &flag); @@ -213,7 +225,7 @@ INT32 sdapUlDataProc(UINT64 upE1apId, UINT64 sessId, UINT64 drbId, MsgbBuff_t *p /* get instance */ for(i = 0; i < pGlobalData->sessNum; i++) - { + { if(sessId == pGlobalData->sessId[i]) { pSdapInstance = &pGlobalData->sdapInstance[sessId]; @@ -274,11 +286,10 @@ INT32 sdapUlDataProc(UINT64 upE1apId, UINT64 sessId, UINT64 drbId, MsgbBuff_t *p /* qfi not found */ return VOS_ERROR; } - + } - + /* 调用NG-U的上行数据处理接口 */ return nguUlDataProc(upE1apId, sessId, qosFlowId, pMsgBuff); } - diff --git a/Cu/CuUpApp/Src/main.c b/Cu/CuUpApp/Src/main.c index eb063a1..b9b56e9 100644 --- a/Cu/CuUpApp/Src/main.c +++ b/Cu/CuUpApp/Src/main.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 #include #include @@ -22,7 +34,7 @@ extern UCHAR cuupUnSocketPath[]; INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) { UCHAR *pInt = NULL; - + struct option long_options[] = { {"startup-item", required_argument, 0, 'i' }, @@ -30,7 +42,7 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) {"help", no_argument, 0, 'h' }, {0, 0, 0, 0 } }; - + while (1) { int option_index = 0; @@ -39,13 +51,13 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) { break; } - + switch (c) { case 'i': pInt = (UCHAR *)cuupUnSocketPath; break; - case 'v': + case 'v': exit(0); break; case 'h': @@ -53,21 +65,21 @@ INT32 cuupGetSetUpPara(INT32 argc, INT8 **argv) 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) @@ -87,7 +99,7 @@ void cuupAppSigHandler(int sig) { VOS_Printf("Du_shm Delete CUUP_SHM_FILE shared memory failed !\n "); return; - } + } } return; } @@ -126,32 +138,26 @@ INT32 cuupAppregisterSignal() 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; } - - - - - - diff --git a/Include/bitsPack.h b/Include/bitsPack.h index 3c90d6d..5d4759c 100644 --- a/Include/bitsPack.h +++ b/Include/bitsPack.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -118,7 +130,3 @@ extern INT32 skipBits(BitOpt_t *pBit, UINT32 n, UINT8 optType); #define packBits(pBit,n,value) packBitsWithdebug(pBit, n, value,(UCHAR *)__func__,__LINE__) #endif - - - - diff --git a/Include/config.h b/Include/config.h index 80d776e..a7a5cff 100644 --- a/Include/config.h +++ b/Include/config.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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; @@ -13,4 +25,3 @@ extern int opt_debug; fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) - diff --git a/Include/cuCommon.h b/Include/cuCommon.h index faea927..f8d8c4f 100644 --- a/Include/cuCommon.h +++ b/Include/cuCommon.h @@ -1,9 +1,21 @@ -/****************************************************************************** -############################################################################### -# 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_ @@ -30,11 +42,11 @@ extern "C" { 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, @@ -44,14 +56,14 @@ typedef enum 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, @@ -59,16 +71,16 @@ typedef enum CuCpVosTask #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 @@ -115,16 +127,16 @@ 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; @@ -133,23 +145,23 @@ typedef struct 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; @@ -157,11 +169,11 @@ typedef struct CuCommCfg_t commCfg; UINT8 cuStackState; UINT8 omState; - + UINT8 printDebug; UINT8 printLevel; UINT8 interLogFlag; - + } CuCtrlBlock_t; typedef struct @@ -170,27 +182,27 @@ 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 @@ -199,9 +211,9 @@ typedef enum SRB1 = 1, SRB2 = 2, SRB3 = 3, - + }SRB_e; - + @@ -209,8 +221,5 @@ typedef enum #ifdef __cplusplus } #endif - -#endif /* _CU_COMMON_H_*/ - - +#endif /* _CU_COMMON_H_*/ diff --git a/Include/cuModuleCommon.h b/Include/cuModuleCommon.h index 648cf4f..646207c 100644 --- a/Include/cuModuleCommon.h +++ b/Include/cuModuleCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -53,7 +65,7 @@ typedef enum cuSecAlgo_ /* gNB Identity */ typedef UINT32 gNBId_t; -typedef struct +typedef struct { PlmnId_t plmnId; gNBId_t gNBId; @@ -133,19 +145,19 @@ typedef struct transLayerAddr 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; @@ -158,9 +170,9 @@ typedef struct }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; @@ -174,12 +186,12 @@ typedef struct 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; diff --git a/Include/cuModuleEnum.h b/Include/cuModuleEnum.h index 7a8e0fb..9a6ba5b 100644 --- a/Include/cuModuleEnum.h +++ b/Include/cuModuleEnum.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -70,7 +82,7 @@ typedef enum NEW_SECURITY_CONTEXT_IND_TRUE = 0 }NewSecurityCtxInd_e; -typedef enum +typedef enum { TIME_WAIT_1S = 0, TIME_WAIT_2S = 1, @@ -94,13 +106,13 @@ typedef enum 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, @@ -116,51 +128,51 @@ typedef enum pduSessType 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 @@ -169,7 +181,7 @@ typedef enum 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 @@ -198,7 +210,7 @@ typedef enum ***********************************************************************************/ typedef enum ngapCause_s -{ +{ NG_START, Ng_RNL_UNSPECIFIED, Ng_RNL_TXnRELOCOverallExpiry, @@ -217,7 +229,7 @@ typedef enum ngapCause_s 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, @@ -248,7 +260,7 @@ typedef enum ngapCause_s 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, @@ -265,7 +277,7 @@ typedef enum ngapCause_s 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, @@ -273,9 +285,9 @@ typedef enum ngapCause_s NG_MISC_UNSPECIFIED, NG_MISC_END, NG_END -}NgapCause_e; +}NgapCause_e; -typedef enum ngapProcCode +typedef enum ngapProcCode { Ng_AMFConfigurationUpdate = 0, Ng_AMFStatusIndication = 1, @@ -332,7 +344,7 @@ typedef enum ngapProcCode Ng_SecondaryRATDataUsageReport = 52 } NgapProcCode_e; -typedef enum ngapProtocolIeId +typedef enum ngapProtocolIeId { Ngap_AllowedNSSAI = 0, Ngap_AMFName = 1, @@ -526,7 +538,7 @@ typedef enum CONTEXT_REQUESTED = 0 } ueContextRequest_e; -typedef enum +typedef enum { amfPging_None, amfPging_gNBId, @@ -540,7 +552,7 @@ typedef enum BOTH_AMF_RAN_NGAPID }NgapIdType_e; -typedef enum +typedef enum { Paging_DRX_v32 = 0, Paging_DRX_v64 = 1, @@ -560,29 +572,29 @@ typedef enum 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; @@ -598,7 +610,7 @@ typedef enum *********************************************************************************** ***********************************************************************************/ -typedef enum e1apCausePr +typedef enum e1apCausePr { E1apCause_PR_NOTHING, E1apCause_PR_radioNetwork, @@ -615,7 +627,7 @@ typedef enum e1apResetPr 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, @@ -647,13 +659,13 @@ typedef enum e1apCauseRadioNetwork 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, @@ -664,7 +676,7 @@ typedef enum e1apCauseProtocol E1apCauseProtocol_unspecified = 6 } E1apCauseProtocol_e; -typedef enum e1apCauseMisc +typedef enum e1apCauseMisc { E1apCauseMisc_control_processing_overload = 0, E1apCauseMisc_not_enough_user_plane_processing_resources = 1, @@ -720,7 +732,7 @@ typedef enum e1apCause_s MISC_CAUSE_MAX_VALUE }E1apCause_e; -typedef enum e1apProcCode +typedef enum e1apProcCode { E1_e1reset = 0, E1_e1errorIndication = 1, @@ -744,7 +756,7 @@ typedef enum e1apProcCode E1_mRDC_DataUsageReport = 19 } E1apProcCode_e; -typedef enum e1apProtocolIeId +typedef enum e1apProtocolIeId { E1ap_E1Cause = 0, E1ap_E1CriticalityDiagnostics = 1, @@ -829,7 +841,7 @@ typedef enum typedef enum { BEARER_CXT_STATUS_CHANGE_SUSPEND, - BEARER_CXT_STATUS_CHANGE_RESUME + BEARER_CXT_STATUS_CHANGE_RESUME } BearCxtStatusChange_e; typedef enum @@ -855,7 +867,7 @@ typedef enum IpAlgorithm_NIA3 }IpAlgorithm_e; -typedef enum +typedef enum { PRIORITY_LEVEL_SPARE = 0, PRIORITY_LEVEL_HIGHEST = 1, @@ -875,7 +887,7 @@ typedef enum DL_TX_STOP_STOP = 0, DL_TX_STOP_RESUME = 1 } DlTXStop_e; - + typedef enum { RAT_TYPE_NR = 0, @@ -913,7 +925,7 @@ typedef enum 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 @@ -1040,12 +1052,12 @@ typedef enum 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; diff --git a/Include/cuModuleInterface.h b/Include/cuModuleInterface.h index b8f5636..1c8eb09 100644 --- a/Include/cuModuleInterface.h +++ b/Include/cuModuleInterface.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -137,7 +149,7 @@ typedef struct ueRadioCapaForPagOfNr #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 */ @@ -150,7 +162,7 @@ typedef struct UeRadioCapability UINT8 buffer[MAX_SIZE_OF_OCTET_STRING]; }UeRadioCapability_t; -typedef struct ngRanTraceId +typedef struct ngRanTraceId { UINT32 size; UINT8 buffer[MAX_SIZE_OF_OCTET_STRING]; @@ -158,7 +170,7 @@ typedef struct ngRanTraceId typedef UINT8 InterToTrace_t; -typedef struct traceActiv +typedef struct traceActiv { NgRanTraceId_t ngRanTraceId; InterToTrace_t interfacesToTrace; @@ -203,7 +215,7 @@ typedef struct mobiRestrInfo CuTac_t notAllowedTac[ngap_maxnoofEPLMNsPlusOne][ngap_maxnoofAllowedAreas]; }MobiRestrInfo_t; -typedef struct ueSecurCapa +typedef struct ueSecurCapa { UINT16 nrEncryptionAlgorithms; UINT16 nrIntegrityProtectionAlgorithms; @@ -214,7 +226,7 @@ typedef struct ueSecurCapa #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 */ @@ -223,7 +235,7 @@ typedef struct expectedUeActivityBehaviour } ExpectedUeActivityBehaviour_t; #define EXPECTEDUEMOVINGTRAJECTORYITEM_TIME_STAYED_IN_CELL_PRESENT (1 << 0) -typedef struct expectedUeMovingTrajectoryItem +typedef struct expectedUeMovingTrajectoryItem { UINT16 bitMask; CuNrCgi_t nrCgi; @@ -260,7 +272,7 @@ typedef struct coreAssitInfo #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; @@ -296,7 +308,7 @@ typedef struct qosFlowSetupReqItem } QosFlowSetupReqItem_t; #define MAX_INTERITY_PROTECTED_DATARATE_PRESENT (1 << 0) -typedef struct securIndic +typedef struct securIndic { UINT16 bitMask; INT64 integrityProtectionIndication; @@ -380,7 +392,7 @@ typedef struct assistDataForPaging PagingAttemptInfo_t pagingAttemptInfo;//Optional }AssistDataForPaging_t; #define QOSFLOW_MAPPING_INDICATION_PRESENT (1 << 0) -typedef struct AssocQosFlowItem +typedef struct AssocQosFlowItem { UINT16 bitMask; INT64 qosFlowId; @@ -391,10 +403,10 @@ typedef struct qosFlowPerTnlInfo { 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; @@ -621,7 +633,7 @@ typedef struct typedef struct { - NgapCause_e cause; + NgapCause_e cause; }PathSwitchReqUnsuccTransfer_t; @@ -659,7 +671,7 @@ typedef struct { UINT8 areaIntItemNum; AreaInterestItem_t areaIntItem[ngap_maxnoofAoI]; - UINT8 locaReportReferenceId; + UINT8 locaReportReferenceId; }AreaInterestListItem_t; typedef struct @@ -668,7 +680,7 @@ typedef struct ReportArea_e reportArea; UINT8 areaIntListItemNum; AreaInterestListItem_t areaIntListItem[ngap_maxnoofAoI]; - UINT8 locaReportReferenceIdTobeCancel;//Condition + UINT8 locaReportReferenceIdTobeCancel;//Condition }LocationReportRequestType_t; /********************************************************************************** @@ -688,7 +700,7 @@ typedef struct ngapRegistergNBReq PagingDRX_e ranDefaPagDrx; UINT8 ueRetInfoFlag; UERetentionInformation_e ueRetenInfo; - RegisterAmf_t registerAmfInfo; + RegisterAmf_t registerAmfInfo; }NgapRegistergNBReq_t; /* First NAS Request (Initial Ue Message)*/ @@ -696,7 +708,7 @@ typedef struct ngapRegistergNBReq #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; @@ -726,7 +738,7 @@ typedef struct ngapUeRadioCapaCheckRsp /* UL NAS Transfer */ #define UL_NAS_LOCATION_INFO_TIMESTAMP_PRESENT (1 << 0) -typedef struct ngapULNas +typedef struct ngapULNas { UINT16 bitMask; Instance_t instance; @@ -752,7 +764,7 @@ typedef struct ngapUeRadioCapaInfoIndication }NgapUeRadioCapaInfoIndication_t; /* Initial Context Setup Response */ -typedef struct ngapInitialContextSetupResp +typedef struct ngapInitialContextSetupResp { Instance_t instance; AmfUeNgapId_t amfUeNgapId; @@ -778,7 +790,7 @@ typedef struct ngapPduSessSetupRsp }NgapPduSessSetupRsp_t; /* Ue Context Release Request */ -typedef struct ngapUeCxtReleaseReq +typedef struct ngapUeCxtReleaseReq { Instance_t instance; UINT64 ranUeNgapId; @@ -790,7 +802,7 @@ typedef struct ngapUeCxtReleaseReq /* 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; @@ -804,7 +816,7 @@ typedef struct ngapUeReleaseComplete 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; @@ -899,7 +911,7 @@ typedef struct ngapRrcInactiveTransitionReport *********************************************************************************** ***********************************************************************************/ /* Register Confirm (NG Setup Response)*/ -typedef struct ngapRegistergNBCnf +typedef struct ngapRegistergNBCnf { Instance_t instance; UINT8 numAmf; /* Number of AMF connected */ @@ -918,7 +930,7 @@ typedef struct ngapUeRadioCapaCheckReq { UINT16 bitMask; Instance_t instance; - AmfUeNgapId_t amfUeNgapId; + AmfUeNgapId_t amfUeNgapId; UINT64 ranUeNgapId; UeRadioCapability_t ueRadioCapability;//Optional }NgapUeRadioCapaCheckReq_t; @@ -934,7 +946,7 @@ typedef struct ngapDLNas { UINT16 bitMask; Instance_t instance; - AmfUeNgapId_t amfUeNgapId; + AmfUeNgapId_t amfUeNgapId; UINT64 ranUeNgapId; AmfName_t oldAmfName; INT64 ranPagPriority; @@ -1012,11 +1024,11 @@ typedef struct ngapUeReleaseCommand { /* 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) @@ -1051,7 +1063,7 @@ typedef struct ngapHandoverPreparationFailure #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; @@ -1136,7 +1148,7 @@ typedef struct ngapPathSwitchRequestFailure AmfUeNgapId_t amfUeNgapId; UINT64 ranUeNgapId; UINT8 rlsSessNum; - PathSwitchRlsPduSessItem_t rlsPduSessItem[NG_MAX_SESSION_NUM]; + PathSwitchRlsPduSessItem_t rlsPduSessItem[NG_MAX_SESSION_NUM]; }NgapPathSwitchRequestFailure_t; /********************************************************************************** *********************************************************************************** @@ -1186,7 +1198,7 @@ typedef struct #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; @@ -1208,9 +1220,9 @@ typedef struct /* 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 */ @@ -1373,9 +1385,9 @@ typedef struct 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 */ @@ -1461,7 +1473,7 @@ typedef struct dFIResponse 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) @@ -1560,15 +1572,15 @@ typedef struct pduSessionResourceToRemoveList 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; @@ -1583,7 +1595,7 @@ typedef struct criticalitydiagnostics typedef struct e1apCause { E1apCausePr_e present; - union E1apCause_u + union E1apCause_u { E1apCauseRadioNetwork_e e1apRadioNetwork; E1apCauseTransport_e e1apTransport; @@ -1592,8 +1604,8 @@ typedef struct e1apCause } 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 { @@ -1611,7 +1623,7 @@ typedef struct partE1InterfaceList typedef struct e1apResetType { E1apResetPr_e present; - union E1apReset_u + union E1apReset_u { INT64 resetAll; PartE1InterfaceList_t PartE1InterfaceList; @@ -1637,7 +1649,7 @@ typedef struct ifmE1apResetAck { UINT16 bitMask; UINT64 transactionId; - PartE1InterfaceList_t PartE1InterfaceList;/*optional*/ + PartE1InterfaceList_t PartE1InterfaceList;/*optional*/ E1Criticalitydiagnostics_t criticalDiagnostics;/*optional*/ } IfmE1apResetAck_t; @@ -1687,7 +1699,7 @@ typedef struct e1apBearerContextSetupReq UINT64 ueDlMaxIPDR;/*optional*/ PlmnId_t servPlmnId; /* e_ActivityNotificationLevel */ - ActNotiLevel_e actNotiLevel; + ActNotiLevel_e actNotiLevel; /* Inactivity_Timer_t */ INT64 inactTimer;/*optional*/ /* e_BearerContextStatusChange */ @@ -1764,7 +1776,7 @@ typedef struct e1apPduSessionResourceToList typedef struct e1apBearerContextModReq { UINT16 bitMask; - NrCellId_t cellId; + NrCellId_t cellId; UINT32 gnbCucpUeE1apId; UINT32 gnbCuupUeE1apId; SecuInfo_t secuInfo; ///< Optional field @@ -1792,11 +1804,11 @@ typedef struct e1apBearerContextRelCmd 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; @@ -1816,13 +1828,13 @@ typedef struct drbSetupItem 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 @@ -1832,7 +1844,7 @@ typedef struct }DRBFailItem_t; typedef struct drbFailedList -{ +{ UINT8 drbFailNum; DRBFailItem_t drbFailItem[e1ap_maxnoofDRBs]; } DRBFailedList_t; @@ -1890,7 +1902,7 @@ typedef struct dRBModifyItem 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) @@ -2002,11 +2014,11 @@ typedef struct e1apRegistergNBReq { 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; @@ -2020,13 +2032,13 @@ typedef struct e1apRegistergNBCnf /* 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) @@ -2119,7 +2131,7 @@ typedef struct dRBSetupModItem 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) @@ -2256,5 +2268,3 @@ typedef struct ifmE1apBearCtxInactiveNotify #endif /* __CUMODULEINTERFACEH__*/ - - diff --git a/Include/cuupCommon.h b/Include/cuupCommon.h index 7cf361f..c56c6cd 100644 --- a/Include/cuupCommon.h +++ b/Include/cuupCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -140,4 +152,3 @@ typedef struct bearerCxtInactive_s extern INT32 ifmUpcBearerCxtInactiveNotification(BearerCxtInactive_t *bearerCxtInactive); extern INT32 ifmUpcDlDataNotification(UINT64 ueE1apId, UINT8 PPI); #endif /* CU_UP_COMMON_H */ - diff --git a/Include/cuupProtocolPara.h b/Include/cuupProtocolPara.h index c370baf..bdaa3b4 100644 --- a/Include/cuupProtocolPara.h +++ b/Include/cuupProtocolPara.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -18,7 +30,7 @@ #define CUUP_NAME_MAX_LEN 32 typedef struct CuupBasicInfoCfg_s -{ +{ UINT64 gnbCuupId; UCHAR gnbCuupName[CUUP_NAME_MAX_LEN]; UINT8 cnSupportType;//ENUMERATED (EPC,5GC,both) @@ -37,7 +49,7 @@ typedef struct CuupBasicInfoCfg_s typedef struct CuupIpAddrList_s { - UINT8 ipType; + UINT8 ipType; UINT32 port; char ipv4Address[MAX_CUUP_IPV4_ADDR_LEN]; char ipv6Address[MAX_CUUP_IPV6_ADDR_LEN]; @@ -83,7 +95,7 @@ typedef struct CuupPlmnIdInfo_s #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 @@ -110,7 +122,7 @@ typedef struct ngranQosSupportList_s 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; @@ -143,4 +155,3 @@ typedef struct cellIdSupportList_s #pragma pack() #endif - diff --git a/Include/cuupTest.h b/Include/cuupTest.h index 0bb7935..8e1a85e 100644 --- a/Include/cuupTest.h +++ b/Include/cuupTest.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 diff --git a/Include/cuupUeIdTransf.h b/Include/cuupUeIdTransf.h index 555e159..7685903 100644 --- a/Include/cuupUeIdTransf.h +++ b/Include/cuupUeIdTransf.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 diff --git a/Include/f1uCommon.h b/Include/f1uCommon.h index 6e78860..50aca2f 100644 --- a/Include/f1uCommon.h +++ b/Include/f1uCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -18,7 +30,7 @@ typedef enum{ LEN_12_BITS = 0, LEN_18_BITS = 1 }PDCPSnSize_e; - + /* CU-F1-U instance */ typedef struct { UINT64 ueE1apId; diff --git a/Include/gnbCommon.h b/Include/gnbCommon.h index 51e4716..27da80f 100644 --- a/Include/gnbCommon.h +++ b/Include/gnbCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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_ @@ -58,7 +70,7 @@ extern struct timeval procStart, procEnd; #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 @@ -101,7 +113,7 @@ extern struct timeval procStart, procEnd; /*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)) { \ @@ -124,13 +136,13 @@ extern UINT32 f1apGetModuleId(); /*********************************************************************************************************** ********************************************* enum define************************************************* ************************************************************************************************************/ - + /* IP Type */ typedef enum ipAddrType { - IPv4, - IPv6, - IPTypeMax, + IPv4, + IPv6, + IPTypeMax, }IpAddrType_e; typedef enum @@ -145,10 +157,10 @@ 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; @@ -173,7 +185,7 @@ typedef INT32 (*HOST_TASK_INIT_FUNCPTR)(void); ************************************************************************************************************/ /* IPV4 Address */ -typedef struct +typedef struct { UINT16 port; UINT32 address; @@ -189,7 +201,7 @@ typedef struct cmInetIpv6Addr /* IP Address */ typedef struct ipAddress -{ +{ IpAddrType_e ipType; /* type of transport address */ union { @@ -205,7 +217,7 @@ typedef struct ngapRanName }NgapRanName_t; /* user task info */ -typedef struct +typedef struct { UINT32 userTaskId; UINT32 hostTaskId; @@ -215,7 +227,7 @@ typedef struct } UserTaskInfo_t; /* Host task info */ -typedef struct +typedef struct { UINT32 hostTaskId; UINT32 procId; @@ -226,11 +238,11 @@ typedef struct /* 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;/*线程执行函数*/ @@ -262,12 +274,12 @@ typedef struct { 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; @@ -281,7 +293,7 @@ typedef struct { UINT32 vosTaskId; SockAddrStr_t ipAddrStr; - + SockAddrStr_t clientAddrInfo; }TaskSockAddrInfo_t; @@ -307,11 +319,11 @@ typedef struct typedef struct { - + }UdpSocketMsg_t; typedef struct { - + }TcpSocketMsg_t; typedef struct @@ -322,22 +334,22 @@ 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; @@ -363,15 +375,15 @@ typedef struct /* 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; @@ -379,12 +391,12 @@ typedef struct /** 采用非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; ///< 无需关心 @@ -396,25 +408,25 @@ typedef struct ************************************************************************************************************/ /*********************************** 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 @@ -426,20 +438,20 @@ typedef enum 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; @@ -459,7 +471,7 @@ typedef struct macCellCfgPara_s }macCellCfgPara_t; /*********************************** SIB1_t ***************************************/ -typedef enum connEstFailureControlCount +typedef enum connEstFailureControlCount { NR_ConnEstFailureControl__connEstFailCount_n1 = 0, NR_ConnEstFailureControl__connEstFailCount_n2 = 1, @@ -467,7 +479,7 @@ typedef enum connEstFailureControlCount NR_ConnEstFailureControl__connEstFailCount_n4 = 3 } ConnEstFailureControlCount_e; -typedef enum connEstFailureControlOffsetValidity +typedef enum connEstFailureControlOffsetValidity { NR_ConnEstFailureControl__connEstFailOffsetValidity_s30 = 0, NR_ConnEstFailureControl__connEstFailOffsetValidity_s60 = 1, @@ -488,7 +500,7 @@ typedef struct connEstFailCtrl UINT8 connEstFailOffset; /*option*/ } ConnEstFailCtrl_t; -typedef enum timerT300 +typedef enum timerT300 { NR_UE_TimersAndConstants__t300_ms100 = 0, NR_UE_TimersAndConstants__t300_ms200 = 1, @@ -499,8 +511,8 @@ typedef enum timerT300 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, @@ -511,8 +523,8 @@ typedef enum timerT301 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, @@ -522,8 +534,8 @@ typedef enum timerT310 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, @@ -534,8 +546,8 @@ typedef enum timerN310 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, @@ -545,8 +557,8 @@ typedef enum timerT311 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, @@ -557,8 +569,8 @@ typedef enum timerN311 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, @@ -588,10 +600,10 @@ typedef struct ueTimersAndConstants { 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) @@ -602,7 +614,7 @@ typedef struct siReqRes UINT8 raPreambleStartIndex; UINT8 raAssociationPeriodIndex; /*option*/ UINT8 raSsbOccasionMaskIndex; /*option*/ - + } SiReqRes_t; #define PRACH_CONFIGURATION_INDEX (1<<0) @@ -626,13 +638,13 @@ typedef struct siRequestConfig 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, @@ -643,7 +655,7 @@ typedef enum schInfoSiPeriod 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, @@ -655,7 +667,7 @@ typedef enum sibType NR_SIB_TypeInfo__type_sibType9 = 7 } SibType_e; -typedef enum sibAreaScope +typedef enum sibAreaScope { NR_SIB_TypeInfo__areaScope_true = 0 } SibAreaScope_e; @@ -666,7 +678,7 @@ typedef enum sibAreaScope typedef struct sibTypeInfo { UINT16 bitMask; - SibType_e type; + SibType_e type; UINT8 valueTag; /*option*/ SibAreaScope_e areaScope; /*option*/ } SibTypeInfo_t; @@ -676,7 +688,7 @@ typedef struct siSchInfo BOOL siBroadcastStatus; SchInfoSiPeriod_e siPeriodicity; - UINT16 sibMappingNum; + UINT16 sibMappingNum; SibTypeInfo_t sibMapping[MAX_SIB]; } SiSchInfo_t; @@ -699,7 +711,7 @@ typedef struct nrControlResourceSet 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 { @@ -718,7 +730,7 @@ typedef struct nrControlResourceSet long pdcch_DMRS_ScramblingID; /* OPTIONAL */ } NrControlResourceSet_t; -typedef struct nrofCandidates +typedef struct nrofCandidates { long aggregationLevel1; long aggregationLevel2; @@ -738,19 +750,19 @@ typedef enum nrSearchSpace_searchSpaceType_PR { #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 @@ -769,7 +781,7 @@ typedef struct nrSearchSpaceType struct SearchSpace_searchSpaceType_common_dci_Format2_1 { } dci_Format2_1;//optional - + struct SearchSpace_searchSpaceType_common_dci_Format2_2 { } dci_Format2_2;//optional @@ -782,11 +794,11 @@ typedef struct nrSearchSpaceType long dummy2; } dci_Format2_3;//optional } common; - struct SearchSpace_searchSpaceType_specific + struct SearchSpace_searchSpaceType_specific { long dci_Formats; }specific; - + } choice; }NrSearchSpaceType_t; @@ -819,11 +831,11 @@ typedef struct nrSearchSpace UINT16 bitmask; long searchSpaceId; long controlResourceSetId; /* OPTIONAL */ - - struct SearchSpaceMonitoringSlotPeriodicityAndOffset + + struct SearchSpaceMonitoringSlotPeriodicityAndOffset { NrSearchSpaceMonitoringSlotPeriodicityAndOffset_PR present; - union SearchSpaceMonitoringSlotPeriodicityAndOffset_u + union SearchSpaceMonitoringSlotPeriodicityAndOffset_u { int sl1; long sl2; @@ -842,7 +854,7 @@ typedef struct nrSearchSpace long sl2560; } choice; } monitoringSlotPeriodicityAndOffset;/* OPTIONAL */ - + long duration; /* OPTIONAL */ UINT16 monitoringSymbolsWithinSlot; /* OPTIONAL */ NrofCandidates_t nrofCandidates; @@ -868,7 +880,7 @@ typedef struct PDCCHCfgCommon long searchSpaceZero; /* OPTIONAL */ UINT8 searchSpaceNum; NrSearchSpace_t searchSpace[MAX_SEARCHSPACE_NUM]; - + long searchSpaceSIB1; /* OPTIONAL */ long searchSpaceOtherSystemInformation; /* OPTIONAL */ long pagingSearchSpace; /* OPTIONAL */ @@ -888,9 +900,9 @@ typedef struct pdcchCfgCommon union Setup_Release_PDCCH_PR_u { UINT32 release; Pdcch_Cfg_Common_t setup; - + }choice; - + } PdcchCfgCommon_t; /* PUCCH-ConfigCommon */ @@ -913,7 +925,7 @@ typedef enum nrPucchCfgCommon_PR NrPucchCfgCommon_PR_setup }NrPucchCfgCommon_PR; -typedef struct nrPucchCfgCommon +typedef struct nrPucchCfgCommon { NrPucchCfgCommon_PR present; @@ -946,7 +958,7 @@ typedef struct puschTimeDomainAlloc #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 */ @@ -965,7 +977,7 @@ typedef struct pdschCfgCommon union Setup_Release_PDSCH_PR_u { UINT32 release; Pdsch_Cfg_Common_t setup; - + }choice; } PdschCfgCommon_t; @@ -1020,10 +1032,10 @@ typedef struct specificCarrier 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*/ @@ -1042,7 +1054,7 @@ typedef struct nrRachCfgGeneric_t 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, @@ -1073,7 +1085,7 @@ typedef struct RACH_Config_Common 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 @@ -1088,18 +1100,18 @@ typedef struct RACH_Config_Common 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 @@ -1146,13 +1158,13 @@ typedef struct nrPusch_ConfigCommon }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 { @@ -1224,7 +1236,7 @@ typedef struct sCS15KHZoneT_s typedef struct sCS30KHZoneT_SCS15KHZhalfT_s { - + UINT16 poNum; UINT16 firstMonitorOccasionOfPO[MAX_PDCCH_MONITORING_OCCASION]; @@ -1277,7 +1289,7 @@ typedef struct pcchConfig { UINT16 bitMask; UINT8 defaultPagingCycle; - + struct PagingFrameOffset { PagingFrameOffset_e present; union PagingFrame { @@ -1292,12 +1304,12 @@ typedef struct pcchConfig 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; @@ -1341,7 +1353,7 @@ typedef struct tddUlDlCfgCom typedef struct servingCellCfg { UINT16 bitMask; - DlCfgCommonSIB_t downlinkConfigCommon; + DlCfgCommonSIB_t downlinkConfigCommon; UlCfgCommonSIB_t uplinkConfigCommon; /*option*/ UlCfgCommonSIB_t supplementaryUplink; /*option*/ UINT8 nTimingAdvanceOffset; /*option*/ @@ -1370,7 +1382,7 @@ typedef enum UacAcBarringListType_PR { typedef struct uACBarringPerPLMN { UINT16 bitMask; - UINT8 plmnIdentityIndex; + UINT8 plmnIdentityIndex; UINT16 BarringListNum; UacImplicitACBarringList_UacExplicitAcBarringList_PR present; union UacAcBarringListType_u { @@ -1421,16 +1433,16 @@ typedef struct sib1UacBarringInfo 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; @@ -1453,13 +1465,13 @@ typedef struct sib1UacBarringInfo #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*/ @@ -1467,7 +1479,7 @@ typedef struct sib1 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*/ @@ -1481,8 +1493,8 @@ typedef struct sib1 typedef enum cmSib2QHyst { qHystdB0 = 0, - qHystdB1 = 1, - qHystdB2 = 2, + qHystdB1 = 1, + qHystdB2 = 2, qHystdB3 = 3, qHystdB4 = 4, qHystdB5 = 5, @@ -1499,30 +1511,30 @@ typedef enum cmSib2QHyst }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, @@ -1534,7 +1546,7 @@ typedef enum cmSib2TEvaluation tEvaluationSpare1 = 7 }CmSib2TEvaluation_e; -typedef enum cmSib2THystNormal +typedef enum cmSib2THystNormal { tHystNormalS30 = 0, tHystNormalS60 = 1, @@ -1547,7 +1559,7 @@ typedef enum cmSib2THystNormal }CmSib2THystNormal_e; -typedef struct cmSib2MobilityStateParameters +typedef struct cmSib2MobilityStateParameters { CmSib2TEvaluation_e tEvaluation; CmSib2THystNormal_e tHystNormal; @@ -1556,16 +1568,16 @@ typedef struct cmSib2MobilityStateParameters }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*/ @@ -1573,7 +1585,7 @@ typedef struct cmSib2ThresholdNr UINT8 thresholdSINR; /*0-127 OPTIONAL*/ }CmSib2ThresholdNr_t; -typedef enum cmSib2QOffsetRange +typedef enum cmSib2QOffsetRange { sib2qOffsetRangeMinus24 = 0, sib2qOffsetRangeMinus22 = 1, @@ -1608,22 +1620,22 @@ typedef enum cmSib2QOffsetRange 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, @@ -1632,9 +1644,9 @@ typedef enum cmSib2CellReselectionSubPriority }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; @@ -1663,7 +1675,7 @@ typedef struct cmSib2NrNsPmaxValue typedef struct cmSib2NrNsPmaxList { - CmSib2NrNsPmaxValue_t nRNsPmaxList[MAX_NR_NS_PMAX]; + CmSib2NrNsPmaxValue_t nRNsPmaxList[MAX_NR_NS_PMAX]; } CmSib2NrNsPmaxList_t; @@ -1677,30 +1689,30 @@ typedef struct cmSib2NrMultiBandInfo 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; @@ -1711,35 +1723,35 @@ typedef struct cmSib2SsbMtc //choice sf5-sf160 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; @@ -1758,7 +1770,7 @@ typedef struct cmSib2IntraFreqCellReselectionInfo BOOL deriveSSBIndexFromCell; } CmSib2IntraFreqCellReselectionInfo_t; -typedef struct sib2 +typedef struct sib2 { CmSib2CellReselectionInfoCommon_t cellReselectionCommon; CmSib2CellReselectionServingFreqInfo_t cellReselectionServingFreq; @@ -1766,7 +1778,7 @@ typedef struct sib2 }Sib2_t; /********************** Sib3_t ************************/ -typedef enum cmSib3QOffsetRange +typedef enum cmSib3QOffsetRange { sib3qOffsetRangeMinus24 = 0, sib3qOffsetRangeMinus22 = 1, @@ -1800,11 +1812,11 @@ typedef enum cmSib3QOffsetRange 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 @@ -1816,7 +1828,7 @@ typedef struct cmSib3IntraFreqNeighCellInfo } CmSib3IntraFreqNeighCellInfo_t; -typedef struct cmSib3IntraFreqNeighCellList +typedef struct cmSib3IntraFreqNeighCellList { UINT32 neighNum; CmSib3IntraFreqNeighCellInfo_t intraFrequenceNeighCellList[MAXCELLINTRA]; @@ -1824,7 +1836,7 @@ typedef struct cmSib3IntraFreqNeighCellList } CmSib3IntraFreqNeighCellList_t; -typedef enum cmSib3Range +typedef enum cmSib3Range { rangeN4 = 0, rangeN8 = 1, @@ -1845,15 +1857,15 @@ typedef enum cmSib3Range }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]; @@ -1862,7 +1874,7 @@ typedef struct cmSib3IntraFreqBlackCellList #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; @@ -1870,11 +1882,11 @@ typedef struct sib3 }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; @@ -1885,7 +1897,7 @@ typedef struct systemInfo }SystemInfo_t; /********************** SiConfig_t ************************/ -typedef struct siConfig +typedef struct siConfig { Mib_t mibCfg; Sib1_t sib1Cfg; @@ -1912,7 +1924,7 @@ typedef struct siConfig #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 */ @@ -1920,14 +1932,14 @@ typedef struct ngapConfig } 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; @@ -1940,7 +1952,7 @@ typedef struct f1apConfig /** * @struct Transmission BandWidth - This structure is the Transmission BandWidth of Cell Configuration + This structure is the Transmission BandWidth of Cell Configuration */ typedef struct transBandWidth { @@ -1950,7 +1962,7 @@ 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 { @@ -1960,7 +1972,7 @@ 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 { @@ -1971,7 +1983,7 @@ 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 @@ -1985,7 +1997,7 @@ 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 { @@ -1997,7 +2009,7 @@ 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 { @@ -2007,7 +2019,7 @@ 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 { @@ -2017,7 +2029,7 @@ 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 { @@ -2030,7 +2042,7 @@ 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)) \ { \ @@ -2041,21 +2053,21 @@ typedef struct oamActCellRsp 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; \ @@ -2075,7 +2087,7 @@ do { \ ((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 { \ @@ -2099,7 +2111,7 @@ extern INT32 error_file(FILE *file_p); 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); @@ -2107,8 +2119,5 @@ void gnbPrintRrcMsg(int direction, int msgType, UINT8 *buf, INT32 size); #ifdef __cplusplus } #endif - -#endif /* _CU_COMMON_H_*/ - - +#endif /* _CU_COMMON_H_*/ diff --git a/Include/gnbServiceType.h b/Include/gnbServiceType.h index 2d8ba8f..aebfd56 100644 --- a/Include/gnbServiceType.h +++ b/Include/gnbServiceType.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -82,7 +94,7 @@ typedef enum { CELL_ACTIVE_STATE, CELL_INACTIVE_STATE, - + }CellState_e; @@ -107,7 +119,7 @@ typedef struct NrCellId typedef struct plmnInformation { UINT16 bitMask; - UINT8 plmnIdNum; + UINT8 plmnIdNum; PlmnId_t plmnId[MAX_PLMN_ID_NUM]; UINT32 trackingAreaCode; /*option*/ UINT8 ranac; /*option*/ @@ -146,4 +158,3 @@ typedef LONG GnbCuId; #endif - diff --git a/Include/gtpCommon.h b/Include/gtpCommon.h index 4b55435..8ba2eff 100644 --- a/Include/gtpCommon.h +++ b/Include/gtpCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -20,7 +32,7 @@ #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 @@ -40,7 +52,7 @@ #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 @@ -121,7 +133,7 @@ typedef struct 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 */ @@ -163,7 +175,7 @@ struct gtpExtHead{ /* GTP-U packet */ typedef struct { - GtpHeadShort_t h; + GtpHeadShort_t h; UINT8 p[GTP_MAX_DATA_LEN]; /* store data */ }GtpPacketShort_t; @@ -196,7 +208,7 @@ typedef struct tun 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 */ @@ -210,16 +222,16 @@ typedef struct { 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 */ @@ -241,7 +253,7 @@ typedef struct } Gtp_t; -typedef struct +typedef struct { UINT8 *pPdu; /* length, content, next extension type */ UINT16 len; /* len = exHeaderLen * 4 */ @@ -252,10 +264,10 @@ typedef struct /* 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; @@ -289,4 +301,3 @@ typedef struct #endif /* GTPU_COMMON_H */ - diff --git a/Include/msgb.h b/Include/msgb.h index 903bc35..35f55ee 100644 --- a/Include/msgb.h +++ b/Include/msgb.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -14,7 +26,7 @@ extern ULONG gMsgbFreeCount; -typedef struct +typedef struct { UINT16 maxHeadLen; /* Head域预留的长度 */ UINT16 maxDataLen; /* Data域预留的长度 */ @@ -43,7 +55,7 @@ UINT8 *msgbTailPullWithDebug(MsgbBuff_t *pMsgBuff, UINT32 len,unsigned char *fun #define msgbAlloc( dataLen, maxHeadLen, moduleId) msgbAllocWithDebug( dataLen, maxHeadLen, moduleId,(UCHAR *)__func__,__LINE__) - + #define msgbData(pMsgBuff) msgbDataWithDebug(pMsgBuff,(UCHAR *)__func__,__LINE__) @@ -78,4 +90,3 @@ extern UINT16 msgbTailLeftRoom(MsgbBuff_t *pMsgBuff); #define msgbTailPull(pMsgBuff, len) msgbTailPullWithDebug(pMsgBuff, len,(UCHAR *)__func__,__LINE__) #endif /* MSGB_H */ - diff --git a/Include/ngu.h b/Include/ngu.h index e77e601..8e3f2d3 100644 --- a/Include/ngu.h +++ b/Include/ngu.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -91,12 +103,12 @@ typedef struct UINT64 ueE1apId; UINT16 ueIdx; UINT16 pduSessionId; - UINT32 ownTeid; -}NguInstance_t; + UINT32 ownTeid; +}NguInstance_t; typedef struct -{ +{ UINT16 ueIdx; UINT64 ueE1apId; CuupBearerStatus_e ueStatus; diff --git a/Include/nguUlDataProc.h b/Include/nguUlDataProc.h index e436ceb..8a9bea2 100644 --- a/Include/nguUlDataProc.h +++ b/Include/nguUlDataProc.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 diff --git a/Include/omCuupApi.h b/Include/omCuupApi.h index db19199..c4953be 100644 --- a/Include/omCuupApi.h +++ b/Include/omCuupApi.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -19,14 +31,14 @@ /*结构体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) @@ -64,4 +76,3 @@ typedef struct CuUp_shm_table_s #endif - diff --git a/Include/pdcpCommon.h b/Include/pdcpCommon.h index ed4a635..309693b 100644 --- a/Include/pdcpCommon.h +++ b/Include/pdcpCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -66,12 +78,12 @@ typedef enum 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 */ @@ -292,7 +304,7 @@ typedef enum{ 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, @@ -302,7 +314,7 @@ typedef enum{ 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, diff --git a/Include/pdcpComprohc.h b/Include/pdcpComprohc.h index 46a51c6..ee7545a 100644 --- a/Include/pdcpComprohc.h +++ b/Include/pdcpComprohc.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 #include #include @@ -11,24 +23,24 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include -#include -#include +#include +#include #include /* for the printf() function */ - + /* includes required to create a fake IP packet */ #include /* for the IPv4 header */ #include /* for the strlen() */ #include /* for the rohc_buf_*() functions */ - + /* includes required to use the compression part of the ROHC library */ #include /* required by time() */ #include /* for rohc_comp_*() functions */ diff --git a/Include/pdcpu.h b/Include/pdcpu.h index 4b35085..1464b77 100644 --- a/Include/pdcpu.h +++ b/Include/pdcpu.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 @@ -94,7 +106,7 @@ typedef enum }PdcpTimer_e; -typedef struct +typedef struct { UINT32 count; UINT32 f1uSn; /* Not used in receiving buffer */ @@ -105,8 +117,8 @@ typedef struct typedef struct -{ - UINT16 notUsed; +{ + UINT16 notUsed; RohcParaPR_e rohcType; union { @@ -121,34 +133,34 @@ typedef struct 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; @@ -174,7 +186,7 @@ typedef struct 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 diff --git a/Include/pdcpuCore.h b/Include/pdcpuCore.h index 12263fc..90211c6 100644 --- a/Include/pdcpuCore.h +++ b/Include/pdcpuCore.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 diff --git a/Include/pdcpuDlDataProc.h b/Include/pdcpuDlDataProc.h index 3d6bc39..04337ce 100644 --- a/Include/pdcpuDlDataProc.h +++ b/Include/pdcpuDlDataProc.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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 diff --git a/Include/plat_alarm.h b/Include/plat_alarm.h index 01ad245..f3fba71 100644 --- a/Include/plat_alarm.h +++ b/Include/plat_alarm.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -69,7 +81,7 @@ typedef struct { UCHAR reserved[2]; ///< 保留字段 } __attribute__((packed)) alm_status_t; -/** +/** * 通用告警上报API,使用变长参数,变长参数只支持ULONG 和char * 字符串。 * 设备索引和上报参数依次排列,不能乱序。 * @param[in] alarmType 告警类型 @@ -79,27 +91,27 @@ typedef struct { 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 @@ -108,7 +120,7 @@ ULONG alarm_Level_get( ULONG alarmType, ULONG alarmId ); ULONG alarm_TrapEnable_get( ULONG alarmType, ULONG alarmId ); -/** +/** * 根据 alarmType 和 alarmId 获取告警 index个数。 * @param[in] alarmType 告警类型 * @param[in] alarmId 告警ID @@ -117,7 +129,7 @@ ULONG alarm_TrapEnable_get( ULONG alarmType, ULONG alarmId ); ULONG alarm_IndexNum_get( ULONG alarmType, ULONG alarmId ); -/** +/** * 根据 alarmType 和 alarmId 获取告警 参数个数。 * @param[in] alarmType 告警类型 * @param[in] alarmId 告警ID @@ -126,106 +138,106 @@ ULONG alarm_IndexNum_get( ULONG alarmType, ULONG alarmId ); 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); diff --git a/Include/plat_db.h b/Include/plat_db.h index fe7b0c3..5161f1d 100644 --- a/Include/plat_db.h +++ b/Include/plat_db.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -42,24 +54,24 @@ extern "C"{ #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 @@ -69,41 +81,41 @@ extern "C"{ /** 数据库的数据类型 */ 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" @@ -128,18 +140,18 @@ typedef union DB_data_val_u{ /** 列信息 */ 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; @@ -157,7 +169,7 @@ typedef struct DB_table_info_s{ 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子元素 */ @@ -193,39 +205,39 @@ typedef enum DB_ret_code_e{ 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 表信息 @@ -233,24 +245,24 @@ BOOL DB_table_exist(DB_database_t *db,const CHAR *table_name, * @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 要操作的表名 @@ -259,12 +271,12 @@ LONG DB_table_delete(DB_database_t *db,const CHAR name[DB_TABLE_NAME_LEN], * @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 要操作的表名 @@ -276,14 +288,14 @@ LONG DB_table_row_add(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LEN] * @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 要操作的表名 @@ -293,12 +305,12 @@ LONG DB_table_row_query(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LE * @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 要操作的表名 @@ -306,12 +318,12 @@ LONG DB_table_row_data_pop(DB_database_t *db,const CHAR table_name[DB_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 要操作的表名 @@ -320,14 +332,14 @@ LONG DB_table_row_handle_destroy(DB_database_t *db,const CHAR table_name[DB_TABL * @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 要操作的表名 @@ -340,13 +352,13 @@ LONG DB_table_row_delete(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_L * @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 要操作的表名 @@ -356,12 +368,12 @@ LONG DB_table_row_update(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_L * @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 要操作的表名 @@ -370,16 +382,16 @@ LONG DB_table_row_count(DB_database_t *db,const CHAR table_name[DB_TABLE_NAME_LE * @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); @@ -388,4 +400,3 @@ const CHAR *DB_err_msg(LONG code); #endif /* end of __cplusplus */ #endif /* end of __PLAT_DB_H__ */ - diff --git a/Include/plat_syslog.h b/Include/plat_syslog.h index a17d119..df8a3f9 100644 --- a/Include/plat_syslog.h +++ b/Include/plat_syslog.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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_ @@ -14,16 +26,16 @@ /** 日志等级 */ 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等级 @@ -35,7 +47,7 @@ typedef enum _tag_SYSLOG_LEVEL VOS_SysLog(module_id, iLog_Level, __FILE__, __LINE__, __func__, content,##__VA_ARGS__); -/** +/** * 指定参数日志记录,只支持打印 %d 类型,传参必须为INT * @param[in] module_id 模块ID * @param[in] iLog_Level Log等级 @@ -48,7 +60,7 @@ typedef enum _tag_SYSLOG_LEVEL 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等级 @@ -61,7 +73,7 @@ typedef enum _tag_SYSLOG_LEVEL 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等级 diff --git a/Include/platform_module_names.h b/Include/platform_module_names.h index 02f96cc..8b8ece0 100644 --- a/Include/platform_module_names.h +++ b/Include/platform_module_names.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -47,4 +59,3 @@ extern "C" #endif /* __cplusplus */ #endif /* __PLATFORM_MODULE_NAMES_H__ */ - diff --git a/Include/sdapCore.h b/Include/sdapCore.h index 320ff5a..d00db8a 100644 --- a/Include/sdapCore.h +++ b/Include/sdapCore.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -44,7 +56,7 @@ typedef struct }SdapActivityNotify_t; -/* 1、每个实体内的Session ID、drbID、QosFlowId,都是连续的 +/* 1、每个实体内的Session ID、drbID、QosFlowId,都是连续的 2、Session和Qos相关的信息都是以ID作为下标保存的 3、DRB是以DRB ID - 1 保存的*/ diff --git a/Include/sys_main_api.h b/Include/sys_main_api.h index f8d0279..6fb682f 100644 --- a/Include/sys_main_api.h +++ b/Include/sys_main_api.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -115,7 +127,7 @@ typedef struct _devsm_notify_info_s /********************* 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) /*本板是否是备用主控*/ diff --git a/Include/upcCommon.h b/Include/upcCommon.h index 3937ec8..2db73d1 100644 --- a/Include/upcCommon.h +++ b/Include/upcCommon.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -38,7 +50,7 @@ extern UpInstance_t s_UpcGlobalData; 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); diff --git a/Include/upcContext.h b/Include/upcContext.h index c7bd320..6874b3f 100644 --- a/Include/upcContext.h +++ b/Include/upcContext.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -53,7 +65,7 @@ typedef struct /* QOS Info Begin */ QosFlowLevelQosPar_t qosPara; - + UINT8 qosMapFlag; QosFlowMapInd_e qosFlowMapInd; /* QOS Info End */ @@ -156,7 +168,7 @@ typedef struct UINT8 dlAMBRFlag; UINT64 sessDlAMBR; - + UINT8 DFIReqFlag; DFIRequest_t DFIInfoReq; UINT8 DFIRspFlag;/* Only Mod Optional */ @@ -193,17 +205,17 @@ typedef struct 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; @@ -229,7 +241,7 @@ typedef struct upDrbCb { UINT8 useFlag; INT64 drbId; - + SdapCfg_t sdapConfig; PDCPConfiguration_t pdcpConfig; UPParametersList_t f1UlUpPara; @@ -264,10 +276,10 @@ typedef struct upSessCb DFIRequest_t dataForInfoReq; - + INT64 networkInstance; - + UINT8 drbNum; UpDrbCb_t *pDrbCb[UPC_MAX_DRB_NUM]; @@ -293,9 +305,9 @@ typedef struct upUeCb UINT64 ueDlAMBR; UINT64 ueDlMaxIPDR; PlmnId_t plmnId; - + INT64 inActTimer; - + UINT16 sessNum;/* current session num */ UpSessCb_t *pSessCb[UPC_MAX_SESSION_NUM]; struct upInstance *pUpInstance; @@ -313,7 +325,7 @@ typedef struct upInstance 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]; @@ -335,5 +347,3 @@ UpDrbCb_t *upcGetDrbCb(UpSessCb_t *pSessCb, UINT8 drbId); #endif #endif - - diff --git a/Include/vos_byteorder.h b/Include/vos_byteorder.h index 0e5aa5c..528ca90 100644 --- a/Include/vos_byteorder.h +++ b/Include/vos_byteorder.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -32,7 +44,7 @@ extern "C"{ #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 diff --git a/Include/vos_cli.h b/Include/vos_cli.h index 5c25065..40077c5 100644 --- a/Include/vos_cli.h +++ b/Include/vos_cli.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -50,9 +62,9 @@ extern "C" /** 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 }; @@ -166,21 +178,21 @@ struct vty /* 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. @@ -199,9 +211,9 @@ struct vty /** cl_vector 动态数组指针 */ -struct _cl_vector +struct _cl_vector { - unsigned int max; ///< 当前最大索引加1 + unsigned int max; ///< 当前最大索引加1 unsigned int alloced; ///< 数组大小 */ void **index; ///< 指针数组 }; @@ -215,9 +227,9 @@ struct cmd_element 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中可以重复的单词的重复位置和重复次数等 }; @@ -232,7 +244,7 @@ struct cmd_node #define DEFUN_FLAG 0 -/** +/** * 命令行定义宏 * @param[in] funcname 回调函数的函数名 * @param[in] cmdname 命令变量的变量名 @@ -246,7 +258,7 @@ struct cmd_node int funcname (struct cmd_element *self, struct vty *vty, int argc, char **argv) -/** +/** * 命令行回调函数中的标准输出函数, * 注意 LONG 输出时,要用%ld,或%lx * @param[in] vty vty @@ -256,7 +268,7 @@ struct cmd_node */ INT vty_out ( struct vty * vty, const CHAR * format, ... ); -/** +/** * 创建并安装命令节点 * @param[in] prompt 节点提示符,用于命令行提示符的显示 * @return 成功返回 一个新节点的指针,失败返回NULL @@ -264,7 +276,7 @@ INT vty_out ( struct vty * vty, const CHAR * format, ... ); struct cmd_node *VOS_cli_create_node(char prompt[VTY_CMD_PROMPT_MAX]); -/** +/** * 把命令安装到指定节点 * @param[in] node_id 节点ID * @param[in] cmd 命令 @@ -273,7 +285,7 @@ struct cmd_node *VOS_cli_create_node(char prompt[VTY_CMD_PROMPT_MAX]); VOID VOS_cli_install_element( enum node_type node_id, struct cmd_element * cmd ); -/** +/** * 在进入节点函数中调用,用于进入节点 * @param[in] vty vty * @param[in] newnode 要进入的节点ID @@ -282,7 +294,7 @@ VOID VOS_cli_install_element( enum node_type node_id, struct cmd_element * cmd ) LONG vty_enter_node(struct vty *vty,enum node_type newnode); -/** +/** * 在进入节点函数中调用,用于自定义要进入节点的命令行提示符, * 调用vty_enter_node后调用 * @param[in] vty vty @@ -315,13 +327,13 @@ enum match_type mac_match, slot_port_match, slot_subport_match, - + time_match, range_match, /*其余的匹配类型在此之前*/ register_match, - + exact_match }; @@ -334,31 +346,31 @@ typedef struct _cmd_notify_register_tag 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] ... 要输出的变量 diff --git a/Include/vos_common.h b/Include/vos_common.h index 6148781..5e7a4e5 100644 --- a/Include/vos_common.h +++ b/Include/vos_common.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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_ diff --git a/Include/vos_ctype.h b/Include/vos_ctype.h index 6756196..00562e4 100644 --- a/Include/vos_ctype.h +++ b/Include/vos_ctype.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + diff --git a/Include/vos_lib.h b/Include/vos_lib.h index 45a536b..dacb847 100644 --- a/Include/vos_lib.h +++ b/Include/vos_lib.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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_ @@ -23,78 +35,78 @@ #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,...); @@ -108,33 +120,33 @@ ULONG VOS_Vsnprintf(CHAR * buf, ULONG size, const CHAR * fmt, va_list args); /** 同 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 延时的秒数 */ @@ -142,37 +154,37 @@ VOID VOS_Sleep(LONG 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(); //信号最小值 @@ -195,32 +207,32 @@ typedef enum VOS_MOD_EVENT_TYPE_S /*=========================================================================================================================*/ /* ###### 下面的函数不要直接调用,使用上面提供的宏 ###### */ -/** +/** * 分配内存,不要直接调用该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); /******计算某个函数运行时间******/ diff --git a/Include/vos_linklist.h b/Include/vos_linklist.h index 9c05436..7691b65 100644 --- a/Include/vos_linklist.h +++ b/Include/vos_linklist.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -59,24 +71,24 @@ typedef struct cl_lib_list /** 获得节点中的数据 */ #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 待添加的数据 @@ -84,21 +96,21 @@ void cl_lib_list_delete ( struct cl_lib_list * plist1 ); 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 函数参数 @@ -106,7 +118,7 @@ void cl_lib_listnode_delete ( struct cl_lib_list * plist1, void * val ); */ void *cl_lib_listnode_cmp_delete ( struct cl_lib_list * plist1, void * val ); -/** +/** * 在当前节点前插入数据 * @param[in] plist1 待插入数据的list * @param[in] currentnode 当前节点 @@ -114,7 +126,7 @@ void *cl_lib_listnode_cmp_delete ( struct cl_lib_list * plist1, void * val ); */ void cl_lib_list_add_node_prev ( plist plist1, plistnode currentnode, void *val ); -/** +/** * 在当前节点后插入数据 * @param[in] plist1 待插入数据的list * @param[in] currentnode 当前节点 @@ -122,7 +134,7 @@ void cl_lib_list_add_node_prev ( plist plist1, plistnode currentnode, void *val */ void cl_lib_list_add_node_next ( plist plist1, plistnode currentnode, void *val ); -/** +/** * 节点查找 API,根据给定val查找 * !!!用此API 需要确保 plist->cmp 成员已赋值,否则无法查找 * !!!不可修改获得节点的 prev 和 next指针 @@ -135,7 +147,7 @@ void cl_lib_list_add_node_next ( plist plist1, plistnode currentnode, void *val plistnode cl_lib_listnode_lookup_by_val( plist plist1, void *data ); -/** +/** * 节点查找 API,根据给定val和cmp方法查找 * !!!不可修改获得节点的 prev 和 next指针 * !!!不可释放获得节点 @@ -148,7 +160,7 @@ plistnode cl_lib_listnode_lookup_by_val( plist plist1, void *data ); 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 diff --git a/Include/vos_module.h b/Include/vos_module.h index 5dcbbc8..60a25a0 100644 --- a/Include/vos_module.h +++ b/Include/vos_module.h @@ -1,12 +1,24 @@ /****************************************************************************** -############################################################################### -# 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" @@ -26,7 +38,7 @@ typedef enum module_type_e{ 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; /** 模块通信类型 */ @@ -53,9 +65,9 @@ typedef enum module_comm_type_e{ 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; ///< 无需关心, @@ -65,15 +77,15 @@ typedef struct vos_module_s{ /** 采用非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 模块管理信息 @@ -85,37 +97,37 @@ typedef LONG (*receive_handler)(VOID *buf,LONG size,VOID *opval,LONG opvalLen); * 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 @@ -123,12 +135,12 @@ ULONG VOS_module_get_Id(CHAR *name); * @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 @@ -140,14 +152,14 @@ LONG VOS_SendAsynMsg2Module(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],C * @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 @@ -158,14 +170,14 @@ LONG VOS_SendSynMsg2Module(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LEN],CH * @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 @@ -180,7 +192,7 @@ LONG VOS_SendAsynMsg2ModuleEx(LONG dst_slot,CHAR dst_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); @@ -190,34 +202,34 @@ LONG VOS_SendAsynMsg2Module_Raw(LONG dst_slot,CHAR dst_moduleName[MODULE_NAME_LE -/** -* 回复同步消息 +/** +* 回复同步消息 * @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); @@ -267,7 +279,7 @@ typedef LONG(*VOS_msg_code_handler_ptr)(ULONG aulMsg[VOS_QUEUE_MSG_SIZE]); /** 用于模块间通信的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; diff --git a/Include/vos_que.h b/Include/vos_que.h index 28f622e..5c9adc1 100644 --- a/Include/vos_que.h +++ b/Include/vos_que.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -38,24 +50,24 @@ typedef enum { }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的数组 @@ -64,11 +76,11 @@ LONG VOS_QueDelete(ULONG msgQId); * @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的数组 @@ -77,11 +89,11 @@ LONG VOS_QueSend(ULONG msgQId, ULONG aulMsg[VOS_QUEUE_MSG_SIZE], LONG lMsec, LON * @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 @@ -89,14 +101,14 @@ LONG VOS_QueReceive(ULONG msgQId, ULONG aulMsg[VOS_QUEUE_MSG_SIZE], LONG lMsec); VOID VOS_QueBindTask(VOS_HANDLE hTask, ULONG ulQId); -/** +/** * 获得队列中消息的数目 * @param[in] msgQId 消息队列ID * @return 成功则返回消息队列中消息的数目,失败则VOS_ERROR。 */ LONG VOS_QueNum(ULONG msgQId); -/** +/** * 删除所有创建的消息队列 * @return 成功VOS_OK */ diff --git a/Include/vos_sctp.h b/Include/vos_sctp.h index 1f46193..864c103 100644 --- a/Include/vos_sctp.h +++ b/Include/vos_sctp.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -449,7 +461,7 @@ typedef enum sctp_sn_error { * * 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; @@ -716,7 +728,7 @@ enum sctp_sstat_state { * 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; diff --git a/Include/vos_sem.h b/Include/vos_sem.h index 69779dd..c38b61d 100644 --- a/Include/vos_sem.h +++ b/Include/vos_sem.h @@ -1,9 +1,22 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -39,54 +52,54 @@ typedef enum{ }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); @@ -97,7 +110,7 @@ LONG VOS_SemDelete(ULONG semID); /* ###### 下面的函数不要直接调用,使用上面提供的宏 ###### */ -/** +/** * 不要直接调用该API,通过宏 VOS_SemBCreate 使用 * 创建Bianary类型的信号量,linux中 与Count类型 一致 * @param[in] lOption 信号量选项,linux 中无效,使用 VOS_SEM_Q_FIFO @@ -105,11 +118,11 @@ LONG VOS_SemDelete(ULONG semID); * @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 @@ -117,18 +130,18 @@ ULONG __VOS_SemBCreate(LONG lOption, VOS_SEM_B_STATE enInitialState,const CHAR * * @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 diff --git a/Include/vos_sockMgr.h b/Include/vos_sockMgr.h index 2d550d1..6cff238 100644 --- a/Include/vos_sockMgr.h +++ b/Include/vos_sockMgr.h @@ -1,13 +1,25 @@ /****************************************************************************** -############################################################################### -# 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" @@ -19,13 +31,13 @@ #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的大小 * */ @@ -56,21 +68,21 @@ typedef union { /** 创建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; ///< 无需关心 @@ -80,40 +92,40 @@ typedef struct vos_sock_info_s{ }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); diff --git a/Include/vos_socket.h b/Include/vos_socket.h index 712f688..753091a 100644 --- a/Include/vos_socket.h +++ b/Include/vos_socket.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -30,10 +42,10 @@ extern "C"{ */ 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; @@ -348,7 +360,7 @@ LONG vos_sctp_bindx(LONG sockfd, vos_sockaddr_t *addrs, LONG addrcnt, LONG flags * 如果 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 有如下取值: @@ -683,4 +695,3 @@ LONG vos_sctp_client_one2many_create_bind(vos_domain_t family,vos_sockaddr_t *s_ #endif /* end of __cplusplus */ #endif /* end of __VOS_SOCKET_H__ */ - diff --git a/Include/vos_string.h b/Include/vos_string.h index 156d7b2..1477af9 100644 --- a/Include/vos_string.h +++ b/Include/vos_string.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -98,7 +110,7 @@ CHAR *VOS_StrToLower(CHAR *src); CHAR *VOS_StrToUpper(CHAR *src); -/** +/** * 复制字符串,申请大小为strlen(src)+1内存,然后将字符串拷入,并返回 * @param[in] src 源字符串 * @param[in] mod_id 模块ID @@ -107,7 +119,7 @@ CHAR *VOS_StrToUpper(CHAR *src); CHAR *VOS_StrDup (const CHAR *src,INT mod_id); -/** +/** * 复制字符串,并转换为小写,申请大小为strlen(src)+1内存,然后将字符串拷入,并返回 * @param[in] src 源字符串 * @param[in] mod_id 模块ID @@ -115,7 +127,7 @@ CHAR *VOS_StrDup (const CHAR *src,INT mod_id); CHAR *VOS_StrDupToLower (const CHAR *src,INT mod_id); -/** +/** * 计算从左侧第一个不是空白字符起到字符串结尾的长度 * @param[in] szStr 字符串 * @return 字符串长度 @@ -123,7 +135,7 @@ CHAR *VOS_StrDupToLower (const CHAR *src,INT mod_id); ULONG VOS_StrLeftTrimLen(const CHAR *szStr); -/** +/** * 将str 中的old字符替换成new字符 * @param[in] src 字符串 * @param[in] old 要替换的字符 diff --git a/Include/vos_sys_diff.h b/Include/vos_sys_diff.h index 7ca7adb..afcec67 100644 --- a/Include/vos_sys_diff.h +++ b/Include/vos_sys_diff.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + diff --git a/Include/vos_sysmsg.h b/Include/vos_sysmsg.h index 52d2c10..9a1b9b3 100644 --- a/Include/vos_sysmsg.h +++ b/Include/vos_sysmsg.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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. +* +*******************************************************************************/ + @@ -16,13 +28,13 @@ 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; /*目的槽位号*/ @@ -30,7 +42,7 @@ typedef struct UCHAR ucMsgBodyStyle; /*用于指明消息头和消息体是否是一体的*/ USHORT usMsgCode; /*消息码,具体消息类型的细分*/ LONG ulUserCode; /* usertask user code */ - + USHORT usResponseType; /*是否要求接收方用户应答:ACK/ NOACK/NEGACK*/ USHORT usFrameLen; /*frame content 的长度 ,用户数据区长度*/ VOID * ptrMsgBody; /*消息体指针*/ @@ -44,5 +56,3 @@ typedef struct #endif #endif /*__SYSDEF_H__*/ - - diff --git a/Include/vos_task.h b/Include/vos_task.h index 23c077b..5373955 100644 --- a/Include/vos_task.h +++ b/Include/vos_task.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -53,8 +65,8 @@ typedef VOS_msg_code_handler_ptr VOS_user_task_entry; /** 用户任务结构体 */ 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; @@ -65,35 +77,35 @@ typedef VOID (*VOS_TASK_ENTRY)( ULONG pArg1, ULONG pArg2, ULONG pArg3, 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 延时时间,毫秒 @@ -103,76 +115,76 @@ typedef VOID (*VOS_TASK_ENTRY)( ULONG pArg1, ULONG pArg2, ULONG pArg3, (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 枚举值 @@ -184,57 +196,57 @@ BOOL VOS_TaskHandleVerify( VOS_HANDLE hTaskHandle ); -/** +/** * 删除宿主任务,同时该宿主任务下的用户任务将被全部删除 - * + * * @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[]); @@ -242,17 +254,17 @@ 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, @@ -260,7 +272,7 @@ VOS_HANDLE VOS_TaskCreate_Ex_X( CHAR szTaskName[VOS_NAME_MAX_LENGTH], ULONG ulStackSize, ULONG pArgs[VOS_MAX_TASK_ARGS]); -/** +/** * 任务延时 API,不要直接使用,通过 VOS_TaskDelay 宏使用 * 当前任务睡眠一定的时间. * @param[in] lMsec 延时时间,毫秒 @@ -271,10 +283,10 @@ VOS_HANDLE VOS_TaskCreate_Ex_X( CHAR szTaskName[VOS_NAME_MAX_LENGTH], 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 @@ -284,25 +296,25 @@ VOS_HANDLE VOS_TaskHostCreate_Ex_X( CHAR szTaskName[VOS_NAME_MAX_LENGTH], 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); diff --git a/Include/vos_time.h b/Include/vos_time.h index d31de0a..c47d6f1 100644 --- a/Include/vos_time.h +++ b/Include/vos_time.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -30,39 +42,39 @@ typedef struct LOCAL_TIME { -/** +/** * 获取当前时间 * @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中 @@ -74,7 +86,7 @@ LONG VOS_mkLocalTime( VOS_LOCAL_TIME *sys_time ,LONG time); 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 时间字符串 @@ -85,7 +97,7 @@ CHAR *VOS_mkLocalTimeStr( VOS_LOCAL_TIME *sys_time ,LONG time,CHAR str[VOS_TIME_ LONG VOS_StrmkLocalTime( CHAR str[VOS_TIME_STR_LEN],VOS_LOCAL_TIME *sys_time ,LONG *time); -/** +/** * 将时间秒数转换成 snmp 时间 * @param[in ] sys_time 时间秒数 * @param[out] snmpTime 时间 @@ -98,4 +110,3 @@ LONG vos_time2snmp(LONG sys_time,VOS_SNMP_DateAndTime_t *snmpTime); #endif /* end of __cplusplus */ #endif /* end of __VOS_TIME_H__ */ - diff --git a/Include/vos_timer.h b/Include/vos_timer.h index 66a1378..5941fe2 100644 --- a/Include/vos_timer.h +++ b/Include/vos_timer.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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__ @@ -19,12 +31,12 @@ extern "C" /** 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队列发送定时器超时消息 @@ -38,7 +50,7 @@ LONG VOS_TimerCreate(ULONG ulModuleId, ULONG msgQId, LONG lMillSec, VOID (*pfTimerFunc)(VOID *), VOID *pArg, VOS_TIMER_TYPE_EN enType); -/** +/** * 改变定时器时间,不能在超时回调函数中调用 * @param[in] ulModuleId 模块ID * @param[in] ulTimerId 定时器Id @@ -48,7 +60,7 @@ LONG VOS_TimerCreate(ULONG ulModuleId, ULONG msgQId, LONG lMillSec, LONG VOS_TimerChange(ULONG ulModuleId, ULONG ulTimerId, LONG lMillSec); -/** +/** * 删除定时器 * @param[in] ulModuleId 模块ID * @param[in] ulTimerId 定时器Id @@ -57,7 +69,7 @@ LONG VOS_TimerChange(ULONG ulModuleId, ULONG ulTimerId, LONG lMillSec); LONG VOS_TimerDelete(ULONG ulModuleId, ULONG ulTimerId); -/** +/** * 创建微秒定时器,必须绑核 * @param[in] ulModuleId 模块ID * @param[in] luSec 定时器的时间,微妙 @@ -72,7 +84,7 @@ LONG VOS_usTimerCreate(ULONG ulModuleId,LONG luSec,VOID (*pfTimerFunc)(VOID *), -/** +/** * 创建微秒定时器,必须绑核 * @param[in] ulModuleId 模块ID * @param[in] ulTimerId Timer ID diff --git a/Include/vos_types.h b/Include/vos_types.h index ba9c8c9..4884d16 100644 --- a/Include/vos_types.h +++ b/Include/vos_types.h @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# 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" @@ -230,9 +242,9 @@ typedef unsigned long long ulonglong; #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 @@ -271,7 +283,7 @@ typedef struct{ /** IPv4 addr */ UINT ip4; /** IPv6 addr structure */ - union + union { UCHAR addr8[16]; USHORT addr16[8];