[Task-ID: ODUHIGH-455] Changes to support new L1 20.11
[o-du/l2.git] / src / du_app / du_f1ap_msg_hdl.c
index 66cbf48..d99b9bf 100644 (file)
@@ -362,30 +362,6 @@ uint8_t BuildDLNRInfo(NRFreqInfo_t *dlnrfreq)
    return ROK;
 }
 
-/*******************************************************************
- *
- * @brief Builds NRCell ID 
- *
- * @details
- *
- *    Function : BuildNrCellId
- *
- *    Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK     - success
- *         RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
-   memset(nrcell->buf, 0, nrcell->size);
-   nrcell->buf[4]   = duCfgParam.sib1Params.cellIdentity; 
-   nrcell->bits_unused = 4;
-   return ROK;
-}
-
 /*******************************************************************
  *
  * @brief Builds Nrcgi 
@@ -425,7 +401,7 @@ uint8_t BuildNrcgi(NRCGI_t *nrcgi)
    {
       return RFAILED;
    }
-   BuildNrCellId(&nrcgi->nRCellIdentity);
+   fillBitString(&nrcgi->nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
 
    return ROK;
 }
@@ -2557,16 +2533,14 @@ void FreeULRRCMessageTransfer( F1AP_PDU_t *f1apMsg)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId, \
+uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  *ueCb, uint8_t lcId, \
       uint16_t msgLen, uint8_t *rrcMsg)
 {
-   uint8_t   elementCnt =0;
-   uint8_t   idx1 =0;
-   uint8_t   idx =0;
-   F1AP_PDU_t                  *f1apMsg = NULLP;
-   ULRRCMessageTransfer_t      *ulRRCMsg = NULLP;
-   asn_enc_rval_t              encRetVal;        /* Encoder return value */
-   uint8_t ret =RFAILED;
+   uint8_t                 elementCnt=0, idx1=0, idx=0;
+   uint8_t                 ret = RFAILED;
+   F1AP_PDU_t              *f1apMsg = NULLP;
+   ULRRCMessageTransfer_t  *ulRRCMsg = NULLP;
+   asn_enc_rval_t          encRetVal;        /* Encoder return value */
    
    memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
 
@@ -2621,7 +2595,7 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId, \
       ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
       ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
                                                              ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
-      ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = ueCb.gnbCuUeF1apId;
+      ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = ueCb->gnbCuUeF1apId;
 
       /*GNB DU UE F1AP ID*/
       idx1++;
@@ -2629,7 +2603,7 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId, \
       ulRRCMsg->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
       ulRRCMsg->protocolIEs.list.array[idx1]->value.present = \
                                                              ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
-      ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = ueCb.gnbDuUeF1apId;
+      ulRRCMsg->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = ueCb->gnbDuUeF1apId;
 
       /*SRBID*/
       idx1++;
@@ -8037,11 +8011,46 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
                macLcConfig = rlcBearerList->list.array[idx]->mac_LogicalChannelConfig;
                if(rlcConfig)
                {
-                  if(rlcConfig->choice.am)
+                  switch(rlcConfig->present)
                   {
-                     DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
-                     DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t)); 
-                     DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+                     case RLC_Config_PR_am:
+                        {
+                           if(rlcConfig->choice.am)
+                           {
+                              DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
+                              DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t)); 
+                              DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Bi_Directional:
+                        {
+                           if(rlcConfig->choice.um_Bi_Directional)
+                           {
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t)); 
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional, sizeof(struct RLC_Config__um_Bi_Directional));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Uni_Directional_UL:
+                        {
+                           if(rlcConfig->choice.um_Uni_Directional_UL)
+                           {
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_UL , sizeof(struct RLC_Config__um_Uni_Directional_UL));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Uni_Directional_DL:
+                        {
+                           if(rlcConfig->choice.um_Uni_Directional_DL )
+                           {
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_DL , sizeof(struct RLC_Config__um_Uni_Directional_DL));
+                           }
+                           break;
+                        }
                   }    
                   DU_FREE(rlcConfig, sizeof(struct RLC_Config));
                }
