[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-472] Implementation of Ul Harq Rtt timer...
[o-du/l2.git] / src / du_app / du_f1ap_msg_hdl.c
index 0f9450c..e96ebb5 100644 (file)
@@ -28,6 +28,8 @@
 #include "lkw.x"
 #include "lrg.x"
 #include "F1AP-PDU.h"
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
 #include "du_app_mac_inf.h"
 #include "du_cfg.h"
 #include "du_app_rlc_inf.h"
 #include "du_utils.h"
 #include "du_ue_mgr.h"
 #include "RAT-Type.h"
+#include "NRFreqInfo.h"
+#include "NRCGI.h"
+#include "TDD-Info.h"
+#include "NR-Mode-Info.h"
+#include "ServedPLMNs-List.h"
+#include "GNB-DU-Served-Cells-List.h"
+#include "Served-Cell-Information.h"
+#include "ProtocolExtensionContainer.h"
+#include "RRC-Version.h"
+#include "FDD-Info.h"
+#include "FreqBandNrItem.h"
+#include "ServedPLMNs-Item.h"
+#include "GNB-DU-Served-Cells-Item.h"
+#include "SliceSupportItem.h"
 #include "FeatureSetUplinkPerCC.h"
+#include "SliceSupportItem.h"
+#include "Served-Cells-To-Modify-Item.h"
+#include "Served-Cells-To-Delete-List.h"
+#include "Served-Cells-To-Delete-Item.h"
+#include "QoSInformation.h"
+#include "ULUPTNLInformation-ToBeSetup-List.h"
+#include "DRB-Information.h"
+#include "DRBs-ToBeSetup-Item.h"
+#include "DRBs-ToBeSetupMod-Item.h"
+#include "DRBs-ToBeModified-Item.h"
+#include "CUtoDURRCInformation.h"
+#include "SCell-ToBeSetup-List.h"
+#include "SRBs-ToBeSetup-List.h"
+#include "DRBs-ToBeSetup-List.h"
+#include "SRBs-ToBeSetup-Item.h"
+#include "DRBs-ToBeModified-List.h"
+#include "RRCContainer.h"
+#include "UE-CapabilityRAT-ContainerList.h"
+#include "DRBs-Setup-List.h"
+#include "CellGroupConfig.h"
+#include "ResetAll.h"
+#include "ResetType.h"
+#include "Cells-to-be-Activated-List.h"
+#include "GNB-CU-Name.h"
+#include "SRBs-SetupMod-List.h"
+#include "DRBs-SetupMod-List.h"
+#include "DRBs-ToBeSetupMod-List.h"
+#include "PagingCell-Item.h"
+#include "PagingCell-list.h"
+#include "QoS-Characteristics.h"
+#include "ULUPTNLInformation-ToBeSetup-Item.h"
+#include "Flows-Mapped-To-DRB-Item.h"
+#include "NonDynamic5QIDescriptor.h"
+#include "Dynamic5QIDescriptor.h"
 #include "FeatureSetDownlinkPerCC.h"
 #include "FeatureSets.h"
 #include "UE-NR-Capability.h"
@@ -1398,7 +1448,7 @@ uint8_t BuildAndSendF1SetupReq()
 
       f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
 
-      elementCnt = (duCfgParam.duName != NULL) ? 5 : 4;
+      elementCnt = 4;
 
       f1SetupReq->protocolIEs.list.count = elementCnt;
       f1SetupReq->protocolIEs.list.size = elementCnt * sizeof(F1SetupRequestIEs_t );
@@ -1407,16 +1457,16 @@ uint8_t BuildAndSendF1SetupReq()
       DU_ALLOC(f1SetupReq->protocolIEs.list.array,f1SetupReq->protocolIEs.list.size);
       if(f1SetupReq->protocolIEs.list.array == NULLP)
       {
-        break;
+         break;
       }
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx],\
-              sizeof(F1SetupRequestIEs_t));
-        if(f1SetupReq->protocolIEs.list.array[ieIdx] == NULLP)
-        {
-           break;
-        }
+         DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx],\
+               sizeof(F1SetupRequestIEs_t));
+         if(f1SetupReq->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            break;
+         }
       }
 
       ieIdx = 0;
