[Jira Id - ODUHIGH-400] Modified F1Setup and Gnb-Du Config Msg wrt TDD and Remove...
[o-du/l2.git] / src / du_app / du_f1ap_msg_hdl.c
index ff73b8e..f7a9d0b 100644 (file)
@@ -22,6 +22,7 @@
 #include "legtp.h"
 #include "lkw.x"
 #include "lrg.x"
+#include "F1AP-PDU.h"
 #include "du_app_mac_inf.h"
 #include "du_cfg.h"
 #include "du_app_rlc_inf.h"
 #include "SchedulingRequestResourceConfig.h"
 #include<ProtocolIE-Field.h>
 #include "ProtocolExtensionField.h"
-#include "F1AP-PDU.h"
 #include "odu_common_codec.h"
 #include "du_mgr.h"
 #include "du_cell_mgr.h"
 #include "du_f1ap_msg_hdl.h"
+#include "DRBs-Setup-Item.h"
+#include "DLUPTNLInformation-ToBeSetup-List.h"
+#include "DLUPTNLInformation-ToBeSetup-Item.h"
+#include "UPTransportLayerInformation.h"
+#include "GTPTunnel.h"
+#include "SupportedSULFreqBandItem.h"
+#include "du_sys_info_hdl.h"
+
+#ifdef O1_ENABLE
+#include "CmInterface.h"
+extern StartupConfig g_cfg;
+#endif
 
 DuCfgParams duCfgParam;
 
+/******************************************************************
+ *
+ * @brief Function to fetch lcId based on DRB Id
+ *
+ * @details
+ *
+ *    Function : fetchLcId
+ *
+ *    @params[in] drbId
+ *
+ *    Functionality: Function to fetch lcId based on DRB Id
+ *
+ * Returns: lcId - SUCCESS
+ *          RFAILED - FAILURE
+ *****************************************************************/
+
+uint8_t fetchLcId(uint8_t drbId)
+{
+   uint8_t cellIdx = 0, ueIdx = 0, lcIdx = 0, numLcs = 0, lcId = 0;
+
+   for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+   {
+      for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+      {
+         if(duCb.actvCellLst[cellIdx] != NULLP)
+         {
+            numLcs = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.numLcs;
+            for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
+            {
+               if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbId == drbId && \
+                  duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbType == RB_TYPE_DRB)
+               {
+                  lcId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].lcId;
+                  return lcId;
+               }
+            }
+         }
+      }
+   }
+   DU_LOG("\nERROR   -->  DU_APP: fetchLcId() failed for drbId %d", drbId);
+   return RFAILED;
+}
+
 /************************************************************************
  *
  * @brief Converts enum values into actual value of Poll retransmit timer
@@ -169,9 +224,9 @@ uint16_t getPollRetxTmr(uint8_t pollRetxTmrCfg)
  * @return Actual value of pollPdu
  *
  * ****************************************************************/
-int16_t getPollPdu(uint8_t pollPduCfg)
+int32_t getPollPdu(uint8_t pollPduCfg)
 {
-   int16_t pollPdu;
+   int32_t pollPdu;
    switch(pollPduCfg)
    {
       case PollPDU_p4:
@@ -588,6 +643,109 @@ int16_t getStatProhTmr(uint8_t statProhTmrCfg)
    return statProhTmr; 
 }
 
+/*******************************************************************
+*
+* @brief Adding F1AP pdu to reserved pdu list
+*
+* @details
+*
+*    Function : addToReservedF1apPduList 
+*
+*    Functionality: Adding F1AP pdu to reserved pdu list.
+*     These pdu are awaiting aknowledgment from CU
+*
+* @params[in] uint8_t transId, F1AP_PDU_t *f1apMsg
+*
+* @return ROK - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+void addToReservedF1apPduList(uint8_t transId, F1AP_PDU_t *f1apPdu)
+{
+   CmLList         *node = NULLP;
+   ReservedF1apPduInfo *pduInfo = NULLP;
+   DU_ALLOC(pduInfo, sizeof(ReservedF1apPduInfo));
+   if(pduInfo)
+   {
+      DU_ALLOC(node, sizeof(CmLList));
+      if(node)
+      {
+         pduInfo->transId = transId;
+         pduInfo->f1apMsg = (void*) f1apPdu;
+
+         node->node = (PTR)pduInfo;
+         cmLListAdd2Tail(&duCb.reservedF1apPduList, node);
+      }
+   }
+}
+
+/*******************************************************************
+*
+* @brief searching for F1AP pdu from ReservedF1apPduList 
+*
+* @details
+*
+*    Function : searchFromReservedF1apPduList 
+*
+*    Functionality: searching for F1AP pdu information
+*
+* @params[in] uint8_t transId
+*
+* @return pointer to F1AP_PDU_t
+*
+* ****************************************************************/
+
+CmLList *searchFromReservedF1apPduList(uint8_t transId)
+{
+   CmLList         *node;
+   ReservedF1apPduInfo *f1apPdu;
+   if(duCb.reservedF1apPduList.count)
+   {
+      CM_LLIST_FIRST_NODE(&duCb.reservedF1apPduList, node);
+      while(node)
+      {
+         f1apPdu = (ReservedF1apPduInfo*)node->node;
+         if(f1apPdu->transId == transId)
+         {
+            return node;
+         }
+         node = node->next;
+      }
+   }
+   return NULL;
+}
+
+/*******************************************************************
+*
+* @brief deleting F1AP pdu information from ReservedF1apPduList
+*
+* @details
+*
+*    Function : deleteFromReservedF1apPduList 
+*
+*    Functionality: deleting pdu information from ReservedF1apPduList
+*
+* @params[in] CmLList *node 
+*
+* @return void 
+*
+* ****************************************************************/
+
+void deleteFromReservedF1apPduList(CmLList *node)
+{
+   ReservedF1apPduInfo *f1apPdu;
+
+   if(node != NULL)
+   {
+      f1apPdu = (ReservedF1apPduInfo *)node->node;
+      cmLListDelFrm(&duCb.reservedF1apPduList, node);
+      DU_FREE(f1apPdu, sizeof(ReservedF1apPduInfo));
+      DU_FREE(node, sizeof(CmLList));
+      node = NULL;
+   }
+}
+
 /*******************************************************************
  *
  * @brief Builds Uplink Info for NR 
@@ -691,7 +849,7 @@ uint8_t BuildDLNRInfo(NRFreqInfo_t *dlnrfreq)
 S16 BuildNrCellId(BIT_STRING_t *nrcell)
 {
    memset(nrcell->buf, 0, nrcell->size);
-   nrcell->buf[4]   = 16
+   nrcell->buf[4]   = duCfgParam.sib1Params.cellIdentity
    nrcell->bits_unused = 4;
    return ROK;
 }
@@ -773,6 +931,89 @@ uint8_t BuildFiveGSTac(Served_Cell_Information_t *servcell)
    servcell->fiveGS_TAC->buf[2] = duCfgParam.srvdCellLst[0].duCellInfo.tac;
    return ROK;  
 }
+
+/*******************************************************************
+ *
+ * @brief fill nr frequency information
+ *
+ * @details
+ *
+ *    Function : fillNrTddInfo 
+ *
+ *    Functionality: fill nr frequency information
+ *
+ * @params[in] NRFreqInfo_t freqInfo
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t fillNrTddInfo(TDD_Info_t *tddInfo)
+{
+   uint8_t elementCnt = 1, freqBandListIdx = 0, supportedBandIdx = 0;
+   NRFreqInfo_t *freqInfo = NULLP;
+
+   if(tddInfo == NULLP)
+   {
+      DU_LOG("\nERROR  --> DU APP : Null pointer received at fillNrTddInfo");
+      return RFAILED;
+   }
+   
+   freqInfo = &tddInfo->nRFreqInfo;
+   freqInfo->nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn; 
+
+   freqInfo->freqBandListNr.list.count = elementCnt; 
+   freqInfo->freqBandListNr.list.size = freqInfo->freqBandListNr.list.count  * sizeof(FreqBandNrItem_t *);
+   DU_ALLOC(freqInfo->freqBandListNr.list.array, freqInfo->freqBandListNr.list.size );
+   if(!freqInfo->freqBandListNr.list.array)
+   {
+      DU_LOG("\nERROR  --> DU APP : Memory allocation failed at fillNrTddInfo");
+      return RFAILED;
+   }
+
+   for(freqBandListIdx = 0; freqBandListIdx<freqInfo->freqBandListNr.list.count; freqBandListIdx++)
+   {
+      DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx],  sizeof(FreqBandNrItem_t ));
+      if(!freqInfo->freqBandListNr.list.array[freqBandListIdx])
+      {
+         DU_LOG("\nERROR  --> DU APP : Memory allocation failed at fillNrTddInfo");
+         return RFAILED;
+      }
+
+      freqInfo->freqBandListNr.list.array[freqBandListIdx]->freqBandIndicatorNr = duCfgParam.srvdCellLst[0].duCellInfo.\
+      f1Mode.mode.tdd.nrFreqInfo.freqBand[0].nrFreqBand;
+      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*);
+
+      DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array,\
+            freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size);
+      if(!freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array)
+      {
+         DU_LOG("\nERROR  --> DU APP : Memory allocation failed at fillNrTddInfo");
+         return RFAILED;
+      }
+
+      for(supportedBandIdx = 0; supportedBandIdx<freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count; supportedBandIdx++)
+      {
+         DU_ALLOC(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx],\
+               sizeof(SupportedSULFreqBandItem_t));
+         if(!freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx])
+         {
+            DU_LOG("\nERROR  --> DU APP : Memory allocation failed at fillNrTddInfo");
+            return RFAILED;
+         }
+
+         freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx]->freqBandIndicatorNr =\
+         duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[0].sulBand[0];
+      }
+   }
+
+   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;
+
+   return ROK;
+}
+
 /*******************************************************************
  *
  * @brief Builds NR Mode 
@@ -792,38 +1033,63 @@ uint8_t BuildNrMode(NR_Mode_Info_t *mode)
 {
    uint8_t BuildDLNRInforet=0;
    uint8_t BuildULNRInforet=0; 
-   /* FDD Mode */
+   
+#ifdef NR_TDD
+   mode->present = NR_Mode_Info_PR_tDD;
+#else
    mode->present = NR_Mode_Info_PR_fDD;
+#endif   
+   
    if(mode->present == NR_Mode_Info_PR_fDD)
    {
       DU_ALLOC(mode->choice.fDD,sizeof(FDD_Info_t));
       if(mode->choice.fDD == NULLP)
       {
-        return RFAILED;
+         DU_LOG("\nERROR  --> Memory allocation failed in BuildNrMode");
+         return RFAILED;
       }
       BuildULNRInforet = BuildULNRInfo(&mode->choice.fDD->uL_NRFreqInfo);
       if(BuildULNRInforet != ROK)
       {
-        return RFAILED;    
+         DU_LOG("\nERROR  --> Failed to build UlNrFreqInfo");
+         return RFAILED;    
       }
       BuildDLNRInforet = BuildDLNRInfo(&mode->choice.fDD->dL_NRFreqInfo);
       if(BuildDLNRInforet != ROK)
       {
-        return RFAILED;
+         DU_LOG("\nERROR  --> Failed to build DlNrFreqInfo");
+         return RFAILED;
+      }
+      mode->choice.fDD->uL_Transmission_Bandwidth.nRSCS = \
+                                                          duCfgParam.srvdCellLst[0].duCellInfo.\
+                                                          f1Mode.mode.fdd.ulTxBw.nrScs;
+      mode->choice.fDD->uL_Transmission_Bandwidth.nRNRB = \
+                                                          duCfgParam.srvdCellLst[0].duCellInfo.\
+                                                          f1Mode.mode.fdd.ulTxBw.nrb;
+      mode->choice.fDD->dL_Transmission_Bandwidth.nRSCS = \
+                                                          duCfgParam.srvdCellLst[0].duCellInfo.\
+                                                          f1Mode.mode.fdd.dlTxBw.nrScs;
+      mode->choice.fDD->dL_Transmission_Bandwidth.nRNRB = \
+                                                          duCfgParam.srvdCellLst[0].duCellInfo.\
+                                                          f1Mode.mode.fdd.dlTxBw.nrb;
+   }
+   else if(mode->present == NR_Mode_Info_PR_tDD) 
+   {
+      DU_ALLOC(mode->choice.tDD,sizeof(TDD_Info_t));
+      if(mode->choice.tDD == NULLP)
+      {
+         DU_LOG("\nERROR  --> Memory allocation failed in BuildNrMode");
+         return RFAILED;
+      }
+
+      if(fillNrTddInfo(mode->choice.tDD) != ROK)
+      {
+         DU_LOG("\nERROR  --> Failed to fill Nr TDD information");
+         return RFAILED;
       }
+
    }
-   mode->choice.fDD->uL_Transmission_Bandwidth.nRSCS = \
-                                                      duCfgParam.srvdCellLst[0].duCellInfo.\
-                                                      f1Mode.mode.fdd.ulTxBw.nrScs;
-   mode->choice.fDD->uL_Transmission_Bandwidth.nRNRB = \
-                                                      duCfgParam.srvdCellLst[0].duCellInfo.\
-                                                      f1Mode.mode.fdd.ulTxBw.nrb;
-   mode->choice.fDD->dL_Transmission_Bandwidth.nRSCS = \
-                                                      duCfgParam.srvdCellLst[0].duCellInfo.\
-                                                      f1Mode.mode.fdd.dlTxBw.nrScs;
-   mode->choice.fDD->dL_Transmission_Bandwidth.nRNRB = \
-                                                      duCfgParam.srvdCellLst[0].duCellInfo.\
-                                                      f1Mode.mode.fdd.dlTxBw.nrb;
+
    return ROK;
 }
 /*******************************************************************
@@ -843,95 +1109,107 @@ uint8_t BuildNrMode(NR_Mode_Info_t *mode)
  * ****************************************************************/
 uint8_t BuildExtensions(ProtocolExtensionContainer_4624P3_t **ieExtend)
 {
-   uint8_t idx;
-   uint8_t plmnidx;
-   uint8_t extensionCnt=1;
-   uint8_t sliceId=0;
-   uint8_t sdId;
+   uint8_t idx=0, plmnidx=0, sliceLstIdx=0;
+   uint8_t elementCnt=0, extensionCnt=0;
+
+   extensionCnt=IE_EXTENSION_LIST_COUNT;
    DU_ALLOC(*ieExtend,sizeof(ProtocolExtensionContainer_4624P3_t));
    if((*ieExtend) == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
       return RFAILED;
    }
    (*ieExtend)->list.count = extensionCnt;
    (*ieExtend)->list.size = \
-                           extensionCnt * sizeof(ServedPLMNs_ItemExtIEs_t *);
+                            extensionCnt * sizeof(ServedPLMNs_ItemExtIEs_t *);
    DU_ALLOC((*ieExtend)->list.array,(*ieExtend)->list.size);
    if((*ieExtend)->list.array == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
       return RFAILED;
    }
    for(plmnidx=0;plmnidx<extensionCnt;plmnidx++)
    {
       DU_ALLOC((*ieExtend)->list.array[plmnidx],\
-           sizeof(ServedPLMNs_ItemExtIEs_t));
+            sizeof(ServedPLMNs_ItemExtIEs_t));
       if((*ieExtend)->list.array[plmnidx] == NULLP)
       {
-        return RFAILED;
+         DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
+         return RFAILED;
       }
    }
+   
+   elementCnt = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst.numSupportedSlices;
    idx = 0;
    (*ieExtend)->list.array[idx]->id = ProtocolIE_ID_id_TAISliceSupportList;
    (*ieExtend)->list.array[idx]->criticality = Criticality_ignore;
    (*ieExtend)->list.array[idx]->extensionValue.present = \
-                                                         ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+   ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
    (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.count = 1;
+      list.count = elementCnt;
    (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.size = sizeof(SliceSupportItem_t *);
-   DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array,sizeof(SliceSupportItem_t *));
-   if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array == NULLP)
-   {
-      return RFAILED;
-   }
-   DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId],sizeof(SliceSupportItem_t));
-   if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId] == NULLP) 
-   {
-      return RFAILED;
-   }
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sST.size = sizeof(uint8_t);
-   DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
-        .list.array[sliceId]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
-        extensionValue.choice.SliceSupportList.\
-        list.array[sliceId]->sNSSAI.sST.size);
-   if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
-        .list.array[sliceId]->sNSSAI.sST.buf == NULLP)
-   {
-      return RFAILED;
-   }
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sST.buf[0] = 3;
+      list.size = (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+      list.count * sizeof(SliceSupportItem_t *);
+
    DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+         list.array, elementCnt * sizeof(SliceSupportItem_t *));
    if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId]->sNSSAI.sD == NULLP)
+         list.array == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
       return RFAILED;
    }
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sD->size = 3*sizeof(uint8_t);
-   DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId]->sNSSAI.sD->buf,(*ieExtend)->list.array[idx]->extensionValue.choice.\
-        SliceSupportList.list.array[sliceId]->sNSSAI.sD->size);
-   if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-        list.array[sliceId]->sNSSAI.sD->buf == NULLP)
+
+   for(sliceLstIdx =0; sliceLstIdx<elementCnt; sliceLstIdx++)
    {
-      return RFAILED;
+      DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx],sizeof(SliceSupportItem_t));
+      if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx] == NULLP) 
+      {
+         DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
+         return RFAILED;
+      }
+      (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+         list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+      DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+            .list.array[sliceLstIdx]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
+            extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx]->sNSSAI.sST.size);
+      if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+            .list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
+         return RFAILED;
+      }
+      (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+         list.array[sliceLstIdx]->sNSSAI.sST.buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.\
+         cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+      
+      DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+      if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
+         return RFAILED;
+      }
+      (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+         list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+      DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx]->sNSSAI.sD->buf, (*ieExtend)->list.array[idx]->extensionValue.choice.\
+            SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
+      if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+            list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : BuildExtensions(): Memory allocation failed");
+         return RFAILED;
+      }
+      memcpy((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[0].duCellInfo.\
+      cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sd, (*ieExtend)->list.array[idx]->\
+      extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
    }
-   sdId = 0;
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sD->buf[sdId] = 3;
-   sdId++;
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sD->buf[sdId] = 6;
-   sdId++;
-   (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
-      list.array[sliceId]->sNSSAI.sD->buf[sdId] = 9;
    return ROK;
 }
 /*******************************************************************
@@ -1086,16 +1364,15 @@ uint8_t BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell)
       return RFAILED;
    }
    /* MIB */
-   srvCellItem->gNB_DU_System_Information->mIB_message.size =\
-                                                            strlen(( char *)duCfgParam.srvdCellLst[0].duSysInfo.mibMsg);
+   srvCellItem->gNB_DU_System_Information->mIB_message.size = duCfgParam.srvdCellLst[0].duSysInfo.mibLen;
    DU_ALLOC(srvCellItem->gNB_DU_System_Information->mIB_message.buf,
         srvCellItem->gNB_DU_System_Information->mIB_message.size);
    if(!srvCellItem->gNB_DU_System_Information->mIB_message.buf)
    {
       return RFAILED;
    }
-   strcpy((char *)srvCellItem->gNB_DU_System_Information->mIB_message.buf,
-        (char *)duCfgParam.srvdCellLst[0].duSysInfo.mibMsg);
+   memcpy(srvCellItem->gNB_DU_System_Information->mIB_message.buf, duCfgParam.srvdCellLst[0].duSysInfo.mibMsg, \
+                  srvCellItem->gNB_DU_System_Information->mIB_message.size);
 
    /* SIB1 */
    srvCellItem->gNB_DU_System_Information->sIB1_message.size =\
@@ -1192,7 +1469,7 @@ uint8_t BuildRrcVer(RRC_Version_t *rrcVer)
  *
  * @details
  *
- *    Function : SendF1APMsg
+ *    Function : sendF1APMsg
  *
  *    Functionality: Sends F1 msg over SCTP
  *
@@ -1202,11 +1479,11 @@ uint8_t BuildRrcVer(RRC_Version_t *rrcVer)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t SendF1APMsg(Region region, Pool pool)
+uint8_t sendF1APMsg()
 {
    Buffer *mBuf = NULLP;
   
-   if(ODU_GET_MSG_BUF(region, pool, &mBuf) == ROK)
+   if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
    {
       if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK)
       {
@@ -1233,7 +1510,7 @@ uint8_t SendF1APMsg(Region region, Pool pool)
       return RFAILED;
    }
    return ROK; 
-} /* SendF1APMsg */
+} /* sendF1APMsg */
 
 /*******************************************************************
  *
@@ -1276,210 +1553,260 @@ void FreeRrcVer(RRC_Version_t *rrcVer)
       DU_FREE(rrcVer->latest_RRC_Version.buf,rrcVer->latest_RRC_Version.size);
    }
 }
+
 /*******************************************************************
  *
- * @brief  deallocating the memory of function BuildAndSendF1SetupReq()
+ * @brief Deallocating memory of TDD NrFreqInfo 
  *
  * @details
  *
- *    Function :  FreeServedCellList
+ *    Function : freeTddNrFreqInfo 
  *
- *    Functionality:  deallocating the memory of function BuildServedCellList
+ *    Functionality: freeTddNrFreqInfo 
+ *
+ * @params[in]  F1AP_PDU_t *f1apDuCfg
+ *
+ * @return ROK     - void
+ *
+ * ****************************************************************/
+void freeTddNrFreqInfo(NRFreqInfo_t *freqInfo)
+{
+   uint8_t freqBandListIdx = 0, supportedBandIdx = 0;
+
+   if(freqInfo->freqBandListNr.list.array)
+   {
+      for(freqBandListIdx = 0; freqBandListIdx<freqInfo->freqBandListNr.list.count; freqBandListIdx++)
+      {
+         if(freqInfo->freqBandListNr.list.array[freqBandListIdx])
+         {
+            if(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array)
+            {
+               for(supportedBandIdx = 0; supportedBandIdx<freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.count; supportedBandIdx++)
+               {
+                  DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array[supportedBandIdx],\
+                        sizeof(SupportedSULFreqBandItem_t));
+               }
+               DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.array,\
+                     freqInfo->freqBandListNr.list.array[freqBandListIdx]->supportedSULBandList.list.size);
+
+            }
+            DU_FREE(freqInfo->freqBandListNr.list.array[freqBandListIdx],  sizeof(FreqBandNrItem_t ));
+         }
+      }
+      DU_FREE(freqInfo->freqBandListNr.list.array, freqInfo->freqBandListNr.list.size );
+   }
+}
 
+/*******************************************************************
  *
- * @params[in] GNB_DU_Served_Cells_List_t *duServedCell
+ * @brief Deallocating memory allocated for Nr fdd frequencey mode 
  *
- * @return void
+ * @details
+ *
+ *    Function : freeFddNrFreqInfo 
+ *
+ *    Functionality:Free memory allocated for Nr fdd frequencey mode 
+ *
+ * @params[in]  
+ *
+ * @return ROK     - void
  *
  * ****************************************************************/
-void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
+void freeFddNrFreqInfo(FDD_Info_t *fDD)
 {
-   uint8_t   plmnCnt=1;
-   uint8_t  servId=0;
-   uint8_t sliceId=0;
-   uint8_t  ieId=0;
-   uint8_t   extensionCnt=1;
-   uint8_t plmnidx=0;
-   GNB_DU_Served_Cells_Item_t *srvCellItem= &duServedCell->list.array[0]->value.choice.GNB_DU_Served_Cells_Item;
-   if(duServedCell->list.array!=NULLP)
+   uint8_t arrIdx =0;
+
+   if(fDD != NULLP)
    {
-      if(duServedCell->list.array[0]!=NULLP)
+      if(fDD->uL_NRFreqInfo.freqBandListNr.list.array != NULLP)
       {
-        if(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf!=NULLP)
-        {
-           if(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf !=NULLP)
-           {
-              if(srvCellItem->served_Cell_Information.fiveGS_TAC!=NULLP)
-              {
-                 if(srvCellItem->served_Cell_Information.fiveGS_TAC->buf!=NULLP)
-                 {
-                    if(srvCellItem->served_Cell_Information.servedPLMNs.list.array!=NULLP)
-                    {
-                       if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[0]!=NULLP)
-                       {
-                          if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->pLMN_Identity.buf!=NULLP)
-                          {
-                             if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions!=NULLP)
-                             {
-                                if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array!=NULLP)
-                                {
-                                   if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]!=NULLP)
-                                   {
-                                      if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                            extensionValue.choice.SliceSupportList.list.array!=NULLP)
-                                      {
-                                         if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                               extensionValue.choice.SliceSupportList.list.array[sliceId]!= NULLP)
-                                         {
-                                            if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                  extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sST.buf!=NULLP)
-                                            {
-                                               if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                     extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD!=NULLP)
-                                               {
-                                                  if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->\
-                                                        list.array[0]->extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD->buf!=NULLP)
-                                                  {
-                                                     if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD!=NULLP)
-                                                     {
-                                                        if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
-                                                              freqBandListNr.list.array!=NULLP)
-                                                        {
-                                                           if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
-                                                                 freqBandListNr.list.array[0]!=NULLP)
-                                                           {
-                                                              if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                    freqBandListNr.list.array)
-                                                              {
-                                                                 if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                       freqBandListNr.list.array[0]!=NULLP)
-                                                                 {
-                                                                    if(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf!=NULLP)
-                                                                    {
-                                                                       if(!srvCellItem->gNB_DU_System_Information)
-                                                                       {
-                                                                          if(srvCellItem->gNB_DU_System_Information->mIB_message.buf!=NULLP)
-                                                                          {
-                                                                             if(srvCellItem->gNB_DU_System_Information->sIB1_message.buf!=NULLP)
-                                                                             { 
-                                                                                DU_FREE(srvCellItem->gNB_DU_System_Information->sIB1_message.buf,\
-                                                                                      srvCellItem->gNB_DU_System_Information->sIB1_message.size);
-                                                                                DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg,\
-                                                                                      srvCellItem->gNB_DU_System_Information->sIB1_message.size);
-                                                                             }
-                                                                             DU_FREE(srvCellItem->gNB_DU_System_Information->mIB_message.buf,\
-                                                                                   srvCellItem->gNB_DU_System_Information->mIB_message.size);
-                                                                             DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.mibMsg,\
-                                                                                   strlen((char*)duCfgParam.srvdCellLst[0].duSysInfo.mibMsg));
-                                                                          }
-                                                                          DU_FREE(srvCellItem->gNB_DU_System_Information,sizeof(GNB_DU_System_Information_t));
-                                                                       }
-                                                                       DU_FREE(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf,\
-                                                                             srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
-                                                                    }
-                                                                    DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                          freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
-                                                                 }
-                                                                 DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                       freqBandListNr.list.array,sizeof(FreqBandNrItem_t *));
-                                                              }
-                                                              DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
-                                                                    list.array[0],sizeof(FreqBandNrItem_t));
-                                                           }
-                                                           DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
-                                                                 list.array,sizeof(FreqBandNrItem_t*));
-                                                        }
-                                                        DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD,sizeof(FDD_Info_t));
-                                                     }
-                                                     DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                           iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->\
-                                                           sNSSAI.sD->buf,srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->
-                                                           list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD->size);
-                                                  }
-                                                  DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                        iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.\
-                                                        list.array[sliceId]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-                                               }
-                                               DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                     iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->\
-                                                     sNSSAI.sST.buf,sizeof(uint8_t));
-                                            }
-                                            DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                  extensionValue.choice.SliceSupportList.list.array[sliceId],sizeof(SliceSupportItem_t));
-                                         }
-                                         DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                               extensionValue.choice.SliceSupportList.list.array,sizeof(SliceSupportItem_t*));
-                                      }
-                                      DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                            array[servId]->iE_Extensions->list.array[plmnidx],sizeof(ServedPLMNs_ItemExtIEs_t));
-                                   }
-                                   DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                         array[servId]->iE_Extensions->list.array,\
-                                         extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
-                                }
-                                DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                      array[servId]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
-                             }
-                             DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                   array[servId]->pLMN_Identity.buf,srvCellItem->served_Cell_Information.\
-                                   servedPLMNs.list.array[servId]->pLMN_Identity.size
-                                   * sizeof(uint8_t));
-                          }
-                          DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnidx],\
-                                sizeof(ServedPLMNs_Item_t *));
-                       }
-                       DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array,\
-                             sizeof(ServedPLMNs_Item_t *));
-                    }
-                    DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC->buf,\
-                          sizeof(srvCellItem->served_Cell_Information.fiveGS_TAC->size));
-                 }
-                 DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC,sizeof(FiveGS_TAC_t));
-              }
-              DU_FREE(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
-                    srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.size *
-                    sizeof(uint8_t));
-           }
-           DU_FREE(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
-                 srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.size *
-                 sizeof(uint8_t));
-        }
-        DU_FREE(duServedCell->list.array[plmnidx],sizeof(GNB_DU_Served_Cells_ItemIEs_t));
+         DU_FREE(fDD->uL_NRFreqInfo.freqBandListNr.list.\
+               array[arrIdx], sizeof(FreqBandNrItem_t));
+         DU_FREE(fDD->uL_NRFreqInfo.freqBandListNr.list.array, \
+               fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+      }
+
+      if(fDD->dL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+      {
+         DU_FREE(fDD->dL_NRFreqInfo.freqBandListNr.list.\
+               array[arrIdx], sizeof(FreqBandNrItem_t));
+         DU_FREE(fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
+               fDD->dL_NRFreqInfo.freqBandListNr.list.size);
       }
-      DU_FREE(duServedCell->list.array,plmnCnt*sizeof(GNB_DU_Served_Cells_ItemIEs_t*));
+      DU_FREE(fDD,sizeof(FDD_Info_t));
    }
 }
+
 /*******************************************************************
  *
  * @brief  deallocating the memory of function BuildAndSendF1SetupReq()
  *
  * @details
  *
- *    Function :  FreeF1SetupReq
+ *    Function :  FreeServedCellList
  *
- *    Functionality:  deallocating the memory of function BuildAndSendF1SetupReq
+ *    Functionality:  deallocating the memory of function BuildServedCellList
+
  *
- * @params[in] F1AP_PDU_t *f1apMsg
+ * @params[in] GNB_DU_Served_Cells_List_t *duServedCell
  *
  * @return void
  *
  * ****************************************************************/