@@ -8091,6 +8100,7 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
       }
       if(macCellGrpCfg->bsr_Config)
       {
+         DU_FREE(macCellGrpCfg->bsr_Config->logicalChannelSR_DelayTimer, sizeof(long));
          DU_FREE(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
       }
       tagConfig = macCellGrpCfg->tag_Config;
@@ -8671,35 +8681,22 @@ void freeRlcLcCfg(RlcBearerCfg *lcCfg)
    {
       case RLC_AM :
          {
-            if(lcCfg->u.amCfg)
-            {
-               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
-            }
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
             break;
          }
       case RLC_UM_BI_DIRECTIONAL :
          {
-            if(lcCfg->u.umBiDirCfg)
-            {
-               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
-            }
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
             break;
          }
       case RLC_UM_UNI_DIRECTIONAL_UL :
          {
-            if(lcCfg->u.umUniDirUlCfg)
-            {
-               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
-            }
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
             break;
-
          }
       case RLC_UM_UNI_DIRECTIONAL_DL :
          {
-            if(lcCfg->u.umUniDirDlCfg)
-            {
-               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
-            }
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
             break;
          }
       default:
@@ -9255,7 +9252,7 @@ void freeAperDecodeinitialUplinkBWPConfig(UplinkConfig_t *ulCfg)
  * @return void
  *
  * ****************************************************************/
-void freeDuUeCfg(DuUeCfg *ueCfg)
+void freeDuUeCfg(UeCtxtActionType actionType, DuUeCfg *ueCfg)
 {
    uint8_t lcIdx = 0;
    uint8_t arrIdx = 0;
@@ -9284,194 +9281,200 @@ void freeDuUeCfg(DuUeCfg *ueCfg)
 
    if(ueCfg->cellGrpCfg)
    {
-      
       rlcBearerList = cellGrpCfg->rlc_BearerToAddModList;
       if(rlcBearerList)
       {
-        if(rlcBearerList->list.array)
-        {
-           for(arrIdx=0; arrIdx<rlcBearerList->list.count; arrIdx++)
-           {
-              if(rlcBearerList->list.array[arrIdx])
-              {
-                 rlcConfig   = rlcBearerList->list.array[arrIdx]->rlc_Config;
-                 macLcConfig = rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig;
-                 
-                 if(rlcBearerList->list.array[arrIdx]->servedRadioBearer)
-                 {
-                    free(rlcBearerList->list.array[arrIdx]->servedRadioBearer);
-                 }
-                 if(rlcConfig)
-                 {
-                    if(rlcConfig->choice.am)
-                    {
-                       free(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength);
-                       free(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength);
-                       free(rlcConfig->choice.am);
-                    }
-                    free(rlcBearerList->list.array[arrIdx]->rlc_Config);
-                 }
-                 if(macLcConfig)
-                 {
-                    if(macLcConfig->ul_SpecificParameters)
-                    {
-                       free(macLcConfig->ul_SpecificParameters->schedulingRequestID);
-                       free(macLcConfig->ul_SpecificParameters->logicalChannelGroup);
-                       free(macLcConfig->ul_SpecificParameters);
-                    }
-                    free(rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig);
-                 }
-                 free(rlcBearerList->list.array[arrIdx]); 
-              }
-           }
-           free(rlcBearerList->list.array);
-        }
-        free(cellGrpCfg->rlc_BearerToAddModList);
+         if(rlcBearerList->list.array)
+         {
+            for(arrIdx=0; arrIdx<rlcBearerList->list.count; arrIdx++)
+            {
+               if(rlcBearerList->list.array[arrIdx])
+               {
+                  rlcConfig   = rlcBearerList->list.array[arrIdx]->rlc_Config;
+                  macLcConfig = rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig;
+
+                  if(rlcBearerList->list.array[arrIdx]->servedRadioBearer)
+                  {
+                     free(rlcBearerList->list.array[arrIdx]->servedRadioBearer);
+                  }
+                  if(rlcConfig)
+                  {
+                     if(rlcConfig->choice.am)
+                     {
+                        free(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength);
+                        free(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength);
+                        free(rlcConfig->choice.am);
+                     }
+                     free(rlcBearerList->list.array[arrIdx]->rlc_Config);
+                  }
+                  if(macLcConfig)
+                  {
+                     if(macLcConfig->ul_SpecificParameters)
+                     {
+                        free(macLcConfig->ul_SpecificParameters->schedulingRequestID);
+                        free(macLcConfig->ul_SpecificParameters->logicalChannelGroup);
+                        free(macLcConfig->ul_SpecificParameters);
+                     }
+                     free(rlcBearerList->list.array[arrIdx]->mac_LogicalChannelConfig);
+                  }
+                  free(rlcBearerList->list.array[arrIdx]); 
+               }
+            }
+            free(rlcBearerList->list.array);
+         }
+         free(cellGrpCfg->rlc_BearerToAddModList);
       }
 
       macCellGrpCfg = cellGrpCfg->mac_CellGroupConfig;
       if(macCellGrpCfg)
       {
-        schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
-        if(schedulingRequestConfig)
-        {
-           schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
-           if(schReqList)
-           {
-              if(schReqList->list.array)
-              {
-                 for(arrIdx=0;arrIdx<schReqList->list.count; arrIdx++)
-                 {
-                    if(schReqList->list.array[arrIdx])
-                    {
-                       free(schReqList->list.array[arrIdx]->sr_ProhibitTimer); 
-                       free(schReqList->list.array[arrIdx]);
-                    }
-                 }
-                 free(schReqList->list.array);
-              }
-              free(schedulingRequestConfig->schedulingRequestToAddModList);
-           }
-           free(macCellGrpCfg->schedulingRequestConfig);
-        }
-        if(macCellGrpCfg->bsr_Config)
-        {
-           free(macCellGrpCfg->bsr_Config);
-        }
-        tagConfig = macCellGrpCfg->tag_Config;
-        if(tagConfig)
-        {
-           tagList = tagConfig->tag_ToAddModList;
-           if(tagList)
-           {
-              if(tagList->list.array)
-              {
-                 for(arrIdx=0; arrIdx<tagList->list.count; arrIdx++)
-                 {
-                    free(tagList->list.array[arrIdx]);
-                 }
-                 free(tagList->list.array);
-              }
-              free(tagConfig->tag_ToAddModList);
-           }
-           free(tagConfig); 
-        }
+         schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig;
+         if(schedulingRequestConfig)
+         {
+            schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
+            if(schReqList)
+            {
+               if(schReqList->list.array)
+               {
+                  for(arrIdx=0;arrIdx<schReqList->list.count; arrIdx++)
+                  {
+                     if(schReqList->list.array[arrIdx])
+                     {
+                        free(schReqList->list.array[arrIdx]->sr_ProhibitTimer); 
+                        free(schReqList->list.array[arrIdx]);
+                     }
+                  }
+                  free(schReqList->list.array);
+               }
+               free(schedulingRequestConfig->schedulingRequestToAddModList);
+            }
+            free(macCellGrpCfg->schedulingRequestConfig);
+         }
+         if(macCellGrpCfg->bsr_Config)
+         {
+            free(macCellGrpCfg->bsr_Config);
+         }
+         tagConfig = macCellGrpCfg->tag_Config;
+         if(tagConfig)
+         {
+            tagList = tagConfig->tag_ToAddModList;
+            if(tagList)
+            {
+               if(tagList->list.array)
+               {
+                  for(arrIdx=0; arrIdx<tagList->list.count; arrIdx++)
+                  {
+                     free(tagList->list.array[arrIdx]);
+                  }
+                  free(tagList->list.array);
+               }
+               free(tagConfig->tag_ToAddModList);
+            }
+            free(tagConfig); 
+         }
 
-        phrConfig = macCellGrpCfg->phr_Config;
-        if(phrConfig)
-        {
-           free(phrConfig->choice.setup); 
-           free(phrConfig); 
-        }
+         phrConfig = macCellGrpCfg->phr_Config;
+         if(phrConfig)
+         {
+            free(phrConfig->choice.setup); 
+            free(phrConfig); 
+         }
 
-        free(macCellGrpCfg); 
+         free(macCellGrpCfg); 
       }
 
       phyCellGrpCfg = cellGrpCfg->physicalCellGroupConfig;
       if(phyCellGrpCfg)
       {
-        free(phyCellGrpCfg->p_NR_FR1);
-        free(phyCellGrpCfg); 
+         free(phyCellGrpCfg->p_NR_FR1);
+         free(phyCellGrpCfg); 
       }
 
       spCellCfg = cellGrpCfg->spCellConfig;
       if(spCellCfg)
       {
-        if(spCellCfg->servCellIndex)
-        {
-           if(spCellCfg->rlmInSyncOutOfSyncThreshold)
-           {
-              if(spCellCfg->spCellConfigDedicated)
-              {
-                 srvCellCfg = spCellCfg->spCellConfigDedicated;
-                 if(srvCellCfg->initialDownlinkBWP)
-                 {
-                    dlBwp = srvCellCfg->initialDownlinkBWP;
-                    if(srvCellCfg->firstActiveDownlinkBWP_Id)
-                    {
-                       if(srvCellCfg->defaultDownlinkBWP_Id)
-                       {
-                          if(srvCellCfg->uplinkConfig)
-                          {
+         if(spCellCfg->servCellIndex)
+         {
+            if(spCellCfg->rlmInSyncOutOfSyncThreshold)
+            {
+               if(spCellCfg->spCellConfigDedicated)
+               {
+                  srvCellCfg = spCellCfg->spCellConfigDedicated;
+                  if(srvCellCfg->initialDownlinkBWP)
+                  {
+                     dlBwp = srvCellCfg->initialDownlinkBWP;
+                     if(srvCellCfg->firstActiveDownlinkBWP_Id)
+                     {
+                        if(srvCellCfg->defaultDownlinkBWP_Id)
+                        {
+                           if(srvCellCfg->uplinkConfig)
+                           {
 
-                             if(srvCellCfg->pdsch_ServingCellConfig)
-                             {
-                                pdschCfg=
-                                   srvCellCfg->pdsch_ServingCellConfig;
-                                if(pdschCfg->choice.setup)
-                                {
+                              if(srvCellCfg->pdsch_ServingCellConfig)
+                              {
+                                 pdschCfg=
+                                    srvCellCfg->pdsch_ServingCellConfig;
+                                 if(pdschCfg->choice.setup)
+                                 {
 
-                                   free(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH);
-                                   free(pdschCfg->choice.setup);
-                                }
+                                    free(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH);
+                                    free(pdschCfg->choice.setup);
+                                 }
 
-                                free(srvCellCfg->pdsch_ServingCellConfig);
-                             }
+                                 free(srvCellCfg->pdsch_ServingCellConfig);
+                              }
 
-                             freeAperDecodeinitialUplinkBWPConfig(srvCellCfg->uplinkConfig);
-                             free(srvCellCfg->uplinkConfig);
-                          }
-                          free(srvCellCfg->defaultDownlinkBWP_Id);
-                       }
+                              freeAperDecodeinitialUplinkBWPConfig(srvCellCfg->uplinkConfig);
+                              free(srvCellCfg->uplinkConfig);
+                           }
+                           free(srvCellCfg->defaultDownlinkBWP_Id);
+                        }
 
-                       free(srvCellCfg->firstActiveDownlinkBWP_Id);
-                    }
-                    if(dlBwp->pdcch_Config)
-                    {
-                       if(dlBwp->pdsch_Config)
-                       {
-                          freeAperDecodeBWPDlDedPdschConfig(dlBwp);
-                          free(dlBwp->pdsch_Config);
-                       }
-                       freeAperDecodeBWPDlDedPdcchConfig(dlBwp);
-                       free(dlBwp->pdcch_Config);
-                    }
-                    free(srvCellCfg->initialDownlinkBWP);
-                 }
+                        free(srvCellCfg->firstActiveDownlinkBWP_Id);
+                     }
+                     if(dlBwp->pdcch_Config)
+                     {
+                        if(dlBwp->pdsch_Config)
+                        {
+                           freeAperDecodeBWPDlDedPdschConfig(dlBwp);
+                           free(dlBwp->pdsch_Config);
+                        }
+                        freeAperDecodeBWPDlDedPdcchConfig(dlBwp);
+                        free(dlBwp->pdcch_Config);
+                     }
+                     free(srvCellCfg->initialDownlinkBWP);
+                  }
 
-                 free(spCellCfg->spCellConfigDedicated);
-              }
-              free(spCellCfg->rlmInSyncOutOfSyncThreshold);
-           }
-           free(spCellCfg->servCellIndex); 
-        }
-        free(spCellCfg);
+                  free(spCellCfg->spCellConfigDedicated);
+               }
+               free(spCellCfg->rlmInSyncOutOfSyncThreshold);
+            }
+            free(spCellCfg->servCellIndex); 
+         }
+         free(spCellCfg);
       }
       DU_FREE(ueCfg->cellGrpCfg, sizeof(CellGroupConfigRrc_t));
       ueCfg->cellGrpCfg = NULLP;
    }
+
    if(ueCfg->ambrCfg)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
    }
-   for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
+
+   if(actionType != UE_CTXT_CFG_QUERY)
    {
-      freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx]);
+      for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
+      {
+         freeRlcLcCfg(&ueCfg->rlcLcCfg[lcIdx]);
+      }
    }