@@ -1424,84 +1474,89 @@ uint8_t BuildAndSendF1SetupReq()
       f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_TransactionID;
       f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.present =\
-                                                              F1SetupRequestIEs__value_PR_TransactionID;
+                                                                F1SetupRequestIEs__value_PR_TransactionID;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = \
-                                                                            TRANS_ID;
+                                                                              TRANS_ID;
 
       /*DU ID*/
       ieIdx++;
       f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
       f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
-                                                               F1SetupRequestIEs__value_PR_GNB_DU_ID;
+                                                                 F1SetupRequestIEs__value_PR_GNB_DU_ID;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size =\
-                                                                            sizeof(uint8_t);
+                                                                              sizeof(uint8_t);
 
       DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
-           f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+            f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
       if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == \
-           NULLP)
+            NULLP)
       {
-        break;
+         break;
       }
 
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] =\
-         duCfgParam.duId;
-
+                                                                                duCfgParam.duId;
+#if 0
+      /* DU name IE is of type printableString_t which wireshark is unable to decode.
+       * However this string is decoded successfully on online decoders.
+       * Since this is an optional IE and the value received in it are not
+       * used as of now, eliminating this IE for now to avoid wireshark error.
+       */
       /*DU Name*/
       if(duCfgParam.duName != NULL)
       {
-        ieIdx++;
-        f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_Name;
-        f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
-        f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = F1SetupRequestIEs__value_PR_GNB_DU_Name;
-        f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size =\
-           strlen((char *)duCfgParam.duName);
-        DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.\
-              GNB_DU_Name.buf, strlen((char *)duCfgParam.duName));
-        if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.\
-              buf == NULLP)
-        {
-           break;
-        }
-        strcpy((char*)f1SetupReq->protocolIEs.list.array[ieIdx]->value.\
-              choice.GNB_DU_Name.buf,
-              (char*)&duCfgParam.duName);
-
+         ieIdx++;
+         f1SetupReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_Name;
+         f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_ignore;
+         f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = F1SetupRequestIEs__value_PR_GNB_DU_Name;
+         f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size = strlen((char *)duCfgParam.duName);
+         DU_ALLOC(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf, \
+               f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.size);
+         if(f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf == NULLP)
+         {
+            break;
+         }
+         strcpy((char*)f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Name.buf,
+               (char*)&duCfgParam.duName);
       }
+#endif
 
       /*Served Cell list */
       ieIdx++;
       f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
-                                                    ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
+                                                      ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
       f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
-                                                               F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
+                                                                 F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
       duServedCell = &f1SetupReq->protocolIEs.list.\
-                    array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
+                     array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
       if(BuildServedCellList(duServedCell))
       {
-        break;
+         break;
       }
+
+
       /*RRC Version*/
       ieIdx++;
       f1SetupReq->protocolIEs.list.array[ieIdx]->id = \
-                                                    ProtocolIE_ID_id_GNB_DU_RRC_Version ;
+                                                      ProtocolIE_ID_id_GNB_DU_RRC_Version ;
       f1SetupReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       f1SetupReq->protocolIEs.list.array[ieIdx]->value.present = \
-                                                               F1SetupRequestIEs__value_PR_RRC_Version;
+                                                                 F1SetupRequestIEs__value_PR_RRC_Version;
       rrcVer = &f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.RRC_Version;
       if(BuildRrcVer(rrcVer))
       {
-        break;
+         break;
       }
+
       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);