-void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
+void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
 {
-   uint8_t ieIdx, ieIdx2;
-   F1SetupRequest_t *f1SetupReq=NULLP;
+   uint8_t   plmnCnt=MAX_PLMN;
+   uint8_t  extensionCnt=IE_EXTENSION_LIST_COUNT;
+   uint8_t  plmnIdx=0, sliceIdx=0;
+   GNB_DU_Served_Cells_Item_t *srvCellItem;
+   ServedPLMNs_Item_t  *servedPlmnItem;
+   SliceSupportItem_t  *sliceSupportItem;
 
-   if(f1apMsg != NULLP)
+   if(duServedCell->list.array!=NULLP)
    {
-      if(f1apMsg->choice.initiatingMessage != NULLP)
+      if(duServedCell->list.array[0]!=NULLP)
       {
-        f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
-        if(f1SetupReq->protocolIEs.list.array != NULLP)
-        {
-           for(ieIdx = 0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
-           {
-              if(f1SetupReq->protocolIEs.list.array[ieIdx] != NULLP)
-              {
+         srvCellItem= &duServedCell->list.array[0]->value.choice.GNB_DU_Served_Cells_Item;
+
+         DU_FREE(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+               srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.size * sizeof(uint8_t));
+         DU_FREE(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+               srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.size * sizeof(uint8_t));
+
+         if(srvCellItem->served_Cell_Information.fiveGS_TAC!=NULLP)
+         {
+            DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC->buf,\
+                  sizeof(srvCellItem->served_Cell_Information.fiveGS_TAC->size));
+            DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC,sizeof(FiveGS_TAC_t));
+         }
+
+         if(srvCellItem->served_Cell_Information.servedPLMNs.list.array!=NULLP)
+         {
+            if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx] != NULLP)
+            {
+               servedPlmnItem = srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx];
+               DU_FREE(servedPlmnItem->pLMN_Identity.buf, servedPlmnItem->pLMN_Identity.size);
+
+               if(servedPlmnItem->iE_Extensions != NULLP)
+               {
+                  if(servedPlmnItem->iE_Extensions->list.array != NULLP)
+                  {
+                     if(servedPlmnItem->iE_Extensions->list.array[0] != NULLP)
+                     {
+                        if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                              SliceSupportList.list.array != NULLP)
+                        {
+                           for(sliceIdx =0; sliceIdx<servedPlmnItem->iE_Extensions->list.array[0]->\
+                                 extensionValue.choice.SliceSupportList.list.count; sliceIdx++)
+                           {
+                              if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                                    SliceSupportList.list.array[sliceIdx] != NULLP)
+                              {
+                                 sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->\
+                                                    extensionValue.choice.SliceSupportList.list.array[sliceIdx];
+
+                                 DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sizeof(uint8_t));
+
+                                 if(sliceSupportItem->sNSSAI.sD != NULLP)
+                                 {
+                                    DU_FREE(sliceSupportItem->sNSSAI.sD->buf,\
+                                          sliceSupportItem->sNSSAI.sD->size);
+                                    DU_FREE(sliceSupportItem->sNSSAI.sD, sizeof(OCTET_STRING_t));
+                                 }
+
+                                 DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.\
+                                       choice.SliceSupportList.list.array[sliceIdx], sizeof(SliceSupportItem_t));
+                              }
+                           }
+                           DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                                 SliceSupportList.list.array, servedPlmnItem->iE_Extensions->list.array[0]->\
+                                 extensionValue.choice.SliceSupportList.list.size);
+                        }
+                        DU_FREE(servedPlmnItem->iE_Extensions->list.array[0],\
+                              sizeof(ServedPLMNs_ItemExtIEs_t));
+                     }
+                     DU_FREE(servedPlmnItem->iE_Extensions->list.array,\
+                           extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
+                  }
+                  DU_FREE(servedPlmnItem->iE_Extensions, sizeof(ProtocolExtensionContainer_4624P3_t));
+               }
+               DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx],\
+                     sizeof(ServedPLMNs_Item_t));
+            }
+            DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array,\
+                  sizeof(ServedPLMNs_Item_t *));
+         }
+
+         if(srvCellItem->served_Cell_Information.nR_Mode_Info.present == NR_Mode_Info_PR_fDD)
+         {
+            freeFddNrFreqInfo(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD);
+         }
+         else   
+         {
+            if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD != NULLP)
+            {
+               freeTddNrFreqInfo(&srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD->nRFreqInfo);
+               DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
+            }
+         }
+         
+         DU_FREE(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf,\
+               srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
+
+         if(srvCellItem->gNB_DU_System_Information != NULLP)
+         {
+            if(srvCellItem->gNB_DU_System_Information->mIB_message.buf != NULLP)
+            {
+               DU_FREE(srvCellItem->gNB_DU_System_Information->mIB_message.buf,\
+                     srvCellItem->gNB_DU_System_Information->mIB_message.size);
+            }
+
+            if(srvCellItem->gNB_DU_System_Information->sIB1_message.buf != NULLP)
+            { 
+               DU_FREE(srvCellItem->gNB_DU_System_Information->sIB1_message.buf,\
+                     srvCellItem->gNB_DU_System_Information->sIB1_message.size);
+            }
+
+            DU_FREE(srvCellItem->gNB_DU_System_Information, sizeof(GNB_DU_System_Information_t));
+         }
+
+         DU_FREE(duServedCell->list.array[0], sizeof(GNB_DU_Served_Cells_ItemIEs_t));
+      }
+      DU_FREE(duServedCell->list.array, plmnCnt * sizeof(GNB_DU_Served_Cells_ItemIEs_t*));
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief  deallocating the memory of function BuildAndSendF1SetupReq()
+ *
+ * @details
+ *
+ *    Function :  FreeF1SetupReq
+ *
+ *    Functionality:  deallocating the memory of function BuildAndSendF1SetupReq
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx, ieIdx2;
+   F1SetupRequest_t *f1SetupReq=NULLP;
+
+   if(f1apMsg != NULLP)
+   {
+      if(f1apMsg->choice.initiatingMessage != NULLP)
+      {
+        f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
+        if(f1SetupReq->protocolIEs.list.array != NULLP)
+        {
+           for(ieIdx = 0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
+           {
+              if(f1SetupReq->protocolIEs.list.array[ieIdx] != NULLP)
+              {
                  switch(f1SetupReq->protocolIEs.list.array[ieIdx]->id)
                  {
                     case ProtocolIE_ID_id_TransactionID:
@@ -1504,7 +1831,6 @@ void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
                        break;
                  }
               }
-              break;
            }
            for(ieIdx2=0; ieIdx2< ieIdx; ieIdx2++)
            {
@@ -1685,7 +2011,7 @@ uint8_t BuildAndSendF1SetupReq()
       }
 
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Setup request failed");
         break;
@@ -1700,6 +2026,113 @@ uint8_t BuildAndSendF1SetupReq()
    return ret;
 }/* End of BuildAndSendF1SetupReq */
 
+/*******************************************************************
+ *
+ * @brief Deallocating memory allocated for Served_Cells_To_Modify_Item_t
+ *
+ * @details
+ *
+ *    Function : freeCellsToModifyItem 
+ *
+ *    Functionality: Deallocating memory of variables allocated in
+ *                    BuildAndSendDUConfigUpdate function
+ *
+ * @params[in]  Served_Cells_To_Modify_Item_t *modifyItem
+ *
+ * @return ROK     - void
+ *
+ * ****************************************************************/
+
+void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
+{
+   uint8_t arrIdx=0, servedPlmnIdx=0, sliceLstIdx=0;
+   ServedPLMNs_Item_t *servedPlmnItem = NULLP;
+   SliceSupportItem_t *sliceSupportItem = NULLP;
+
+   DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf, modifyItem->oldNRCGI.pLMN_Identity.size);
+   DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf, modifyItem->oldNRCGI.nRCellIdentity.size);
+
+   DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+           modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
+   DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+         modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
+
+   if(modifyItem->served_Cell_Information.servedPLMNs.list.array != NULLP)
+   {
+      if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx] != NULLP)
+      {
+         servedPlmnItem = modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx];
+
+         DU_FREE(servedPlmnItem->pLMN_Identity.buf,servedPlmnItem->pLMN_Identity.size);
+
+         if(servedPlmnItem->iE_Extensions != NULLP)
+         {
+            if(servedPlmnItem->iE_Extensions->list.array != NULLP)
+            {
+               if(servedPlmnItem->iE_Extensions->list.array[arrIdx] != NULLP)
+               {
+                  if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                        list.array != NULLP)
+                  {
+                     for(sliceLstIdx =0; sliceLstIdx<servedPlmnItem->iE_Extensions->list.array[arrIdx]->\
+                           extensionValue.choice.SliceSupportList.list.count; sliceLstIdx++)
+                     {
+                        if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                              list.array[sliceLstIdx] != NULLP)
+                        {
+
+                           sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                              SliceSupportList.list.array[sliceLstIdx];
+
+                           DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sliceSupportItem->sNSSAI.sST.size);
+                           if(sliceSupportItem->sNSSAI.sD != NULLP)
+                           {
+                              DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
+                              DU_FREE(sliceSupportItem->sNSSAI.sD,sizeof(OCTET_STRING_t));
+                           }
+                           DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                 SliceSupportList.list.array[sliceLstIdx], sizeof(SliceSupportItem_t));
+                        }
+                     }
+                     DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.\
+                           choice.SliceSupportList.list.array,\
+                           servedPlmnItem->iE_Extensions->list.array[arrIdx]->\
+                           extensionValue.choice.SliceSupportList.list.size);
+                  }
+               }
+               for(servedPlmnIdx=0; servedPlmnIdx< servedPlmnItem->iE_Extensions->list.count ; servedPlmnIdx++)
+               {
+                  DU_FREE(servedPlmnItem->iE_Extensions->list.array[servedPlmnIdx], sizeof(ServedPLMNs_ItemExtIEs_t ));
+               }
+               DU_FREE(servedPlmnItem->iE_Extensions->list.array, servedPlmnItem->iE_Extensions->list.size);
+            }
+            DU_FREE(servedPlmnItem->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+         }
+      }
+      for(servedPlmnIdx=0; servedPlmnIdx<modifyItem->served_Cell_Information.servedPLMNs.list.count; servedPlmnIdx++)
+      {
+         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[servedPlmnIdx], sizeof(ServedPLMNs_Item_t));
+      }
+      DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
+         modifyItem->served_Cell_Information.servedPLMNs.list.size);
+   }
+   
+   if(modifyItem->served_Cell_Information.nR_Mode_Info.present == NR_Mode_Info_PR_fDD)
+   {
+      freeFddNrFreqInfo(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD);
+   }  
+   else
+   {
+      if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD)
+      {
+         freeTddNrFreqInfo(&modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD->nRFreqInfo);
+         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
+      }
+   }
+   DU_FREE(modifyItem->served_Cell_Information.measurementTimingConfiguration.buf,\
+      modifyItem->served_Cell_Information.measurementTimingConfiguration.size);
+}
+
 /*******************************************************************
  *
  * @brief Deallocating memory of BuildAndSendDUConfigUpdate
@@ -1718,231 +2151,87 @@ uint8_t BuildAndSendF1SetupReq()
  * ****************************************************************/
 void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
 {
-   uint8_t  i;
-   uint8_t  idx;
+   uint8_t  ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
-   Served_Cells_To_Modify_List_t  *cellsToModify;
-   Served_Cells_To_Modify_Item_t *modifyItem;
-   idx=0;
-   i=1;
+   Served_Cells_To_Modify_List_t  *cellsToModify=NULLP;
+   Served_Cells_To_Delete_List_t  *cellsToDelete=NULLP;
+   Served_Cells_To_Delete_Item_t  *deleteItem = NULLP;
+   Served_Cells_To_Delete_ItemIEs_t *deleteItemIe = NULLP;
+
    if(f1apDuCfg != NULLP)
    {
       if(f1apDuCfg->choice.initiatingMessage != NULLP)
       {
-        duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->\
-                      value.choice.GNBDUConfigurationUpdate;
-        if(duCfgUpdate->protocolIEs.list.array != NULLP)
-        {
-           if(duCfgUpdate->protocolIEs.list.array[i] != NULLP)
-           {
-              cellsToModify = &duCfgUpdate->protocolIEs.list.array[i]->\
-                              value.choice.Served_Cells_To_Modify_List;
-              if(cellsToModify->list.array != NULLP)
-              {
-                 if(cellsToModify->list.array[idx] != NULLP)
-                 {
-                    modifyItem=&cellsToModify->list.array[idx]->value.choice.\
-                               Served_Cells_To_Modify_Item;
-                    if(modifyItem->oldNRCGI.pLMN_Identity.buf != NULLP)
-                    {
-                       if(modifyItem->oldNRCGI.nRCellIdentity.buf != NULLP)
-                       {
-                          if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf != NULLP)
-                          {
-                             if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf
-                                   != NULLP)
-                             { 
-                                if(modifyItem->served_Cell_Information.servedPLMNs.list.array\
-                                      != NULLP)
-                                {
-                                   if(!modifyItem->served_Cell_Information.servedPLMNs.list.array[idx])
-                                   {
-                                      if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                            array[idx]->pLMN_Identity.buf != NULLP)
-                                      {
-                                         if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                               array[idx]->iE_Extensions!= NULLP)
-                                         {
-                                            if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                  array[idx]->iE_Extensions->list.array != NULLP)
-                                            {
-                                               if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.array[idx])
-                                               {
-                                                  if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                        iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                        list.array !=NULLP)
-                                                  {
-                                                     if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                           list.array[idx]!=NULLP)
-                                                     {   
-                                                        if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                              iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                              list.array[idx]->sNSSAI.sST.buf!=NULLP)
-                                                        {
-                                                           if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                 iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                 list.array[idx]->sNSSAI.sD != NULLP)
-                                                           { 
-                                                              if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                    iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                    list.array[idx]->sNSSAI.sD->buf!=NULLP)
-                                                              {
-                                                                 if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD
-                                                                       !=NULLP)
-                                                                 {
-                                                                    if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                          fDD->uL_NRFreqInfo.freqBandListNr.list.array!=NULLP)
-                                                                    {
-                                                                       if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.array[idx]!=NULLP)
-                                                                       {
-                                                                          if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                                fDD->dL_NRFreqInfo.freqBandListNr.list.array !=NULLP)
-                                                                          {
-                                                                             if(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                   choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
-                                                                                   array[idx]!= NULLP)
-                                                                             {
-                                                                                if(modifyItem->served_Cell_Information.\
-                                                                                      measurementTimingConfiguration.buf !=NULLP)
-                                                                                {
-                                                                                   idx=2;
-                                                                                   if(duCfgUpdate->protocolIEs.list.array[idx]->value.\
-                                                                                         choice.GNB_DU_ID.buf!=NULLP)
-                                                                                   {
-                                                                                      DU_FREE(duCfgUpdate->protocolIEs.list.\
-                                                                                            array[idx]->value.choice.GNB_DU_ID.buf,\
-                                                                                            duCfgUpdate->protocolIEs.list.array[idx]->\
-                                                                                            value.choice.GNB_DU_ID.size);
-                                                                                   }
-                                                                                   idx=0;
-                                                                                   DU_FREE(modifyItem->served_Cell_Information.\
-                                                                                         measurementTimingConfiguration.\
-                                                                                         buf,modifyItem->served_Cell_Information.\
-                                                                                         measurementTimingConfiguration.size);
-                                                                                }
-                                                                                DU_FREE(modifyItem->served_Cell_Information.\
-                                                                                      nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.\
-                                                                                      list.array[idx],sizeof(FreqBandNrItem_t));
-                                                                             }
-                                                                             DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info\
-                                                                                   .choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
-                                                                                   modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                   choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
-                                                                          }
-                                                                          DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                                                array[idx],sizeof(FreqBandNrItem_t));
-                                                                       }
-                                                                       DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                             choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                                             array,modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.size);
-                                                                    }
-                                                                    DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                          fDD,sizeof(FDD_Info_t));
-                                                                 }
-                                                                 DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                                       array[idx]->iE_Extensions->list.array[idx]->extensionValue.choice.\
-                                                                       SliceSupportList.\
-                                                                       list.array[idx]->sNSSAI.sD->buf,modifyItem->served_Cell_Information.\
-                                                                       servedPLMNs.list.array[idx]->iE_Extensions->list.array[idx]->\
-                                                                       extensionValue.choice.SliceSupportList.list.array[idx]->\
-                                                                       sNSSAI.sD->size);
-
-                                                              }
-                                                              DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                                    array[idx]->\
-                                                                    iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                    list.array[idx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-                                                           }
-                                                           DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                 iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                 list.array[idx]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.\
-                                                                 servedPLMNs.\
-                                                                 list.array[idx]->iE_Extensions->list.array[idx]->extensionValue.choice.\
-                                                                 SliceSupportList.list.array[idx]->sNSSAI.sST.size);
-                                                        }
-                                                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                              iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                              list.array[idx],sizeof(SliceSupportItem_t));
-                                                     }
-                                                     DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                           list.array,\
-                                                           modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.list.size);
-                                                  }
-                                               }
-                                               for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.count;i++)
-                                               {
-                                                  DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                        array[idx]->iE_Extensions->list.array[i],\
-                                                        sizeof(ServedPLMNs_ItemExtIEs_t ));
-                                               }
-                                               DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.array,modifyItem->served_Cell_Information.servedPLMNs.
-                                                     list.array[idx]->iE_Extensions->list.size);
-                                            }
-                                            DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                  array[idx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
-                                         }
-                                         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                               array[idx]->pLMN_Identity.buf,
-                                               modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->pLMN_Identity.size);
-                                      }
-                                   }
-                                   for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
-                                   {
-                                      if(modifyItem->served_Cell_Information.servedPLMNs.list.array[i]
-                                            != NULLP)
-                                      {
-                                         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i],\
-                                               sizeof(ServedPLMNs_Item_t));
-                                      }
-                                   }
-                                   DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
-                                         modifyItem->served_Cell_Information.servedPLMNs.list.size);
-                                }
-                                DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
-                                      modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);          
-                             }
-                             DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
-                                   modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
-                          }
-                          DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf,\
-                                modifyItem->oldNRCGI.nRCellIdentity.size);
-                       }
-                       DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf,\
-                             modifyItem->oldNRCGI.pLMN_Identity.size);
-                    }
-                 }
-                 for(i=0; i<cellsToModify->list.count ;i++)
-                 {
-                    if(cellsToModify->list.array[i] != NULLP)
-                    {
-                       DU_FREE(cellsToModify->list.array[i],\
-                             sizeof(Served_Cells_To_Modify_ItemIEs_t));
-                    } 
-                 }
-                 DU_FREE(cellsToModify->list.array,cellsToModify->list.size);
-              }
-           }
-           for(i=0;i<duCfgUpdate->protocolIEs.list.count;i++)
-           {
-              if(duCfgUpdate->protocolIEs.list.array[i] !=NULLP)
-              {
-                 DU_FREE(duCfgUpdate->protocolIEs.list.array[i],\
-                       sizeof(GNBDUConfigurationUpdateIEs_t));
-              }
-           }
-           DU_FREE(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
-        }
-        DU_FREE(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+         duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->\
+                       value.choice.GNBDUConfigurationUpdate;
+         if(duCfgUpdate->protocolIEs.list.array != NULLP)
+         {
+            for(ieIdx=0; ieIdx<duCfgUpdate->protocolIEs.list.count; ieIdx++)
+            {
+               if(duCfgUpdate->protocolIEs.list.array[ieIdx] != NULLP)
+               {
+                  switch(duCfgUpdate->protocolIEs.list.array[ieIdx]->id)
+                  {
+                     case ProtocolIE_ID_id_Served_Cells_To_Modify_List:
+                        {
+                           cellsToModify = &duCfgUpdate->protocolIEs.list.array[ieIdx]->\
+                                           value.choice.Served_Cells_To_Modify_List;
+                           if(cellsToModify->list.array != NULLP)
+                           {
+                              for(cellModifyIdx=0; cellModifyIdx<cellsToModify->list.count ;cellModifyIdx++)
+                              {
+                                 if(cellsToModify->list.array[cellModifyIdx] != NULLP)
+                                 {
+                                    freeCellsToModifyItem(&cellsToModify->list.array[cellModifyIdx]->value.choice.\
+                                          Served_Cells_To_Modify_Item);
+                                    DU_FREE(cellsToModify->list.array[cellModifyIdx],\
+                                          sizeof(Served_Cells_To_Modify_ItemIEs_t));
+                                 }
+                              }
+                              DU_FREE(cellsToModify->list.array,cellsToModify->list.size);
+                           }
+                           break;
+                        }
+                     case ProtocolIE_ID_id_Served_Cells_To_Delete_List:
+                        {
+                           cellsToDelete = &duCfgUpdate->protocolIEs.list.array[ieIdx]->\
+                                           value.choice.Served_Cells_To_Delete_List;
+                           if(cellsToDelete->list.array != NULLP)
+                           {
+                              for(cellDeleteIdx=0; cellDeleteIdx<cellsToDelete->list.count ;cellDeleteIdx++)
+                              {
+                                 if(cellsToDelete->list.array[cellDeleteIdx] != NULLP)
+                                 {
+                                    deleteItemIe = ((Served_Cells_To_Delete_ItemIEs_t*)\
+                                          cellsToDelete->list.array[cellDeleteIdx]);
+                                    deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+                                    DU_FREE(deleteItem->oldNRCGI.pLMN_Identity.buf,\
+                                          deleteItem->oldNRCGI.pLMN_Identity.size); 
+                                    DU_FREE(deleteItem->oldNRCGI.nRCellIdentity.buf,\
+                                          deleteItem->oldNRCGI.nRCellIdentity.size);
+                                    DU_FREE(cellsToDelete->list.array[cellDeleteIdx],\
+                                          sizeof(Served_Cells_To_Delete_ItemIEs_t));
+                                 }
+                              }
+                              DU_FREE(cellsToDelete->list.array,cellsToDelete->list.size);
+                           }
+
+                           break;
+                        }
+                     case ProtocolIE_ID_id_gNB_DU_ID:
+                        {
+                           DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
+                                 duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+                           break;
+                        }
+                  }
+                  DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx],\
+                        sizeof(GNBDUConfigurationUpdateIEs_t));
+               }
+            }
+            DU_FREE(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
+         }
+         DU_FREE(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
       }
       DU_FREE(f1apDuCfg, (Size)sizeof(F1AP_PDU_t));
    }
@@ -1967,119 +2256,135 @@ void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
 
 uint8_t fillServedPlmns(ServedPLMNs_List_t *servedPlmn)
 {
-   uint8_t ieIdx, ieListCnt;
+   uint8_t ieIdx=0, arrayIdx=0, ieListCnt=0, elementCnt=0, sliceLstIdx=0;
 
-   servedPlmn->list.array[0]->pLMN_Identity.size = 3*sizeof(uint8_t);
-   DU_ALLOC(servedPlmn->list.array[0]->pLMN_Identity.buf, servedPlmn->list.\
-        array[0]->pLMN_Identity.size);
-   if(servedPlmn->list.array[0]->pLMN_Identity.buf == NULLP)
+   servedPlmn->list.array[arrayIdx]->pLMN_Identity.size = 3*sizeof(uint8_t);
+   DU_ALLOC(servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf, servedPlmn->list.\
+         array[arrayIdx]->pLMN_Identity.size);
+   if(servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
       return RFAILED;
    }
-   buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
-        servedPlmn->list.array[0]->pLMN_Identity.buf);
-   DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
-   if(servedPlmn->list.array[0]->iE_Extensions == NULLP)
+   buildPlmnId(duCfgParam.srvdCellLst[arrayIdx].duCellInfo.cellInfo.srvdPlmn[arrayIdx].plmn,\
+         servedPlmn->list.array[arrayIdx]->pLMN_Identity.buf);
+   DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+   if(servedPlmn->list.array[arrayIdx]->iE_Extensions == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
       return RFAILED;
    }
 
    ieListCnt=1;
-   servedPlmn->list.array[0]->iE_Extensions->list.count = ieListCnt;
-   servedPlmn->list.array[0]->iE_Extensions->list.size = ieListCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
-   DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array,servedPlmn->list.array[0]->\
-        iE_Extensions->list.size);
-   if(servedPlmn->list.array[0]->iE_Extensions->list.array == NULLP)
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.count = ieListCnt;
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.size = ieListCnt *sizeof(ServedPLMNs_ItemExtIEs_t *);
+   DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array,servedPlmn->list.array[arrayIdx]->\
+         iE_Extensions->list.size);
+   if(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array == NULLP)
    {
+      DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
       return RFAILED;
    }
-   for(ieIdx=0;ieIdx<ieListCnt;ieIdx++)
+   for(ieIdx=arrayIdx;ieIdx<ieListCnt;ieIdx++)
    {
-      DU_ALLOC(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx],\
-           sizeof(ServedPLMNs_ItemExtIEs_t));
-      if(servedPlmn->list.array[0]->iE_Extensions->list.array[ieIdx] == NULLP)
+      DU_ALLOC(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx],\
+            sizeof(ServedPLMNs_ItemExtIEs_t));
+      if(servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx] == NULLP)
       {
-        return RFAILED;
+         DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+         return RFAILED;
+      }
+   }
+   
+   ieIdx = 0;
+   elementCnt = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst.numSupportedSlices; 
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->id =ProtocolIE_ID_id_TAISliceSupportList;
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->criticality = Criticality_ignore;
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.present = \
+   ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+   servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.count = elementCnt;
+   servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.size = elementCnt * sizeof(SliceSupportItem_t *);
+   DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+         iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+         list.array,servedPlmn->list.array[arrayIdx]->\
+         iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.size);
+   if(servedPlmn->list.array[arrayIdx]->\
+         iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+         list.array == NULLP)
+   {
+      DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+      return RFAILED;
+   }
+
+   for(sliceLstIdx =0; sliceLstIdx< elementCnt; sliceLstIdx++)
+   {
+      DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx],sizeof( SliceSupportItem_t));
+      if(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx] == NULLP)
+      {   
+         DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+         return RFAILED;
       }
+      
+      servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+      DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sST.buf,servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->\
+      sNSSAI.sST.size);
+      
+      if(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+         return RFAILED;
+      }
+      servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sST.buf[arrayIdx] =  duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+      cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+
+      DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+      if(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+         return RFAILED;
+      }
+      servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+      DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->buf,servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->size);
+      if(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+      {
+         DU_LOG("ERROR  --> DU_APP : fillServedPlmns(): Memory allocation failed");
+         return RFAILED;
+      }
+      memcpy(servedPlmn->list.array[arrayIdx]->\
+      iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+      cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sd,\
+      servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+      list.array[sliceLstIdx]->sNSSAI.sD->size);
    }
-   //plmnIeExt = servedPlmn->list.array[0]->iE_Extensions; 
-   servedPlmn->list.array[0]->iE_Extensions->list.array[0]->id =ProtocolIE_ID_id_TAISliceSupportList;
-   servedPlmn->list.array[0]->iE_Extensions->list.array[0]->criticality = Criticality_ignore;
-   servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.present = \
-      ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
-   servedPlmn->list.array[0]->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.count = 1;
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.size = sizeof(SliceSupportItem_t *);
-   DU_ALLOC(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array,servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.size);
-   if(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array == NULLP)
-   {
-      return RFAILED;
-   }
-
-   DU_ALLOC(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0],sizeof( SliceSupportItem_t));
-   if(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0] == NULLP)
-   {
-      return RFAILED;
-   }
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sST.size = sizeof(uint8_t);
-   DU_ALLOC(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sST.buf,servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.array[0]->sNSSAI.sST.size);
-   if(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sST.buf == NULLP)
-   {
-      return RFAILED;
-   }
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sST.buf[0] = 3;
-   DU_ALLOC(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-   if(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sD == NULLP)
-   {
-      return RFAILED;
-   }
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sD->size = 3*sizeof(uint8_t);
-   DU_ALLOC(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sD->buf,servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sD->size);
-   if(servedPlmn->list.array[0]->\
-        iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-        list.array[0]->sNSSAI.sD->buf == NULLP)
-   {
-      return RFAILED;
-   }
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sD->buf[0] = 3;
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sD->buf[1] = 6;
-   servedPlmn->list.array[0]->\
-      iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
-      list.array[0]->sNSSAI.sD->buf[2] = 9;
    return ROK;
 }
 
@@ -2093,64 +2398,70 @@ uint8_t fillServedPlmns(ServedPLMNs_List_t *servedPlmn)
  *
  *    Functionality: Fills Nr Fdd Info required in ServCellInfo IE
  *
- * @params[in] Pointer to NR_Mode_Info_t *
+ * @params[in] FDD_Info_t *fDD
  *
  * @return ROK     - success
  *         RFAILED - failure
  *
  *****************************************************************/
 