+
    for(lcIdx = 0; lcIdx < ueCfg->numMacLcs; lcIdx++)
    {
       freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]);
    }
+
    for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++)
    {
       DU_FREE(ueCfg->upTnlInfo[lcIdx].tnlCfg1, sizeof(GtpTnlCfg));
@@ -9505,7 +9508,7 @@ void freeF1UeDb(F1UeContextSetupDb *f1UeDb)
       }
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
    }
-   freeDuUeCfg(&f1UeDb->duUeCfg);
+   freeDuUeCfg(f1UeDb->actionType, &f1UeDb->duUeCfg);
    memset(f1UeDb, 0, sizeof(F1UeContextSetupDb));
    DU_FREE(f1UeDb, sizeof(F1UeContextSetupDb));
 }
@@ -12994,7 +12997,8 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
    int8_t ueIdx = -1;
    uint8_t  ret=0, ieIdx=0, ieExtIdx = 0, servCellIdx = 0;
    bool ueCbFound = false, hoInProgress = false;
-   uint16_t nrCellId = 0,  cellIdx=0;
+   uint16_t cellIdx=0;
+   uint64_t nrCellId = 0;
    uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
    DuUeCb   *duUeCb = NULL;
    UEContextSetupRequest_t   *ueSetReq = NULL;