+            encBuf);
 
       /* Encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
@@ -1513,17 +1568,19 @@ uint8_t BuildAndSendF1SetupReq()
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for F1SetupRequest\n");
+#ifdef DEBUG_ASN_PRINT
          for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
          {
             printf("%x",encBuf[ieIdx]);
          }
-         
+#endif
+
          duCb.f1SetupReqAndRspMsg.f1MsgReqBufSize = encBufSize;
          DU_ALLOC(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf, encBufSize);
          if(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf == NULLP)
          {
-             DU_LOG("\nERROR  -->  F1AP : Memory allocation failed to store the encoding of f1setup req");
-             return RFAILED;
+            DU_LOG("\nERROR  -->  F1AP : Memory allocation failed to store the encoding of f1setup req");
+            return RFAILED;
          }
          memcpy(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf, &encBuf, duCb.f1SetupReqAndRspMsg.f1MsgReqBufSize);
       }
@@ -2448,10 +2505,12 @@ uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction)
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DUConfigUpdate\n");
+#ifdef DEBUG_ASN_PRINT
          for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
          {
             printf("%x",encBuf[ieIdx]);
          }
+#endif
       }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
@@ -2649,10 +2708,12 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb  *ueCb, uint8_t lcId, \
       else
       {
         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
+#ifdef DEBUG_ASN_PRINT
         for(int i=0; i< encBufSize; i++)
         {
            printf("%x",encBuf[i]);
         }
+#endif
       }
 
       /* Sending  msg  */
@@ -5444,6 +5505,7 @@ uint8_t BuildSrsRsrcAddModList(struct SRS_Config__srs_ResourceToAddModList *reso
       DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildSrsRsrcAddModList");
       return RFAILED;
    }
+
    resourceList->list.array[rsrcIdx]->sequenceId = SRS_SEQ_ID;
 
    return ROK;
@@ -5609,7 +5671,6 @@ uint8_t BuildBWPUlDedSrsCfg(SRS_Config_t *srsCfg)
    {
       return RFAILED;
    }
-
    srsCfg->tpc_Accumulation = NULLP;
 
    return ROK;
@@ -5648,6 +5709,7 @@ uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *pusch
    puschCfg->choice.setup->rateMatching = NULLP;
    puschCfg->choice.setup->xOverhead = NULLP;
    puschCfg->choice.setup->ext1 = NULLP;
+
    DU_ALLOC(puschCfg->choice.setup->ext1, sizeof(struct PUSCH_ServingCellConfig__ext1));
    if(!puschCfg->choice.setup->ext1)
    {
@@ -5672,6 +5734,7 @@ uint8_t BuildPuschSrvCellCfg(struct UplinkConfig__pusch_ServingCellConfig *pusch
       return RFAILED;
    }
    *(puschCfg->choice.setup->ext1->processingType2Enabled) = PUSCH_PROCESS_TYPE2_ENABLED;
+
    return ROK;
 }
 
@@ -6051,12 +6114,6 @@ uint8_t BuildSpCellCfgDed(DuUeCb *ueCb, ServingCellConfig_t *srvCellCfg)
    }
 
    srvCellCfg->tdd_UL_DL_ConfigurationDedicated = NULLP;
-   DU_ALLOC(srvCellCfg->tdd_UL_DL_ConfigurationDedicated, sizeof(TDD_UL_DL_ConfigDedicated_t));
-   if(!srvCellCfg->tdd_UL_DL_ConfigurationDedicated)
-   {
-      DU_LOG("\nERROR  -->  F1AP : Memory allocation failure in BuildSpCellCfgDed");
-      return RFAILED;
-   }
 
    srvCellCfg->initialDownlinkBWP = NULLP;
    DU_ALLOC(srvCellCfg->initialDownlinkBWP, sizeof(BWP_DownlinkDedicated_t));
@@ -8550,7 +8607,7 @@ uint8_t BuildCellGroupConfigRrc(DuUeCb *ueCb, OCTET_STRING_t *duToCuRrcContainer
       xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, &cellGrpCfg);
       memset(encBuf, 0, ENC_BUF_MAX_LEN);
       encBufSize = 0;
