From 86d32ade1f454a53759aec62c7c865c62d1e85ee Mon Sep 17 00:00:00 2001 From: svaidhya Date: Tue, 20 May 2025 08:00:51 +0000 Subject: [PATCH] [Epic-ID:ODUHIGH-557][Task-ID:ODUHIGH-640] Fixes related to OAI-CU integration with ODU Change-Id: I0ed03974a00c2d790d8585fae286498cdec80718 Signed-off-by: svaidhya --- build/config/tdd_odu_config.xml | 80 +++++++++++----------- src/du_app/du_cfg.c | 11 +++ src/du_app/du_f1ap_msg_hdl.c | 4 +- src/du_app/du_sctp.c | 2 +- src/du_app/du_sys_info_hdl.c | 147 ++++++++++++++++++++++++++++++++++++++++ src/du_app/du_sys_info_hdl.h | 3 + 6 files changed, 204 insertions(+), 43 deletions(-) diff --git a/build/config/tdd_odu_config.xml b/build/config/tdd_odu_config.xml index 7fdfff051..f85ebc0ed 100644 --- a/build/config/tdd_odu_config.xml +++ b/build/config/tdd_odu_config.xml @@ -14,8 +14,8 @@ 1 ORAN OAM DU 29 - 192.168.130.81 - 192.168.130.82 + 127.0.0.5 + 127.0.0.4 192.168.130.80 38472 @@ -23,20 +23,20 @@ 2 - 2152 - 2152 + 2153 + 2153 1 - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 @@ -219,13 +219,13 @@ 1 - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 @@ -234,25 +234,25 @@ - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 @@ -363,25 +363,25 @@ - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 @@ -394,12 +394,12 @@ 1 - 100 + 273 623400 - 100 + 273 623400 - 1 - 1 + 2 + 2 0 @@ -408,13 +408,13 @@ - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 @@ -611,13 +611,13 @@ - 3 - 1 + 0 + 0 1 - 4 - 8 + 0 + 1 0 diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 6e2d84401..7bd1de827 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -1333,7 +1333,11 @@ uint8_t fillDuSrvdCellSysInfo(F1DuSysInfo *sysInfo) sysInfo->mibLen = encBufSize; /* GNB DU System Info SIB1 msg */ +#ifdef OAI_TESTING + BuildSib1MsgForF1AP(); +#else BuildSib1Msg(); +#endif DU_ALLOC(sysInfo->sib1Msg, encBufSize); if(!(sysInfo->sib1Msg)) { @@ -2349,6 +2353,12 @@ uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg cur = cur -> next; } +#ifdef OAI_TESTING + BuildSib1Msg(); + DU_ALLOC_SHRABL_BUF(sib1CellCfg->sib1Pdu,encBufSize); + memcpy(sib1CellCfg->sib1Pdu, encBuf,encBufSize); + sib1CellCfg->sib1PduLen = encBufSize; +#else sib1CellCfg->sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len; if(sib1CellCfg->sib1PduLen > 0) { @@ -2360,6 +2370,7 @@ uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg } memcpy(sib1CellCfg->sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, sib1CellCfg->sib1PduLen); } +#endif return ROK; } diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 637e73a72..180f3cf26 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -550,7 +550,7 @@ uint8_t fillNrTddInfo(TDD_Info_t *tddInfo) freqInfo->freqBandListNr.list.array[freqBandListIdx]->freqBandIndicatorNr = duCfgParam.srvdCellLst[0].duCellInfo.\ f1Mode.mode.tdd.nrFreqInfo.freqBand[0].nrFreqBand; - +#ifndef OAI_TESTING freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count = elementCnt; freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size = freqInfo->freqBandListNr.list.array[freqBandListIdx]->\ supportedSULBandList.list.count * sizeof(SupportedSULFreqBandItem_t*); @@ -576,8 +576,8 @@ uint8_t fillNrTddInfo(TDD_Info_t *tddInfo) freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx]->freqBandIndicatorNr =\ duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[0].sulBand[0]; } +#endif } - tddInfo->transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs; tddInfo->transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb; diff --git a/src/du_app/du_sctp.c b/src/du_app/du_sctp.c index 374ab506b..fb299b8db 100644 --- a/src/du_app/du_sctp.c +++ b/src/du_app/du_sctp.c @@ -871,7 +871,7 @@ uint8_t sctpSend(Buffer *mBuf, uint8_t itfType) #ifdef CALL_FLOW_DEBUG_LOG DU_LOG("\nCall Flow: ENTSCTP -> CU : EVENT_F1AP_MSG_TO_CU\n"); #endif - ret = cmInetSctpSendMsg(&f1Params.sockFd, &f1Params.destIpNetAddr, f1Params.destPort, &memInfo, mBuf, &len, 0, FALSE, 0, 0/*SCT_PROTID_NONE*/, RWOULDBLOCK); + ret = cmInetSctpSendMsg(&f1Params.sockFd, &f1Params.destIpNetAddr, f1Params.destPort, &memInfo, mBuf, &len, 0, FALSE, 0, 62, RWOULDBLOCK); } if(itfType == E2_INTERFACE) diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index 3c7eff25b..9da52d72b 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -2386,6 +2386,153 @@ uint8_t BuildUeTimerAndConstants(UE_TimersAndConstants_t *ue_TimersAndConstants) return ROK; } +#ifdef OAI_TESTING +uint8_t BuildSib1MsgForF1AP() +{ + SIB1_t *sib1Msg; + CellAccessRelatedInfo_t *cellAccessInfo; + uint8_t elementCnt; + uint8_t ret1; + asn_enc_rval_t encRetVal; + uint8_t ret = RFAILED; + + do + { + DU_ALLOC(sib1Msg, sizeof(SIB1_t)); + + elementCnt = ODU_VALUE_ONE; + + /* Cell Selection Info */ +#if 0 + DU_ALLOC(sib1Msg->cellSelectionInfo, sizeof(struct SIB1__cellSelectionInfo)); + if(!sib1Msg->cellSelectionInfo) + { + DU_LOG("\nERROR --> DU APP: SIB1 Cell Selection Info memory allocation failed"); + break; + } + + sib1Msg->cellSelectionInfo->q_RxLevMin = 0; + + DU_ALLOC(sib1Msg->cellSelectionInfo->q_RxLevMinSUL, sizeof(Q_RxLevMin_t)); + if(!sib1Msg->cellSelectionInfo->q_RxLevMinSUL) + { + DU_LOG("\nERROR --> DU APP: BuildSib1Msg(): Memory allocation failed for q_RxLevMinSUL"); + break; + } + *(sib1Msg->cellSelectionInfo->q_RxLevMinSUL) = -50; + + DU_ALLOC(sib1Msg->cellSelectionInfo->q_QualMin, sizeof(Q_QualMin_t)); + if(!sib1Msg->cellSelectionInfo->q_QualMin) + { + DU_LOG("\nERROR --> DU APP: BuildSib1Msg(): Memory allocation failed for q_QualMin"); + break; + } + *(sib1Msg->cellSelectionInfo->q_QualMin) = -30; +#endif + /* PLMN list */ + cellAccessInfo = &sib1Msg->cellAccessRelatedInfo; + cellAccessInfo->plmn_IdentityList.list.count = elementCnt; + cellAccessInfo->plmn_IdentityList.list.size = elementCnt * sizeof(PLMN_IdentityInfo_t *); + + ret1 = BuildPlmnList(cellAccessInfo); + if(ret1 != ROK) + { + break; + } + /* Connection Establish Failure Control */ + DU_ALLOC(sib1Msg->connEstFailureControl, sizeof(ConnEstFailureControl_t)); + if(!sib1Msg->connEstFailureControl) + { + DU_LOG("\nERROR --> DU APP: sib1Msg->connEstFailureControl memory allocation failure"); + break; + } + sib1Msg->connEstFailureControl->connEstFailCount = duCfgParam.sib1Params.connEstFailCnt; + sib1Msg->connEstFailureControl->connEstFailOffsetValidity = duCfgParam.sib1Params.connEstFailOffValidity; + + DU_ALLOC(sib1Msg->connEstFailureControl->connEstFailOffset, sizeof(long)); + if(!sib1Msg->connEstFailureControl->connEstFailOffset) + { + DU_LOG("\nERROR --> DU APP: BuildSib1Msg(): Memory allocation failed for connEstFailOffset"); + break; + } + *(sib1Msg->connEstFailureControl->connEstFailOffset) = duCfgParam.sib1Params.connEstFailOffset; + + /* SI Scheduling Info */ + DU_ALLOC(sib1Msg->si_SchedulingInfo, sizeof(SI_SchedulingInfo_t)); + if(!sib1Msg->si_SchedulingInfo) + { + DU_LOG("\nERROR --> DU APP: sib1Msg->si_SchedulingInfo memory allocation failure"); + break; + } + elementCnt = ODU_VALUE_ONE; + sib1Msg->si_SchedulingInfo->schedulingInfoList.list.count = elementCnt; + sib1Msg->si_SchedulingInfo->schedulingInfoList.list.size = elementCnt * + sizeof(struct SchedulingInfo *); + ret1 = BuildSiSchedInfoList(&sib1Msg->si_SchedulingInfo->schedulingInfoList); + if(ret1 != ROK) + { + break; + } + sib1Msg->si_SchedulingInfo->si_WindowLength = duCfgParam.sib1Params.siSchedInfo.winLen; + + /* Serving Cell Config Common */ + DU_ALLOC(sib1Msg->servingCellConfigCommon, sizeof(ServingCellConfigCommonSIB_t)); + if(!sib1Msg->servingCellConfigCommon) + { + DU_LOG("\nERROR --> DU APP: sib1Msg->servingCellConfigCommon memory allocation failure"); + break; + } + ret1 = BuildServCellCfgCommonSib(sib1Msg->servingCellConfigCommon); + if(ret1 != ROK) + { + break; + } + DU_ALLOC(sib1Msg->ue_TimersAndConstants, sizeof(UE_TimersAndConstants_t)); + ret1 = BuildUeTimerAndConstants(sib1Msg->ue_TimersAndConstants); +#if 0 + DU_ALLOC(sib1Msg->uac_BarringInfo, sizeof(struct SIB1__uac_BarringInfo)); + DU_ALLOC(sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List, sizeof(struct UAC_BarringPerPLMN_List)); + sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.count = 1; + sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.size = sizeof(struct UAC_BarringPerPLMN *); + DU_ALLOC(sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.array,sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.size); + DU_ALLOC(sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.array[0], sizeof(struct UAC_BarringPerPLMN)); + sib1Msg->uac_BarringInfo->uac_BarringPerPLMN_List->list.array[0]->plmn_IdentityIndex = 0; + + DU_ALLOC(sib1Msg->useFullResumeID, sizeof(long)); + *sib1Msg->useFullResumeID = 0; +#endif + xer_fprint(stdout, &asn_DEF_SIB1, sib1Msg); + + /* Encode the F1SetupRequest type as APER */ + memset(encBuf, 0, ENC_BUF_MAX_LEN); + encBufSize = 0; + encRetVal = uper_encode(&asn_DEF_SIB1, 0, sib1Msg, PrepFinalEncBuf,\ + encBuf); + printf("\nencbufSize: %d\n", encBufSize); + if(encRetVal.encoded == -1) + { + DU_LOG("\nERROR --> DU APP : Could not encode SIB1 structure (at %s)\n",\ + encRetVal.failed_type ? + encRetVal.failed_type->name : + "unknown"); + break; + } +#ifdef DEBUG_ASN_PRINT + for(int i=0; i< encBufSize; i++) + { + printf("%x\t",encBuf[i]); + } + printf("\n"); +#endif + + ret = ROK; + break; + }while(true); + + FreeSib1Msg(sib1Msg); + return ret; +} +#endif /******************************************************************* * * @brief Builds SIB message in Served Cell Info diff --git a/src/du_app/du_sys_info_hdl.h b/src/du_app/du_sys_info_hdl.h index ba0b33096..456dfe43d 100644 --- a/src/du_app/du_sys_info_hdl.h +++ b/src/du_app/du_sys_info_hdl.h @@ -32,6 +32,9 @@ uint8_t BuildMibPdu(); uint8_t BuildMibMsg(); uint8_t BuildSib1Msg(); +#ifdef OAI_TESTING +uint8_t BuildSib1MsgForF1AP(); +#endif uint8_t BuildBwpDlCommon(BWP_DownlinkCommon_t *bwp); uint8_t BuildBwpUlCommon(BWP_UplinkCommon_t *bwp); uint8_t BuildTddUlDlCfgComm(TDD_UL_DL_ConfigCommon_t *tddCfg); -- 2.16.6