@@ -13027,7 +13031,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
                GET_CELL_IDX(nrCellId, cellIdx);
                if(!duCb.actvCellLst[cellIdx])
                {
-                  DU_LOG("\nERROR  -->  F1AP : Cell Id [%d] not found", nrCellId);
+                  DU_LOG("\nERROR  -->  F1AP : Cell Id [%lu] not found", nrCellId);
                   ret = RFAILED;
                }
                break;
@@ -13082,7 +13086,7 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
                      gnbDuUeF1apId = ueIdx +1;
                   else
                   {
-                     DU_LOG("\nERROR  -->  F1AP : No free UE IDX found in UE bit map of cell Id [%d]", nrCellId);
+                     DU_LOG("\nERROR  -->  F1AP : No free UE IDX found in UE bit map of cell Id [%lu]", nrCellId);
                      ret = RFAILED;
                      break;
                   }
@@ -13188,13 +13192,16 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
 
          case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
             {
-               if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
-               {
-                  duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
-               }
-               else
+               if(duUeCb->f1UeDb->dlRrcMsg)
                {
-                  DU_LOG("\nERROR  -->  Ignoring delivery report, since rrcContainer is not present");
+                  if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+                  {
+                     duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
+                  }
+                  else
+                  {
+                     DU_LOG("\nERROR  -->  Ignoring delivery report, since rrcContainer is not present");
+                  }
                }
                break;
             }
