Changing the buildPlmnId function 67/4867/1
authorsphoorthi <sphoorthi.dayanand@radisys.com>
Tue, 20 Oct 2020 13:58:11 +0000 (19:28 +0530)
committersphoorthi <sphoorthi.dayanand@radisys.com>
Tue, 20 Oct 2020 13:58:36 +0000 (19:28 +0530)
Change-Id: I1fc5fe7baf39b8871e4c8e5a76a8a5364fea2907
Signed-off-by: sphoorthi <sphoorthi.dayanand@radisys.com>
src/codec_utils/common/odu_common_codec.c
src/codec_utils/common/odu_common_codec.h
src/cu_stub/cu_f1ap_msg_hdl.c
src/du_app/du_e2ap_msg_hdl.c
src/du_app/du_f1ap_msg_hdl.c
src/ric_stub/ric_e2ap_msg_hdl.c

index 9e7693c..92667dd 100644 (file)
@@ -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;
 }
index a502e52..cc4a0b1 100644 (file)
@@ -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);
 
index 0d9c523..caa75f0 100644 (file)
@@ -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)
    {
index 125f00a..be05d8f 100644 (file)
@@ -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);
                                }
                        }
                }
index c16921b..ad75fd1 100644 (file)
@@ -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.\
index 7484edd..512ab5b 100644 (file)
@@ -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 = \