From e7b5eab0138956edeae768a021be476f4a7a807f Mon Sep 17 00:00:00 2001 From: sphoorthi Date: Tue, 20 Oct 2020 19:28:11 +0530 Subject: [PATCH] Changing the buildPlmnId function Change-Id: I1fc5fe7baf39b8871e4c8e5a76a8a5364fea2907 Signed-off-by: sphoorthi --- src/codec_utils/common/odu_common_codec.c | 12 ++++++------ src/codec_utils/common/odu_common_codec.h | 2 +- src/cu_stub/cu_f1ap_msg_hdl.c | 6 +++--- src/du_app/du_e2ap_msg_hdl.c | 6 +++--- src/du_app/du_f1ap_msg_hdl.c | 10 +++++----- src/ric_stub/ric_e2ap_msg_hdl.c | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/codec_utils/common/odu_common_codec.c b/src/codec_utils/common/odu_common_codec.c index 9e7693c36..92667dd2f 100644 --- a/src/codec_utils/common/odu_common_codec.c +++ b/src/codec_utils/common/odu_common_codec.c @@ -44,20 +44,20 @@ int PrepFinalEncBuf(const void *buffer, size_t size, void *encodedBuf) * RFAILED - failure * * ****************************************************************/ -uint8_t buildPlmnId(Plmn plmn, OCTET_STRING_t *octe) +uint8_t buildPlmnId(Plmn plmn, uint8_t *buf) { uint8_t mncCnt; mncCnt = 2; - octe->buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0])); + buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0])); if(mncCnt == 2) { - octe->buf[1] = ((0xf0) | (plmn.mcc[2])); - octe->buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0])); + buf[1] = ((0xf0) | (plmn.mcc[2])); + buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0])); } else { - octe->buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2])); - octe->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1])); + buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2])); + buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1])); } return ROK; } diff --git a/src/codec_utils/common/odu_common_codec.h b/src/codec_utils/common/odu_common_codec.h index a502e52dd..cc4a0b174 100644 --- a/src/codec_utils/common/odu_common_codec.h +++ b/src/codec_utils/common/odu_common_codec.h @@ -26,7 +26,7 @@ char encBuf[ENC_BUF_MAX_LEN]; int encBufSize; int PrepFinalEncBuf(const void *buffer, size_t size, void *encodedBuf); -uint8_t buildPlmnId(Plmn plmn, OCTET_STRING_t *octe); +uint8_t buildPlmnId(Plmn plmn, uint8_t *buf); uint8_t fillBitString(BIT_STRING_t *id, uint8_t unusedBits, uint8_t byteSize, uint8_t val); uint8_t bitStringToInt(BIT_STRING_t *bitString, uint16_t *val); diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 0d9c5232a..caa75f0b0 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -305,8 +305,8 @@ S16 BuildAndSendF1SetupRsp() CU_FREE(f1apMsg, sizeof(F1AP_PDU_t)); return RFAILED; } - buildPlmnId(cuCfgParams.plmn , &cellToActivate->list.array[0]->value.choice.\ - Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity); + buildPlmnId(cuCfgParams.plmn , cellToActivate->list.array[0]->value.choice.\ + Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf); cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\ nRCGI.nRCellIdentity.size = 5; CU_ALLOC(cellToActivate->list.array[0]->value.choice.\ @@ -1432,7 +1432,7 @@ uint8_t BuildNrcgi(NRCGI_t *nrcgi) { return RFAILED; } - ret = buildPlmnId(cuCfgParams.plmn , &nrcgi->pLMN_Identity); + ret = buildPlmnId(cuCfgParams.plmn , nrcgi->pLMN_Identity.buf); if(ret != ROK) { diff --git a/src/du_app/du_e2ap_msg_hdl.c b/src/du_app/du_e2ap_msg_hdl.c index 125f00aab..be05d8f1a 100644 --- a/src/du_app/du_e2ap_msg_hdl.c +++ b/src/du_app/du_e2ap_msg_hdl.c @@ -69,7 +69,7 @@ uint8_t BuildGlobalgNBId(GlobalE2node_gNB_ID_t *gNbId) else { buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \ - &gNbId->global_gNB_ID.plmn_id); + gNbId->global_gNB_ID.plmn_id.buf); /* fill gND Id */ gNbId->global_gNB_ID.gnb_id.present = GNB_ID_Choice_PR_gnb_ID; /* Allocate Buffer size */ @@ -1029,7 +1029,7 @@ uint8_t FillRicIndication(RICindication_t *ricIndicationMsg) else { buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \ - &ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader); + ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader.buf); idx++; /* TO BE CHANGED: RIC INDICATION DATA */ /* For now filling a dummy octect data, need to tested with PRBs*/ @@ -1049,7 +1049,7 @@ uint8_t FillRicIndication(RICindication_t *ricIndicationMsg) else { buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \ - &ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage); + ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage.buf); } } } diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index c16921b0a..ad75fd191 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -195,7 +195,7 @@ uint8_t BuildNrcgi(NRCGI_t *nrcgi) return RFAILED; } ret = buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\ - &nrcgi->pLMN_Identity); // Building PLMN function + nrcgi->pLMN_Identity.buf); // Building PLMN function if(ret != ROK) { return RFAILED; @@ -451,7 +451,7 @@ uint8_t BuildServedPlmn(ServedPLMNs_List_t *srvplmn) srvplmn->list.array[0]->pLMN_Identity.size = PLMN_SIZE * sizeof(uint8_t); DU_ALLOC(srvplmn->list.array[0]->pLMN_Identity.buf, srvplmn->list.array[0]->pLMN_Identity.size); buildPlmnIdret = buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\ - &srvplmn->list.array[0]->pLMN_Identity); + srvplmn->list.array[0]->pLMN_Identity.buf); if(buildPlmnIdret!= ROK) { return RFAILED; @@ -1314,7 +1314,7 @@ uint8_t BuildAndSendDUConfigUpdate() break; } buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\ - &modifyItem->oldNRCGI.pLMN_Identity); + modifyItem->oldNRCGI.pLMN_Identity.buf); /*nRCellIdentity*/ modifyItem->oldNRCGI.nRCellIdentity.size = 5*sizeof(uint8_t); @@ -1340,7 +1340,7 @@ uint8_t BuildAndSendDUConfigUpdate() break; } buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\ - &modifyItem->served_Cell_Information.nRCGI.pLMN_Identity); + modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf); modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size =5*sizeof(uint8_t); DU_ALLOC(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\ modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size); @@ -1389,7 +1389,7 @@ uint8_t BuildAndSendDUConfigUpdate() break; } buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\ - &modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->pLMN_Identity); + modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->pLMN_Identity.buf); DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\ array[0]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t)); if(modifyItem->served_Cell_Information.servedPLMNs.list.\ diff --git a/src/ric_stub/ric_e2ap_msg_hdl.c b/src/ric_stub/ric_e2ap_msg_hdl.c index 7484edd5f..512ab5b4f 100644 --- a/src/ric_stub/ric_e2ap_msg_hdl.c +++ b/src/ric_stub/ric_e2ap_msg_hdl.c @@ -107,7 +107,7 @@ S16 BuildGlobalRicId(GlobalRIC_ID_t *ricId) { ricId->pLMN_Identity.size = byteSize * sizeof(U8); RIC_ALLOC(ricId->pLMN_Identity.buf, ricId->pLMN_Identity.size); - buildPlmnId(ricCfgParams.plmn , &ricId->pLMN_Identity); + buildPlmnId(ricCfgParams.plmn , ricId->pLMN_Identity.buf); /* fill ric Id */ ricId->ric_ID.size = byteSize * sizeof(U8); RIC_ALLOC(ricId->ric_ID.buf, ricId->ric_ID.size); @@ -343,7 +343,7 @@ S16 BuildRicSubsDetails(RICsubscriptionDetails_t *subsDetails) U8 byteSize = 3; subsDetails->ricEventTriggerDefinition.size = byteSize * sizeof(U8); RIC_ALLOC(subsDetails->ricEventTriggerDefinition.buf, subsDetails->ricEventTriggerDefinition.size); - buildPlmnId(ricCfgParams.plmn, &subsDetails->ricEventTriggerDefinition); + buildPlmnId(ricCfgParams.plmn, subsDetails->ricEventTriggerDefinition.buf); elementCnt = 1; subsDetails->ricAction_ToBeSetup_List.list.count = elementCnt; subsDetails->ricAction_ToBeSetup_List.list.size = \ -- 2.16.6