-      encRetVal = aper_encode(&asn_DEF_CellGroupConfigRrc, 0, &cellGrpCfg, PrepFinalEncBuf, encBuf);
+      encRetVal = uper_encode(&asn_DEF_CellGroupConfigRrc, 0, &cellGrpCfg, PrepFinalEncBuf, encBuf);
       /* Encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
       {
@@ -8562,10 +8619,12 @@ uint8_t BuildCellGroupConfigRrc(DuUeCb *ueCb, OCTET_STRING_t *duToCuRrcContainer
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DuToCuRrcContainer\n");
+#ifdef DEBUG_ASN_PRINT
          for(int i=0; i< encBufSize; i++)
          {
             printf("%x",encBuf[i]);
          }
+#endif
       }
 
       duToCuRrcContainer->size = encBufSize;
@@ -8851,10 +8910,12 @@ uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti
 
         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for Initial UL RRC\
               Message transfer\n");
+#ifdef DEBUG_ASN_PRINT
         for(int i=0; i< encBufSize; i++)
         {
            printf("%x",encBuf[i]);
         }
+#endif
       }
       /* Sending  msg  */
       if(sendF1APMsg() != ROK)
@@ -12881,7 +12942,7 @@ uint8_t extractCuToDuRrcInfoExt(ProtocolExtensionContainer_4624P16_t *protocolIe
                   if(cellGrpCfg)
                   {
                      memset(cellGrpCfg, 0, sizeof(CellGroupConfigRrc_t));
-                     rval = aper_decode(0, &asn_DEF_CellGroupConfigRrc, (void **)&cellGrpCfg,
+                     rval = uper_decode(0, &asn_DEF_CellGroupConfigRrc, (void **)&cellGrpCfg,
                            extIeInfo->extensionValue.choice.CellGroupConfig.buf, recvBufLen, 0, 0);
                      if(rval.code == RC_FAIL || rval.code == RC_WMORE)
                      {
@@ -13326,7 +13387,7 @@ UE_NR_Capability_t *extractUeCapability(UE_CapabilityRAT_ContainerList_t *ueCapa
    }
    memset(ueCapRatContList, 0, sizeof(UE_CapabilityRAT_ContainerListRRC_t));
    memset(&rval, 0, sizeof(asn_dec_rval_t));
-   rval = aper_decode(0, &asn_DEF_UE_CapabilityRAT_ContainerListRRC, (void **)&ueCapRatContList,
+   rval = uper_decode(0, &asn_DEF_UE_CapabilityRAT_ContainerListRRC, (void **)&ueCapRatContList,
           ueCapablityListBuf->buf, recvBufLen, 0, 0);
    if(rval.code == RC_FAIL || rval.code == RC_WMORE)
    {
@@ -13352,7 +13413,7 @@ UE_NR_Capability_t *extractUeCapability(UE_CapabilityRAT_ContainerList_t *ueCapa
           } 
           memset(ueNrCap, 0, sizeof(UE_NR_Capability_t));
           memset(&rval, 0, sizeof(asn_dec_rval_t));
-          rval = aper_decode(0, &asn_DEF_UE_NR_Capability, (void **)&ueNrCap,
+          rval = uper_decode(0, &asn_DEF_UE_NR_Capability, (void **)&ueNrCap,
                  ueCapRatContList->list.array[idx]->ue_CapabilityRAT_Container.buf, recvBufLen, 0, 0);
           if(rval.code == RC_FAIL || rval.code == RC_WMORE)
           {
@@ -13396,62 +13457,72 @@ void freeAperDecodeF1UeContextSetupReq(UEContextSetupRequest_t   *ueSetReq)
    {
       for(ieIdx = 0; ieIdx < ueSetReq->protocolIEs.list.count; ieIdx++)
       {
-        if(ueSetReq->protocolIEs.list.array[ieIdx])
-        {
-           switch(ueSetReq->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_SpCell_ID:
-                 freeAperDecodeNrcgi(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.NRCGI);
-                 break;
-              case ProtocolIE_ID_id_ServCellIndex:
-                 break;
-              case ProtocolIE_ID_id_SpCellULConfigured:
-                 break;
-              case ProtocolIE_ID_id_CUtoDURRCInformation:
+         if(ueSetReq->protocolIEs.list.array[ieIdx])
+         {
+            switch(ueSetReq->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_SpCell_ID:
+                  freeAperDecodeNrcgi(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.NRCGI);
+                  break;
+               case ProtocolIE_ID_id_ServCellIndex:
+                  break;
+               case ProtocolIE_ID_id_SpCellULConfigured:
+                  break;
+               case ProtocolIE_ID_id_CUtoDURRCInformation:
 
-                 freeAperDecodeCuToDuInfo(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation);
-                 break;
-              case ProtocolIE_ID_id_SCell_ToBeSetup_List:
+                  freeAperDecodeCuToDuInfo(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.CUtoDURRCInformation);
+                  break;
+               case ProtocolIE_ID_id_SCell_ToBeSetup_List:
 
-                 freeAperDecodeSplCellList(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SCell_ToBeSetup_List);
-                 break;
-              case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
+                  freeAperDecodeSplCellList(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SCell_ToBeSetup_List);
+                  break;
+               case ProtocolIE_ID_id_SRBs_ToBeSetup_List:
 
-                 freeAperDecodeSRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List);
-                 break;
-              case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
+                  freeAperDecodeSRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.SRBs_ToBeSetup_List);
+                  break;
+               case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
 
-                 freeAperDecodeDRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List);
-                 break;
-              case ProtocolIE_ID_id_RRCContainer:
-                 {
+                  freeAperDecodeDRBSetup(&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List);
+                  break;
+               case ProtocolIE_ID_id_RRCContainer:
+                  {
 
-                    if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf != NULLP)
-                    {
+                     if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf != NULLP)
+                     {
 
-                       free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
-                    }
-                    break;
-                 }
-              case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
-                 break;
-              case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
-                 {
-                    if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf)
-                    {
-                       free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf);
-                    }
-                    break;
-                 }
-              default:
-                 DU_LOG("\nERROR  -->  F1AP: Invalid event type %ld " ,ueSetReq->protocolIEs.list.array[ieIdx]->id);
-           } 
-           free(ueSetReq->protocolIEs.list.array[ieIdx]);
-        }
+                        free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf);
+                     }
+                     break;
+                  }
+               case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+                  break;
+               case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
+                  {
+                     if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf)
+                     {
+                        free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf);
+                     }
+                     break;
+                  }
+#ifdef NR_DRX
+               case ProtocolIE_ID_id_DRXCycle:
+                  {
+                     if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleLength)
+                        free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleLength);
+                     if(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleTimer)
+                        free(ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRXCycle.shortDRXCycleTimer);
+                     break;
+                  }
+#endif             
+                default:
+                  DU_LOG("\nERROR  -->  F1AP: Invalid event type %ld " ,ueSetReq->protocolIEs.list.array[ieIdx]->id);
+            } 
+            free(ueSetReq->protocolIEs.list.array[ieIdx]);
+         }
       }
       free(ueSetReq->protocolIEs.list.array);
    }