@@ -14422,7 +14429,8 @@ uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
 uint8_t extractCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
 {
    uint8_t  ret = ROK;
-   uint16_t idx, nci, pci = 0;
+   uint16_t idx, pci = 0;
+   uint64_t nci;
    Cells_to_be_Activated_List_Item_t cell;
 
    for(idx=0; idx<cellsToActivate.list.count; idx++)
@@ -14433,7 +14441,7 @@ uint8_t extractCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate)
 
       if(cell.nRPCI)
       {
-        pci = *cell.nRPCI;
+         pci = *cell.nRPCI;
       }
       ret = duProcCellsToBeActivated(cell.nRCGI.pLMN_Identity.buf, nci, pci);
    }
@@ -14687,7 +14695,8 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
 {
    uint8_t  ieIdx=0, arrIdx=0,ret=ROK;
    uint8_t  ueId =0 , ueIdx =0, totalActiveUe = 0;
-   uint16_t cellId =0, cellIdx =0, crnti=0;
+   uint16_t cellIdx =0, crnti=0;
+   uint64_t cellId =0;
    CmLList *f1apPduNode = NULLP;
    ReservedF1apPduInfo *f1apPduInfo =NULLP;
    F1AP_PDU_t *f1apMsgPdu = NULLP;
@@ -14743,7 +14752,7 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
                            if(ret == RFAILED)
                            {
                               DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
-                              request for cellId[%d]", cellId);
+                              request for cellId[%lu]", cellId);
                            }
                         }
                         else