-uint8_t fillNrFddInfo(NR_Mode_Info_t *nrFdd)
+uint8_t fillNrFddInfo(FDD_Info_t *fDD)
 {
-   nrFdd->choice.fDD->uL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.\
+   fDD->uL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.\
       f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn;
-   nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.count = 1;
-   nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t*);
-   DU_ALLOC(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
-        array, nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
-   if(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array == NULLP)
+   fDD->uL_NRFreqInfo.freqBandListNr.list.count = 1;
+   fDD->uL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t*);
+   DU_ALLOC(fDD->uL_NRFreqInfo.freqBandListNr.list.\
+        array, fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+   if(fDD->uL_NRFreqInfo.freqBandListNr.list.array == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillNrFddInfo");
       return RFAILED;
    }
-   DU_ALLOC(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0], \
+
+   DU_ALLOC(fDD->uL_NRFreqInfo.freqBandListNr.list.array[0], \
       sizeof(FreqBandNrItem_t));
-   if(nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
+   if(fDD->uL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillNrFddInfo");
       return RFAILED;
    }
-   nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
+   
+   fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
       duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.\
       freqBand[0].nrFreqBand;
-   nrFdd->choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
-   nrFdd->choice.fDD->dL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.\
+   fDD->uL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
+   fDD->dL_NRFreqInfo.nRARFCN = duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.\
       dlNrFreqInfo.nrArfcn;
-   nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.count = 1;
-   nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t *);
-   DU_ALLOC(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,nrFdd->\
-        choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
-   if(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array == NULLP)
+   fDD->dL_NRFreqInfo.freqBandListNr.list.count = 1;
+   fDD->dL_NRFreqInfo.freqBandListNr.list.size = sizeof(FreqBandNrItem_t *);
+   DU_ALLOC(fDD->dL_NRFreqInfo.freqBandListNr.list.array, fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+   if(fDD->dL_NRFreqInfo.freqBandListNr.list.array == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillNrFddInfo");
       return RFAILED;
    }
-   DU_ALLOC(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0],\
-        sizeof(FreqBandNrItem_t));
-   if(nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
+   
+   DU_ALLOC(fDD->dL_NRFreqInfo.freqBandListNr.list.array[0],  sizeof(FreqBandNrItem_t));
+   if(fDD->dL_NRFreqInfo.freqBandListNr.list.array[0] == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillNrFddInfo");
       return RFAILED;
    }
-   nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
+
+   fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->freqBandIndicatorNr = \
       duCfgParam.srvdCellLst[0].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.\
       freqBand[0].nrFreqBand;
-   nrFdd->choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
+   fDD->dL_NRFreqInfo.freqBandListNr.list.array[0]->supportedSULBandList.list.count=0;
    
    /*Transmission Bandwidth*/
-   nrFdd->choice.fDD->uL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
+   fDD->uL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
       f1Mode.mode.fdd.ulTxBw.nrScs;
-   nrFdd->choice.fDD->uL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
+   fDD->uL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
       f1Mode.mode.fdd.ulTxBw.nrb;
-   nrFdd->choice.fDD->dL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
+   fDD->dL_Transmission_Bandwidth.nRSCS = duCfgParam.srvdCellLst[0].duCellInfo.\
       f1Mode.mode.fdd.dlTxBw.nrScs;
-   nrFdd->choice.fDD->dL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
+   fDD->dL_Transmission_Bandwidth.nRNRB = duCfgParam.srvdCellLst[0].duCellInfo.\
       f1Mode.mode.fdd.dlTxBw.nrb;
 
    return ROK;
@@ -2175,7 +2486,7 @@ uint8_t fillNrFddInfo(NR_Mode_Info_t *nrFdd)
 
 uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
 {
-   uint8_t tmp, ieIdx, ieListCnt;
+   uint8_t ieIdx, ieListCnt;
 
    /*nRCGI*/
    srvCellInfo->nRCGI.pLMN_Identity.size =3*sizeof(uint8_t);
@@ -2183,6 +2494,7 @@ uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
         srvCellInfo->nRCGI.pLMN_Identity.size);
    if(srvCellInfo->nRCGI.pLMN_Identity.buf == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
       return RFAILED;
    }
    buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
@@ -2191,17 +2503,12 @@ uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
    DU_ALLOC(srvCellInfo->nRCGI.nRCellIdentity.buf,\
         srvCellInfo->nRCGI.nRCellIdentity.size);
    if(srvCellInfo->nRCGI.nRCellIdentity.buf == NULLP)
-   {
+   {   
+      DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
       return RFAILED;
    }
-   for (tmp = 0 ; tmp < srvCellInfo->\
-        nRCGI.nRCellIdentity.size-1 ; tmp++)
-   {
-      srvCellInfo->nRCGI.nRCellIdentity.buf[tmp] = 0;
-   }
-   srvCellInfo->nRCGI.nRCellIdentity.buf[4] = 16;
-   srvCellInfo->nRCGI.nRCellIdentity.bits_unused =4;
-
+   
+   fillBitString(&srvCellInfo->nRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
    /*nRPCI*/
    srvCellInfo->nRPCI = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrPci;
 
@@ -2209,36 +2516,55 @@ uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
    ieListCnt = 1;
    srvCellInfo->servedPLMNs.list.count = ieListCnt;
    srvCellInfo->servedPLMNs.list.size = ieListCnt*sizeof(ServedPLMNs_Item_t *);
-   DU_ALLOC(srvCellInfo->servedPLMNs.list.array,\
-        srvCellInfo->servedPLMNs.list.size);
+   DU_ALLOC(srvCellInfo->servedPLMNs.list.array, srvCellInfo->servedPLMNs.list.size);
    if(srvCellInfo->servedPLMNs.list.array == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
       return RFAILED;
    }
    for(ieIdx=0; ieIdx < ieListCnt; ieIdx++)
    {
-      DU_ALLOC(srvCellInfo->servedPLMNs.list.array[ieIdx],\
-           sizeof(ServedPLMNs_Item_t));
+      DU_ALLOC(srvCellInfo->servedPLMNs.list.array[ieIdx], sizeof(ServedPLMNs_Item_t));
       if(srvCellInfo->servedPLMNs.list.array[ieIdx]== NULLP)
       {
-        return RFAILED;
+         DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
+         return RFAILED;
       }
    }
    if(fillServedPlmns(&srvCellInfo->servedPLMNs))
    {
+      DU_LOG("\nERROR  --> Failed to fill Served Plmn info");
       return RFAILED;
    }
 
+#ifndef NR_TDD
    /*nR Mode Info with FDD*/
    srvCellInfo->nR_Mode_Info.present = NR_Mode_Info_PR_fDD;
-   DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.fDD,\
-         sizeof(FDD_Info_t));
+   DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.fDD, sizeof(FDD_Info_t));
    if(srvCellInfo->nR_Mode_Info.choice.fDD == NULLP)
    {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
+      return RFAILED;
+   }
+   if(fillNrFddInfo(srvCellInfo->nR_Mode_Info.choice.fDD))
+   {
+       DU_LOG("\nERROR  --> Failed to fill the Nr FDD information");
+      return RFAILED;
+   }
+#else
+   srvCellInfo->nR_Mode_Info.present = NR_Mode_Info_PR_tDD;   
+   DU_ALLOC(srvCellInfo->nR_Mode_Info.choice.tDD, sizeof(TDD_Info_t));
+   if(srvCellInfo->nR_Mode_Info.choice.tDD == NULLP)
+   {
+      DU_LOG("\nERROR  --> Memory allocation failed in fillServedCellInfo");
       return RFAILED;
    }
-   if(fillNrFddInfo(&srvCellInfo->nR_Mode_Info))
+   if(fillNrTddInfo(srvCellInfo->nR_Mode_Info.choice.tDD) != ROK)
+   {
+      DU_LOG("\nERROR  --> Failed to fill the Nr TDD information");
       return RFAILED;
+   }
+#endif
 
    /*Measurement timing Config*/
    srvCellInfo->measurementTimingConfiguration.size = sizeof(uint8_t);
@@ -2273,8 +2599,6 @@ uint8_t fillServedCellInfo(Served_Cell_Information_t *srvCellInfo)
 
 uint8_t fillServCellToModItem(Served_Cells_To_Modify_Item_t *modifyItem)
 {
-   uint8_t ieIdx;
-
    /*pLMN_Identity*/
    modifyItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
    DU_ALLOC(modifyItem->oldNRCGI.pLMN_Identity.buf,modifyItem->oldNRCGI.pLMN_Identity.size);
@@ -2293,12 +2617,7 @@ uint8_t fillServCellToModItem(Served_Cells_To_Modify_Item_t *modifyItem)
    {
       return RFAILED;
    }
-   for(ieIdx = 0; ieIdx < modifyItem->oldNRCGI.nRCellIdentity.size-1; ieIdx++)
-   {
-      modifyItem->oldNRCGI.nRCellIdentity.buf[ieIdx] = 0;
-   }
-   modifyItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
-   modifyItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
+   fillBitString(&modifyItem->oldNRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
 
    if(fillServedCellInfo(&modifyItem->served_Cell_Information))
       return RFAILED;
@@ -2355,6 +2674,105 @@ uint8_t buildServCellToModList(Served_Cells_To_Modify_List_t *cellsToModify)
    else
       return ROK;
 }
+/*******************************************************************
+ *
+ * @brief filling the DeleteItemList
+ *
+ * @details
+ *
+ *    Function : fillCellToDeleteItem 
+ *
+ *    Functionality: Filling the DeleteItemIe 
+ *
+ * @params[in] Pointer to Served_Cells_To_Delete_ItemIEs_t 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t fillCellToDeleteItem(struct Served_Cells_To_Delete_ItemIEs *deleteItemIe)
+{
+   Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
+   
+   deleteItemIe->id = ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
+   deleteItemIe->criticality = Criticality_reject;
+   deleteItemIe->value.present =\
+   Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
+   deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+
+   /*pLMN_Identity*/
+   deleteItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
+   DU_ALLOC(deleteItem->oldNRCGI.pLMN_Identity.buf,deleteItem->oldNRCGI.pLMN_Identity.size);
+   if(deleteItem->oldNRCGI.pLMN_Identity.buf == NULLP)
+   {
+      DU_LOG("ERROR  --> F1AP: fillCellToDeleteItem(): Failed to allocate the memory");
+      return RFAILED;
+   }
+   buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+         deleteItem->oldNRCGI.pLMN_Identity.buf);
+
+   /*nRCellIdentity*/
+   deleteItem->oldNRCGI.nRCellIdentity.size = 5*sizeof(uint8_t);
+   DU_ALLOC(deleteItem->oldNRCGI.nRCellIdentity.buf,\
+         deleteItem->oldNRCGI.nRCellIdentity.size);
+   if(deleteItem->oldNRCGI.nRCellIdentity.buf == NULLP)
+   {
+      DU_LOG("ERROR  --> F1AP: fillCellToDeleteItem(): Failed to allocate the memory");
+      return RFAILED;
+   }
+   fillBitString(&deleteItem->oldNRCGI.nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
+   return ROK;
+} 
+/*******************************************************************
+ *
+ * @brief Builds ServCellToDeleteList
+ *
+ * @details
+ *
+ *    Function : buildServCellToDeleteList
+ *
+ *    Functionality: Builds the serv cell to delete List
+ *
+ * @params[in] Pointer to Served_Cells_To_Delete_List_t *
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t buildServCellToDeleteList(Served_Cells_To_Delete_List_t *cellsToDelete)
+{
+   uint8_t ieListCnt, arrIdx;
+   
+   ieListCnt = 1;
+   cellsToDelete->list.count = ieListCnt;
+   cellsToDelete->list.size = ieListCnt*sizeof(Served_Cells_To_Delete_ItemIEs_t *);
+   
+   DU_ALLOC(cellsToDelete->list.array,cellsToDelete->list.size);
+   if(cellsToDelete->list.array == NULLP)
+   {
+      DU_LOG("\nERROR  --> F1AP : buildServCellToDeleteList(): Memory allocation failed");
+      return RFAILED;
+   }
+   
+   for(arrIdx=0; arrIdx< ieListCnt; arrIdx++)
+   {
+      DU_ALLOC(cellsToDelete->list.array[arrIdx],sizeof(Served_Cells_To_Delete_ItemIEs_t));
+      if(cellsToDelete->list.array[arrIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  --> F1AP : buildServCellToDeleteList(): Memory allocation failed");
+         return RFAILED;
+      }
+   }
+   
+   arrIdx=0;
+   if(fillCellToDeleteItem((Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx]) !=ROK)
+   {
+      DU_LOG("\nERROR  -->  F1AP: buildServCellToDeleteList(): failed to fill Served_Cells_To_Delete_ItemIEs");
+      return RFAILED;
+   }
+   return ROK;
+}
 
 /*******************************************************************
  *
@@ -2374,12 +2792,14 @@ uint8_t buildServCellToModList(Served_Cells_To_Modify_List_t *cellsToModify)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t BuildAndSendDUConfigUpdate()
+uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction)
 {
-   uint8_t ret, ieIdx, elementCnt;
+   uint8_t ret =0, ieIdx=0, elementCnt=0;
+   bool memAlloctionFailure = false;
    F1AP_PDU_t                 *f1apDuCfg = NULLP;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
    asn_enc_rval_t encRetVal;     /* Encoder return value */
+   
    memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
    ret= RFAILED;
 
@@ -2390,78 +2810,106 @@ uint8_t BuildAndSendDUConfigUpdate()
       DU_ALLOC(f1apDuCfg, sizeof(F1AP_PDU_t));
       if(f1apDuCfg == NULLP)
       {
-        DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation for F1AP-PDU failed");
+         break;
       }
 
       f1apDuCfg->present = F1AP_PDU_PR_initiatingMessage;
       DU_ALLOC(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
       if(f1apDuCfg->choice.initiatingMessage == NULLP)
       {
-        DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation for F1AP-PDU failed");
+         break;
       }
 
       f1apDuCfg->choice.initiatingMessage->procedureCode = \
-                                                          ProcedureCode_id_gNBDUConfigurationUpdate;
+                                                           ProcedureCode_id_gNBDUConfigurationUpdate;
       f1apDuCfg->choice.initiatingMessage->criticality = Criticality_reject;
       f1apDuCfg->choice.initiatingMessage->value.present = \
-                                                          InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
+                                                           InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
       duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
-                   choice.GNBDUConfigurationUpdate;
+                    choice.GNBDUConfigurationUpdate;
       elementCnt = 3;
       duCfgUpdate->protocolIEs.list.count = elementCnt;
       duCfgUpdate->protocolIEs.list.size = \
-                                          elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
+                                           elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
 
       /* Initialize the F1Setup members */
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
       if(duCfgUpdate->protocolIEs.list.array == NULLP)
       {
-        DU_LOG("ERROR  -->  F1AP : Memory allocation for F1RequestIEs failed");
-        break;
+         DU_LOG("ERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation failed");
+         break;
       }
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx],sizeof(GNBDUConfigurationUpdateIEs_t));
-        if(duCfgUpdate->protocolIEs.list.array[ieIdx] == NULLP)
-        {
-           break;
-        }
-      }
-
+         DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx],sizeof(GNBDUConfigurationUpdateIEs_t));
+         if(duCfgUpdate->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("ERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation failed");
+            memAlloctionFailure = true;
+            break;
+         }
+      }
+      
+      if(memAlloctionFailure == true)
+      {
+         break;
+      }
       /*TransactionID*/
       ieIdx = 0;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id=ProtocolIE_ID_id_TransactionID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-         GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
+      GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = TRANS_ID;
-
-      /*Served Cell to Modify */
+      
       ieIdx++;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
-                                                     ProtocolIE_ID_id_Served_Cells_To_Modify_List;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-        GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
-      if(buildServCellToModList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
-        Served_Cells_To_Modify_List))
-         break;
-
+      if(servCellAction == SERV_CELL_TO_MODIFY)
+      {
+         /*Served Cell to Modify */
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
+         ProtocolIE_ID_id_Served_Cells_To_Modify_List;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+         GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
+         if(buildServCellToModList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+                  Served_Cells_To_Modify_List))
+         {
+            DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): failed to build ServCellToModList");
+            break;
+         }
+      }
+      else
+      {
+         /*Served Cell to Delete */ 
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
+         ProtocolIE_ID_id_Served_Cells_To_Delete_List;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+         GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
+         if(buildServCellToDeleteList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+         Served_Cells_To_Delete_List)!=ROK)
+         {
+            DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): failed to build ServCellToDeleteList");
+            break;
+         }
+         
+      }
       // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
       /*GNB DU ID */
       ieIdx++;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-       GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
+      GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size = sizeof(uint8_t);
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
-           duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+            duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
       if(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == NULLP)
       {
-        break;
+         DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): Memory allocation failed for GNB_DU_ID");
+         break;
       }
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] = duCfgParam.duId;
 
@@ -2475,30 +2923,30 @@ uint8_t BuildAndSendDUConfigUpdate()
       /* Checking encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
       {
-        DU_LOG("ERROR  -->  F1AP : Could not encode DUConfigUpdate structure (at %s)\n",\
-        encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
-        break;
+         DU_LOG("ERROR  -->  F1AP : Could not encode DUConfigUpdate structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
       }
       else
       {
-        DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DUConfigUpdate\n");
-        for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
-        {
-           printf("%x",encBuf[ieIdx]);
-        }
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DUConfigUpdate\n");
+         for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
       }
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
-        DU_LOG("\nERROR  -->  F1AP : Sending GNB-DU Config Update failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : Sending GNB-DU Config Update failed");
+         break;
       }
 
       ret = ROK;
       break;
    }
-   FreeDUConfigUpdate(f1apDuCfg);
-
+  
+   addToReservedF1apPduList(TRANS_ID,f1apDuCfg);
    return ret;
 }
 
@@ -2692,7 +3140,7 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  ueCb, uint8_t lcId, \
       }
 
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL)        !=      ROK)
+      if(sendF1APMsg() !=      ROK)
       {
         DU_LOG("\nERROR  -->   F1AP : Sending  UL RRC Message Transfer Failed");
         break;
@@ -3192,7 +3640,7 @@ uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddMod
    coreset1StartPrb = coreset0EndPrb + 6;
    coreset1NumPrb = CORESET1_NUM_PRB;
    /* calculate the PRBs */
-   freqDomRscAllocType0(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
+   fillCoresetFeqDomAllocMap(((coreset1StartPrb)/6), (coreset1NumPrb/6), freqDomainResource);
    memcpy(controlRSet->frequencyDomainResources.buf, freqDomainResource, FREQ_DOM_RSRC_SIZE);
    controlRSet->frequencyDomainResources.bits_unused = bitsUnused;
 
@@ -3578,7 +4026,7 @@ uint8_t BuildTCIStatesToAddModList(struct PDSCH_Config__tci_StatesToAddModList *
       return RFAILED;
    }
 
-   elementCnt = 1;
+   elementCnt = 2;
    timeDomAllocList->choice.setup->list.count = elementCnt;
    timeDomAllocList->choice.setup->list.size = \
                                               elementCnt * sizeof(struct PDSCH_TimeDomainResourceAllocation *);
@@ -3606,12 +4054,29 @@ uint8_t BuildTCIStatesToAddModList(struct PDSCH_Config__tci_StatesToAddModList *
 
    idx = 0;
    timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
-
-   timeDomAlloc->k0 = NULLP;
+   DU_ALLOC(timeDomAlloc->k0, sizeof(long));
+   if(!timeDomAlloc->k0)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+      return RFAILED;
+   }
+   *(timeDomAlloc->k0) = 0;
    timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
    timeDomAlloc->startSymbolAndLength = \
                                        calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
 
+   idx++;
+   timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+   DU_ALLOC(timeDomAlloc->k0, sizeof(long));
+   if(!timeDomAlloc->k0)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPdschTimeDomAllocList");
+      return RFAILED;
+   }
+   *(timeDomAlloc->k0) = 1;
+   timeDomAlloc->mappingType = PDSCH_MAPPING_TYPE_A;
+   timeDomAlloc->startSymbolAndLength = calcSliv(PDSCH_START_SYMBOL, PDSCH_LENGTH_SYMBOL);
+
    return ROK;
 }
 
@@ -3919,7 +4384,7 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       return RFAILED;
    }
 
-   elementCnt = 1;
+   elementCnt = 2;
    timeDomAllocList->choice.setup->list.count = elementCnt;
    timeDomAllocList->choice.setup->list.size = \
                                               elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
@@ -3952,9 +4417,22 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
       return RFAILED;
    }
-   *(timeDomAlloc->k2) = PUSCH_K2;
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG1;
+   timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
+   timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+
+   idx++;
+   timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+   DU_ALLOC(timeDomAlloc->k2, sizeof(long));
+   if(!timeDomAlloc->k2)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+      return RFAILED;
+   }
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG2;
    timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
    timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+
    return ROK;
 }
 
@@ -4042,6 +4520,177 @@ uint8_t BuildBWPUlDedPuschCfg(PUSCH_Config_t *puschCfg)
    return ROK;
 }
 
+/*******************************************************************
+ *
+ * @brief Builds BWP UL dedicated PUCCH Config
+ *
+ * @details
+ *
+ *    Function : BuildBWPUlDedPucchCfg
+ *
+ *    Functionality:
+ *      Builds BWP UL dedicated PUCCH Config
+ *
+ * @params[in] : PUCCH_Config_t *pucchCfg
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildBWPUlDedPucchCfg(PUCCH_Config_t *pucchCfg)
+{
+   uint8_t arrIdx, elementCnt;
+   uint8_t rsrcIdx, rsrcSetIdx;
+   PUCCH_ResourceSet_t *rsrcSet = NULLP;
+   PUCCH_Resource_t *rsrc = NULLP;
+
+   //RESOURCE SET
+   elementCnt = 1;
+   DU_ALLOC(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList));
+   if(pucchCfg->resourceSetToAddModList == NULL)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+
+   pucchCfg->resourceSetToAddModList->list.count = elementCnt;
+   pucchCfg->resourceSetToAddModList->list.size = elementCnt * sizeof(PUCCH_ResourceSet_t *);
+   DU_ALLOC(pucchCfg->resourceSetToAddModList->list.array, pucchCfg->resourceSetToAddModList->list.size);
+   if(pucchCfg->resourceSetToAddModList->list.array == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   for(rsrcSetIdx=0; rsrcSetIdx < pucchCfg->resourceSetToAddModList->list.count; rsrcSetIdx++)
+   {
+      DU_ALLOC(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t));
+      if(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+         return RFAILED;
+      }
+   }
+   rsrcSetIdx = 0;
+   rsrcSet = pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx];
+   rsrcSet->pucch_ResourceSetId = 1;
+   elementCnt = 1;
+   rsrcSet->resourceList.list.count = elementCnt;
+   rsrcSet->resourceList.list.size = elementCnt * sizeof(PUCCH_ResourceId_t *);
+   DU_ALLOC(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size);
+   if(rsrcSet->resourceList.list.array == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++)
+   {
+      DU_ALLOC(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t));
+      if(rsrcSet->resourceList.list.array[rsrcIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+         return RFAILED;
+      }
+   }
+   rsrcIdx = 0;
+   *(rsrcSet->resourceList.list.array[rsrcIdx]) = 1;
+
+   //RESOURCE
+   elementCnt = 1;
+   DU_ALLOC(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList));
+   if(pucchCfg->resourceToAddModList == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   pucchCfg->resourceToAddModList->list.count = elementCnt;
+   pucchCfg->resourceToAddModList->list.size = elementCnt * sizeof(PUCCH_Resource_t *);
+   DU_ALLOC(pucchCfg->resourceToAddModList->list.array, pucchCfg->resourceToAddModList->list.size);
+   if(pucchCfg->resourceToAddModList->list.array == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   for(rsrcIdx=0; rsrcIdx < pucchCfg->resourceToAddModList->list.count; rsrcIdx++)
+   {
+      DU_ALLOC(pucchCfg->resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t));
+      if(pucchCfg->resourceToAddModList->list.array[rsrcIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+         return RFAILED;
+      }
+   }
+   rsrcIdx = 0;
+   rsrc = pucchCfg->resourceToAddModList->list.array[rsrcIdx];
+   rsrc->pucch_ResourceId = 1;
+   rsrc->startingPRB = 0;
+   rsrc->format.present = PUCCH_Resource__format_PR_format1; 
+   DU_ALLOC(rsrc->format.choice.format1, sizeof(PUCCH_format1_t));
+   if(rsrc->format.choice.format1 == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   rsrc->format.choice.format1->initialCyclicShift = 0;
+   rsrc->format.choice.format1->nrofSymbols = 4;
+   rsrc->format.choice.format1->startingSymbolIndex = 0;
+   rsrc->format.choice.format1->timeDomainOCC = 0;
+
+   //PUCCH Format 1
+   DU_ALLOC(pucchCfg->format1, sizeof(struct PUCCH_Config__format1));
+   if(pucchCfg->format1 == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   pucchCfg->format1->present = PUCCH_Config__format1_PR_setup;
+   DU_ALLOC(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t));
+   if(pucchCfg->format1->choice.setup == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   DU_ALLOC(pucchCfg->format1->choice.setup->nrofSlots, sizeof(long));
+   if(pucchCfg->format1->choice.setup->nrofSlots == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   *(pucchCfg->format1->choice.setup->nrofSlots) = PUCCH_FormatConfig__nrofSlots_n4;
+
+   //DL DATA TO UL ACK
+   DU_ALLOC(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
+   if(pucchCfg->dl_DataToUL_ACK == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }
+   
+   elementCnt = 2;
+   pucchCfg->dl_DataToUL_ACK->list.count = elementCnt;
+   pucchCfg->dl_DataToUL_ACK->list.size = elementCnt * sizeof(long *);
+   DU_ALLOC(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size);
+   if(pucchCfg->dl_DataToUL_ACK->list.array == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+      return RFAILED;
+   }   
+
+   for(arrIdx = 0; arrIdx <  pucchCfg->dl_DataToUL_ACK->list.count; arrIdx++)
+   {
+      DU_ALLOC(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx], sizeof(long));
+      if(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx] == NULLP)
+      {
+          DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildBWPUlDedPucchCfg");
+          return RFAILED;
+      }   
+   }
+   
+   arrIdx = 0;
+   *(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx++]) = 1;
+   *(pucchCfg->dl_DataToUL_ACK->list.array[arrIdx]) = 2;
+   return ROK;
+}
+
 /*******************************************************************
  *
  * @brief Fills SRS resource to add/modify list 
@@ -4376,6 +5025,26 @@ uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *pusch
 uint8_t BuildInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
 {
    ulBwp->pucch_Config = NULLP;
+   DU_ALLOC(ulBwp->pucch_Config, sizeof(struct BWP_UplinkDedicated__pucch_Config));
+   if(!ulBwp->pucch_Config)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildInitialUlBWP");
+      return RFAILED;
+   }
+
+   ulBwp->pucch_Config->present = BWP_UplinkDedicated__pucch_Config_PR_setup;
+   ulBwp->pucch_Config->choice.setup = NULLP;
+   DU_ALLOC(ulBwp->pucch_Config->choice.setup, sizeof(PUCCH_Config_t));
+   if(!ulBwp->pucch_Config->choice.setup)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildInitialUlBWP");
+      return RFAILED;
+   }
+
+   if(BuildBWPUlDedPucchCfg(ulBwp->pucch_Config->choice.setup) != ROK)
+   {
+      return RFAILED;
+   }
 
    /* Fill BWP UL dedicated PUSCH config */
    ulBwp->pusch_Config = NULLP;
@@ -4923,7 +5592,7 @@ void FreeSearchSpcToAddModList(struct PDCCH_Config__searchSpacesToAddModList *se
  *
  * @return void
  *
4221 * ****************************************************************/
+ * ****************************************************************/
 void FreePdschTimeDomAllocList( struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAllocList)
 {
    uint8_t idx1=0;
@@ -4932,16 +5601,17 @@ void FreePdschTimeDomAllocList( struct PDSCH_Config__pdsch_TimeDomainAllocationL
    {
       if(timeDomAllocList->choice.setup->list.array)
       {
-        for(idx1 = 0; idx1 <timeDomAllocList->choice.setup->list.count ; idx1++)
-        {
-           DU_FREE(timeDomAllocList->choice.setup->list.array[idx1],
-                 sizeof(struct PDSCH_TimeDomainResourceAllocation));
-        }
-        DU_FREE(timeDomAllocList->choice.setup->list.array, \
-              timeDomAllocList->choice.setup->list.size);
+         for(idx1 = 0; idx1 <timeDomAllocList->choice.setup->list.count ; idx1++)
+         {
+            DU_FREE(timeDomAllocList->choice.setup->list.array[idx1]->k0, sizeof(long));
+            DU_FREE(timeDomAllocList->choice.setup->list.array[idx1],
+                  sizeof(struct PDSCH_TimeDomainResourceAllocation));
+         }
+         DU_FREE(timeDomAllocList->choice.setup->list.array, \
+               timeDomAllocList->choice.setup->list.size);
       }
       DU_FREE(timeDomAllocList->choice.setup,\
-           sizeof(struct PDSCH_TimeDomainResourceAllocationList));
+            sizeof(struct PDSCH_TimeDomainResourceAllocationList));
    }
 }
 /*******************************************************************
@@ -4961,8 +5631,7 @@ void FreePdschTimeDomAllocList( struct PDSCH_Config__pdsch_TimeDomainAllocationL
  * ****************************************************************/
 void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg)
 {
-   uint8_t idx1=0;
-   uint8_t idx2=0;
+   uint8_t rsrcListIdx=0;
    struct PUSCH_Config__pusch_TimeDomainAllocationList *timeDomAllocList_t=NULLP;
 
    if(puschCfg->pusch_TimeDomainAllocationList)
@@ -4970,26 +5639,125 @@ void FreePuschTimeDomAllocList(PUSCH_Config_t *puschCfg)
       timeDomAllocList_t=puschCfg->pusch_TimeDomainAllocationList;
       if(timeDomAllocList_t->choice.setup)
       {
-        if(timeDomAllocList_t->choice.setup->list.array)
-        {
-           DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx2]->k2, sizeof(long));
-           for(idx1 = 0; idx1<timeDomAllocList_t->choice.setup->list.count; idx1++)
-           {
-              DU_FREE(timeDomAllocList_t->choice.setup->list.array[idx1],\
-                    sizeof(PUSCH_TimeDomainResourceAllocation_t));
-           }
-           DU_FREE(timeDomAllocList_t->choice.setup->list.array, \
-                 timeDomAllocList_t->choice.setup->list.size);
-        }
-        DU_FREE(timeDomAllocList_t->choice.setup, \
-              sizeof(struct PUSCH_TimeDomainResourceAllocationList));
+         if(timeDomAllocList_t->choice.setup->list.array)
+         {
+            for(rsrcListIdx = 0; rsrcListIdx<timeDomAllocList_t->choice.setup->list.count; rsrcListIdx++)
+            {
+               DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx]->k2, sizeof(long));
+               DU_FREE(timeDomAllocList_t->choice.setup->list.array[rsrcListIdx],\
+                     sizeof(PUSCH_TimeDomainResourceAllocation_t));
+            }
+            DU_FREE(timeDomAllocList_t->choice.setup->list.array, \
+                  timeDomAllocList_t->choice.setup->list.size);
+         }
+         DU_FREE(timeDomAllocList_t->choice.setup, \
+               sizeof(struct PUSCH_TimeDomainResourceAllocationList));
       }
       DU_FREE(puschCfg->transformPrecoder, sizeof(long));
       DU_FREE(puschCfg->pusch_TimeDomainAllocationList, \
-           sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
+            sizeof(struct PUSCH_Config__pusch_TimeDomainAllocationList));
    }
 
 }