@@ -13483,8 +13554,9 @@ uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
    UEContextSetupRequest_t   *ueSetReq = NULL;
    DRBs_ToBeSetup_List_t *drbCfg = NULL;
    CUtoDURRCInformation_t *rrcInfo = NULL;
+#ifdef NR_DRX
    DRXCycle_t *drxCycle;
-
+#endif
    ret = ROK;
 
    ueSetReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
@@ -13830,50 +13902,52 @@ void FreeUeContextSetupRsp(F1AP_PDU_t *f1apMsg)
    {
       if(f1apMsg->choice.successfulOutcome)
       {
-        ueSetRsp = &f1apMsg->choice.successfulOutcome->value.choice.\
-                   UEContextSetupResponse;
-        if(ueSetRsp->protocolIEs.list.array)
-        {
-           for(idx = 0; idx < ueSetRsp->protocolIEs.list.count; idx++)
-           {
-              if(ueSetRsp->protocolIEs.list.array[idx])
-              {
-                 switch(ueSetRsp->protocolIEs.list.array[idx]->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_DUtoCURRCInformation:
-                       {
-                          CellGroupConfig_t *cellGrpCfg = NULLP;
-                          cellGrpCfg  = &ueSetRsp->protocolIEs.list.array[idx]->value.choice.\
-                                        DUtoCURRCInformation.cellGroupConfig;
-                          if(cellGrpCfg->buf != NULLP)
-                          {
-                             DU_FREE(cellGrpCfg->buf, cellGrpCfg->size);
-                             cellGrpCfg = NULLP;
-                          }
-                          break;
-                       }
-                    case ProtocolIE_ID_id_DRBs_Setup_List:
-                       {
+         ueSetRsp = &f1apMsg->choice.successfulOutcome->value.choice.\
+                    UEContextSetupResponse;
+         if(ueSetRsp->protocolIEs.list.array)
+         {
+            for(idx = 0; idx < ueSetRsp->protocolIEs.list.count; idx++)
+            {
+               if(ueSetRsp->protocolIEs.list.array[idx])
+               {
+                  switch(ueSetRsp->protocolIEs.list.array[idx]->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_C_RNTI:
+                        break;
+                     case ProtocolIE_ID_id_DUtoCURRCInformation:
+                        {
+                           CellGroupConfig_t *cellGrpCfg = NULLP;
+                           cellGrpCfg  = &ueSetRsp->protocolIEs.list.array[idx]->value.choice.\
+                                         DUtoCURRCInformation.cellGroupConfig;
+                           if(cellGrpCfg->buf != NULLP)
+                           {
+                              DU_FREE(cellGrpCfg->buf, cellGrpCfg->size);
+                              cellGrpCfg = NULLP;
+                           }
+                           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);
-                       break;
-                 }
-                 DU_FREE(ueSetRsp->protocolIEs.list.array[idx],\
-                       sizeof(UEContextSetupResponseIEs_t));
-              }
-           }
-           DU_FREE(ueSetRsp->protocolIEs.list.array, \
-                 ueSetRsp->protocolIEs.list.size);
-        }
-        DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+                        }
+                     default:
+                        DU_LOG("\nERROR  -->  DUAPP: Invalid Id %ld at FreeUeContextSetupRsp()",\
+                              ueSetRsp->protocolIEs.list.array[idx]->id);
+                        break;
+                  }
+                  DU_FREE(ueSetRsp->protocolIEs.list.array[idx],\
+                        sizeof(UEContextSetupResponseIEs_t));
+               }
+            }
+            DU_FREE(ueSetRsp->protocolIEs.list.array, \
+                  ueSetRsp->protocolIEs.list.size);
+         }
+         DU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       }
       DU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
    }