@@ -14764,7 +14773,7 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
                               if(ret == RFAILED)
                               {
                                  DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
-                                 request for cellId[%d]", cellId);
+                                 request for cellId[%lu]", cellId);
                               }
                               ueIdx++;
                               totalActiveUe--;
@@ -14773,7 +14782,7 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
                      }
                      else
                      {
-                        DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
+                        DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%lu] not found", cellId);
                         ret = RFAILED;
                      }
                      break;
@@ -15249,7 +15258,7 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb)
 
    DU_LOG("\nINFO  -->  F1AP : Building UE context modification response\n");
 
-   while(1)
+   while(true)
    {
       DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
       if(f1apMsg == NULLP)
@@ -16505,14 +16514,13 @@ void freeAperDecodePagingMsg(Paging_t   *paging)
 uint8_t procPagingMsg(F1AP_PDU_t *f1apMsg) 
 {
    uint8_t ieIdx = 0, cellListIdx = 0;
-   uint16_t cellId = 0;
+   uint64_t cellId = 0;
    Paging_t   *paging = NULLP;
    PagingCell_list_t  *pagingCelllist = NULLP;
    PagingCell_ItemIEs_t *pagingCellItemIes = NULLP;
    PagingCell_Item_t *pagingCellItem = NULLP;
    DuPagingMsg *tmpPagingParam = NULLP;
 
-   DU_LOG("\nINFO  --> DU APP : Processing the Paging Message");
    paging = &f1apMsg->choice.initiatingMessage->value.choice.Paging;
    if(paging)
    {
@@ -16592,7 +16600,7 @@ uint8_t procPagingMsg(F1AP_PDU_t *f1apMsg)
                                  bitStringToInt(&pagingCellItem->nRCGI.nRCellIdentity, &cellId);
                                  if(processPagingMsg(cellId, tmpPagingParam) != ROK)
                                  {
-                                    DU_LOG("\nERROR  --> DU APP : Paging Processing Failed at CellId:%d",cellId);
+                                    DU_LOG("\nERROR  --> DU APP : Paging Processing Failed at CellId:%lu",cellId);
                                     continue;
                                  }
                               }