+
+/*******************************************************************
+ *
+ * @brief Frees memory allocated for Dedicated PUCCH config
+ *
+ * @details
+ *
+ *    Function : FreeBWPUlDedPucchCfg
+ *
+ *    Functionality: Deallocating memory of Dedicated PUCCH cfg
+ *
+ * @params[in] BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void FreeBWPUlDedPucchCfg(struct BWP_UplinkDedicated__pucch_Config *ulBwpPucchCfg)
+{
+   uint8_t k1Idx, rsrcIdx, rsrcSetIdx;
+   PUCCH_Config_t *pucchCfg = NULLP;
+   PUCCH_ResourceSet_t *rsrcSet = NULLP;
+   PUCCH_Resource_t *rsrc = NULLP;
+
+   if(ulBwpPucchCfg)
+   {
+      if(ulBwpPucchCfg->choice.setup)
+      {
+         pucchCfg = ulBwpPucchCfg->choice.setup;
+
+         //Free resource set list
+         if(pucchCfg->resourceSetToAddModList)
+         {
+            if(pucchCfg->resourceSetToAddModList->list.array)
+            {
+               for(rsrcSetIdx=0; rsrcSetIdx < pucchCfg->resourceSetToAddModList->list.count; rsrcSetIdx++)
+               {
+                  rsrcSet = pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx];
+                  if(rsrcSet->resourceList.list.array)
+                  {
+                     for(rsrcIdx=0; rsrcIdx < rsrcSet->resourceList.list.count; rsrcIdx++)
+                     {
+                        DU_FREE(rsrcSet->resourceList.list.array[rsrcIdx], sizeof(PUCCH_ResourceId_t));
+                     }
+                     DU_FREE(rsrcSet->resourceList.list.array, rsrcSet->resourceList.list.size);
+                  }
+                  DU_FREE(pucchCfg->resourceSetToAddModList->list.array[rsrcSetIdx], sizeof(PUCCH_ResourceSet_t));
+               }
+               DU_FREE(pucchCfg->resourceSetToAddModList->list.array, pucchCfg->resourceSetToAddModList->list.size);
+            }
+            DU_FREE(pucchCfg->resourceSetToAddModList, sizeof(struct PUCCH_Config__resourceSetToAddModList));
+         }
+
+         //Free resource list
+         if(pucchCfg->resourceToAddModList)
+         {
+            if(pucchCfg->resourceToAddModList->list.array)
+            {
+               for(rsrcIdx=0; rsrcIdx < pucchCfg->resourceToAddModList->list.count; rsrcIdx++)
+               {
+                  rsrc = pucchCfg->resourceToAddModList->list.array[rsrcIdx];
+                  DU_FREE(rsrc->format.choice.format1, sizeof(PUCCH_format1_t));
+                  DU_FREE(pucchCfg->resourceToAddModList->list.array[rsrcIdx], sizeof(PUCCH_Resource_t));
+               }
+               DU_FREE(pucchCfg->resourceToAddModList->list.array, pucchCfg->resourceToAddModList->list.size);
+            }
+            DU_FREE(pucchCfg->resourceToAddModList, sizeof(struct PUCCH_Config__resourceToAddModList));
+         }
+
+         //PUCCH Format 1
+         if(pucchCfg->format1)
+         {
+            if(pucchCfg->format1->choice.setup)
+            {
+               DU_FREE(pucchCfg->format1->choice.setup->nrofSlots, sizeof(long));
+               DU_FREE(pucchCfg->format1->choice.setup, sizeof(PUCCH_FormatConfig_t));
+            }
+            DU_FREE(pucchCfg->format1, sizeof(struct PUCCH_Config__format1));
+         }
+         
+         //DL DATA TO UL ACK
+         if(pucchCfg->dl_DataToUL_ACK)
+         {
+            if(pucchCfg->dl_DataToUL_ACK->list.array)
+            {
+               for(k1Idx = 0; k1Idx <  pucchCfg->dl_DataToUL_ACK->list.count; k1Idx++)
+               {
+                  DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array[k1Idx], sizeof(long));
+               }
+               DU_FREE(pucchCfg->dl_DataToUL_ACK->list.array, pucchCfg->dl_DataToUL_ACK->list.size);
+            }
+            DU_FREE(pucchCfg->dl_DataToUL_ACK, sizeof(struct PUCCH_Config__dl_DataToUL_ACK));
+         }
+
+         DU_FREE(ulBwpPucchCfg->choice.setup, sizeof(PUCCH_Config_t));
+      }
+      DU_FREE(ulBwpPucchCfg, sizeof(struct BWP_UplinkDedicated__pucch_Config));
+   }
+}
+
 /*******************************************************************
  *
  * @brief Frees memory allocated for InitialUlBWP
@@ -5015,114 +5783,116 @@ void FreeInitialUlBWP(BWP_UplinkDedicated_t *ulBwp)
    struct SRS_ResourceSet__srs_ResourceIdList *rsrcIdList = NULLP;
    struct SRS_Config__srs_ResourceToAddModList *resourceList = NULLP;
 
+   FreeBWPUlDedPucchCfg(ulBwp->pucch_Config);
+
    if(ulBwp->pusch_Config)
    {
       if(ulBwp->pusch_Config->choice.setup)
       {
-        puschCfg=ulBwp->pusch_Config->choice.setup;
-        if(puschCfg->dataScramblingIdentityPUSCH)
-        {
-           if(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA)
-           {
-              FreePuschTimeDomAllocList(puschCfg);
-              dmrsUlCfg=puschCfg->dmrs_UplinkForPUSCH_MappingTypeA;
-              if(dmrsUlCfg->choice.setup)
-              {
-                 if(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition)
-                 {
-                    if(dmrsUlCfg->choice.setup->transformPrecodingDisabled)
-                    {
-                       DU_FREE(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0,\
-                             sizeof(long));
-                       DU_FREE(dmrsUlCfg->choice.setup->transformPrecodingDisabled,
-                             sizeof(struct DMRS_UplinkConfig__transformPrecodingDisabled));
-                    }
-                    DU_FREE(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition,
-                          sizeof(long));
-                 }
-                 DU_FREE(dmrsUlCfg->choice.setup,sizeof(DMRS_UplinkConfig_t));
-              }
-              DU_FREE(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA, \
-                    sizeof(struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA));
-           }
-           DU_FREE(puschCfg->dataScramblingIdentityPUSCH, sizeof(long));
-        }
-        DU_FREE(ulBwp->pusch_Config->choice.setup, sizeof(PUSCH_Config_t));
+         puschCfg=ulBwp->pusch_Config->choice.setup;
+         if(puschCfg->dataScramblingIdentityPUSCH)
+         {
+            if(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA)
+            {
+               FreePuschTimeDomAllocList(puschCfg);
+               dmrsUlCfg=puschCfg->dmrs_UplinkForPUSCH_MappingTypeA;
+               if(dmrsUlCfg->choice.setup)
+               {
+                  if(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition)
+                  {
+                     if(dmrsUlCfg->choice.setup->transformPrecodingDisabled)
+                     {
+                        DU_FREE(dmrsUlCfg->choice.setup->transformPrecodingDisabled->scramblingID0,\
+                              sizeof(long));
+                        DU_FREE(dmrsUlCfg->choice.setup->transformPrecodingDisabled,
+                              sizeof(struct DMRS_UplinkConfig__transformPrecodingDisabled));
+                     }
+                     DU_FREE(dmrsUlCfg->choice.setup->dmrs_AdditionalPosition,
+                           sizeof(long));
+                  }
+                  DU_FREE(dmrsUlCfg->choice.setup,sizeof(DMRS_UplinkConfig_t));
+               }
+               DU_FREE(puschCfg->dmrs_UplinkForPUSCH_MappingTypeA, \
+                     sizeof(struct PUSCH_Config__dmrs_UplinkForPUSCH_MappingTypeA));
+            }
+            DU_FREE(puschCfg->dataScramblingIdentityPUSCH, sizeof(long));
+         }
+         DU_FREE(ulBwp->pusch_Config->choice.setup, sizeof(PUSCH_Config_t));
       }
       DU_FREE(ulBwp->pusch_Config, sizeof(struct BWP_UplinkDedicated__pusch_Config));
 
       /* Free SRS-Config */
       if(ulBwp->srs_Config)
       {
-        if(ulBwp->srs_Config->choice.setup)
-        {
-           srsCfg = ulBwp->srs_Config->choice.setup;
+         if(ulBwp->srs_Config->choice.setup)
+         {
+            srsCfg = ulBwp->srs_Config->choice.setup;
 
-           /* Free Resource Set to add/mod list */
-           if(srsCfg->srs_ResourceSetToAddModList)
-           {
-              rsrcSetList = srsCfg->srs_ResourceSetToAddModList;
-              if(rsrcSetList->list.array)
-              {
-                 rSetIdx = 0;
+            /* Free Resource Set to add/mod list */
+            if(srsCfg->srs_ResourceSetToAddModList)
+            {
+               rsrcSetList = srsCfg->srs_ResourceSetToAddModList;
+               if(rsrcSetList->list.array)
+               {
+                  rSetIdx = 0;
 
-                 /* Free SRS resource Id list in this SRS resource set */
-                 if(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
-                 {
-                    rsrcIdList = rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList;
+                  /* Free SRS resource Id list in this SRS resource set */
+                  if(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList)
+                  {
+                     rsrcIdList = rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList;
 
-                    if(rsrcIdList->list.array)
-                    {
-                       for(rsrcIdx = 0; rsrcIdx < rsrcIdList->list.count; rsrcIdx++)
-                       {
-                          DU_FREE(rsrcIdList->list.array[rsrcIdx], sizeof(SRS_ResourceId_t));
-                       }
-                       DU_FREE(rsrcIdList->list.array, rsrcIdList->list.size);
-                    }
-                    DU_FREE(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList,\
-                          sizeof(struct SRS_ResourceSet__srs_ResourceIdList));
-                 }
+                     if(rsrcIdList->list.array)
+                     {
+                        for(rsrcIdx = 0; rsrcIdx < rsrcIdList->list.count; rsrcIdx++)
+                        {
+                           DU_FREE(rsrcIdList->list.array[rsrcIdx], sizeof(SRS_ResourceId_t));
+                        }
+                        DU_FREE(rsrcIdList->list.array, rsrcIdList->list.size);
+                     }
+                     DU_FREE(rsrcSetList->list.array[rSetIdx]->srs_ResourceIdList,\
+                           sizeof(struct SRS_ResourceSet__srs_ResourceIdList));
+                  }
 
-                 /* Free resource type info for this SRS resource set */
-                 DU_FREE(rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic, \
-                       sizeof(struct SRS_ResourceSet__resourceType__aperiodic));
+                  /* Free resource type info for this SRS resource set */
+                  DU_FREE(rsrcSetList->list.array[rSetIdx]->resourceType.choice.aperiodic, \
+                        sizeof(struct SRS_ResourceSet__resourceType__aperiodic));
 
-                 /* Free memory for each resource set */
-                 for(rSetIdx = 0; rSetIdx < rsrcSetList->list.count; rSetIdx++)
-                 {
-                    DU_FREE(rsrcSetList->list.array[rSetIdx], sizeof(SRS_ResourceSet_t));
-                 }
-                 DU_FREE(rsrcSetList->list.array, rsrcSetList->list.size); 
-              }
-              DU_FREE(srsCfg->srs_ResourceSetToAddModList, \
-                    sizeof(struct SRS_Config__srs_ResourceSetToAddModList));
-           }
+                  /* Free memory for each resource set */
+                  for(rSetIdx = 0; rSetIdx < rsrcSetList->list.count; rSetIdx++)
+                  {
+                     DU_FREE(rsrcSetList->list.array[rSetIdx], sizeof(SRS_ResourceSet_t));
+                  }
+                  DU_FREE(rsrcSetList->list.array, rsrcSetList->list.size); 
+               }
+               DU_FREE(srsCfg->srs_ResourceSetToAddModList, \
+                     sizeof(struct SRS_Config__srs_ResourceSetToAddModList));
+            }
 
-           /* Free resource to add/modd list */
-           if(srsCfg->srs_ResourceToAddModList)
-           {
-              resourceList = srsCfg->srs_ResourceToAddModList;
-              if(resourceList->list.array)
-              {
-                 rsrcIdx = 0;
-                 DU_FREE(resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2,\
-                       sizeof(struct SRS_Resource__transmissionComb__n2));
-                 DU_FREE(resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic,\
-                       sizeof(struct SRS_Resource__resourceType__aperiodic));
+            /* Free resource to add/modd list */
+            if(srsCfg->srs_ResourceToAddModList)
+            {
+               resourceList = srsCfg->srs_ResourceToAddModList;
+               if(resourceList->list.array)
+               {
+                  rsrcIdx = 0;
+                  DU_FREE(resourceList->list.array[rsrcIdx]->transmissionComb.choice.n2,\
+                        sizeof(struct SRS_Resource__transmissionComb__n2));
+                  DU_FREE(resourceList->list.array[rsrcIdx]->resourceType.choice.aperiodic,\
+                        sizeof(struct SRS_Resource__resourceType__aperiodic));
 
-                 for(rsrcIdx = 0; rsrcIdx < resourceList->list.count; rsrcIdx++)
-                 {
-                    DU_FREE(resourceList->list.array[rsrcIdx], sizeof(SRS_Resource_t));
-                 }
-                 DU_FREE(resourceList->list.array, resourceList->list.size);
-              }
-              DU_FREE(srsCfg->srs_ResourceToAddModList, \
-                    sizeof(struct SRS_Config__srs_ResourceToAddModList));
-           }
+                  for(rsrcIdx = 0; rsrcIdx < resourceList->list.count; rsrcIdx++)
+                  {
+                     DU_FREE(resourceList->list.array[rsrcIdx], sizeof(SRS_Resource_t));
+                  }
+                  DU_FREE(resourceList->list.array, resourceList->list.size);
+               }
+               DU_FREE(srsCfg->srs_ResourceToAddModList, \
+                     sizeof(struct SRS_Config__srs_ResourceToAddModList));
+            }
 
-           DU_FREE(ulBwp->srs_Config->choice.setup, sizeof(SRS_Config_t));
-        }
-        DU_FREE(ulBwp->srs_Config, sizeof(struct BWP_UplinkDedicated__srs_Config));
+            DU_FREE(ulBwp->srs_Config->choice.setup, sizeof(SRS_Config_t));
+         }
+         DU_FREE(ulBwp->srs_Config, sizeof(struct BWP_UplinkDedicated__srs_Config));
       }
    }
 }      
@@ -5334,37 +6104,37 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
    {
       if(rlcBearerList->list.array)
       {
-        for(idx=0; idx<rlcBearerList->list.count; idx++)
-        {
-           if(rlcBearerList->list.array[idx])
-           {  
-              rlcConfig   = rlcBearerList->list.array[idx]->rlc_Config;
-              macLcConfig = rlcBearerList->list.array[idx]->mac_LogicalChannelConfig;
-              if(rlcConfig)
-              {
-                 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));
-                 }     
-                 DU_FREE(rlcConfig, sizeof(struct RLC_Config));
-              }
-              DU_FREE(rlcBearerList->list.array[idx]->servedRadioBearer, sizeof(struct RLC_BearerConfig__servedRadioBearer));
-              if(macLcConfig)
-              {
-                 if(macLcConfig->ul_SpecificParameters)
-                 {
-                    DU_FREE(macLcConfig->ul_SpecificParameters->schedulingRequestID,   sizeof(SchedulingRequestId_t));
-                    DU_FREE(macLcConfig->ul_SpecificParameters->logicalChannelGroup,   sizeof(long));
-                    DU_FREE(macLcConfig->ul_SpecificParameters, sizeof(struct LogicalChannelConfig__ul_SpecificParameters));
-                 }
-                 DU_FREE(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, sizeof(struct LogicalChannelConfig));
-              }
-              DU_FREE(rlcBearerList->list.array[idx], sizeof(struct RLC_BearerConfig));
-           }   
-        }
-        DU_FREE(rlcBearerList->list.array, rlcBearerList->list.size);
+         for(idx=0; idx<rlcBearerList->list.count; idx++)
+         {
+            if(rlcBearerList->list.array[idx])
+            {  
+               rlcConfig   = rlcBearerList->list.array[idx]->rlc_Config;
+               macLcConfig = rlcBearerList->list.array[idx]->mac_LogicalChannelConfig;
+               if(rlcConfig)
+               {
+                  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));
+                  }    
+                  DU_FREE(rlcConfig, sizeof(struct RLC_Config));
+               }
+               DU_FREE(rlcBearerList->list.array[idx]->servedRadioBearer, sizeof(struct RLC_BearerConfig__servedRadioBearer));
+               if(macLcConfig)
+               {
+                  if(macLcConfig->ul_SpecificParameters)
+                  {
+                     DU_FREE(macLcConfig->ul_SpecificParameters->schedulingRequestID,  sizeof(SchedulingRequestId_t));
+                     DU_FREE(macLcConfig->ul_SpecificParameters->logicalChannelGroup,  sizeof(long));
+                     DU_FREE(macLcConfig->ul_SpecificParameters, sizeof(struct LogicalChannelConfig__ul_SpecificParameters));
+                  }
+                  DU_FREE(rlcBearerList->list.array[idx]->mac_LogicalChannelConfig, sizeof(struct LogicalChannelConfig));
+               }
+               DU_FREE(rlcBearerList->list.array[idx], sizeof(struct RLC_BearerConfig));
+            }  
+         }
+         DU_FREE(rlcBearerList->list.array, rlcBearerList->list.size);
       }
       DU_FREE(cellGrpCfg->rlc_BearerToAddModList, sizeof(struct CellGroupConfigRrc__rlc_BearerToAddModList));
    }
@@ -5375,53 +6145,53 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
       schedulingRequestConfig = macCellGrpCfg->schedulingRequestConfig; 
       if(schedulingRequestConfig)
       {
-        schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
-        if(schReqList)
-        {
-           if(schReqList->list.array)
-           {
-              for(idx=0;idx<schReqList->list.count; idx++)
-              {
-                 if(schReqList->list.array[idx])
-                 {
-                    DU_FREE(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long));
-                    DU_FREE(schReqList->list.array[idx], sizeof(struct SchedulingRequestToAddMod));
-                 }
-              }
-              DU_FREE(schReqList->list.array, schReqList->list.size);
-           }
-           DU_FREE(schedulingRequestConfig->schedulingRequestToAddModList,\
-                 sizeof(struct SchedulingRequestConfig__schedulingRequestToAddModList));    }
-           DU_FREE(macCellGrpCfg->schedulingRequestConfig, sizeof(struct SchedulingRequestConfig));
+         schReqList = schedulingRequestConfig->schedulingRequestToAddModList;
+         if(schReqList)
+         {
+            if(schReqList->list.array)
+            {
+               for(idx=0;idx<schReqList->list.count; idx++)
+               {
+                  if(schReqList->list.array[idx])
+                  {
+                     DU_FREE(schReqList->list.array[idx]->sr_ProhibitTimer, sizeof(long));
+                     DU_FREE(schReqList->list.array[idx], sizeof(struct SchedulingRequestToAddMod));
+                  }
+               }
+               DU_FREE(schReqList->list.array, schReqList->list.size);
+            }
+            DU_FREE(schedulingRequestConfig->schedulingRequestToAddModList,\
+                  sizeof(struct SchedulingRequestConfig__schedulingRequestToAddModList));    }
+            DU_FREE(macCellGrpCfg->schedulingRequestConfig, sizeof(struct SchedulingRequestConfig));
       }
       if(macCellGrpCfg->bsr_Config)
       {
-        DU_FREE(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
+         DU_FREE(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
       }
       tagConfig = macCellGrpCfg->tag_Config;
       if(tagConfig)
       {
-        tagList = tagConfig->tag_ToAddModList;
-        if(tagList)
-        {
-           if(tagList->list.array)
-           {
-              for(idx=0; idx<tagList->list.count; idx++)
-              {
-                 DU_FREE(tagList->list.array[idx], sizeof(struct TAG));
-              }
-              DU_FREE(tagList->list.array, tagList->list.size);
-           }
-           DU_FREE(tagConfig->tag_ToAddModList, sizeof(struct TAG_Config__tag_ToAddModList));
-        }
-        DU_FREE(tagConfig, sizeof(struct TAG_Config));
+         tagList = tagConfig->tag_ToAddModList;
+         if(tagList)
+         {
+            if(tagList->list.array)
+            {
+               for(idx=0; idx<tagList->list.count; idx++)
+               {
+                  DU_FREE(tagList->list.array[idx], sizeof(struct TAG));
+               }
+               DU_FREE(tagList->list.array, tagList->list.size);
+            }
+            DU_FREE(tagConfig->tag_ToAddModList, sizeof(struct TAG_Config__tag_ToAddModList));
+         }
+         DU_FREE(tagConfig, sizeof(struct TAG_Config));
       }
 
       phrConfig = macCellGrpCfg->phr_Config;
       if(phrConfig)
       {
-        DU_FREE(phrConfig->choice.setup, sizeof(struct PHR_Config));
-        DU_FREE(phrConfig, sizeof(struct MAC_CellGroupConfig__phr_Config));
+         DU_FREE(phrConfig->choice.setup, sizeof(struct PHR_Config));
+         DU_FREE(phrConfig, sizeof(struct MAC_CellGroupConfig__phr_Config));
       }
 
       DU_FREE(macCellGrpCfg, sizeof(MAC_CellGroupConfig_t));
@@ -5439,59 +6209,59 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
    {
       if(spCellCfg->servCellIndex)
       {
-        if(spCellCfg->rlmInSyncOutOfSyncThreshold)
-        {
-           if(spCellCfg->spCellConfigDedicated)
-           {
-              srvCellCfg = spCellCfg->spCellConfigDedicated;
-              if(srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
-              {
-                 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)
-                                {
-                                   DU_FREE(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH,sizeof(long));
-                                   DU_FREE(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
-                                }
-                                DU_FREE(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct
-                                      ServingCellConfig__pdsch_ServingCellConfig));
-                             }  
-                             FreeinitialUplinkBWP(srvCellCfg->uplinkConfig);
-                             DU_FREE(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));        
-                          }
-                          DU_FREE(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
-                       }
-                       DU_FREE(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
-                    }
-                    if(dlBwp->pdcch_Config)
-                    {
-                       if(dlBwp->pdsch_Config)
-                       {
-                          FreeBWPDlDedPdschCfg(dlBwp);
-                          DU_FREE(dlBwp->pdsch_Config, sizeof(struct BWP_DownlinkDedicated__pdsch_Config));
-                       }
-                       FreeBWPDlDedPdcchCfg(dlBwp);
-                       DU_FREE(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
-                   }
-                   DU_FREE(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
-                 }
-                 DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
-              }
-              DU_FREE(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
-           }
-           DU_FREE(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
-        }
-        DU_FREE(spCellCfg->servCellIndex, sizeof(long));
+         if(spCellCfg->rlmInSyncOutOfSyncThreshold)
+         {
+            if(spCellCfg->spCellConfigDedicated)
+            {
+               srvCellCfg = spCellCfg->spCellConfigDedicated;
+               if(srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
+               {
+                  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)
+                                 {
+                                    DU_FREE(pdschCfg->choice.setup->nrofHARQ_ProcessesForPDSCH,sizeof(long));
+                                    DU_FREE(pdschCfg->choice.setup, sizeof( struct PDSCH_ServingCellConfig));
+                                 }
+                                 DU_FREE(srvCellCfg->pdsch_ServingCellConfig, sizeof(struct
+                                          ServingCellConfig__pdsch_ServingCellConfig));
+                              }  
+                              FreeinitialUplinkBWP(srvCellCfg->uplinkConfig);
+                              DU_FREE(srvCellCfg->uplinkConfig, sizeof(UplinkConfig_t));       
+                           }
+                           DU_FREE(srvCellCfg->defaultDownlinkBWP_Id, sizeof(long));
+                        }
+                        DU_FREE(srvCellCfg->firstActiveDownlinkBWP_Id, sizeof(long));
+                     }
+                     if(dlBwp->pdcch_Config)
+                     {
+                        if(dlBwp->pdsch_Config)
+                        {
+                           FreeBWPDlDedPdschCfg(dlBwp);
+                           DU_FREE(dlBwp->pdsch_Config, sizeof(struct BWP_DownlinkDedicated__pdsch_Config));
+                        }
+                        FreeBWPDlDedPdcchCfg(dlBwp);
+                        DU_FREE(dlBwp->pdcch_Config, sizeof(struct BWP_DownlinkDedicated__pdcch_Config));
+                     }
+                     DU_FREE(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
+                  }
+                  DU_FREE(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
+               }
+               DU_FREE(spCellCfg->spCellConfigDedicated, sizeof(ServingCellConfig_t));
+            }
+            DU_FREE(spCellCfg->rlmInSyncOutOfSyncThreshold, sizeof(long));
+         }
+         DU_FREE(spCellCfg->servCellIndex, sizeof(long));
       }
       DU_FREE(spCellCfg,sizeof(SpCellConfig_t));
    }
@@ -5889,7 +6659,7 @@ uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti
         }
       }
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending Initial UL RRC Message Transfer Failed");
         ret = RFAILED;
@@ -5947,48 +6717,45 @@ void freeRlcLcCfg(RlcBearerCfg *lcCfg)
    switch(lcCfg->rlcMode)
    {
       case RLC_AM :
-      {
-         if(lcCfg->u.amCfg)
-        {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
-            lcCfg->u.amCfg = NULLP;
-        }
-         break;
-      }
+         {
+            if(lcCfg->u.amCfg)
+            {
+               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));
-           lcCfg->u.umBiDirCfg = NULLP;
+         {
+            if(lcCfg->u.umBiDirCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
+            }
+            break;
          }
-         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));
-           lcCfg->u.umUniDirUlCfg = NULLP;
-        }
-         break;
+         {
+            if(lcCfg->u.umUniDirUlCfg)
+            {
+               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));
-           lcCfg->u.umUniDirDlCfg = NULLP;
+         {
+            if(lcCfg->u.umUniDirDlCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
+            }
+            break;
          }
-         break;
-      }
       default:
          DU_LOG("\nERROR  -->  DU_APP: Invalid Rlc Mode %d at freeRlcLcCfg()", lcCfg->rlcMode);
-        break;
+         break;
    }
-   memset(lcCfg, 0, sizeof(LcCfg));
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai));
 }
+
 /*******************************************************************
  *
  * @brief Function to free MacLcCfg
@@ -6010,15 +6777,12 @@ void  freeMacLcCfg(LcCfg *lcCfg)
    if(lcCfg->drbQos)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
-      lcCfg->drbQos = NULLP;
    }
    /* Deleting SNSSAI */
    if(lcCfg->snssai)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai));
-      lcCfg->snssai = NULLP;
    }
-   memset(lcCfg, 0, sizeof(LcCfg));
 }
 /*******************************************************************
  *
@@ -6745,7 +7509,6 @@ void freeDuUeCfg(DuUeCfg *ueCfg)
    }
    if(ueCfg->ambrCfg)
    {
-      memset(ueCfg->ambrCfg, 0, sizeof(AmbrCfg));
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
    }
    for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
@@ -6756,6 +7519,10 @@ void freeDuUeCfg(DuUeCfg *ueCfg)
    {
       freeMacLcCfg(&ueCfg->macLcCfg[lcIdx]);
    }
+   for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++)
+   {
+      DU_FREE(ueCfg->upTnlInfo[lcIdx].tnlCfg1, sizeof(GtpTnlCfg));
+   }
 }
 
 /*******************************************************************
@@ -6780,10 +7547,10 @@ void freeF1UeDb(F1UeContextSetupDb *f1UeDb)
    {
       if(f1UeDb->dlRrcMsg->rrcMsgPdu)
       {
-         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\
-           f1UeDb->dlRrcMsg->rrcMsgPdu, f1UeDb->dlRrcMsg->rrcMsgSize);
+        //DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\
+              f1UeDb->dlRrcMsg->rrcMsgPdu, f1UeDb->dlRrcMsg->rrcMsgSize);
       }
-      memset(f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
    }
    freeDuUeCfg(&f1UeDb->duUeCfg);
    memset(f1UeDb, 0, sizeof(F1UeContextSetupDb));
@@ -6945,21 +7712,21 @@ void extractRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *rlcDbCfg, RLC_Config_t *lc
          case RLC_AM :
             {
                if(lcCfg->choice.am)
-              {
+               {
                   DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.amCfg, sizeof(AmBearerCfg));
-                 if(rlcDbCfg->u.amCfg)
-                    extractRlcAmCfg(rlcDbCfg->u.amCfg, lcCfg->choice.am);
-              }
+                  if(rlcDbCfg->u.amCfg)
+                     extractRlcAmCfg(rlcDbCfg->u.amCfg, lcCfg->choice.am);
+               }
                break;
             }
          case RLC_UM_BI_DIRECTIONAL :
             {
                if(lcCfg->choice.um_Bi_Directional)
-              {
+               {
                   DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
-                 if(rlcDbCfg->u.umBiDirCfg)
+                  if(rlcDbCfg->u.umBiDirCfg)
                      extractRlcUmBiCfg(rlcDbCfg->u.umBiDirCfg, lcCfg->choice.um_Bi_Directional);
-              }
+               }
                break;
             }
          case RLC_UM_UNI_DIRECTIONAL_UL :
@@ -6967,9 +7734,9 @@ void extractRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *rlcDbCfg, RLC_Config_t *lc
                if(lcCfg->choice.um_Uni_Directional_DL)
                {
                   DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
-                 if(rlcDbCfg->u.umUniDirUlCfg)
+                  if(rlcDbCfg->u.umUniDirUlCfg)
                      extractRlcUmUlCfg(rlcDbCfg->u.umUniDirUlCfg, lcCfg->choice.um_Uni_Directional_DL);
-              }
+               }
                break;
             }
          case RLC_UM_UNI_DIRECTIONAL_DL :
@@ -6977,9 +7744,9 @@ void extractRlcModeCfg(uint8_t rlcMode, RlcBearerCfg *rlcDbCfg, RLC_Config_t *lc
                if(lcCfg->choice.um_Uni_Directional_UL)
                {
                   DU_ALLOC_SHRABL_BUF(rlcDbCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
-                 if(rlcDbCfg->u.umUniDirDlCfg)
+                  if(rlcDbCfg->u.umUniDirDlCfg)
                      extractRlcUmDlCfg(rlcDbCfg->u.umUniDirDlCfg, lcCfg->choice.um_Uni_Directional_UL);
-              }
+               }
                break;
             }
          default:
@@ -7030,6 +7797,48 @@ void extractUlLcCfg(UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg)
    }
 }
 
+/*******************************************************************
+*
+* @brief Function to extract Snssai Cfg Info from CU
+*
+* @details
+*
+*    Function : extractDrbSnssaiCfg
+*
+*    Functionality: Function to extract Drb Snssai Cfg Info from CU
+*
+* @params[in] DRB_Information_t *drbInfo, Snssai  *snssai
+* @return ROK/RFAILED
+*
+* ****************************************************************/
+
+uint8_t extractDrbSnssaiCfg(SNSSAI_t *RecvSnssai, Snssai **snssaiToBeShared)
+{
+   if(!(*snssaiToBeShared))
+   {
+      DU_ALLOC_SHRABL_BUF((*snssaiToBeShared), sizeof(Snssai));
+      if(snssaiToBeShared == NULLP)
+      {
+         DU_LOG("\nERROR  -->  DUAPP : extractDrbSnssaiCfg(): Memory failed at allocating for SNSSAI ");
+         return RFAILED;
+      }
+   }
+   if(RecvSnssai)
+   {
+      memcpy(&(*snssaiToBeShared)->sst, RecvSnssai->sST.buf, RecvSnssai->sST.size);
+      if(RecvSnssai->sD)
+      {
+         memcpy((*snssaiToBeShared)->sd, RecvSnssai->sD->buf,  RecvSnssai->sD->size);
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DUAPP : extractDrbSnssaiCfg(): Received Null pointer of Snssai->SD");
+         return RFAILED;
+      }
+   }
+   return ROK;
+}
+
 /*******************************************************************
  *
  * @brief Function to procRlcLcCfg
@@ -7047,8 +7856,9 @@ void extractUlLcCfg(UlLcCfg *f1UlLcCfg, LogicalChannelConfig_t *ulLcCfg)
  * ****************************************************************/
 
 void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
-   uint8_t configType, RLC_Config_t *f1RlcCfg, RlcBearerCfg *lcCfg)
+   uint8_t configType, RLC_Config_t *f1RlcCfg, RlcBearerCfg *lcCfg, QoSInformation_t *qoSInformation)
 {
+   DRB_Information_t *drbInfo;
 
    lcCfg->rbId   = rbId;
    lcCfg->configType = configType;
@@ -7071,10 +7881,24 @@ void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
    {
       extractRlcModeCfg(lcCfg->rlcMode, lcCfg, f1RlcCfg);
    }
+   if(qoSInformation != NULLP)
+   {
+      if(qoSInformation->present == QoSInformation_PR_choice_extension)
+      {
+         if(qoSInformation->choice.choice_extension->value.present ==\
+               QoSInformation_ExtIEs__value_PR_DRB_Information)
+         {
+            drbInfo = &qoSInformation->choice.choice_extension->value.choice.DRB_Information; 
+            if(extractDrbSnssaiCfg(&drbInfo->sNSSAI, &lcCfg->snssai) != ROK)
+            {
+               DU_LOG("\nERROR  -->  DUAPP: Unable to extract Snssai information at procRlcLcCfg()");
+               return RFAILED;
+            }
+         }
+      }
+   }
 }
 
-
-
 /*******************************************************************
  *
  * @brief Fills DrbQos Info received by CU
@@ -7093,104 +7917,288 @@ void procRlcLcCfg(uint8_t rbId, uint8_t lcId, uint8_t rbType, uint8_t rlcMode,\
 
 void extractQosInfo(DrbQosInfo *qosToAdd, QoSFlowLevelQoSParameters_t *qosFlowCfg)
 {
+   uint8_t qosCntIdx = 0;
+   ProtocolExtensionContainer_4624P74_t *qosIeExt = NULLP;
+
    qosToAdd->fiveQiType = qosFlowCfg->qoS_Characteristics.present;
    qosToAdd->u.nonDyn5Qi.fiveQi     =\
-         qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI;
+                                     qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI;
    if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow)
    {
       qosToAdd->u.nonDyn5Qi.avgWindow = \
-        *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+                                        *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
    }
    qosToAdd->u.nonDyn5Qi.maxDataBurstVol = \
-      *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+                                           *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
    if(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel)
    {
       qosToAdd->u.nonDyn5Qi.priorLevel = \
-         *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel);
+                                         *(qosFlowCfg->qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel);
    }
    qosToAdd->ngRanRetPri.priorityLevel = \
-      qosFlowCfg->nGRANallocationRetentionPriority.priorityLevel; 
+                                         qosFlowCfg->nGRANallocationRetentionPriority.priorityLevel; 
    qosToAdd->ngRanRetPri.preEmptionCap = \
-      qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionCapability;
+                                         qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionCapability;
    qosToAdd->ngRanRetPri.preEmptionVul = \
-      qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionVulnerability;
+                                         qosFlowCfg->nGRANallocationRetentionPriority.pre_emptionVulnerability;
    if(qosFlowCfg->gBR_QoS_Flow_Information)
    {
       memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateDl, \
-         qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.buf, \
-         qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.size);
+            qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.buf, \
+            qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateDownlink.size);
       memcpy(&qosToAdd->grbQosInfo.maxFlowBitRateUl, \
-         qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.buf, \
-         qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.size);
+            qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.buf, \
+            qosFlowCfg->gBR_QoS_Flow_Information->maxFlowBitRateUplink.size);
       memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateDl,\
-         qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.buf, \
-         qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.size);
+            qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.buf, \
+            qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink.size);
       memcpy(&qosToAdd->grbQosInfo.guarFlowBitRateUl,\
-         qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.buf, \
-         qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.size);
+            qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.buf, \
+            qosFlowCfg->gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink.size);
+   }
+   /*Extracting PDU_SESSION_ID*/
+   qosIeExt = (ProtocolExtensionContainer_4624P74_t *)qosFlowCfg->iE_Extensions;
+   if(qosIeExt)
+   {
+      for(qosCntIdx = 0; qosCntIdx < qosIeExt->list.count; qosCntIdx++)
+      {
+         if(qosIeExt->list.array[qosCntIdx]->extensionValue.present == \
+               QoSFlowLevelQoSParameters_ExtIEs__extensionValue_PR_PDUSessionID)
+         {
+            qosToAdd->pduSessionId = qosIeExt->list.array[qosCntIdx]->extensionValue.choice.PDUSessionID;
+            DU_LOG("\nDEBUG -->  DU_F1AP : extractQosInfo: PDU SessionID:%d",qosToAdd->pduSessionId);
+         }
+      }  
    }
-   qosToAdd->pduSessionId = 0;
    qosToAdd->ulPduSessAggMaxBitRate = 0;
 }
 
-uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, LcCfg *macLcToAdd)
+/*******************************************************************
+ *
+ * @brief Function to extract GTP Tunnel Info from CU
+ *
+ * @details
+ *
+ *    Function : extractUpTnlInfo
+ *
+ *    Functionality: Function to extract GTP Tunnel Info from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractUpTnlInfo(uint8_t drbId, uint8_t configType,\
+   ULUPTNLInformation_ToBeSetup_List_t *tnlInfo, UpTnlCfg *upTnlInfo)
 {
-   DRB_Information_t *drbInfo = NULLP;
+   uint8_t tnlIdx;
+   uint32_t ipv4_du = 0;
+   GTPTunnel_t *gtpTunnel = NULLP;
+
+   upTnlInfo->drbId = drbId; 
+   upTnlInfo->configType = configType;
+#ifdef O1_ENABLE
+   cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &ipv4_du);
+#else
+   cmInetAddr((char *)DU_IP_V4_ADDR, &ipv4_du);
+#endif
 
-   if(drbItem->qoSInformation.present == QoSInformation_PR_choice_extension)
+   for(tnlIdx=0; tnlIdx < tnlInfo->list.count; tnlIdx++)
    {
-      if(drbItem->qoSInformation.choice.choice_extension->value.present ==
-           QoSInformation_ExtIEs__value_PR_DRB_Information)
+      if(tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.present == UPTransportLayerInformation_PR_gTPTunnel)
       {
-        drbInfo = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
-
-        if(!macLcToAdd->drbQos)
+        if(tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.choice.gTPTunnel)
         {
-           DU_ALLOC_SHRABL_BUF(macLcToAdd->drbQos, sizeof(DrbQosInfo));
-           if(macLcToAdd->drbQos == NULLP)
+           gtpTunnel = tnlInfo->list.array[tnlIdx]->uLUPTNLInformation.choice.gTPTunnel;
+           DU_ALLOC(upTnlInfo->tnlCfg1, sizeof(GtpTnlCfg));
+            if(upTnlInfo->tnlCfg1 == NULLP)
            {
-              DU_LOG("\nERROR  -->  DUAPP:Memory failed at allocating DrbQos at extractDrbCfg()");
-              return RFAILED;
+               DU_LOG("\nERROR  -->  F1AP : extractUpTnlInfo: Failed to allocate mmeory for tunnel cfg 1");
+               return RFAILED;
            }
-
-        }
-        if(drbInfo->dRB_QoS.qoS_Characteristics.present == QoS_Characteristics_PR_non_Dynamic_5QI)
-        {
-           extractQosInfo(macLcToAdd->drbQos, &drbInfo->dRB_QoS);
-            macLcToAdd->dlLcCfg.lcp = macLcToAdd->drbQos->ngRanRetPri.priorityLevel;
-        }
-        if(!macLcToAdd->snssai)
-        {
-           DU_ALLOC_SHRABL_BUF(macLcToAdd->snssai, sizeof(Snssai));
-           if(macLcToAdd->snssai == NULLP)
+           bitStringToInt(&gtpTunnel->transportLayerAddress, &upTnlInfo->tnlCfg1->ulTnlAddress);
+           upTnlInfo->tnlCfg1->dlTnlAddress = ipv4_du;
+           if(gtpTunnel->gTP_TEID.size > 0)
            {
-              DU_LOG("\nERROR  -->  DUAPP : Memory failed at allocating SNSSAI at extractDrbCfg()");
-              return RFAILED;
+              teIdStringToInt(gtpTunnel->gTP_TEID.buf, &upTnlInfo->tnlCfg1->teId);
            }
         }
-        memcpy(&macLcToAdd->snssai->sst, drbInfo->sNSSAI.sST.buf, \
-              drbInfo->sNSSAI.sST.size);
-        if(drbInfo->sNSSAI.sD)
-        {
-           memcpy(macLcToAdd->snssai->sd, drbInfo->sNSSAI.sD->buf, \
-                 drbInfo->sNSSAI.sD->size);
-        }
-      }/*End of DRB Info*/
+        break;
+      }
    }
    return ROK;
 }
 
-uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg)
-{
-   uint8_t ret = ROK;
-
-   if(drbCfg)
+/*******************************************************************
+*
+* @brief Function to extract Drb Qos Cfg Info from CU
+*
+* @details
+*
+*    Function : extractDrbQosCfg 
+*
+*    Functionality: Function to extract Drb Qos Cfg Info from CU
+*
+* @params[in] DRB_Information_t *drbInfo, LcCfg *macLcToAdd
+* @return ROK/RFAILED
+*
+* ****************************************************************/
+
+uint8_t extractDrbQosCfg(DRB_Information_t *drbInfo, LcCfg *macLcToAdd ) 
+{
+   if(!macLcToAdd->drbQos)
    {
-      ret = extractDrbCfg(drbCfg, lcCfg);
-      if(ret == RFAILED)
+      DU_ALLOC_SHRABL_BUF(macLcToAdd->drbQos, sizeof(DrbQosInfo));
+      if(macLcToAdd->drbQos == NULLP)
+      {
+         DU_LOG("\nERROR  -->  DUAPP:Memory failed at allocating DrbQos at extractDrbQosCfg()");
+         return RFAILED;
+      }
+
+   }
+   if(drbInfo->dRB_QoS.qoS_Characteristics.present == QoS_Characteristics_PR_non_Dynamic_5QI)
+   {
+      extractQosInfo(macLcToAdd->drbQos, &drbInfo->dRB_QoS);
+      macLcToAdd->dlLcCfg.lcp = macLcToAdd->drbQos->ngRanRetPri.priorityLevel;
+   }
+   if(extractDrbSnssaiCfg(&drbInfo->sNSSAI, &macLcToAdd->snssai) != ROK)
+   {
+      DU_LOG("\nERROR  -->  DUAPP: Unable to extract Snssai information  at extractDrbQosCfg()");
+      return RFAILED;
+   }
+   return ROK;
+}
+/*******************************************************************
+ *
+ * @brief Function to extract DRB info received from CU
+ *
+ * @details
+ *
+ *    Function : extractDrbCfg
+ *
+ *    Functionality: Function to extract DRB info received from CU
+ *
+ * @params[in] F1AP message
+ * @return void
+ *
+ * ****************************************************************/
+uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\
+DRBs_ToBeModified_Item_t *drbModItem,  LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo)
+{
+   DRB_Information_t *drbInfo = NULLP;
+
+   if(drbItem != NULLP)
+   {
+      if(extractUpTnlInfo(drbItem->dRBID, CONFIG_ADD, &drbItem->uLUPTNLInformation_ToBeSetup_List, upTnlInfo) != ROK)
+      {
+         DU_LOG("\nERROR  -->  DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+         return RFAILED;
+      }
+      if(drbItem->qoSInformation.present == QoSInformation_PR_choice_extension)
+      {
+         if(drbItem->qoSInformation.choice.choice_extension->value.present == QoSInformation_ExtIEs__value_PR_DRB_Information)
+         {
+            drbInfo = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
+            if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+            {
+               DU_LOG("\nERROR  -->  DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
+               return RFAILED;
+            }
+         }
+      }
+   }
+   else if(drbSetupModItem != NULLP)
+   {
+      if(extractUpTnlInfo(drbSetupModItem->dRBID, CONFIG_ADD, &drbSetupModItem->uLUPTNLInformation_ToBeSetup_List,\
+      upTnlInfo) != ROK)
+      {
+         DU_LOG("\nERROR  -->  DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+         return RFAILED;
+      }
+      if(drbSetupModItem->qoSInformation.present == QoSInformation_PR_choice_extension)
+      {
+         if(drbSetupModItem->qoSInformation.choice.choice_extension->value.present ==\
+         QoSInformation_ExtIEs__value_PR_DRB_Information)
+         {
+            drbInfo = &drbSetupModItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information;
+            if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+            {
+               DU_LOG("\nERROR  -->  DUAPP : Failed to extract qos Cfg at extractDrbCfg()");  
+               return RFAILED;
+            }
+
+         }
+      }
+   }
+   else if(drbModItem != NULLP)
+   {
+      if(extractUpTnlInfo(drbModItem->dRBID, CONFIG_MOD, &drbModItem->uLUPTNLInformation_ToBeSetup_List,\
+      upTnlInfo) != ROK)
+      {
+         DU_LOG("\nERROR  -->  DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+         return RFAILED;
+      }
+      if(drbModItem->qoSInformation != NULLP)
+      {
+         if(drbModItem->qoSInformation->present == QoSInformation_PR_choice_extension)
+         {
+            if(drbModItem->qoSInformation->choice.choice_extension->value.present ==\
+                  QoSInformation_ExtIEs__value_PR_DRB_Information)
+            {
+               drbInfo = &drbModItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information;
+               if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+               {
+                  DU_LOG("\nERROR  -->  DUAPP : Failed to extract qos Cfg at extractDrbCfg()");  
+                  return RFAILED;
+               }
+
+            }
+         }
+      }
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extract RB info received from CU
+ *
+ * @details
+ *
+ *    Function : extractMacRbCfg
+ *
+ *    Functionality: Function to extract RB info received from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModCfg,  DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
+{
+   if(drbCfg != NULLP)
+   {
+      if(extractDrbCfg(drbCfg, NULL, NULL, lcCfg, upTnlInfo) != ROK)
+      {
+         DU_LOG("ERROR  -->  F1AP : Failed to build Drb Qos at extractMacRbCfg()");
+         return RFAILED;
+      }
+   }
+   else if(drbSetupModCfg != NULLP)
+   { 
+      if(extractDrbCfg(NULL, drbSetupModCfg, NULL, lcCfg, upTnlInfo) != ROK)
+      {
+         DU_LOG("ERROR  -->  F1AP : Failed to build Drb Qos at extractMacRbCfg()");
+         return RFAILED;
+      }
+   }
+   else if(drbModCfg != NULLP)
+   { 
+      if(extractDrbCfg(NULL, NULL, drbModCfg, lcCfg, upTnlInfo) != ROK)
       {
          DU_LOG("ERROR  -->  F1AP : Failed to build Drb Qos at extractMacRbCfg()");
-        return ret;
+         return RFAILED;
       }
    }
    else
@@ -7209,11 +8217,27 @@ uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg, LogicalChan
    }
    else
       lcCfg->ulLcCfgPres = false;
-   return ret;
+   return ROK;
 }
 
-uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
-   DRBs_ToBeSetup_Item_t *drbItem, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg)
+/*******************************************************************
+ *
+ * @brief Function processing LC config info received from CU
+ *
+ * @details
+ *
+ *    Function : procMacLcCfg
+ *
+ *    Functionality: Function processing LC config info received from CU
+ *
+ * @params[in] F1AP message
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType, DRBs_ToBeSetup_Item_t *drbItem,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LogicalChannelConfig_t *ulLcCfg,\
+LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
 {
    uint8_t ret = ROK;
 
@@ -7221,11 +8245,16 @@ uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
    lcCfg->configType = configType;
    if(rbType == RB_TYPE_SRB)
    {
-      ret = extractMacRbCfg(lcId, NULL, ulLcCfg, lcCfg);
+      ret = extractMacRbCfg(lcId, NULL, NULL, NULL, ulLcCfg, lcCfg, NULL);
    }
    else if(rbType == RB_TYPE_DRB)
    {
-      ret = extractMacRbCfg(lcId, drbItem, ulLcCfg, lcCfg);
+      if(drbItem != NULL)
+        ret = extractMacRbCfg(lcId, drbItem, NULL, NULL, ulLcCfg, lcCfg, upTnlInfo);
+      else if(drbSetupModItem != NULL)
+        ret = extractMacRbCfg(lcId, NULL, drbSetupModItem, NULL, ulLcCfg, lcCfg, upTnlInfo);
+      else if(drbModItem != NULL)
+        ret = extractMacRbCfg(lcId, NULL, NULL, drbModItem, ulLcCfg, lcCfg, upTnlInfo);
    }
    return ret;
 }
@@ -7246,10 +8275,9 @@ uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
  *
  * ****************************************************************/
 
-uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList *lcCfg, \
-   DuUeCfg *ueCfgDb)
+uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList *lcCfg, DuUeCfg *ueCfgDb)
 {
-  uint8_t ret, idx, rbId, lcId, rlcMode, rbType;
+  uint8_t idx, rbId, lcId, rlcMode, rbType;
   RLC_Config_t *f1RlcCfg = NULLP;
   LogicalChannelConfig_t *macUlLcCfg = NULLP;
 
@@ -7297,18 +8325,19 @@ uint8_t extractRlcCfgToAddMod(struct CellGroupConfigRrc__rlc_BearerToAddModList
      /* Filling RLC/MAC Config*/
      memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg));
      memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg));
-     procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]));
-     ret = procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx]);
-     if(ret == RFAILED)
+     procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]), NULLP);
+     if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK)
      {
         DU_LOG("\nERROR  -->  DU APP : Failed while filling MAC LC config at extractRlcCfgToAddMod()");
-        return ret;
+        return RFAILED;
      }
      (ueCfgDb->numRlcLcs)++;
      (ueCfgDb->numMacLcs)++;
+         DU_LOG("\nDEBUG  -> DUAPP: extractRlcCfgToAddMod:RBType:%d, DrbID: %d,lcId:%d, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+                            rbType, rbId, lcId, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs,  ueCfgDb->numDrb);
   }
   //TODO: To send the failure cause in UeContextSetupRsp 
-  return ret;
+  return ROK;
 }
 
 /*******************************************************************
@@ -7330,7 +8359,7 @@ void freeMacPdschServCellInfo(PdschServCellCfg *pdsch)
 {
    if(pdsch->xOverhead)
    {
-      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(uint8_t));
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->xOverhead, sizeof(PdschXOverhead));
    }
    if(pdsch->codeBlkGrpFlushInd)
    {
@@ -7338,7 +8367,7 @@ void freeMacPdschServCellInfo(PdschServCellCfg *pdsch)
    }
    if(pdsch->maxCodeBlkGrpPerTb)
    {
-      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, pdsch->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
    }
    if(pdsch->maxMimoLayers)
    {
@@ -7362,11 +8391,27 @@ void freeMacPdschServCellInfo(PdschServCellCfg *pdsch)
  * ****************************************************************/
 void freeMacServingCellInfo(ServCellCfgInfo *srvCellCfg)
 {
+   uint8_t timeDomRsrcIdx;
+
+   if(srvCellCfg->initDlBwp.pdschPresent)
+   {
+      for(timeDomRsrcIdx = 0; timeDomRsrcIdx < srvCellCfg->initDlBwp.pdschCfg.numTimeDomRsrcAlloc; timeDomRsrcIdx++)
+      {
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+            srvCellCfg->initDlBwp.pdschCfg.timeDomRsrcAllociList[timeDomRsrcIdx].k0, sizeof(uint8_t));
+      }
+   }
+
    freeMacPdschServCellInfo(&srvCellCfg->pdschServCellCfg);
    if(srvCellCfg->bwpInactivityTmr)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, srvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
    }
+
+   if(srvCellCfg->initUlBwp.pucchPresent)
+   {
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, srvCellCfg->initUlBwp.pucchCfg.dlDataToUlAck, sizeof(PucchDlDataToUlAck));
+   }
 }
 
 /*******************************************************************
@@ -7531,31 +8576,34 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
       if(cRsetToAddModList->list.count)
       {
          macPdcchCfg->numCRsetToAddMod = cRsetToAddModList->list.count;
-        for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++)
-        {
-           macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \
-             cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId;
-           bitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\
-              macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc);
+         for(cRsetIdx = 0; cRsetIdx < cRsetToAddModList->list.count; cRsetIdx++)
+         {
+            macPdcchCfg->cRSetToAddModList[cRsetIdx].cRSetId = \
+               cRsetToAddModList->list.array[cRsetIdx]->controlResourceSetId;
+            //freqDomRsrcBitStringToInt(&cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources,\
+                  macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc);
+            memcpy(macPdcchCfg->cRSetToAddModList[cRsetIdx].freqDomainRsrc, \
+               cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources.buf,
+               cRsetToAddModList->list.array[cRsetIdx]->frequencyDomainResources.size);
+
             macPdcchCfg->cRSetToAddModList[cRsetIdx].duration = \
-             cRsetToAddModList->list.array[cRsetIdx]->duration;
+                cRsetToAddModList->list.array[cRsetIdx]->duration;
 
-           macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \
-             cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present;   
+            macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType = \
+               cRsetToAddModList->list.array[cRsetIdx]->cce_REG_MappingType.present;   
             if(macPdcchCfg->cRSetToAddModList[cRsetIdx].cceRegMappingType == CCE_REG_MAPPINGTYPE_PR_INTERLEAVED)
-           {
-              //TODO: handle the case for Interleaved
+            {
+               //TODO: handle the case for Interleaved
             }
             macPdcchCfg->cRSetToAddModList[cRsetIdx].precoderGranularity = \
-             cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity;
-           if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID)
-           {
-              macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \
-                 *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID);
-           }
+                cRsetToAddModList->list.array[cRsetIdx]->precoderGranularity;
+            if(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID)
+            {
+               macPdcchCfg->cRSetToAddModList[cRsetIdx].dmrsScramblingId= \
+                  *(cRsetToAddModList->list.array[cRsetIdx]->pdcch_DMRS_ScramblingID);
+            }
          }
       }
-
    }
    /* Control Resource Set To Release List */
    if(cuPdcchCfg->controlResourceSetToReleaseList)
@@ -7564,10 +8612,10 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
       if(cRsetToRelList->list.count)
       {
          macPdcchCfg->numCRsetToRel = cRsetToRelList->list.count;
-        for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++)
-        {
+         for(cRsetIdx = 0; cRsetIdx < cRsetToRelList->list.count; cRsetIdx++)
+         {
             macPdcchCfg->cRSetToRelList[cRsetIdx] = *(cRsetToRelList->list.array[cRsetIdx]);
-        }
+         }
       }
    }
 
@@ -7578,49 +8626,49 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
       if(srchSpcToAddModList->list.count)
       {
          macPdcchCfg->numSearchSpcToAddMod = srchSpcToAddModList->list.count;
-        for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++)
-        {
+         for(srchSpcIdx = 0; srchSpcIdx < srchSpcToAddModList->list.count; srchSpcIdx++)
+         {
             macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceId =\
-              srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId;
+                                                                          srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceId;
             macPdcchCfg->searchSpcToAddModList[srchSpcIdx].cRSetId =\
-              *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId);
-           if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset)
-           {
+                                                                    *(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId);
+            if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset)
+            {
                macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset =\
-                 srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
+                                                                                         srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
             }
             if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot)
             {
-              bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\
-                 macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot);
+               bitStringToInt(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot,\
+                     macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSymbolsWithinSlot);
             }
-           if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates)
+            if(srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates)
             {
-             macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \
-                 srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1;
-              macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \
-                 srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2;
-              macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \
-                 srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4;
-              
-              macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \
-                 srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8;
-              
-              macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \
-                 srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16;
-           }
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel1 = \
+                                                                                       srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel1;
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel2 = \
+                                                                                       srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel2;
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel4 = \
+                                                                                       srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel4;
+
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel8 = \
+                                                                                       srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel8;
+
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].numCandidatesAggLevel16 = \
+                                                                                        srchSpcToAddModList->list.array[srchSpcIdx]->nrofCandidates->aggregationLevel16;
+            }
             if(srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType)
-           {
-              macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\
-                 srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present;
-              if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC)
-              {
-                 macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\
-                    srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats;
-              }
-         
-           }
-        }
+            {
+               macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType =\
+                                                                               srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->present;
+               if(macPdcchCfg->searchSpcToAddModList[srchSpcIdx].searchSpaceType == SEARCHSPACETYPE_PR_UE_SPECIFIC)
+               {
+                  macPdcchCfg->searchSpcToAddModList[srchSpcIdx].ueSpecificDciFormat =\
+                                                                                      srchSpcToAddModList->list.array[srchSpcIdx]->searchSpaceType->choice.ue_Specific->dci_Formats;
+               }
+
+            }
+         }
       }
    }
    /* Search space To Rel List */
@@ -7630,11 +8678,11 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
       if(srchSpcToRelList->list.count)
       {
          macPdcchCfg->numSearchSpcToRel = srchSpcToRelList->list.count;
-        for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++)
-        {
+         for(srchSpcIdx = 0; srchSpcIdx < srchSpcToRelList->list.count; srchSpcIdx++)
+         {
             macPdcchCfg->searchSpcToRelList[srchSpcIdx] =\
-              *(srchSpcToRelList->list.array[srchSpcIdx]);
-        }
+                                                         *(srchSpcToRelList->list.array[srchSpcIdx]);
+         }
       }
    }
 }
@@ -7649,13 +8697,19 @@ void extractPdcchCfg(PDCCH_Config_t *cuPdcchCfg, PdcchConfig *macPdcchCfg)
  *
  *    Functionality: Fills PdschCfg received  by CU
  *
- * @params[in] PDSCH_Config_t *cuPdschCfg,
- *             PdschConfig *macPdschCfg
+ * @params[in] PDSCH_Config_t *cuPdschCfg = Information which is send by CU,
+ *                   which we have stored in F1UeContextSetupDb,
+ *             PdschConfig *macPdschCfg = Used to Store the information which
+ *                   needs to send in other layer, as well as this can be the variable
+ *                   which stores the information in DuCb,
+ *             PdschConfig *storedPdschCfg =  Null in case of sending the
+ *                   information to other layer else it will have stored pdsch 
+ *                   configuration in copyOfmacUeCfg.
  * @return void
  *
  * ****************************************************************/
 
-void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
+void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg, PdschConfig *storedPdschCfg)
 {
    uint8_t timeDomIdx;
    struct PDSCH_Config__pdsch_TimeDomainAllocationList *timeDomAlloc = NULLP;
@@ -7663,13 +8717,13 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
    if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA)
    {
       if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->present == \
-         PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA_PR_setup)
+            PDSCH_Config__dmrs_DownlinkForPDSCH_MappingTypeA_PR_setup)
       {
          if(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup)
-        {
+         {
             macPdschCfg->dmrsDlCfgForPdschMapTypeA.addPos = \
-              *(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition);
-        }
+               *(cuPdschCfg->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition);
+         }
       }
    }
    macPdschCfg->resourceAllocType = cuPdschCfg->resourceAllocation;
@@ -7677,19 +8731,49 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
    {
       timeDomAlloc = cuPdschCfg->pdsch_TimeDomainAllocationList;
       if(timeDomAlloc->present ==\
-         PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup)
+            PDSCH_Config__pdsch_TimeDomainAllocationList_PR_setup)
       {
          if(timeDomAlloc->choice.setup)
-        {
-           macPdschCfg->numTimeDomRsrcAlloc  = timeDomAlloc->choice.setup->list.count;
+         {
+            macPdschCfg->numTimeDomRsrcAlloc  = timeDomAlloc->choice.setup->list.count;
             for(timeDomIdx = 0; timeDomIdx < timeDomAlloc->choice.setup->list.count; timeDomIdx++)
             {
-              macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \
-                 timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType;
-              macPdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbolAndLength = \
-                 timeDomAlloc->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
-           }
-        }
+               macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 = NULLP;
+               if(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0)
+               {
+                  if(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 == NULL)
+                  {
+                     if(storedPdschCfg)
+                     {
+                        if(storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0)
+                        {
+                           macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0 =\
+                           storedPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0;
+                        }
+                        else
+                        {
+                           DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t));
+                        }
+                     }
+                     else
+                     {
+                        DU_ALLOC_SHRABL_BUF(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0, sizeof(uint8_t));
+                     }
+                     if(!macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0)
+                     {
+                        DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for k0 at extractPdschCfg()");
+                        return RFAILED;
+                     }
+                  }
+                  *(macPdschCfg->timeDomRsrcAllociList[timeDomIdx].k0) = \
+                  *(timeDomAlloc->choice.setup->list.array[timeDomIdx]->k0);
+               }
+               macPdschCfg->timeDomRsrcAllociList[timeDomIdx].mappingType = \
+                  timeDomAlloc->choice.setup->list.array[timeDomIdx]->mappingType;
+               macPdschCfg->timeDomRsrcAllociList[timeDomIdx].startSymbolAndLength = \
+                  timeDomAlloc->choice.setup->list.array[timeDomIdx]->startSymbolAndLength;
+            }
+         }
       }
    }
    macPdschCfg->rbgSize = cuPdschCfg->rbg_Size;
@@ -7701,10 +8785,10 @@ void extractPdschCfg(PDSCH_Config_t *cuPdschCfg, PdschConfig *macPdschCfg)
       if(cuPdschCfg->prb_BundlingType.choice.staticBundling)
       {
          if(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize)
-        {
+         {
             macPdschCfg->bundlingInfo.StaticBundling.size = \
-              *(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize);
-        }
+               *(cuPdschCfg->prb_BundlingType.choice.staticBundling->bundleSize);
+         }
       }
    }
    else if(cuPdschCfg->prb_BundlingType.present == PDSCH_Config__prb_BundlingType_PR_dynamicBundling)
@@ -7743,7 +8827,7 @@ uint8_t extractPdschServingCellCfg(PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg,
         }
         else
         {
-            DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(uint8_t));
+            DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(MaxCodeBlkGrpPerTB));
             if(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)
            {
                *(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb)  = \
@@ -7762,7 +8846,7 @@ uint8_t extractPdschServingCellCfg(PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg,
         }
         else
         {
-            DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->maxCodeBlkGrpPerTb, sizeof(bool));
+            DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->codeBlkGrpFlushInd , sizeof(bool));
             if(macUePdschSrvCellCfg->codeBlkGrpFlushInd)
            {
                *(macUePdschSrvCellCfg->codeBlkGrpFlushInd)  = \
@@ -7811,7 +8895,7 @@ uint8_t extractPdschServingCellCfg(PDSCH_ServingCellConfig_t *cuPdschSrvCellCfg,
       }
       else
       {
-         DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(uint8_t));
+         DU_ALLOC_SHRABL_BUF(macUePdschSrvCellCfg->xOverhead, sizeof(PdschXOverhead));
          if(macUePdschSrvCellCfg->xOverhead)
          {
             *(macUePdschSrvCellCfg->xOverhead)  = *(cuPdschSrvCellCfg->xOverhead);
@@ -7996,8 +9080,16 @@ void extractResrcSetToAddModList(PucchResrcSetCfg *macRsrcSetList, struct PUCCH_
          macRsrcSetList->resrcSetToAddModList[arrIdx].resrcList[rsrcListIdx] =\
             *cuRsrcSetList->list.array[arrIdx]->resourceList.list.array[rsrcListIdx];
       }
-      macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\
-         *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1;
+
+      if(cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1)
+      {
+         macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize =\
+            *cuRsrcSetList->list.array[arrIdx]->maxPayloadMinus1;
+      }
+      else
+      {
+         macRsrcSetList->resrcSetToAddModList[arrIdx].maxPayLoadSize = 0;
+      }
    }
 }/* End of extractResrcSetToAddModList */
 
@@ -8328,13 +9420,20 @@ void extractSchedReqCfgToAddMod(PucchSchedReqCfg *macSchedReqCfg, struct PUCCH_C
  *
  *    Functionality: Fills PucchCfg received  by CU
  *
- * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg,
- *             PucchCfg *macPucchCfg
+ * @params[in] BWP_UplinkDedicated__pucch_Config *cuPucchCfg = Information which
+ *                is send by CU, which we have stored in F1UeContextSetupDb,
+ *             PucchCfg *macPucchCfg = Used to Store the information which
+ *                needs to send in other layer, as well as this can be the variable
+ *                which stores the information in DuCb,
+ *             PucchCfg *storedPucchCfg = Null in case of sending the
+ *                information to other layer else it will have Pucch Cfg which
+ *                we have stored in copyOfmacUeCfg.
  * @return ROK/RFAILED
  *
  * ****************************************************************/
 
-uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg)         
+uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, PucchCfg *macPucchCfg,\
+PucchCfg *storedPucchCfg)        
 {
    uint8_t arrIdx;
 
@@ -8460,20 +9559,34 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu
 
          /* Dl_DataToUL_ACK */ 
         if(cuPucchCfg->choice.setup->dl_DataToUL_ACK)
-        {
+    {
+       if(storedPucchCfg)
+       {
+          if(storedPucchCfg->dlDataToUlAck)
+          {
+             macPucchCfg->dlDataToUlAck = storedPucchCfg->dlDataToUlAck; 
+          }
+          else
+          {
             DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck));
-           if(macPucchCfg->dlDataToUlAck == NULLP)
-           {
-              DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()");
-              return RFAILED;
-           }
-           memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck));
-            macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count;
-           for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++)
-            {
-               macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\
-                  *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx];
-           }
+          }
+       }
+       else
+       {
+          DU_ALLOC_SHRABL_BUF(macPucchCfg->dlDataToUlAck, sizeof(PucchDlDataToUlAck));
+       }
+       if(macPucchCfg->dlDataToUlAck == NULLP)
+       {
+          DU_LOG("\nERROR --> F1AP : Failed to extract Dl_DataToUL_ACK in extractPucchCfg()");
+          return RFAILED;
+       }
+       memset(macPucchCfg->dlDataToUlAck, 0, sizeof(PucchDlDataToUlAck));
+       macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount = cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.count;
+       for(arrIdx = 0; arrIdx < macPucchCfg->dlDataToUlAck->dlDataToUlAckListCount; arrIdx++)
+       {
+          macPucchCfg->dlDataToUlAck->dlDataToUlAckList[arrIdx] =\
+          *cuPucchCfg->choice.setup->dl_DataToUL_ACK->list.array[arrIdx];
+       }
         }
 
         /* Power Control */
@@ -8503,12 +9616,19 @@ uint8_t extractPucchCfg(struct BWP_UplinkDedicated__pucch_Config *cuPucchCfg, Pu
  *
  *    Functionality: Fills ServingCellReconfig received  by CU
  *
- * @params[in] ServingCellConfig_t *cuSrvCellCfg
- *             ServCellCfgInfo *macSrvCellCfg
+ * @params[in] ServingCellConfig_t *cuSrvCellCfg = Information which is send by
+ *                  CU, which we have stored in F1UeContextSetupDb,
+ *             ServCellCfgInfo *macSrvCellCfg = Used to Store the information
+ *                  which  needs to send in other layer, as well as this can be the
+ *                  variable which stores the information in DuCb, 
+ *             ServCellCfgInfo *storedSrvCellCfg = Null in case of sending the
+ *                  information to other layer else it will have ServCellCfgInfo which
+ *                  we have stored in copyOfmacUeCfg.
  * @return ROK/RFAILD
  *
  * ****************************************************************/
-uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg)
+uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfgInfo *macSrvCellCfg,\
+ServCellCfgInfo *storedSrvCellCfg)
 {
    uint8_t ret = ROK;
    BWP_DownlinkDedicated_t *dlBwp = NULLP;
@@ -8520,18 +9640,48 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       if(dlBwp->pdcch_Config)
       {
          if(dlBwp->pdcch_Config->choice.setup)
-        {
-           macSrvCellCfg->initDlBwp.pdcchPresent = true;
-           extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
-        }
+         {
+            macSrvCellCfg->initDlBwp.pdcchPresent = true;
+            if(storedSrvCellCfg)
+            {
+               if(!storedSrvCellCfg->initDlBwp.pdcchPresent)
+               {
+                  extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
+               }
+               else
+               {
+                  extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
+               }
+            }
+            else
+            {
+               extractPdcchCfg(dlBwp->pdcch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdcchCfg);
+            }
+         }
       }
       if(dlBwp->pdsch_Config)
       {
          if(dlBwp->pdsch_Config->choice.setup)
-        {
-           macSrvCellCfg->initDlBwp.pdschPresent = true;
-           extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg);
-        }
+         {
+            macSrvCellCfg->initDlBwp.pdschPresent = true;
+            
+            if(storedSrvCellCfg)
+            {
+               if(!storedSrvCellCfg->initDlBwp.pdschPresent)
+               {
+                  extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL);
+               }
+               else
+               {
+                  extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg,\
+                        &storedSrvCellCfg->initDlBwp.pdschCfg);
+               }
+            }
+            else
+            {
+               extractPdschCfg(dlBwp->pdsch_Config->choice.setup, &macSrvCellCfg->initDlBwp.pdschCfg, NULL);
+            }
+         }
       }
    }
    if(cuSrvCellCfg->firstActiveDownlinkBWP_Id)
@@ -8548,15 +9698,15 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       {
          macSrvCellCfg->bwpInactivityTmr = NULLP;
          DU_ALLOC_SHRABL_BUF(macSrvCellCfg->bwpInactivityTmr, sizeof(uint8_t));
-        if(macSrvCellCfg->bwpInactivityTmr)
-        {
+         if(macSrvCellCfg->bwpInactivityTmr)
+         {
             memcpy(macSrvCellCfg->bwpInactivityTmr, cuSrvCellCfg->bwp_InactivityTimer, sizeof(uint8_t));
-        }
-        else
-        {
-           DU_LOG("\nERROR  --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()");
-           return RFAILED;
-        }
+         }
+         else
+         {
+            DU_LOG("\nERROR  --> F1AP : Memory Alloc failed for bwpInactivityTmr at extractSpCellDedicatedCfg()");
+            return RFAILED;
+         }
       }
    }
    if(cuSrvCellCfg->pdsch_ServingCellConfig)
@@ -8565,34 +9715,45 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
       {
          ret = extractPdschServingCellCfg(cuSrvCellCfg->pdsch_ServingCellConfig->choice.setup, &macSrvCellCfg->pdschServCellCfg);
          if(ret == RFAILED)
-        {
-           DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()");
-           return RFAILED;
-        }
+         {
+            DU_LOG("\nERROR --> F1AP : Failed at extractPdschServingCellCfg()");
+            return RFAILED;
+         }
       }
    }
    if(cuSrvCellCfg->uplinkConfig)
    {
-     if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
-     {
-        ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
-       if(ulBwp->pusch_Config)
-       {
-          macSrvCellCfg->initUlBwp.puschPresent = true;
-           extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
-       }
-       if(ulBwp->pucch_Config)
-       {
-          macSrvCellCfg->initUlBwp.pucchPresent = true;
-          memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg));
-           extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg); 
-       }
-     }
-     if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
-        macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
-   }
-   return ret;
-}
+      if(cuSrvCellCfg->uplinkConfig->initialUplinkBWP)
+      {
+         ulBwp = ((BWP_UplinkDedicated_t *)(cuSrvCellCfg->uplinkConfig->initialUplinkBWP));
+         if(ulBwp->pusch_Config)
+         {
+            macSrvCellCfg->initUlBwp.puschPresent = true;
+            extractPuschCfg(ulBwp->pusch_Config, &macSrvCellCfg->initUlBwp.puschCfg);
+         }
+         if(ulBwp->pucch_Config)
+         {
+            macSrvCellCfg->initUlBwp.pucchPresent = true;
+            memset(&macSrvCellCfg->initUlBwp.pucchCfg, 0, sizeof(PucchCfg));
+            if(storedSrvCellCfg)
+            {
+               if(!storedSrvCellCfg->initUlBwp.pucchPresent)
+                  extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL);
+               else
+                  extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg,\
+                  &storedSrvCellCfg->initUlBwp.pucchCfg);
+            }
+            else
+            {
+               extractPucchCfg(ulBwp->pucch_Config, &macSrvCellCfg->initUlBwp.pucchCfg, NULL);
+            }
+         }
+      }
+      if(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id)
+         macSrvCellCfg->firstActvUlBwpId = *(cuSrvCellCfg->uplinkConfig->firstActiveUplinkBWP_Id);
+   }
+   return ret;
+}
 /*******************************************************************
  *
  * @brief Fills Reconfig Cell group Info received by CU
@@ -8602,13 +9763,20 @@ uint8_t extractSpCellDedicatedCfg(ServingCellConfig_t *cuSrvCellCfg, ServCellCfg
  *    Function : extractUeReCfgCellInfo
  *
  *    Functionality: Fills Reconfig Cell group Info received by CU
+ *   
+ * @params[in] CellGroupConfigRrc_t *cellGrp = CellGroupConfigRrc_t information which
+ *                       is send by CU, which we have stored in F1UeContextSetupDb
+ *             MacUeCfg *MacUeCfg = Used to Store the information,
+ *                      which needs to send in other layer, as well as this can be
+ *                      the variable which stores the information in DuCb,
+ *             MacUeCfg *storedMacUeCfg = Null in case of sending the
+ *                      information to other layer else it will have copyOfmacUeCfg
+ *                      which we have stored in F1UeContextSetupDb.
  *
- * @params[in] CellGroupConfigRrc_t *macCellGrpCfg
- *             MacUeCfg*  macUeCfg
  * @return ROK/RFAILED
  *
  * ****************************************************************/
-uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg)
+uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg, MacUeCfg *storedMacUeCfg)
 {
    uint8_t ret = ROK;
    MAC_CellGroupConfig_t     *macCellGroup = NULLP;
@@ -8621,79 +9789,93 @@ uint8_t extractUeReCfgCellInfo(CellGroupConfigRrc_t *cellGrp, MacUeCfg *macUeCfg
       /* Fill MacCell Group Reconfig  */
       if(cellGrp->mac_CellGroupConfig)
       {
+         macUeCfg->macCellGrpCfgPres = true;
          macCellGroup = ((MAC_CellGroupConfig_t *)(cellGrp->mac_CellGroupConfig));
          if(macCellGroup->schedulingRequestConfig)
-        {
+         {
             extractSchReqReConfig(macCellGroup->schedulingRequestConfig, &macUeCfg->macCellGrpCfg.schReqCfg);
-        }
+         }
          if(macCellGroup->tag_Config)
-        {
+         {
             extractTagReconfig(macCellGroup->tag_Config, &macUeCfg->macCellGrpCfg.tagCfg);
-        }
-        if(macCellGroup->bsr_Config)
-        {
+         }
+         if(macCellGroup->bsr_Config)
+         {
             macUeCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer = macCellGroup->bsr_Config->periodicBSR_Timer;
             macUeCfg->macCellGrpCfg.bsrTmrCfg.retxTimer     = macCellGroup->bsr_Config->retxBSR_Timer;
-           if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
-           {
+            if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
+            {
                macUeCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer  =\
-                 *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
-           }
-        }
-        if(macCellGroup->phr_Config)
-        {
-           if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
-           {
+               *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
+            }
+         }
+         if(macCellGroup->phr_Config)
+         {
+            if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
+            {
                macUeCfg->macCellGrpCfg.phrCfgSetupPres = true;
                if(macCellGroup->phr_Config->choice.setup)
-              {
-                macUeCfg->macCellGrpCfg.phrCfg.periodicTimer     = \
-                  macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
-                macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer     = \
-                  macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
-                macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor     = \
-                  macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
-                macUeCfg->macCellGrpCfg.phrCfg.multiplePHR       = \
-                  macCellGroup->phr_Config->choice.setup->multiplePHR;
-                macUeCfg->macCellGrpCfg.phrCfg.dummy             = \
-                  macCellGroup->phr_Config->choice.setup->dummy;
-                macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
-                  macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
-                macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG        = \
-                  macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
-              }
-           }
-        }
+               {
+                  macUeCfg->macCellGrpCfg.phrCfg.periodicTimer     = \
+                  macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
+                  macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer     = \
+                  macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
+                  macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor     = \
+                  macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
+                  macUeCfg->macCellGrpCfg.phrCfg.multiplePHR       = \
+                  macCellGroup->phr_Config->choice.setup->multiplePHR;
+                  macUeCfg->macCellGrpCfg.phrCfg.dummy             = \
+                  macCellGroup->phr_Config->choice.setup->dummy;
+                  macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
+                  macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
+                  macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG        = \
+                  macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
+               }
+            }
+         }
       }
       /* Fill Physical Cell Group Reconfig */
       if(cellGrp->physicalCellGroupConfig)
       {
+         macUeCfg->phyCellGrpCfgPres = true;
          phyCellGrpCfg = ((PhysicalCellGroupConfig_t *)(cellGrp->physicalCellGroupConfig));
          if(phyCellGrpCfg->p_NR_FR1)
-        {
-           if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
+         {
+            if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
                macUeCfg->phyCellGrpCfg.pNrFr1 = *(phyCellGrpCfg->p_NR_FR1);
-        }
+         }
          macUeCfg->phyCellGrpCfg.pdschHarqAckCodebook = phyCellGrpCfg->pdsch_HARQ_ACK_Codebook;
       }
       /* Fill SpCell Reconfig */
       if(cellGrp->spCellConfig)
       {
+         macUeCfg->spCellCfgPres = true;
          spcellCfg = ((SpCellConfig_t *)(cellGrp->spCellConfig));  
          if(spcellCfg->servCellIndex)
-        {
+         {
             macUeCfg->spCellCfg.servCellIdx = *(spcellCfg->servCellIndex);
-        }
+         }
          /* Fill Serving cell Reconfig info */
-        if(cellGrp->spCellConfig->spCellConfigDedicated)
-        {
-           servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
-            ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg);
-           if(ret == RFAILED)
-           {
-              DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
-           }
-        }
+         if(cellGrp->spCellConfig->spCellConfigDedicated)
+         {
+            servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
+            if(storedMacUeCfg)
+            {
+               if(!storedMacUeCfg->spCellCfgPres)
+                  ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL);
+               else
+                  ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg,\
+                        &storedMacUeCfg->spCellCfg.servCellCfg);
+            }
+            else
+            {
+               ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg, NULL);
+            }
+            if(ret == RFAILED)
+            {
+               DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
+            }
+         }
       }
    }
    return ret;
@@ -8925,129 +10107,132 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
    DRBs_ToBeSetup_Item_t *drbSetItem = NULLP;
    uint8_t  flowIdx =0;
    uint8_t  drbIdx =0;
-   
+
    if(drbSet->list.array != NULLP)
    {
       for(drbIdx=0; drbIdx<drbSet->list.count; drbIdx++)
       {
-        if(drbIdx==0&&drbSet->list.array[drbIdx] != NULLP)
-        {
-           drbSetItem =&drbSet->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
-           if(drbSetItem->qoSInformation.choice.choice_extension != NULLP)
-           {
-              if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
-                    qoS_Characteristics.choice.non_Dynamic_5QI !=NULLP)
-              {
-                 if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
-                       qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
-                 {
-                    if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
-                          qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
-                    {
-
-                       if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf!=NULLP)
-                       {
-
-                          if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD!=NULLP)
-                          {
-
-                             if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->\
-                             buf!=NULLP)
-                             {
-
-                                if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
-                                      flows_Mapped_To_DRB_List.list.array != NULLP)
-                                {
-
-                                   for(flowIdx=0;flowIdx<drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                   DRB_Information.flows_Mapped_To_DRB_List.list.count; flowIdx++)
-                                   {
-
-                                      if(flowIdx==0&&drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                            DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
-                                      {
-                                         if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                               DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                               qoSFlowLevelQoSParameters.\
-                                               qoS_Characteristics.choice.non_Dynamic_5QI!=NULLP)
-                                         {
-                                            if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                                  DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                                  qoSFlowLevelQoSParameters.\
-                                                  qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
-                                            {
-
-                                               if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                                     DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                                     qoSFlowLevelQoSParameters.\
-                                                     qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
-                                               {
-                                                  freeAperDecodeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
-                                                  free(drbSetItem->uLConfiguration);
-
-
-                                                  free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                                        DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                                        qoSFlowLevelQoSParameters.\
-                                                        qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
-                                               }
-
-                                               free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                                     DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                                     qoSFlowLevelQoSParameters.\
-                                                     qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
-                                            }
-
-                                            free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-
-                                                  DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
-                                                  qoSFlowLevelQoSParameters.\
-                                                  qoS_Characteristics.choice.non_Dynamic_5QI);
-                                         }
-                                      }
-                                      if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                            DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
-                                      {
-
-                                         free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                               DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]);
-                                      }
-                                   }
-
-                                   free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                         DRB_Information.flows_Mapped_To_DRB_List.list.array);
-                                }
-
-                                free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
-                                DRB_Information.sNSSAI.sD->buf);
-                             }
-
-                             free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD);
-                          }
-
-                          free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf);
-
-                       }
-
-                       free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+         if(drbIdx==0&&drbSet->list.array[drbIdx] != NULLP)
+         {
+            drbSetItem =&drbSet->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
+            if(drbSetItem->qoSInformation.choice.choice_extension != NULLP)
+            {
+               if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+                     qoS_Characteristics.choice.non_Dynamic_5QI !=NULLP)
+               {
+                  if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+                        qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+                  {
+                     if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+                           qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+                     {
 
-                             qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
-                    }
+                        if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf!=NULLP)
+                        {
+
+                           if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD!=NULLP)
+                           {
+
+                              if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->\
+                                    buf!=NULLP)
+                              {
+
+                                 if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+                                       flows_Mapped_To_DRB_List.list.array != NULLP)
+                                 {
+
+                                    for(flowIdx=0;flowIdx<drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                          DRB_Information.flows_Mapped_To_DRB_List.list.count; flowIdx++)
+                                    {
+
+                                       if(flowIdx==0&&drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                             DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
+                                       {
+                                          if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                qoSFlowLevelQoSParameters.\
+                                                qoS_Characteristics.choice.non_Dynamic_5QI!=NULLP)
+                                          {
+                                             if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                   DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                   qoSFlowLevelQoSParameters.\
+                                                   qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+                                             {
+
+                                                if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                      DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                      qoSFlowLevelQoSParameters.\
+                                                      qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+                                                {
+
+
+                                                   free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                         DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                         qoSFlowLevelQoSParameters.\
+                                                         qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+                                                }
+
+                                                free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                      DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                      qoSFlowLevelQoSParameters.\
+                                                      qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+                                             }
+
+                                             free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+
+                                                   DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]->\
+                                                   qoSFlowLevelQoSParameters.\
+                                                   qoS_Characteristics.choice.non_Dynamic_5QI);
+                                          }
+                                       }
+                                       if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                             DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]!=NULLP)
+                                       {
+
+                                          free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                                DRB_Information.flows_Mapped_To_DRB_List.list.array[flowIdx]);
+                                       }
+                                    }
+
+                                    free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                          DRB_Information.flows_Mapped_To_DRB_List.list.array);
+                                 }
+
+                                 free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+                                       DRB_Information.sNSSAI.sD->buf);
+                              }
+
+                              free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD);
+                           }
+
+                           free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf);
+
+                        }
+
+                        free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+
+                              qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+                     }
 
-                    free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
-                          qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
-                 }
+                     free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+                           qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+                  }
 
-                 free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
-                       qoS_Characteristics.choice.non_Dynamic_5QI);
-              }
-              free(drbSetItem->qoSInformation.choice.choice_extension);
-           }
-        }
-        if(drbSet->list.array[drbIdx]!=NULLP)
-        {
-           free(drbSet->list.array[drbIdx]);
-        }
+                  free(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+                        qoS_Characteristics.choice.non_Dynamic_5QI);
+               }
+               free(drbSetItem->qoSInformation.choice.choice_extension);
+            }
+            freeAperDecodeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+            if(drbSetItem->uLConfiguration)
+            {
+               free(drbSetItem->uLConfiguration);
+            }
+         }
+         if(drbSet->list.array[drbIdx]!=NULLP)
+         {
+            free(drbSet->list.array[drbIdx]);
+         }
       }
       free(drbSet->list.array);
    }
@@ -9064,13 +10249,19 @@ void freeAperDecodeDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
  *
  *    Functionality: builds Mac Cell Cfg
  *
- * @params[in] MacUeCfg pointer
- *             void pointer
+ * @params[in] MacUeCfg *macUeCfgToSend = Used to Store the information which
+ *                       needs to send in other layer, as well as this can be
+ *                       the variable which stores the information in DuCb.
+ *             MacUeCfg *storedMacUeCfg = Null in case of sending the
+ *                       information to other layer else it will have copyOfmacUeCfg  
+ *                       which we have stored in F1UeContextSetupDb
+ *             void *cellInfo = CellGroupConfigRrc_t information which is send
+ *                        by CU, which we have stored in F1UeContextSetupDb 
  *
  * @return void 
  *
  * ****************************************************************/
-uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
+uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfgToSend,MacUeCfg *storedMacUeCfg, void *cellInfo)
 {
    uint8_t ret = ROK;
    CellGroupConfigRrc_t *cellGrp = NULLP;
@@ -9078,13 +10269,13 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
    if(cellInfo)
    {
       cellGrp = (CellGroupConfigRrc_t *)cellInfo;
-      ret = extractUeReCfgCellInfo(cellGrp, macUeCfg);
+      ret = extractUeReCfgCellInfo(cellGrp, macUeCfgToSend, storedMacUeCfg);
       if(ret == RFAILED)
          DU_LOG("\nERROR  -->  F1AP : Failed at procUeReCfgCellInfo()");
    }
    if(ret == RFAILED)
    {
-      freeUeReCfgCellGrpInfo(macUeCfg);
+      freeUeReCfgCellGrpInfo(macUeCfgToSend);
    }
    return ret;
 }
@@ -9108,93 +10299,100 @@ uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellInfo)
  * ****************************************************************/
 void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap)
 {
-   UE_NR_Capability_t *ueNrCap;
-
-   if(ueCap)
-      ueNrCap = (UE_NR_Capability_t *)ueCap;
+   UE_NR_Capability_t *ueNrCap=NULLP;
 
-   /* Filling DL modulation info */
-   if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsDownlinkPerCC && \
-        ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0] && \
-        ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL)
+   if(!ueCap)
    {
-      switch(*(ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL))
-      {
-        case ModulationOrder_qpsk:
-           {
-              ueCfg->dlModInfo.modOrder = MOD_ORDER_QPSK;
-              break;
-           }
-        case ModulationOrder_qam16:
-           {
-              ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM16;
-              break;
-           }
-        case ModulationOrder_qam64:
-           {
-              ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM64;
-              ueCfg->dlModInfo.mcsIndex = PDSCH_MCS_INDEX;
-              ueCfg->dlModInfo.mcsTable = MCS_TABLE_QAM64;
-              break;
-           }
-        case ModulationOrder_qam256:
-           {
-              ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM256;
-              break;
-           }
-        default:
-           {
-              DU_LOG("\nERROR  -->  DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration");
-              memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
-              break;
-           }
-      }
+      memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));     
+      memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
    }
    else
    {
-      memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
-   }
+      ueNrCap = (UE_NR_Capability_t *)ueCap;
 
-   /* Filling UL modulation info */
-   if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsUplinkPerCC && \
-        ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0] && \
-        ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL)
-   {
-      switch(*(ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL))
+      /* Filling DL modulation info */
+      if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsDownlinkPerCC && \
+         ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0] && \
+         ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL)
       {
-        case ModulationOrder_qpsk:
-           {
-              ueCfg->ulModInfo.modOrder = MOD_ORDER_QPSK;
-              break;
-           }
-        case ModulationOrder_qam16:
-           {
-              ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM16;
-              ueCfg->ulModInfo.mcsIndex = PUSCH_MCS_INDEX;
-              ueCfg->ulModInfo.mcsTable = MCS_TABLE_QAM64;
-              break;
-           }
-        case ModulationOrder_qam64:
-           {
-              ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM64;
-              break;
-           }
-        case ModulationOrder_qam256:
-           {
-              ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM256;
-              break;
-           }
-        default:
-           {
-              DU_LOG("\nERROR  -->  DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration");
-              memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
-              break;
-           }
+         switch(*(ueNrCap->featureSets->featureSetsDownlinkPerCC->list.array[0]->supportedModulationOrderDL))
+         {
+            case ModulationOrder_qpsk:
+               {
+                  ueCfg->dlModInfo.modOrder = MOD_ORDER_QPSK;
+                  break;
+               }
+            case ModulationOrder_qam16:
+               {
+                  ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM16;
+                  break;
+               }
+            case ModulationOrder_qam64:
+               {
+                  ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM64;
+                  ueCfg->dlModInfo.mcsIndex = PDSCH_MCS_INDEX;
+                  ueCfg->dlModInfo.mcsTable = MCS_TABLE_QAM64;
+                  break;
+               }
+            case ModulationOrder_qam256:
+               {
+                  ueCfg->dlModInfo.modOrder = MOD_ORDER_QAM256;
+                  break;
+               }
+            default:
+               {
+                  DU_LOG("\nERROR  -->  DU APP: Incorrect downlink modulation order received. Reatining old modulation configuration");
+                  memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+                  break;
+               }
+         }
+      }
+      else
+      {
+         memcpy(&ueCfg->dlModInfo, &oldUeCfg->dlModInfo, sizeof(ModulationInfo));
+      }
+
+      /* Filling UL modulation info */
+      if(ueNrCap->featureSets && ueNrCap->featureSets->featureSetsUplinkPerCC && \
+         ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0] && \
+         ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL)
+      {
+         switch(*(ueNrCap->featureSets->featureSetsUplinkPerCC->list.array[0]->supportedModulationOrderUL))
+         {
+            case ModulationOrder_qpsk:
+               {
+                  ueCfg->ulModInfo.modOrder = MOD_ORDER_QPSK;
+                  break;
+               }
+            case ModulationOrder_qam16:
+               {
+                  ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM16;
+                  ueCfg->ulModInfo.mcsIndex = PUSCH_MCS_INDEX;
+                  ueCfg->ulModInfo.mcsTable = MCS_TABLE_QAM64;
+                  break;
+               }
+            case ModulationOrder_qam64:
+               {
+                  ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM64;
+                  break;
+               }
+            case ModulationOrder_qam256:
+               {
+                  ueCfg->ulModInfo.modOrder = MOD_ORDER_QAM256;
+                  break;
+               }
+            default:
+               {
+                  DU_LOG("\nERROR  -->  DU APP: Incorrect uplink modulation order received. Reatining old modulation configuration");
+                  memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
+                  break;
+               }
+         }
+      }
+      else
+      {
+         memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
       }
-   }
-   else
-   {
-      memcpy(&ueCfg->ulModInfo, &oldUeCfg->ulModInfo, sizeof(ModulationInfo));
    }
 }
 
@@ -9216,7 +10414,7 @@ void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap)
  * ****************************************************************/
 
 CellGroupConfigRrc_t *extractCellGrpInfo(ProtocolExtensionContainer_4624P16_t *protocolIeExtn,\
-   DuUeCfg *ueCfgDb)
+      DuUeCfg *ueCfgDb)
 {
    uint8_t idx2 =0;
    uint16_t id =0;
@@ -9282,19 +10480,18 @@ CellGroupConfigRrc_t *extractCellGrpInfo(ProtocolExtensionContainer_4624P16_t *p
  * ****************************************************************/
 uint8_t procSrbListToSetup(SRBs_ToBeSetup_Item_t * srbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
 {
-   uint8_t ret = ROK;
 
    /* Filling RLC INFO */
-   procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd);
+   procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd, NULL);
 
    /* Filling MAC INFO */
-   ret = procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL, NULL, macLcToAdd);
-   if(ret == RFAILED)
+   if(procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, macLcToAdd, NULL)  != ROK)
    { 
       DU_LOG("\nERROR  -->  F1AP : Failed at MAC LC Cfg in procSrbListToSetup()");
-      return ret;
+      return RFAILED;
    }
-   return ret;
+
+   return ROK;
 }
 
 
@@ -9344,6 +10541,8 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb)
            &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
         ueCfgDb->numRlcLcs++;
         ueCfgDb->numMacLcs++;
+         DU_LOG("\nDEBUG --> DUAPP: extractSrbListToSetup: SRBID: %d [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+                            srbItem->sRBID, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs,  ueCfgDb->numDrb);
         if(ret == RFAILED)
         {
             DU_LOG("\nERROR  -->  F1AP:  Failed at extractSrbListToSetup()");
@@ -9363,34 +10562,72 @@ uint8_t extractSrbListToSetup(SRBs_ToBeSetup_List_t *srbCfg, DuUeCfg *ueCfgDb)
  *
  * @details
  *
- *    Function : procDrbListToSetup
+ *    Function : procDrbListToSetupMod
  *
  *    Functionality: Fills Drb List received by CU
  *                   for both MAC and RLC
  *
- * @params[in] SRBs_ToBeSetup_Item_t pointer
- *             LcCfg pointer,
- *             RlcBearerCfg pointer
+ * @params[in] DRBs_ToBeSetup_Item_t , DRBs_ToBeSetupMod_Item_t,
+ *             DRBs_ToBeModified_Item_t , lcId, LcCfg pointer,
+ *             RlcBearerCfg , UpTnlCfg, RlcUeCfg
  * @return void
  *
  * ****************************************************************/
 
-uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd)
+uint8_t procDrbListToSetupMod(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo, RlcUeCfg *storedRlcUeCfg)
 {
-   uint8_t ret = ROK;
+   uint8_t cfgIdx = 0;
+   RlcMode rlcModeInfo;
 
-   /* Filling RLC INFO */
-   procRlcLcCfg(drbItem->dRBID, lcId, RB_TYPE_DRB, drbItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
+   if(drbItem != NULLP)
+   {
+      /* Filling RLC INFO */
+      procRlcLcCfg(drbItem->dRBID, lcId, RB_TYPE_DRB, drbItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd, &drbItem->\
+      qoSInformation);
 
-   /* Filling MAC INFO */
-   ret = procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, macLcToAdd);
-   if(ret == RFAILED)
-   { 
-      DU_LOG("\nERROR  -->  F1AP : Failed at RLC LC Cfg in extractDrbListToSetup()");
-      return ret;
+      /* Filling MAC INFO */
+      if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
+      { 
+         DU_LOG("\nERROR  --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
+         return RFAILED;
+      }
    }
+   else if(drbSetupModItem != NULLP)
+   {
+      procRlcLcCfg(drbSetupModItem->dRBID, lcId, RB_TYPE_DRB, drbSetupModItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd, 
+      &drbSetupModItem->qoSInformation);
 
-   return ret;
+      if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, NULL, drbSetupModItem, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
+      {
+         DU_LOG("\nERROR  --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
+         return RFAILED;
+      }
+   }
+   else if(drbModItem != NULLP)
+   {
+      /* Drb to Mod IEs doesnot have rlcMode to be modified
+       * in ASN. Hence no change in RLC configurations */
+      if(storedRlcUeCfg != NULLP)
+      {
+         for(cfgIdx = 0; cfgIdx < storedRlcUeCfg->numLcs; cfgIdx++)
+         {
+            if(storedRlcUeCfg->rlcLcCfg[cfgIdx].lcId == lcId)
+            {
+               rlcModeInfo = storedRlcUeCfg->rlcLcCfg[cfgIdx].rlcMode;
+               break;
+            }
+         }
+      }
+
+      procRlcLcCfg(drbModItem->dRBID, lcId, RB_TYPE_DRB, rlcModeInfo, CONFIG_MOD, NULL, rlcLcToAdd, drbModItem->qoSInformation);
+      if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_MOD, NULL, NULL, drbModItem, NULL, macLcToAdd, upTnlInfo) != ROK)
+      {
+         DU_LOG("\nERROR  --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
+         return RFAILED;
+      }
+   }
+   return ROK;
 }
 
 /*******************************************************************
@@ -9399,7 +10636,7 @@ uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem, LcCfg *
  *
  * @details
  *
- *    Function : extractDrbListToSetup
+ *    Function : extractDrbListToSetupMod
  *
  *    Functionality: extract Drb List received by CU
  *                   for both MAC and RLC
@@ -9410,53 +10647,111 @@ uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem, LcCfg *
  *
  * ****************************************************************/
 
-uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg, DuUeCfg *ueCfgDb)
+uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
+ DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap, RlcUeCfg *rlcUeCfg)
 {
-   uint8_t ret, drbIdx;
+   uint8_t ret, drbIdx = 0, lcId = 0;
    DRBs_ToBeSetup_Item_t *drbItem = NULLP;
+   DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
+   DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP;
 
    ret = ROK;
-   if(drbCfg)
+   if(drbCount > 0)
    {
-      for(drbIdx = 0; drbIdx < drbCfg->list.count; drbIdx++)
+      for(drbIdx = 0; drbIdx < drbCount; drbIdx++)
       {
-         drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
-        if(ueCfgDb->numMacLcs > MAX_NUM_LC)
-        { 
-            DU_LOG("\nERROR   -->  F1AP:  MAX LC Reached in MAC ");
-           ret = RFAILED;
-           break;
-        }
-        if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
-        {
-            DU_LOG("\nERROR   -->  F1AP:  MAX LC Reached in RLC");
-           ret = RFAILED;
-           break;
-        }
-        memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
-        memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
-         ret = procDrbListToSetup(lcId, drbItem, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
-           &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
-        ueCfgDb->numRlcLcs++;
-        ueCfgDb->numMacLcs++;
-        if(ret == RFAILED)
-        {
-            DU_LOG("\nERROR  -->  F1AP :  Failed at extractDrbListToSetup()");
-           break;
-        }
-      }
-   }
-   else
-      ret = RFAILED;
-
-   return ret;
-}
+         if(ueCfgDb->numMacLcs > MAX_NUM_LC)
+         { 
+            DU_LOG("\nERROR  -->  F1AP :  MAX LC Reached in MAC at extractDrbListToSetupMod()");
+            ret = RFAILED;
+            break;
+         }
+         if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
+         {
+            DU_LOG("\nERROR  -->  F1AP :  MAX LC Reached in RLC at extractDrbListToSetupMod()");
+            ret = RFAILED;
+            break;
+         }
+         memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
+         memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
 
-/*******************************************************************
- *
- * @brief Function to extract Dl RRC Msg received from CU
- *
- * @details
+         if(drbModCfg != NULLP)
+         {
+            drbModItem = (DRBs_ToBeModified_ItemIEs_t *) drbModCfg->list.array[drbIdx];
+            lcId = fetchLcId(drbModItem->value.choice.DRBs_ToBeModified_Item.dRBID);
+            if(lcId < MIN_DRB_LCID)
+            {
+               DU_LOG("\nERROR  --> F1AP : Failed fetching LCID %d in extractDrbListToSetupMod() for Modified List", lcId);
+               break;
+            } 
+            ret = procDrbListToSetupMod(lcId, NULL, NULL, &(drbModItem->value.choice.DRBs_ToBeModified_Item),\
+            &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
+            &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+            if(ret == RFAILED)
+            {
+               DU_LOG("\nERROR  --> F1AP : Failed at extractDrbListToSetupMod() for Modified List");
+               break;
+            }
+
+         }
+         else
+         {
+            lcId = getDrbLcId(drbBitMap);
+            if(lcId == RFAILED)
+            {
+               DU_LOG("\nERROR  -->  F1AP :  InCorrect LCID extractDrbListToSetupMod()");
+               ret = RFAILED;
+               break;
+            }
+            if(drbCfg != NULL)
+            {
+               drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
+               ret = procDrbListToSetupMod(lcId, drbItem, NULL, NULL, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
+                     &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+               if(ret == RFAILED)
+               {
+                  DU_LOG("\nERROR  --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetup List");
+                  break;
+               }
+            }
+            else if(drbSetupModCfg != NULL)
+            {
+               drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
+               ret = procDrbListToSetupMod(lcId, NULL, &(drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item), NULL,\
+                     &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
+                     &ueCfgDb->upTnlInfo[ueCfgDb->numDrb], rlcUeCfg);
+               if(ret == RFAILED)
+               {
+                  DU_LOG("\nERROR  --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetupMod List");
+                  break;
+               }
+               ueCfgDb->numDrbSetupMod++;
+            }
+         }
+         ueCfgDb->numRlcLcs++;
+         ueCfgDb->numMacLcs++;
+         ueCfgDb->numDrb++;
+         DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetupMod:lcId:%x ,BitMap:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+                            lcId,*drbBitMap, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs,  ueCfgDb->numDrb);
+         if(ret == RFAILED)
+         {
+            DU_LOG("\nERROR  --> F1AP : Failed at extractDrbListToSetupMod()");
+            break;
+         }
+      }
+   }
+   else
+      ret = RFAILED;
+
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Function to extract Dl RRC Msg received from CU
+ *
+ * @details
  *
  *    Function : extractDlRrcMsg
  *
@@ -9478,7 +10773,7 @@ uint8_t extractDlRrcMsg(uint32_t gnbDuUeF1apId, uint32_t gnbCuUeF1apId, \
       DU_ALLOC_SHRABL_BUF(dlRrcMsg->rrcMsgPdu, dlRrcMsg->rrcMsgSize);
       if(!dlRrcMsg->rrcMsgPdu)
       {
-         DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for RRC Msg in procUeCtxtSetupReq");
+         DU_LOG("\nERROR  --> DU APP : Memory allocation failed for RRC Msg in extractDlRrcMsg()");
          ret = RFAILED;
       }
       else
@@ -9672,193 +10967,251 @@ void freeAperDecodeF1UeContextSetupReq(UEContextSetupRequest_t   *ueSetReq)
  * ****************************************************************/
 uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
 {
-   uint8_t  ret, ieIdx, ueIdx, lcId, cellIdx;
+   uint8_t  ret=0, ieIdx=0, ueIdx=0, cellIdx=0;
    bool ueCbFound = false;
-   uint32_t gnbCuUeF1apId, gnbDuUeF1apId, bitRateSize;
-   DuUeCb   *duUeCb = NULLP;
-   UEContextSetupRequest_t   *ueSetReq = NULLP;
-    
+   uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
+   DuUeCb   *duUeCb = NULL;
+   UEContextSetupRequest_t   *ueSetReq = NULL;
+   DRBs_ToBeSetup_List_t *drbCfg = NULL;
+
    ret = ROK;
-   
+
    ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
    for(ieIdx=0; (ieIdx < ueSetReq->protocolIEs.list.count && ret == ROK); ieIdx++)
    {
       switch(ueSetReq->protocolIEs.list.array[ieIdx]->id)
       {
-        case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
-           {
-              gnbCuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
-              break;
-           }
-        case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
-           {
-              gnbDuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
-              break;
-           }
-        case ProtocolIE_ID_id_ServCellIndex:
-           {
-              cellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
+         case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+            {
+               gnbCuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
+               break;
+            }
+         case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+            {
+               gnbDuUeF1apId = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+               break;
+            }
+         case ProtocolIE_ID_id_ServCellIndex:
+            {
+               cellIdx = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.ServCellIndex;
                for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
-              {
-                 if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
-                    (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
-                 {
-                    ueCbFound = true;
+               {
+                  if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+                        (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+                  {
+                     ueCbFound = true;
                      duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
                      DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
                      if(duUeCb->f1UeDb)
                      {
                         memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
-                       duUeCb->f1UeDb->actionType = UE_CTXT_SETUP;
-                       duUeCb->f1UeDb->cellIdx = cellIdx;
-                    }
-                    else
-                    {
+                        duUeCb->f1UeDb->actionType = UE_CTXT_SETUP;
+                        duUeCb->f1UeDb->cellIdx = cellIdx;
+                     }
+                     else
+                     {
                         DU_LOG("\nERROR  -->  F1AP: Memory Alloc Failed at procF1UeContextSetupReq()");
                         ret = RFAILED;
-                    }
-                 }
-                 else
-                    ueCbFound = false;
-                 
-              }
-              if(!ueCbFound)
-              {
+                     }
+                     break;
+                  }
+                  else
+                     ueCbFound = false;
+
+               }
+               if(!ueCbFound)
+               {
                   DU_LOG("\nERROR  -->  F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
                   ret = RFAILED;
-              }
-              break;
-           }
+               }
+               break;
+            }
          case ProtocolIE_ID_id_SpCellULConfigured:
-           /* Indicates whether the gNB-CU requests the gNB-DU to configure the uplink as no UL, 
-           UL, SUL or UL+SUL for the indicated cell for the UE */
-           break;
+            /* Indicates whether the gNB-CU requests the gNB-DU to configure the uplink as no UL, 
+               UL, SUL or UL+SUL for the indicated cell for the UE */
+            break;
          case ProtocolIE_ID_id_CUtoDURRCInformation:
-           {
+            {
                if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList)
                {
                   duUeCb->f1UeDb->duUeCfg.ueNrCapability = \
-                     extractUeCapability(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.\
-                        uE_CapabilityRAT_ContainerList, duUeCb);
+                  extractUeCapability(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.\
+                  uE_CapabilityRAT_ContainerList, duUeCb);
                }
-              if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.iE_Extensions)
-              {
+               if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation.iE_Extensions)
+               {
                   duUeCb->f1UeDb->duUeCfg.cellGrpCfg = extractCellGrpInfo(ueSetReq->protocolIEs.list.array[ieIdx]->\
-                    value.choice.CUtoDURRCInformation.iE_Extensions, &duUeCb->f1UeDb->duUeCfg);
-                 if(!duUeCb->f1UeDb->duUeCfg.cellGrpCfg)
-                 {
-                    DU_LOG("\nERROR  -->  F1AP: Failed to extract cell Grp Info");
-                    //TODO: Update the failure cause in ue context Setup Response
-                    ret = RFAILED;
-                 }
-              }
+                        value.choice.CUtoDURRCInformation.iE_Extensions, &duUeCb->f1UeDb->duUeCfg);
+                  if(!duUeCb->f1UeDb->duUeCfg.cellGrpCfg)
+                  {
+                     DU_LOG("\nERROR  -->  F1AP: Failed to extract cell Grp Info");
+                     //TODO: Update the failure cause in ue context Setup Response
+                     ret = RFAILED;
+                  }
+               }
                break;
             } 
          case ProtocolIE_ID_id_SCell_ToBeSetup_List:
-           {
-              DU_LOG("\nINFO   -->  DU_APP: Received SCell_ToBeSetup_List but  Not processing the list");
-           break;
-           }
+            {
+               DU_LOG("\nINFO   -->  DU_APP: Received SCell_ToBeSetup_List but  Not processing the list");
+               break;
+            }
          case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
-           {
-              if(extractSrbListToSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List,\
-                 &duUeCb->f1UeDb->duUeCfg))
-              {
-                 DU_LOG("\nERROR  -->  DU APP : Failed at extractSrbListToSetup()");
-                 //TODO: Update the failure cause in ue context Setup Response
-                 ret = RFAILED;
-              }
-              break;
-           }
+            {
+               if(extractSrbListToSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List,\
+               &duUeCb->f1UeDb->duUeCfg))
+               {
+                  DU_LOG("\nERROR  -->  DU APP : Failed at extractSrbListToSetup()");
+                  //TODO: Update the failure cause in ue context Setup Response
+                  ret = RFAILED;
+               }
+               break;
+            }
          case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
-           {
-              lcId = getDrbLcId(&duUeCb->drbBitMap);
-              if(lcId != RFAILED)
-              {
-                  if(extractDrbListToSetup(lcId, &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List,\
-                    &duUeCb->f1UeDb->duUeCfg))
-                 {
-                    DU_LOG("\nERROR  -->  DU APP : Failed at extractDrbListToSetup()");
-                    //TODO: Update the failure cause in ue context Setup Response
-                    ret = RFAILED;
-                 }
-              }
-              else 
-                 ret = RFAILED;
+            {
+                  drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
+
+                  if(extractDrbListToSetupMod(drbCfg, NULL, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, NULLP))
+                  {
+                     DU_LOG("\nERROR  -->  DU APP : Failed at extractDrbListToSetupMod()");
+                     //TODO: Update the failure cause in ue context Setup Response
+                     ret = RFAILED;
+                  }
                break;
-           }
-        case ProtocolIE_ID_id_RRCContainer:
-           {
-              /* Filling Dl RRC Msg Info */
-              DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
-              if(!duUeCb->f1UeDb->dlRrcMsg)
-              {
-                 DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for DL RRC Msg in procUeCtxtSetupReq()");
-                 ret = RFAILED;
-              }
-              else
-              {
-                 memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
-                 ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
-                    &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer);
-              }          
-              break;
-           }
-        case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
-           {
-              if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
-              {
-                 duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
-              }
-              else
-              {
-                 DU_LOG("\nERROR  -->  Ignoring delivery report, since rrcContainer is not present");
-              }
-              break;
-           }
-        case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
-            {
+            }
+         case ProtocolIE_ID_id_RRCContainer:
+            {
+               /* Filling Dl RRC Msg Info */
+               DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+               if(!duUeCb->f1UeDb->dlRrcMsg)
+               {
+                  DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for DL RRC Msg in procUeCtxtSetupReq()");
+                  ret = RFAILED;
+               }
+               else
+               {
+                  duUeCb->f1UeDb->dlRrcMsgPres = true;
+                  memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+                  ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+                        &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer);
+               }         
+               break;
+            }
+         case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+            {
+               if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+               {
+                  duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
+               }
+               else
+               {
+                  DU_LOG("\nERROR  -->  Ignoring delivery report, since rrcContainer is not present");
+               }
+               break;
+            }
+         case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
+            {
                /* MaximumBitRate Uplink */
-              bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size;
-              if(bitRateSize > 0)
-              {
+               bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size;
+               if(bitRateSize > 0)
+               {
                   DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.ambrCfg, bitRateSize);
-                 if(!duUeCb->f1UeDb->duUeCfg.ambrCfg)
-                 {
-                    DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq");
-                    ret = RFAILED;
-                 }
-                 else
-                 {
-                    memset(duUeCb->f1UeDb->duUeCfg.ambrCfg, 0, sizeof(AmbrCfg)); 
+                  if(!duUeCb->f1UeDb->duUeCfg.ambrCfg)
+                  {
+                     DU_LOG("\nERROR  -->  DU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq");
+                     ret = RFAILED;
+                  }
+                  else
+                  {
+                     memset(duUeCb->f1UeDb->duUeCfg.ambrCfg, 0, sizeof(AmbrCfg)); 
                      memcpy(&duUeCb->f1UeDb->duUeCfg.ambrCfg->ulBr,
-                    ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf, bitRateSize);
-                     duUeCb->f1UeDb->duUeCfg.ambrCfg->dlBr = 0;
-                 }
-              }
-              else
-                 ret = RFAILED;
-              break;
-           }
-        default:
-           {
-              break;
-           }
+                           ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf, bitRateSize);
+                  }
+               }
+               else
+                  ret = RFAILED;
+               break;
+            }
+         default:
+            {
+               break;
+            }
       }
    }
    if(ret == RFAILED)
    {
       /*TODO : Negative case*/
-      // BuildAndSendUeContextSetupRsp(ueIdx, cellId);
+      // BuildAndSendUeContextSetupRsp(cellId,ueIdx);
       DU_LOG("\nERROR  -->  F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()"); 
    }
    else
       ret = duProcUeContextSetupRequest(duUeCb);