@@ -13903,7 +13977,7 @@ uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfi
    xer_fprint(stdout, &asn_DEF_CellGroupConfigRrc, duCellGrpCfg);
    memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
    encBufSize = 0;
-   encRetVal = aper_encode(&asn_DEF_CellGroupConfigRrc, 0, duCellGrpCfg, PrepFinalEncBuf, encBuf);
+   encRetVal = uper_encode(&asn_DEF_CellGroupConfigRrc, 0, duCellGrpCfg, PrepFinalEncBuf, encBuf);
    /* Encode results */
    if(encRetVal.encoded == ENCODE_FAIL)
    {
@@ -13914,10 +13988,12 @@ uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfi
    else
    {
       DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UeCntxtDuToCuInfo\n");
+#ifdef DEBUG_ASN_PRINT
       for(int i=0; i< encBufSize; i++)
       {
         printf("%x",encBuf[i]);
       }
+#endif
    }
    duToCuCellGrp->size = encBufSize;
    DU_ALLOC(duToCuCellGrp->buf, duToCuCellGrp->size);
@@ -14246,10 +14322,12 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueId)
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UE Context Setup Response\n");
+#ifdef DEBUG_ASN_PRINT
          for(int i=0; i< encBufSize; i++)
          {
             printf("%x",encBuf[i]);
          }