-   
+
    freeAperDecodeF1UeContextSetupReq(ueSetReq); 
    return ret;
 
 }
+/*******************************************************************
+ * @brief Free the memory allocated for Dl Tunnel Info
+ *
+ * @details
+ *
+ *    Function : freeDlTnlInfo
+ *
+ *    Functionality:
+ *       Free the memory allocated for Dl Tunnel Info
+ *
+ * @params[in] DLUPTNLInformation_ToBeSetup_List_t *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeDlTnlInfo(DLUPTNLInformation_ToBeSetup_List_t *tnlInfo)
+{
+   uint8_t arrIdx = 0;
+
+   if(tnlInfo)
+   {
+      for(arrIdx=0; arrIdx < tnlInfo->list.count; arrIdx++)
+      {
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.buf,\
+               tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.size);
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf,\
+               tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->gTP_TEID.size);
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+         DU_FREE(tnlInfo->list.array[arrIdx], sizeof(DLUPTNLInformation_ToBeSetup_Item_t));
+      }
+      DU_FREE(tnlInfo->list.array, tnlInfo->list.size);
+   }
+}
+
+/*******************************************************************
+ * @brief Free the memory allocated for DRB setup List
+ *
+ * @details
+ *
+ *    Function : freeDrbSetupList
+ *
+ *    Functionality:
+ *       Free the memory allocated for DRB setup list
+ *
+ * @params[in] DRBs_Setup_List_t *
+ * @return void
+ *
+ * ****************************************************************/
+void freeDrbSetupList(DRBs_Setup_List_t *drbSetupList)
+{
+   uint8_t arrIdx = 0;
+   DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+   for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+   {
+      drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+      freeDlTnlInfo(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
+      DU_FREE(drbSetupList->list.array[arrIdx],  sizeof(DRBs_Setup_Item_t));
+   }
+   DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
+}
 
 /*******************************************************************
  * @brief Free the memory allocated for UE Setup response
@@ -9910,6 +11263,11 @@ void FreeUeContextSetupRsp(F1AP_PDU_t *f1apMsg)
                           }
                           break;
                        }
+                    case ProtocolIE_ID_id_DRBs_Setup_List:
+                       {
+                           freeDrbSetupList(&ueSetRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List); 
+                           break;
+                       }
                     default:
                        DU_LOG("\nERROR  -->  DUAPP: Invalid Id %ld at FreeUeContextSetupRsp()",\
                        ueSetRsp->protocolIEs.list.array[idx]->id);
@@ -9980,14 +11338,13 @@ uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfi
 
 /*******************************************************************
  *
- * @brief Builds and sends the UE Setup Response
+ * @brief Fills Dl Gtp tunnel Info
  *
  * @details
  *
- *    Function : BuildAndSendUeContextSetupRsp
+ *    Function : fillGtpTunnelforDl
  *
- *    Functionality: Constructs the UE Setup Response and sends
- *                   it to the DU through SCTP.
+ *    Functionality: Fills Dl Gtp tunnel Info
  *
  * @params[in] 
  *
@@ -9995,30 +11352,183 @@ uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfi
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
+
+uint8_t fillGtpTunnelforDl(GTPTunnel_t *gtpDl, GtpTnlCfg *gtpUeCfg)
 {
-   uint8_t   idx, ret, cellIdx, elementCnt;
-   uint32_t  gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
-   uint32_t  gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
-   asn_enc_rval_t  encRetVal;        /* Encoder return value */
-   F1AP_PDU_t               *f1apMsg = NULLP;
-   UEContextSetupResponse_t *ueSetRsp = NULLP;
-   CellGroupConfigRrc_t     *cellGrpCfg = NULLP;
-   DuUeCb                   *ueCb = NULLP;
+   uint8_t bufSize = 0;
 
-   DU_LOG("\n INFO   -->  F1AP : Building UE Context Setup Response for cellId %d, ueIdx %d\n", cellId, ueIdx);
+   gtpDl->transportLayerAddress.size   = 4*sizeof(uint8_t);
+   DU_ALLOC(gtpDl->transportLayerAddress.buf, gtpDl->transportLayerAddress.size);
+   if(gtpDl->transportLayerAddress.buf == NULLP)
+   {
+      return RFAILED;
+   }
+   memcpy(gtpDl->transportLayerAddress.buf, &gtpUeCfg->dlTnlAddress, gtpDl->transportLayerAddress.size);
 
-   while(true)
+   /*GTP TEID*/
+   gtpDl->gTP_TEID.size = 4 * sizeof(uint8_t);
+   DU_ALLOC(gtpDl->gTP_TEID.buf, gtpDl->gTP_TEID.size);
+   if(gtpDl->gTP_TEID.buf == NULLP)
    {
-      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
-      if(f1apMsg == NULLP)
-      {
-        DU_LOG(" ERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
-        ret = RFAILED;
-        break;
-      }
+      return RFAILED;
+   }
+   bufSize = 3; /*forming an Octect String*/
+   fillTeIdString(bufSize, gtpUeCfg->teId, gtpDl->gTP_TEID.buf);
 
-      f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills DL Tunnel Setup List
+ *
+ * @details
+ *
+ *    Function : fillDlTnlSetupList
+ *
+ *    Functionality: Fills the DL Tunnel Setup List
+ *
+ * @params[in] 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillDlTnlSetupList(DLUPTNLInformation_ToBeSetup_List_t *dlTnlInfo, UpTnlCfg *tnlCfg)
+{
+   uint8_t ret = ROK, arrIdx = 0, eleCount = 0;
+
+   eleCount = 1;
+   dlTnlInfo->list.count = eleCount; 
+   dlTnlInfo->list.size = (eleCount * sizeof(DLUPTNLInformation_ToBeSetup_Item_t *));
+
+   /* Initialize the DL Tnl Setup List Members */
+   DU_ALLOC(dlTnlInfo->list.array, dlTnlInfo->list.size);
+   if(dlTnlInfo->list.array == NULLP)
+   {
+      DU_LOG(" ERROR  -->  F1AP : Memory allocation for DL Tnl Setup List in fillDlTnlSetupList()");
+      ret = RFAILED;
+   }
+   for(arrIdx=0; arrIdx < eleCount; arrIdx++)
+   {
+      DU_ALLOC(dlTnlInfo->list.array[arrIdx], sizeof(DLUPTNLInformation_ToBeSetup_Item_t));
+      if(dlTnlInfo->list.array[arrIdx] == NULLP)
+      {
+         DU_LOG(" ERROR  -->  F1AP : Memory allocation for arrIdx [%d] failed in fillDlTnlSetupList()", arrIdx);
+         return RFAILED;
+      }
+      dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.present = UPTransportLayerInformation_PR_gTPTunnel;
+      DU_ALLOC(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+      if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel == NULLP)
+      {
+         DU_LOG(" ERROR  -->  F1AP : Memory allocation for DL tunnel info in fillDlTnlSetupList()");
+         return RFAILED;
+      }
+      ret = fillGtpTunnelforDl(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel,\
+               tnlCfg->tnlCfg1);
+      if(ret != ROK)
+         break;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Fills the Drb Setup List for Ue Context Setup Response
+ *
+ * @details
+ *
+ *    Function : fillDrbSetupList
+ *
+ *    Functionality: Fills the Drb Setup List for Ue Context Setup Response
+ *
+ * @params[in] 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t fillDrbSetupList(DRBs_Setup_List_t *drbSetupList, DuUeCfg *ueCfg)
+{
+   uint8_t ret = ROK, arrIdx = 0, eleCount = 0;
+   DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+   eleCount = ueCfg->numDrb;
+   drbSetupList->list.count = eleCount;
+   drbSetupList->list.size = \
+       (eleCount * sizeof(DRBs_Setup_Item_t *));
+
+   /* Initialize the Drb Setup List Members */
+   DU_ALLOC(drbSetupList->list.array, drbSetupList->list.size);
+   if(drbSetupList->list.array == NULLP)
+   {
+      DU_LOG(" ERROR  -->  F1AP : Memory allocation for DRB Setup List in fillDrbSetupList()");
+      ret = RFAILED;
+   }
+
+   for(arrIdx=0; arrIdx < eleCount; arrIdx++)
+   {
+      DU_ALLOC(drbSetupList->list.array[arrIdx], sizeof(DRBs_Setup_Item_t));
+      if(drbSetupList->list.array[arrIdx] == NULLP)
+      {
+         DU_LOG(" ERROR  -->  F1AP : Memory allocation for arrIdx [%d] failed in fillDrbSetupList()", arrIdx);
+         return RFAILED;
+      }
+      drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+      drbItemIe->id = ProtocolIE_ID_id_DRBs_Setup_Item;
+      drbItemIe->criticality = Criticality_reject;
+      drbItemIe->value.present = DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item;
+      drbItemIe->value.choice.DRBs_Setup_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
+      ret = fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List,\
+          &ueCfg->upTnlInfo[arrIdx]);
+      if(ret != ROK)
+         break;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds and sends the UE Setup Response
+ *
+ * @details
+ *
+ *    Function : BuildAndSendUeContextSetupRsp
+ *
+ *    Functionality: Constructs the UE Setup Response and sends
+ *                   it to the DU through SCTP.
+ *
+ * @params[in] uint8_t cellId,uint8_t ueIdx
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueIdx)
+{
+   uint8_t   idx, ret, cellIdx, elementCnt;
+   uint32_t  gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
+   uint32_t  gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
+   asn_enc_rval_t  encRetVal;        /* Encoder return value */
+   F1AP_PDU_t               *f1apMsg = NULLP;
+   UEContextSetupResponse_t *ueSetRsp = NULLP;
+   CellGroupConfigRrc_t     *cellGrpCfg = NULLP;
+   DuUeCb                   *ueCb = NULLP;
+
+   DU_LOG("\n INFO   -->  F1AP : Building UE Context Setup Response for cellId %d, ueIdx %d\n", cellId, ueIdx);
+
+   while(true)
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+        DU_LOG(" ERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
+        ret = RFAILED;
+        break;
+      }
+
+      f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
       DU_ALLOC(f1apMsg->choice.successfulOutcome,
            sizeof(SuccessfulOutcome_t));
       if(f1apMsg->choice.successfulOutcome == NULLP)
@@ -10036,7 +11546,7 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
 
       ueSetRsp =
         &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
-      elementCnt = 3;
+      elementCnt = 4;
       ueSetRsp->protocolIEs.list.count = elementCnt;
       ueSetRsp->protocolIEs.list.size = \
                                        elementCnt * sizeof(UEContextSetupResponse_t *);
@@ -10101,19 +11611,44 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
            cellGrpCfg = (CellGroupConfigRrc_t*)ueCb->f1UeDb->duUeCfg.cellGrpCfg;
            ret = EncodeUeCntxtDuToCuInfo(&ueSetRsp->protocolIEs.list.array[idx]->value.\
                     choice.DUtoCURRCInformation.cellGroupConfig, cellGrpCfg);
-           /* Free UeContext Db created during Ue context Req */
-           freeF1UeDb(ueCb->f1UeDb);
-           ueCb->f1UeDb = NULLP;
+            if(ret == RFAILED)
+           {
+               DU_LOG("\nERROR  -->  F1AP : Failed to EncodeUeCntxtDuToCuInfo in BuildAndSendUeContextSetupRsp()");
+               freeF1UeDb(ueCb->f1UeDb);
+               ueCb->f1UeDb = NULLP;
+               break;
+           }
          }
       }
       else
       {
-         DU_LOG("\nERROR  -->  F1AP: Failed to form DUtoCU RRCInfo at BuildAndSendUeContextSetupRsp()");
+         DU_LOG("\nERROR  -->  F1AP : Failed to form DUtoCU RRCInfo at BuildAndSendUeContextSetupRsp()");
          ret = RFAILED;
+         break;
       }
+
+      /* Drb Setup List */
+      idx++;
+      ueSetRsp->protocolIEs.list.array[idx]->id  = \
+                                ProtocolIE_ID_id_DRBs_Setup_List;
+      ueSetRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
+      ueSetRsp->protocolIEs.list.array[idx]->value.present =\
+                                UEContextSetupResponseIEs__value_PR_DRBs_Setup_List;
+      ret = fillDrbSetupList(&ueSetRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List,\
+               &ueCb->f1UeDb->duUeCfg);
       if(ret == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Failed to fillDrbSetupList in BuildAndSendUeContextSetupRsp()");
+         freeF1UeDb(ueCb->f1UeDb);
+         ueCb->f1UeDb = NULLP;
          break;
+      }
+
+       /* Free UeContext Db created during Ue context Req */
+       freeF1UeDb(ueCb->f1UeDb);
+       ueCb->f1UeDb = NULLP;
 
+      /* TODO: To send Drb list */
       xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
 
       /* Encode the UE context setup response type as APER */
@@ -10124,14 +11659,14 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
       /* Encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
       {
-        DU_LOG( "\nERROR  -->  F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\
+        DU_LOG( "\nERROR  -->  F1AP : Could not encode UE Context Setup Response structure (at %s)\n",\
               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
         ret = RFAILED;
         break;
       }
       else
       {
-        DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UE Context Setup Request\n");
+        DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UE Context Setup Response\n");
         for(int i=0; i< encBufSize; i++)
         {
            printf("%x",encBuf[i]);
@@ -10139,9 +11674,9 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
       }
 
       /* Sending  msg  */
-      if(SendF1APMsg(DU_APP_MEM_REGION,DU_POOL)        != ROK)
+      if(sendF1APMsg() != ROK)
       {
-        DU_LOG("\nERROR  -->  F1AP : Sending UE Context Setup Request Failed");
+        DU_LOG("\nERROR  -->  F1AP : Sending UE Context Setup Response failed");
         ret = RFAILED;
         break;
       }
@@ -10165,7 +11700,7 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
 *         failure = RFAILED
 *
 * ****************************************************************/
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx)
 {
    uint8_t cellIdx = 0, actionType = 0; 
 
@@ -10175,11 +11710,15 @@ uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
    switch(actionType)
    {
       case UE_CTXT_SETUP:
-         BuildAndSendUeContextSetupRsp(ueIdx, cellId);
-         break;
+         {
+            BuildAndSendUeContextSetupRsp(cellId,ueIdx);
+            break;
+         }
       case UE_CTXT_MOD:
-         //TODO: Build Ue context Modification Rsp
-         break;
+         {
+            BuildAndSendUeContextModRsp(cellId, ueIdx);
+            break;
+         }
       default:
          DU_LOG("ERROR  -->  F1AP: Invalid Action Type %d at BuildAndSendUeCtxtRsp()", actionType);
          break;
@@ -10341,7 +11880,7 @@ uint8_t BuildAndSendF1ResetReq()
         }
       }
 
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Reset request failed");
         break;
@@ -10494,7 +12033,7 @@ uint8_t BuildAndSendF1ResetAck()
         }
       }
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending F1 Reset Acknowledgement failed");
         break;
@@ -10761,7 +12300,7 @@ uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
       }
 
       /* Sending msg */
-      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      if(sendF1APMsg() != ROK)
       {
         DU_LOG("\nERROR  -->  F1AP : Sending RRC delivery  msg request failed");
         break;
@@ -11024,6 +12563,127 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck)
       free(gnbDuAck->protocolIEs.list.array);
    }
 }