+#endif
       }
 
       /* Sending  msg  */
@@ -14461,10 +14539,12 @@ uint8_t BuildAndSendF1ResetReq()
       else
       {
         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for F1Reset\n");
+#ifdef DEBUG_ASN_PRINT
         for(idx=0; idx< encBufSize; idx++)
         {
            printf("%x",encBuf[idx]);
         }
+#endif
       }
 
       if(sendF1APMsg() != ROK)
@@ -14614,10 +14694,12 @@ uint8_t BuildAndSendF1ResetAck()
       else
       {
         DU_LOG("\nDUBUG   -->  F1AP : Created APER encoded buffer for F1ResetAck\n");
+#ifdef DEBUG_ASN_PRINT
         for(int i=0; i< encBufSize; i++)
         {
            printf("%x",encBuf[i]);
         }
+#endif
       }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
@@ -14880,10 +14962,12 @@ uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \
       else
       {
         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for RRC Delivery Msg \n");
+#ifdef DEBUG_ASN_PRINT
         for(idx=0; idx< encBufSize; idx++)
         {
            printf("%x",encBuf[idx]);
         }
+#endif
       }
 
       /* Sending msg */
@@ -15125,7 +15209,7 @@ uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg, MsgLen recvBufLen, char *recvBuf)
       return RFAILED;
    }
    memcpy(duCb.f1SetupReqAndRspMsg.f1MsgRspBuf, recvBuf, recvBufLen);
-   
+
    if(BuildAndSendE2SetupReq() != ROK)
    {
       DU_LOG("\nERROR  -->  F1AP : Failed to build and send E2 setup request ");
@@ -15900,10 +15984,12 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb)
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UE Context Modification Response\n");
+#ifdef DEBUG_ASN_PRINT
          for(int i=0; i< encBufSize; i++)
          {
             printf("%x",encBuf[i]);
          }
+#endif
       }
 
       /* Sending  msg  */
@@ -16338,6 +16424,13 @@ uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
                }
                break;
             }
+#ifdef NR_DRX
+         case ProtocolIE_ID_id_DRXConfigurationIndicator:
+            {
+               duUeCb->f1UeDb->duUeCfg.drxConfigIndicatorRelease = true;
+               break;
+            }
+#endif
               
       }
    }
@@ -16519,10 +16612,12 @@ uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueId)
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseRequest\n");
+#ifdef DEBUG_ASN_PRINT
          for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
          {
             printf("%x",encBuf[ieIdx]);
          }
+#endif
       }
 
       /* Sending msg */
@@ -16683,10 +16778,12 @@ uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1
       else
       {
          DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for UEContextReleaseComplete\n");
+#ifdef DEBUG_ASN_PRINT
          for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
          {
             printf("%x",encBuf[ieIdx]);
          }
+#endif
       }
 
       /* Sending msg */
@@ -17160,11 +17257,13 @@ void F1APMsgHdlr(Buffer *mBuf)
       return;
    }
 
+#ifdef DEBUG_ASN_PRINT
    printf("\nDEBUG   -->  F1AP : Received flat buffer to be decoded : ");
    for(i=0; i< recvBufLen; i++)
    {
       printf("%x",recvBuf[i]);
    }
+#endif
 
    /* Decoding flat buffer into F1AP messsage */
    f1apMsg = &f1apasnmsg;