+
+/*******************************************************************
+*
+* @brief Building  result of gnb-du config update ack output
+*
+* @details
+*
+*    Function : duProcGnbDuCfgUpdAckMsg 
+*
+*    Functionality: 
+*        Building output of gnb-du config update ack 
+*
+* @params[in] transId
+* @return void
+*
+* ****************************************************************/
+
+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;
+   CmLList *f1apPduNode = NULLP;
+   ReservedF1apPduInfo *f1apPduInfo =NULLP;
+   F1AP_PDU_t *f1apMsgPdu = NULLP;
+   GNBDUConfigurationUpdate_t *gnbDuConfigUpdate = NULLP;
+   BIT_STRING_t *cellIdentity=NULLP;
+   struct Served_Cells_To_Delete_ItemIEs *deleteItemIe=NULLP;
+   Served_Cells_To_Delete_List_t *cellsToDelete=NULLP;
+   Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
+
+   DU_LOG("\nINFO   -->  DU APP: GNB-DU config update Ack received ");
+   f1apPduNode = searchFromReservedF1apPduList(transId);
+   f1apPduInfo = (ReservedF1apPduInfo *)f1apPduNode->node;
+   f1apMsgPdu = (F1AP_PDU_t *)f1apPduInfo->f1apMsg;
+
+   if(f1apMsgPdu)
+   {
+      if(f1apMsgPdu->choice.initiatingMessage)
+      {
+         gnbDuConfigUpdate = &f1apMsgPdu->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
+         for(ieIdx=0; ieIdx < gnbDuConfigUpdate->protocolIEs.list.count; ieIdx++)
+         {
+            switch(gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->id)
+            {
+               case ProtocolIE_ID_id_Served_Cells_To_Delete_List:
+                  {
+                     cellsToDelete = &gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+                                     Served_Cells_To_Delete_List;
+                     if(cellsToDelete->list.array)
+                     {
+                        if(cellsToDelete->list.array[arrIdx])
+                        {
+                           deleteItemIe = (Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx];
+                           deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+                           if(deleteItem->oldNRCGI.nRCellIdentity.buf)
+                           {
+                              cellIdentity = &deleteItem->oldNRCGI.nRCellIdentity;
+                              bitStringToInt(cellIdentity, &cellId);
+                           }
+                        }
+                     }
+
+                     GET_CELL_IDX(cellId, cellIdx);
+                     if(duCb.actvCellLst[cellIdx] != NULLP)
+                     {
+                        if(duCb.actvCellLst[cellIdx]->numActvUes == 0)
+                        {
+                           duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+                           ret = duSendCellDeletReq(cellId);
+                           if(ret == RFAILED)
+                           {
+                              DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
+                              request for cellId[%d]", cellId);
+                           }
+                        }
+                        else
+                        {
+                           totalActiveUe = duCb.actvCellLst[cellIdx]->numActvUes;
+                           while(totalActiveUe)
+                           {
+                              if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].ueState != UE_ACTIVE)
+                              {
+                                 ueIdx++;
+                                 continue;
+                              }
+
+                              crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
+                              GET_UE_IDX(crnti,ueId);
+                              /* Sending Ue Context release request only for maximum supporting UEs */
+                              ret = BuildAndSendUeContextReleaseReq(cellId, ueId);
+                              if(ret == RFAILED)
+                              {
+                                 DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
+                                 request for cellId[%d]", cellId);
+                              }
+                              ueIdx++;
+                              totalActiveUe--;
+                           }
+                        }
+                     }
+                     else
+                     {
+                        DU_LOG("\nERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
+                        ret = RFAILED;
+                     }
+                     break;
+                  }
+
+               default:
+                  break;
+            }
+         }
+      }
+   }
+   
+   FreeDUConfigUpdate(f1apMsgPdu);
+   deleteFromReservedF1apPduList(f1apPduNode);
+   return ret;
+}
+
 /*******************************************************************
 *
 * @brief Processes GNB DU config update ack
@@ -11040,28 +12700,40 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck)
 * ****************************************************************/
 uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
 {
-   uint8_t ieIdx;
+   uint8_t ieIdx=0,transId=0;
    GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck = NULLP;
-   
+
    DU_LOG("\nINFO   -->  F1AP : GNB-DU config update acknowledgment");
    gnbDuAck = &f1apMsg->choice.successfulOutcome->value.choice.GNBDUConfigurationUpdateAcknowledge;
-   
+
    for(ieIdx=0; ieIdx < gnbDuAck->protocolIEs.list.count; ieIdx++)
    {
       switch(gnbDuAck->protocolIEs.list.array[ieIdx]->id)
       {
          case ProtocolIE_ID_id_TransactionID:
-           break;
+            {
+               transId = gnbDuAck->protocolIEs.list.array[ieIdx]->value.choice.TransactionID;
+               break;
+            }
          case ProtocolIE_ID_id_Cells_to_be_Activated_List:
-           break;
+            {
+               break;
+            }
          default :
-            DU_LOG("\nERROR  -->  F1AP: Invalid IE Received: %ld, at procF1GNBDUCfgUpdAck()", \
-           gnbDuAck->protocolIEs.list.array[ieIdx]->id);
-           break;
+            {
+               DU_LOG("\nERROR  -->  F1AP: procF1GNBDUCfgUpdAck(): Invalid IE Received: %ld", \
+                     gnbDuAck->protocolIEs.list.array[ieIdx]->id);
+               break;
+            }
       }
    }
-   duProcGnbDuCfgUpdAckMsg();
+   
+   duProcGnbDuCfgUpdAckMsg(transId);
+    
 #if 0
+   /* presently we are not supporting F1 Reset from DU to CU , we are only
+    * supporting F1 Reset from CU to DU */
+
    if(BuildAndSendF1ResetReq() != ROK)
    {
       return RFAILED;
@@ -11178,7 +12850,7 @@ uint8_t procF1DlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
               if(f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size > 0)
               {
                  dlMsg.rrcMsgSize = f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.size;
-                 DU_ALLOC(dlMsg.rrcMsgPdu, dlMsg.rrcMsgSize);
+                 DU_ALLOC_SHRABL_BUF(dlMsg.rrcMsgPdu, dlMsg.rrcMsgSize);
                  if(dlMsg.rrcMsgPdu)
                  {
                     memcpy(dlMsg.rrcMsgPdu, f1DlRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf,\
@@ -11214,55 +12886,1241 @@ uint8_t procF1DlRrcMsgTrans(F1AP_PDU_t *f1apMsg)
    freeAperDecodef1DlRrcMsg(f1DlRrcMsg);
    return ret;
 }
-
-/*****************************************************************i
- *
- * @brief Handles received F1AP message and sends back response  
- *
- * @details
- *
- *    Function : F1APMsgHdlr
- *
- *    Functionality:
- *         - Decodes received F1AP control message
- *         - Prepares response message, encodes and sends to SCTP
- *
- * @params[in] 
- * @return ROK     - success
- *         RFAILED - failure
+/*******************************************************************
  *
- * ****************************************************************/
-void F1APMsgHdlr(Buffer *mBuf)
-{
-   int i =0;
-   char *recvBuf =NULLP;
-   MsgLen copyCnt =0;
-   MsgLen recvBufLen =0;
-   F1AP_PDU_t *f1apMsg =NULLP;
-   asn_dec_rval_t rval; /* Decoder return value */
-   F1AP_PDU_t f1apasnmsg ;
-   DU_LOG("\nINFO  -->  F1AP : Received F1AP message buffer");
-   ODU_PRINT_MSG(mBuf, 0,0);
+* @brief Builds the DRB to be Setup Mod list
+*
+* @details
+*
+*    Function : 
+*
+*    Functionality: Constructs the DRB to be Setup Mod list
+*
+* @params[in] DRBs_SetupMod_List_t *drbSet
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
 
-   /* Copy mBuf into char array to decode it */
-   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
-   DU_ALLOC(recvBuf, (Size)recvBufLen);
+uint8_t BuildDrbSetupModList(DRBs_SetupMod_List_t *drbSet , DuUeCfg *ueCfg)
+{
+   uint8_t arrIdx =0;
+   uint8_t drbCnt =0;
+   struct DRBs_SetupMod_ItemIEs *drbItemIe;
 
-   if(recvBuf == NULLP)
+   drbCnt = ueCfg->numDrbSetupMod;
+   drbSet->list.count = drbCnt;
+   drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *);
+   DU_ALLOC(drbSet->list.array, drbSet->list.size);
+   if(drbSet->list.array == NULLP)
    {
-      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed");
-      return;
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+      return  RFAILED;
    }
-   if(ODU_COPY_MSG_TO_FIX_BUF(mBuf, 0, recvBufLen, (Data *)recvBuf, &copyCnt) != ROK)
+   for(arrIdx=0; arrIdx<drbCnt; arrIdx++)
    {
-      DU_LOG("\nERROR   -->  F1AP : Failed while copying %d", copyCnt);
-      return;
+      DU_ALLOC(drbSet->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
+      if(drbSet->list.array[arrIdx] == NULLP)
+      {
+             DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+             return  RFAILED;
+      }
+
+      drbItemIe = (struct DRBs_SetupMod_ItemIEs *)drbSet->list.array[arrIdx];
+      drbItemIe->id = ProtocolIE_ID_id_DRBs_SetupMod_Item;
+      drbItemIe->criticality = Criticality_reject;
+      drbItemIe->value.present = DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item;
+      drbItemIe->value.choice.DRBs_SetupMod_Item.dRBID = ueCfg->upTnlInfo[arrIdx].drbId;
+      if(fillDlTnlSetupList(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List,\
+      &ueCfg->upTnlInfo[arrIdx])!= ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Failed to fill DlTnl SetupList in BuildDrbToBeSetupModList");
+         return RFAILED;
+      }
+      
    }
 
-   printf("\nDEBUG   -->  F1AP : Received flat buffer to be decoded : ");
-   for(i=0; i< recvBufLen; i++)
+   return ROK;
+}
+/*******************************************************************
+* @brief Free the memory allocated for DRB setup List
+*
+* @details
+*
+*    Function : FreeDrbSetupModList 
+*
+*    Functionality:
+*       Free the memory allocated for DRB setup list
+*
+* @params[in] DRBs_Setup_List_t *
+* @return void
+*
+* ****************************************************************/
+void FreeDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList)
+{
+   uint8_t arrIdx = 0;
+   DRBs_SetupMod_ItemIEs_t *drbItemIe = NULLP;
+
+   for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
    {
-      printf("%x",recvBuf[i]);
+      drbItemIe = ((DRBs_SetupMod_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+      freeDlTnlInfo(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List);
+      DU_FREE(drbSetupList->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
+   }
+   DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
+}
+/*******************************************************************
+* @brief Free the memory allocated for UE Context Mod Response
+*
+* @details
+*
+*    Function : FreeUeContextModResp 
+*
+*    Functionality:
+*       Free the memory allocated for UE Context Mod Response
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+
+void FreeUeContextModResp(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextModificationResponse_t *ueContextModifyRes = NULLP;
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.successfulOutcome)
+      {
+         ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
+         if(ueContextModifyRes->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueContextModifyRes->protocolIEs.list.count; ieIdx++)
+            {
+               if(ueContextModifyRes->protocolIEs.list.array[ieIdx])
+               {
+                  switch(ueContextModifyRes->protocolIEs.list.array[ieIdx]->id)
+                  {
+                     case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+                        break;
+                     case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+                        break;
+                     case ProtocolIE_ID_id_DRBs_SetupMod_List:
+                        {
+                            FreeDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+                            value.choice.DRBs_SetupMod_List));
+                            break; 
+                        }
+                  }
+                  DU_FREE(ueContextModifyRes->protocolIEs.list.array[ieIdx], sizeof(UEContextModificationResponse_t));
+               }
+
+            }
+            DU_FREE(ueContextModifyRes->protocolIEs.list.array, ueContextModifyRes->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      }
+      DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+}
+
+/*****************************************************************i
+*
+* @brief Creating the ue context modifcation response and sending
+*
+* @details
+*
+*    Function : BuildAndSendUeContextModRsp 
+*
+*    Functionality:
+*         - Creating the ue context modifcation response 
+*
+* @params[in] uint8_t cellId,uint8_t ueIdx
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx)
+{
+   uint8_t   ieIdx = 0;
+   uint8_t   cellIdx =0;
+   uint8_t   elementCnt = 0;
+   uint8_t   ret = RFAILED;
+   uint32_t  gnbCuUeF1apId;   /* gNB-CU UE F1AP Id */
+   uint32_t  gnbDuUeF1apId;   /* gNB-DU UE F1AP Id */
+   F1AP_PDU_t *f1apMsg = NULLP;
+   asn_enc_rval_t         encRetVal;
+   UEContextModificationResponse_t *ueContextModifyRes = NULLP;
+   DuUeCb                   *ueCb = NULLP;
+
+   DU_LOG("\nINFO  -->  F1AP : Building Ue context modification response\n");
+
+   while(1)
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed Ue context modification");
+         break;
+      }
+
+      f1apMsg->present =  F1AP_PDU_PR_successfulOutcome;
+
+      DU_ALLOC(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      if(f1apMsg->choice.successfulOutcome == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed Ue context modification");
+         break;
+      }
+      f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_UEContextModification;
+      f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+      f1apMsg->choice.successfulOutcome->value.present = SuccessfulOutcome__value_PR_UEContextModificationResponse;
+
+      ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
+
+      elementCnt = 3;
+      ueContextModifyRes->protocolIEs.list.count = elementCnt;
+      ueContextModifyRes->protocolIEs.list.size = elementCnt*sizeof(UEContextModificationResponse_t*);
+
+      /* Initialize the UE context modification members */
+      DU_ALLOC(ueContextModifyRes->protocolIEs.list.array, ueContextModifyRes->protocolIEs.list.size);
+      if(ueContextModifyRes->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Memory allocation for UE context modifcation Request failed");
+         break;
+      }
+
+      for(ieIdx=0 ; ieIdx<elementCnt; ieIdx++)
+      {
+         DU_ALLOC(ueContextModifyRes->protocolIEs.list.array[ieIdx], sizeof(UEContextModificationResponse_t));
+         if(ueContextModifyRes->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : Memory allocation for UE context modifcation Request failed");
+            break;
+         }
+      }
+
+      /* Fetching Ue Cb Info*/
+      GET_CELL_IDX(cellId, cellIdx);
+      gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+      gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+      ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1];
+
+      ieIdx=0;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
+
+      ieIdx++;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present=\
+      UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+
+      ieIdx++;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+      ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
+      if(ueCb->f1UeDb)
+      {
+         ret = BuildDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+                  value.choice.DRBs_SetupMod_List) , &ueCb->f1UeDb->duUeCfg);
+         if(ret != ROK)
+         {
+            DU_LOG( "\nERROR  -->  F1AP : Failed to build drb setupmod List ");
+            break;
+         }
+         freeF1UeDb(ueCb->f1UeDb);
+         ueCb->f1UeDb = NULLP;
+      }
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the F1SetupRequest type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,encBuf);
+
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG( "\nERROR  -->  F1AP : Could not encode UE Context Setup Request structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         ret = RFAILED;
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UE Context Modification Response\n");
+         for(int i=0; i< encBufSize; i++)
+         {
+            printf("%x",encBuf[i]);
+         }
+      }
+
+      /* Sending  msg  */
+      if(sendF1APMsg() != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Setup Res Failed");
+         ret = RFAILED;
+         break;
+      }
+      break;
+   }
+   FreeUeContextModResp(f1apMsg);
+   return ret;
+}
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ *          for QOSInfo
+ *
+ * @details
+ *
+ *    Function : freeAperDecodeQosInfo
+ *
+ *    Functionality:  Deallocating the memory allocated for QOSInfo
+ *
+ * @params[in] QoSFlowLevelQoSParameters_t *drbQos
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeQosInfo(QoSFlowLevelQoSParameters_t *drbQos)
+{
+   if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI != NULLP)
+   {
+      if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+      {
+         if(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+         {
+            free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume);
+         }
+         free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow);
+      }
+      free(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI);
+   }
+}
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ *          for UlTnlInfoforDrb
+ *
+ * @details
+ *
+ *    Function : freeAperDecodeUlTnlInfoforDrbSetupMod 
+ *
+ *    Functionality:  Deallocating memory allocated for UlTnlInfoforDrb
+ *
+ * @params[in] ULUPTNLInformation_ToBeSetup_List_t *ulInfo
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeAperDecodeUlTnlInfoforDrbSetupMod(ULUPTNLInformation_ToBeSetup_List_t *ulInfo)
+{
+   uint8_t arrIdx =0;
+
+   if(ulInfo->list.array)
+   {
+      for(arrIdx=0; arrIdx<ulInfo->list.count ; arrIdx++)
+      {
+         if(ulInfo->list.array[arrIdx])
+         {
+            if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel )
+            {
+               if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.buf)
+               {
+                  if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf)
+                  {
+                     free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+                           gTP_TEID.buf);
+                  }
+                  free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+                        transportLayerAddress.buf);
+               }
+               free(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel);
+            }
+            free(ulInfo->list.array[arrIdx]);
+         }
+      }
+      free(ulInfo->list.array);
+   }
+}
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ *          for DrbSetupModItem  
+ *
+ * @details
+ *
+ *    Function : freeAperDecodeDrbSetupModItem 
+ *
+ *    Functionality:  Deallocating memory allocated for DrbSetupModItem
+ *
+ * @params[in] DRBs_ToBeSetupMod_Item_t *drbItem
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeDrbSetupModItem(DRBs_ToBeSetupMod_Item_t *drbItem)
+{
+   uint8_t arrIdx =0;
+   SNSSAI_t *snssai =NULLP;
+   Flows_Mapped_To_DRB_List_t *flowMap = NULLP;
+
+   drbItem->qoSInformation.present = QoSInformation_PR_choice_extension;
+   switch(drbItem->qoSInformation.present)
+   {
+      case QoSInformation_PR_NOTHING:
+         break;
+      case QoSInformation_PR_eUTRANQoS:
+         {
+            if(drbItem->qoSInformation.choice.eUTRANQoS)
+            {
+               free(drbItem->qoSInformation.choice.eUTRANQoS);
+            }
+            break;
+         }
+      case QoSInformation_PR_choice_extension:
+         {
+            if(drbItem->qoSInformation.choice.choice_extension)
+            {
+               freeAperDecodeQosInfo(&drbItem->qoSInformation.choice.choice_extension->value.choice.\
+                     DRB_Information.dRB_QoS);
+               snssai = &drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI;
+               if(snssai->sST.buf)
+               {
+                  free(snssai->sST.buf);
+               }
+               if(snssai->sD)
+               {
+                  if(snssai->sD->buf)
+                  {
+                     free(snssai->sD->buf);
+                  }
+                  free(snssai->sD);
+               }
+
+               flowMap = &drbItem->qoSInformation.choice.choice_extension->value.choice.\
+                         DRB_Information.flows_Mapped_To_DRB_List;
+               if(flowMap->list.array)
+               {
+                  for(arrIdx=0; arrIdx<flowMap->list.count; arrIdx++)
+                  {
+                     if(flowMap->list.array[arrIdx] )
+                     {
+                        freeAperDecodeQosInfo(&flowMap->list.array[arrIdx]->qoSFlowLevelQoSParameters);
+                        free(flowMap->list.array[arrIdx]);
+                     }
+                  }
+                  free(flowMap->list.array);
+               }
+
+               free(drbItem->qoSInformation.choice.choice_extension);
+            }
+            break;
+         }
+
+   }
+   freeAperDecodeUlTnlInfoforDrbSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List);
+   if(drbItem->uLConfiguration)
+   {
+      free(drbItem->uLConfiguration);
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ *          for DrbToBeSetupModList
+ *
+ * @details
+ *
+ *    Function : freeAperDecodeDrbToBeSetupModList
+ *
+ *    Functionality:  Deallocating memory allocated for DrbToBeSetupModList
+ *
+ * @params[in] DRBs_ToBeSetupMod_List_t *drbSet
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void freeAperDecodeDrbToBeSetupModList(DRBs_ToBeSetupMod_List_t *drbSet)
+{
+   uint8_t arrIdx =0;
+   struct DRBs_ToBeSetupMod_ItemIEs *drbItemIe;
+
+   if(drbSet->list.array)
+   {
+      for(arrIdx=0; arrIdx<drbSet->list.count ; arrIdx++)
+      {
+         if(drbSet->list.array[arrIdx] != NULLP)
+         {
+            if(arrIdx == 0)
+            {
+               drbItemIe = (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx];
+               freeAperDecodeDrbSetupModItem(&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item));
+            }
+            free(drbSet->list.array[arrIdx]);
+         }
+      }
+      free(drbSet->list.array);
+   }
+
+}
+/*******************************************************************
+ *
+ * @brief Deallocating the memory allocated by the aper decoder
+ *          for UeContextModificationReqMsg
+ *
+ * @details
+ *
+ *    Function : freeAperDecodeUeContextModificationReqMsg
+ *
+ *    Functionality:  Deallocating memory allocated for
+ *                  UeContextModificationReqMsg
+ *
+ * @params[in] UEContextModificationRequest_t *UeContextModifyReq
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *UeContextModifyReq )
+{
+   uint8_t arrIdx, ieId;
+
+   if(UeContextModifyReq->protocolIEs.list.array)
+   {
+      for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
+      {
+         if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
+         {
+            ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
+            switch(ieId)
+            {
+               case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+                  {
+                     freeAperDecodeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->\
+                           value.choice.DRBs_ToBeSetupMod_List);
+                     break;
+                  }
+            }
+            free(UeContextModifyReq->protocolIEs.list.array[arrIdx]);
+         }
+      }
+      free(UeContextModifyReq->protocolIEs.list.array);
+   }
+}
+/*******************************************************************
+ *
+ * @brief processing the F1 UeContextModificationReq
+ *
+ * @details
+ *
+ *    Function : procF1UeContextModificationReq
+ *
+ *    Functionality:  processing the F1 UeContextModificationReq
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ *
+ * @return
+ * ****************************************************************/
+uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
+{
+   UEContextModificationRequest_t *ueContextModifyReq = NULLP;
+   uint8_t  ret = ROK, ieIdx = 0, cellIdx=0, ueIdx=0;
+   DuUeCb   *duUeCb = NULLP;
+   DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
+   DRBs_ToBeModified_List_t *drbModifiedCfg;
+   uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
+
+   ueContextModifyReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
+   for(ieIdx=0; (ieIdx < ueContextModifyReq->protocolIEs.list.count && ret == ROK); ieIdx++)
+   {
+      switch(ueContextModifyReq->protocolIEs.list.array[ieIdx]->id)
+      {
+         case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+            {
+               gnbCuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID;
+               break;
+            }
+         case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+            {
+               gnbDuUeF1apId = ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID;
+               break;
+            }
+         case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+         case ProtocolIE_ID_id_DRBs_ToBeModified_List:
+            {
+               for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+               {
+                  for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+                  {
+                     if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+                           (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+                     {
+
+                        duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+                        if(duUeCb->f1UeDb == NULLP)
+                        {
+                           DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+                        }
+                        if(duUeCb->f1UeDb)
+                        {
+                           duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
+                           if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\
+                                 UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List)
+                           {
+                              drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+                              choice.DRBs_ToBeSetupMod_List;
+                              
+                              if(extractDrbListToSetupMod(NULL, drbSetupModCfg, NULL, drbSetupModCfg->list.count,\
+                              &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, NULL))
+                              {
+                                 DU_LOG("\nERROR  -->  DU APP : Failed at extractDrbListToSetupMod() for DrbSetupModList");
+                                 ret = RFAILED;
+                              }
+                           }
+
+                           if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \
+                                  UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List)
+
+                           {
+                              drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+                              choice.DRBs_ToBeModified_List;
+                              if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbModifiedCfg->list.count,\
+                                 &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap, &duUeCb->rlcUeCfg))
+                              {
+                                 DU_LOG("\nERROR  -->  DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
+                                 ret = RFAILED;
+                              }
+                           }
+                        }
+                        break;
+                     }
+                  }
+                  if(ueIdx >= duCb.actvCellLst[cellIdx]->numActvUes)
+                  {
+                     DU_LOG("\nERROR  -->  DU APP : wrong values of gnbCuUeF1apId and gnbDuUeF1apId ");
+                     ret = RFAILED;
+                  }
+               }
+               break;
+            }
+      }
+   }
+   if(ret != RFAILED)
+   {
+      ret = duProcUeContextModReq(duUeCb);
+   }
+   freeAperDecodeUeContextModificationReqMsg(ueContextModifyReq);
+   return ret; 
+}
+/*****************************************************************i
+*
+* @brief Free memory allocated for UE Context Release Request
+*
+* @details
+*
+*    Function : FreeUeContextReleaseReq
+*
+*    Functionality:
+*         - Free memory allocated for UE Context Release Request
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void 
+*
+* *************************************************************/
+void FreeUeContextReleaseReq(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextReleaseRequest_t *ueReleaseReq = NULLP;
+   
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.initiatingMessage)
+      {
+         ueReleaseReq =&f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
+         if(ueReleaseReq->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueReleaseReq->protocolIEs.list.count; ieIdx++)
+            {
+               DU_FREE(ueReleaseReq->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseRequest_t));
+            }
+            DU_FREE(ueReleaseReq->protocolIEs.list.array, ueReleaseReq->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      }
+      DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+
+}
+/*****************************************************************i
+*
+* @brief Build and Send UE Context Release Request  
+*
+* @details
+*
+*    Function : BuildAndSendUeContextReleaseReq
+*
+*    Functionality:
+*         - Build and Send UE Context Release Request 
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* *************************************************************/
+uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx)
+{
+   bool memAllocFail = false;
+   uint8_t ieIdx =0;
+   uint8_t ret = RFAILED;
+   uint16_t cellIdx =0;
+   uint16_t crnti = 0;
+   uint8_t  elementCnt = 0;
+   uint32_t  gnbCuUeF1apId =0;   /* gNB-CU UE F1AP Id */
+   uint32_t  gnbDuUeF1apId =0;   /* gNB-DU UE F1AP Id */
+   asn_enc_rval_t encRetVal; 
+   F1AP_PDU_t *f1apMsg = NULLP;
+   UEContextReleaseRequest_t *ueReleaseReq = NULLP;
+
+   DU_LOG("\nINFO  --> Building the UE Context Release Request");
+   do
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for f1apMsg");
+         break;
+      }
+
+      f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+      DU_ALLOC(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+      if(f1apMsg->choice.initiatingMessage == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for\
+         initiatingMessage");   
+         break;
+      }
+      f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_UEContextReleaseRequest;
+      f1apMsg->choice.initiatingMessage->criticality = Criticality_reject;
+      f1apMsg->choice.initiatingMessage->value.present = \
+      InitiatingMessage__value_PR_UEContextReleaseRequest;
+
+      ueReleaseReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
+
+      elementCnt = 2;
+
+      ueReleaseReq->protocolIEs.list.count = elementCnt;
+      ueReleaseReq->protocolIEs.list.size = elementCnt * sizeof(UEContextReleaseRequest_t *);
+
+      /* Initialize the F1Setup members */
+      DU_ALLOC(ueReleaseReq->protocolIEs.list.array,ueReleaseReq->protocolIEs.list.size);
+      if(ueReleaseReq->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for IE array");
+         break;
+      }
+      for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+      {
+         DU_ALLOC(ueReleaseReq->protocolIEs.list.array[ieIdx],\
+               sizeof(UEContextReleaseRequest_t));
+         if(ueReleaseReq->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): Memory allocation failed for IE elements");
+            memAllocFail = true;  
+            break;
+         }
+      }
+      if(memAllocFail == true)
+         break;
+
+      /* Fetching Ue Cb Info*/
+      GET_CELL_IDX(cellId, cellIdx);
+      if(duCb.actvCellLst[cellIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): CellId[%d] does not exist", cellId);
+         break;
+      }
+      else
+      {
+         GET_CRNTI(crnti, ueIdx);
+         if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].crnti != crnti)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseReq(): crnti[%d] does not exist", crnti);
+            break;
+         }
+         gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
+         gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
+      }
+
+      ieIdx=0; 
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; 
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID =gnbCuUeF1apId;
+      
+      ieIdx++;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueReleaseReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =gnbDuUeF1apId;
+      
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the F1SetupRequest type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Could not encode UEContextReleaseRequest structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseRequest\n");
+         for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
+      }
+
+      /* Sending msg */
+      if(sendF1APMsg() != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Release Request failed");
+         break;
+      }
+      ret = ROK;
+      break;
+   }while(true);
+
+   FreeUeContextReleaseReq(f1apMsg);
+   return ret;
+}
+/*****************************************************************i
+ *
+ * @brief Free memory allocated for UE Context Release Complete
+ *
+ * @details
+ *
+ *    Function : FreeUeContextReleaseComplete
+ *
+ *    Functionality:
+ *         - Free memory allocated for UE Context Release Complete
+ *
+ * @params[in] F1AP_PDU_t *f1apMsg
+ * @return void
+ *
+ * *************************************************************/
+void FreeUeContextReleaseComplete(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx;
+   UEContextReleaseComplete_t *ueReleaseComplete = NULLP;
+
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.successfulOutcome)
+      {
+         ueReleaseComplete =&f1apMsg->choice.successfulOutcome->value.choice.UEContextReleaseComplete;
+         if(ueReleaseComplete->protocolIEs.list.array)
+         {
+            for(ieIdx=0 ; ieIdx<ueReleaseComplete->protocolIEs.list.count; ieIdx++)
+            {
+               DU_FREE(ueReleaseComplete->protocolIEs.list.array[ieIdx], sizeof(UEContextReleaseComplete_t));
+            }
+            DU_FREE(ueReleaseComplete->protocolIEs.list.array, ueReleaseComplete->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      }
+      DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+   }
+
+}
+/*****************************************************************i
+ *
+ * @brief Build and Send UE Context Release Complete
+ *
+ * @details
+ *
+ *    Function : BuildAndSendUeContextReleaseComplete
+ *
+ *    Functionality:
+ *         - Build and Send UE Context Release Complete
+ *
+ * @params[in]  cellId,  gnbCuUeF1apId, gnbDuUeF1apId
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * *************************************************************/
+uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId)
+{
+   bool memAllocFail = false;
+   uint8_t ieIdx =0, ret = RFAILED, elementCnt = 0;
+   asn_enc_rval_t encRetVal;
+   F1AP_PDU_t *f1apMsg = NULLP;
+   UEContextReleaseComplete_t *ueReleaseComplete = NULLP;
+
+   DU_LOG("\nINFO  --> Building the UE Context Release Complete");
+   do
+   {
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for f1apMsg");
+         break;
+      }
+
+      f1apMsg->present = F1AP_PDU_PR_successfulOutcome;
+      DU_ALLOC(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+      if(f1apMsg->choice.successfulOutcome == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for\
+               successfulOutcome");
+         break;
+      }
+      f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_UEContextRelease;
+      f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
+      f1apMsg->choice.successfulOutcome->value.present = \
+      SuccessfulOutcome__value_PR_UEContextReleaseComplete;
+
+      ueReleaseComplete = &f1apMsg->choice.successfulOutcome->value.choice.UEContextReleaseComplete;
+
+      elementCnt = 2;
+      ueReleaseComplete->protocolIEs.list.count = elementCnt;
+      ueReleaseComplete->protocolIEs.list.size = elementCnt * sizeof(UEContextReleaseComplete_t *);
+
+      /* Initialize the UE Release Complete members */
+      DU_ALLOC(ueReleaseComplete->protocolIEs.list.array,ueReleaseComplete->protocolIEs.list.size);
+      if(ueReleaseComplete->protocolIEs.list.array == NULLP)
+      {
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for IE array");
+         break;
+      }
+      for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+      {
+         DU_ALLOC(ueReleaseComplete->protocolIEs.list.array[ieIdx],\
+               sizeof(UEContextReleaseComplete_t));
+         if(ueReleaseComplete->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("\nERROR  -->  F1AP : BuildAndSendUeContextReleaseComplete(): Memory allocation failed for IE\
+            elements");
+            memAllocFail = true;
+            break;
+         }
+      }
+      if(memAllocFail == true)
+         break;
+
+
+      ieIdx=0;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.present = \
+      UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.choice.GNB_CU_UE_F1AP_ID =gnbCuUeF1apId;
+
+      ieIdx++;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.present =\
+      UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      ueReleaseComplete->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID =gnbDuUeF1apId;
+
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the F1SetupComplete type as APER */
+      memset(encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf, encBuf);
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Could not encode UEContextReleaseComplete structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
+      }
+      else
+      {
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseComplete\n");
+         for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
+      }
+
+      /* Sending msg */
+      if(sendF1APMsg() != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Sending UE Context Release Complete failed");
+         break;
+      }
+      ret = ROK;
+      break;
+   }while(true);
+   
+   if(ret == ROK && (duCb.actvCellLst[cellId-1]->numActvUes == 0))
+   {
+      duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+      ret = duSendCellDeletReq(cellId);
+      if(ret != ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP: BuildAndSendUeContextReleaseComplete(): Failed to process cell\
+               Delete req for CellId");
+      }
+   }
+   FreeUeContextReleaseComplete(f1apMsg);
+   return ret;
+
+}
+
+/*******************************************************************
+*
+* @brief added free part for the memory allocated by aper_decoder 
+*
+* @details
+*
+*    Function : freeAperDecodeUeContextReleaseCommand 
+*
+*    Functionality: added free part for the memory allocated by aper_decoder
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+void freeAperDecodeUeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx=0;
+   UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+   ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+   
+   if(ueContextReleaseCommand->protocolIEs.list.array)
+   {
+      for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++)
+      {
+         if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx])
+         {
+            switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id)
+            {
+               case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+                  break;
+               case ProtocolIE_ID_id_Cause:
+                  break;
+               case ProtocolIE_ID_id_RRCContainer:
+               {
+                  if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
+                  {
+                     free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
+                  }
+                  break;
+               }
+               default :
+                  DU_LOG("\nERROR  -->  F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\
+                       ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id);
+                  break;
+            }
+         }
+         free(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]);
+      }
+      free(ueContextReleaseCommand->protocolIEs.list.array);
+   }
+}
+/*******************************************************************
+*
+* @brief processing of UE Context Release Command
+*
+* @details
+*
+*    Function : procF1UeContextReleaseCommand 
+*
+*    Functionality: processing of UE Context Release Command
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return void
+*
+* ****************************************************************/
+uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t  ieIdx=0, ret=ROK, ueIdx=0;
+   uint16_t cellIdx =0;
+   bool ueIdxFound;
+   uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0;
+   DuUeCb   *duUeCb = NULLP;
+   UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+   ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+
+   if(ueContextReleaseCommand->protocolIEs.list.array)
+   {
+      for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++)
+      {
+         if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx])
+         {
+            switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id)
+            {
+               case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+                  {
+                     gnbCuUeF1apId= ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+                                    value.choice.GNB_CU_UE_F1AP_ID;
+                     break;
+                  }
+
+               case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+                  {
+                     gnbDuUeF1apId = ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+                                     value.choice.GNB_DU_UE_F1AP_ID;
+                     break;
+                  }
+
+               case ProtocolIE_ID_id_Cause:
+                  {
+                     break;
+                  }
+
+               case ProtocolIE_ID_id_RRCContainer:
+                  {
+                     for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+                     {
+                        for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+                        {
+                           if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+                                 (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+                           {
+                              duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+                              DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+                              if(duUeCb->f1UeDb)
+                              {
+                                 memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
+                                 duUeCb->f1UeDb->actionType = UE_CTXT_RELEASE;
+                                 duUeCb->f1UeDb->cellIdx = cellIdx;
+                                 /* Filling Dl RRC Msg Info */
+                                 DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+                                 if(!duUeCb->f1UeDb->dlRrcMsg)
+                                 {
+                                    DU_LOG("\nERROR  -->  DU APP : procF1UeContextReleaseCommand(): \
+                                    Memory allocation failed ");
+                                    ret = RFAILED;
+                                 }
+                                 else
+                                 {
+                                    duUeCb->f1UeDb->dlRrcMsgPres = true;
+                                    memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+                                    ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+                                          &ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+                                          value.choice.RRCContainer);
+                                 }
+
+                              }
+                              else
+                              {
+                                 DU_LOG("\nERROR  -->  DU APP : procF1UeContextReleaseCommand(): \
+                                 Memory allocation failed ");
+                                 ret = RFAILED;
+
+                              }
+
+                              ueIdxFound = true;
+                              break;
+                           }
+                        }
+                        if(ueIdxFound == true)
+                        {
+                           break;
+                        }
+                     }
+                     if(!ueIdxFound)
+                     {
+                        DU_LOG("\nERROR  -->  F1AP: DuUeCb is not found at procF1UeContextReleaseCommand()");
+                        ret = RFAILED;
+                     }
+
+
+                     break;
+                  }
+               default :
+                  DU_LOG("\nERROR  -->  F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\
+                        ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id);
+                  break;
+            }
+         }
+      }
+   }
+   if(ret != RFAILED)
+   {
+      duProcUeContextReleaseCommand(duUeCb);
+   }
+   freeAperDecodeUeContextReleaseCommand(f1apMsg);
+   return ret;
+}
+/**************************************************************
+ *
+ * @brief Handles received F1AP message and sends back response  
+ *
+ * @details
+ *
+ *    Function : F1APMsgHdlr
+ *
+ *    Functionality:
+ *         - Decodes received F1AP control message
+ *         - Prepares response message, encodes and sends to SCTP
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void F1APMsgHdlr(Buffer *mBuf)
+{
+   int i =0;
+   char *recvBuf =NULLP;
+   MsgLen copyCnt =0;
+   MsgLen recvBufLen =0;
+   F1AP_PDU_t *f1apMsg =NULLP;
+   asn_dec_rval_t rval; /* Decoder return value */
+   F1AP_PDU_t f1apasnmsg ;
+   DU_LOG("\nINFO  -->  F1AP : Received F1AP message buffer");
+   ODU_PRINT_MSG(mBuf, 0,0);
+
+   /* Copy mBuf into char array to decode it */
+   ODU_GET_MSG_LEN(mBuf, &recvBufLen);
+   DU_ALLOC(recvBuf, (Size)recvBufLen);
+
+   if(recvBuf == NULLP)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed");
+      return;
+   }
+   if(ODU_COPY_MSG_TO_FIX_BUF(mBuf, 0, recvBufLen, (Data *)recvBuf, &copyCnt) != ROK)
+   {
+      DU_LOG("\nERROR   -->  F1AP : Failed while copying %d", copyCnt);
+      return;
+   }
+
+   printf("\nDEBUG   -->  F1AP : Received flat buffer to be decoded : ");
+   for(i=0; i< recvBufLen; i++)
+   {
+      printf("%x",recvBuf[i]);
    }
 
    /* Decoding flat buffer into F1AP messsage */
@@ -11283,74 +14141,84 @@ void F1APMsgHdlr(Buffer *mBuf)
    switch(f1apMsg->present)
    {
       case F1AP_PDU_PR_successfulOutcome:
-        {
-           switch(f1apMsg->choice.successfulOutcome->value.present)
-           {
-              case SuccessfulOutcome__value_PR_ResetAcknowledge:
-                 {
-                    DU_LOG("\nINFO   -->  F1AP : F1ResetAcknowledge is received successfully ");
-                    break;
-                 }
-              case SuccessfulOutcome__value_PR_F1SetupResponse:
-                 {                             
+         {
+            switch(f1apMsg->choice.successfulOutcome->value.present)
+            {
+               case SuccessfulOutcome__value_PR_ResetAcknowledge:
+                  {
+                     DU_LOG("\nINFO   -->  F1AP : F1ResetAcknowledge is received successfully ");
+                     break;
+                  }
+               case SuccessfulOutcome__value_PR_F1SetupResponse:
+                  {                            
 #ifndef ODU_TEST_STUB
-                    procF1SetupRsp(f1apMsg);
+                     procF1SetupRsp(f1apMsg);
 #endif
-                    break;
-                 }
+                     break;
+                  }
 
-              case SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
-                 {
-                    procF1GNBDUCfgUpdAck(f1apMsg);
-                    break;
-                 }
+               case SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
+                  {
+                     procF1GNBDUCfgUpdAck(f1apMsg);
+                     break;
+                  }
 
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  F1AP : Invalid type of SuccessfulOutcome__value_PR_ResetAcknowledge [%d]",\
-                    f1apMsg->choice.successfulOutcome->value.present);
-                    return;
-                 }
-           }/* End of switch(successfulOutcome) */
-           free(f1apMsg->choice.successfulOutcome);
-           break;
-        }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  F1AP : Invalid type of SuccessfulOutcome__value_PR_ResetAcknowledge [%d]",\
+                           f1apMsg->choice.successfulOutcome->value.present);
+                     return;
+                  }
+            }/* End of switch(successfulOutcome) */
+            free(f1apMsg->choice.successfulOutcome);
+            break;
+         }
       case F1AP_PDU_PR_initiatingMessage:
-        {
-           switch(f1apMsg->choice.initiatingMessage->value.present)
-           {
-              case InitiatingMessage__value_PR_Reset:
-                 {
-                    procF1ResetReq(f1apMsg);
-                    break;
-                 }
-              case InitiatingMessage__value_PR_DLRRCMessageTransfer:
-                 {
-                    procF1DlRrcMsgTrans(f1apMsg);
-                    break;
-                 }
-              case InitiatingMessage__value_PR_UEContextSetupRequest:
-                 {
-                    procF1UeContextSetupReq(f1apMsg);
-                    break;
-                 }
-              default:
-                 {
-                    DU_LOG("\nERROR  -->  F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",
-                          f1apMsg->choice.initiatingMessage->value.present);
-                    return;
-                 }
-           }/* End of switch(initiatingMessage) */
-           free(f1apMsg->choice.initiatingMessage);
-           break;
-        }
+         {
+            switch(f1apMsg->choice.initiatingMessage->value.present)
+            {
+               case InitiatingMessage__value_PR_Reset:
+                  {
+                     procF1ResetReq(f1apMsg);
+                     break;
+                  }
+               case InitiatingMessage__value_PR_DLRRCMessageTransfer:
+                  {
+                     procF1DlRrcMsgTrans(f1apMsg);
+                     break;
+                  }
+               case InitiatingMessage__value_PR_UEContextSetupRequest:
+                  {
+                     procF1UeContextSetupReq(f1apMsg);
+                     break;
+                  }
+               case InitiatingMessage__value_PR_UEContextModificationRequest:
+                  {
+                     procF1UeContextModificationReq(f1apMsg);
+                     break;
+                  }
+               case InitiatingMessage__value_PR_UEContextReleaseCommand:
+                  {
+                      procF1UeContextReleaseCommand(f1apMsg);
+                      break;
+                  }
+               default:
+                  {
+                     DU_LOG("\nERROR  -->  F1AP : Invalid type of F1AP_PDU_PR_initiatingMessage [%d]",
+                           f1apMsg->choice.initiatingMessage->value.present);
+                     return;
+                  }
+            }/* End of switch(initiatingMessage) */
+            free(f1apMsg->choice.initiatingMessage);
+            break;
+         }
 
       default:
-        {
-           DU_LOG("\nERROR  -->  F1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
-           return;
-        }
-        free(f1apMsg);
+         {
+            DU_LOG("\nERROR  -->  F1AP : Invalid type of f1apMsg->present [%d]",f1apMsg->present);
+            return;
+         }
+         free(f1apMsg);
 
    }/* End of switch(f1apMsg->present) */