Implementation of Slice related configuration and Slice Discovery procedure [Jira... 27/6727/6
authorlal.harshita <Harshita.Lal@radisys.com>
Wed, 22 Sep 2021 05:48:09 +0000 (11:18 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 27 Sep 2021 16:04:29 +0000 (21:34 +0530)
Change-Id: If9bbc3117d861a08ac26abad4bc664fd8f15c718
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_stub.h
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_f1ap_msg_hdl.c

index 07e176c..588d750 100644 (file)
@@ -7753,7 +7753,6 @@ uint8_t procGnbDuUpdate(F1AP_PDU_t *f1apMsg)
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
 
    duCfgUpdate = &f1apMsg->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
-
    for(ieIdx=0; ieIdx < duCfgUpdate->protocolIEs.list.count; ieIdx++)
    {
       switch(duCfgUpdate->protocolIEs.list.array[ieIdx]->id)
@@ -7797,6 +7796,178 @@ uint8_t procGnbDuUpdate(F1AP_PDU_t *f1apMsg)
 
    return ROK;
 }
+
+/*******************************************************************
+*
+* @brief storing slice list in CU database
+*
+* @details
+*
+*    Function : buildSliceList
+*
+*    Functionality:
+*         - storing slice list in CU database 
+*
+* @params[in] SliceSupportList_t *sliceSupportList
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t buildSliceList(SliceSupportList_t *sliceSupportList)
+{
+   uint8_t sliceListIdx = 0;
+
+   if(sliceSupportList)
+   {
+      if(sliceSupportList->list.array)
+      {
+         cuCfgParams.numSnssaiSupported = sliceSupportList->list.count;
+         for(sliceListIdx=0; sliceListIdx<sliceSupportList->list.count; sliceListIdx++)
+         {
+            if(sliceSupportList->list.array[sliceListIdx])
+            {
+               CU_ALLOC(cuCfgParams.snssaiList[sliceListIdx], sizeof(Snssai)); 
+               if(cuCfgParams.snssaiList[sliceListIdx] == NULLP)
+               {
+                   DU_LOG("\nERROR  --> CU_STUB: buildSliceList(): Memory allocation failed");
+                   return RFAILED;
+               }
+               if(sliceSupportList->list.array[sliceListIdx]->sNSSAI.sST.buf)
+               {
+                  memcpy(&cuCfgParams.snssaiList[sliceListIdx]->sst, sliceSupportList->list.array[sliceListIdx]->\
+                  sNSSAI.sST.buf, sliceSupportList->list.array[sliceListIdx]->sNSSAI.sST.size);
+               }
+               if(sliceSupportList->list.array[sliceListIdx]->sNSSAI.sD->size)
+               {
+                  memcpy(&cuCfgParams.snssaiList[sliceListIdx]->sd,\
+                  sliceSupportList->list.array[sliceListIdx]->sNSSAI.sD->buf,\
+                  sliceSupportList->list.array[sliceListIdx]->sNSSAI.sD->size);
+               }
+            }
+         }
+      }
+   }
+   return ROK;
+}
+
+/*******************************************************************
+*
+* @brief processing of GNB_DU_Served_Cells Plmn list  information
+*
+* @details
+*
+*    Function : procServedCellPlmnList
+*
+*    Functionality:
+*         - processing of GNB_DU_Served_Cells Plmn list information for storing
+*         SNSSAI list
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t procServedCellPlmnList(ServedPLMNs_List_t *srvPlmn)
+{
+   uint8_t srvPlmnIdx=0, ieExtensionsLstIdx=0;
+   ProtocolExtensionContainer_4624P3_t **ieExtend;
+
+   if(srvPlmn->list.array)
+   {
+      for(srvPlmnIdx=0; srvPlmnIdx<srvPlmn->list.count; srvPlmnIdx++)
+      {
+         if(srvPlmn->list.array[srvPlmnIdx])
+         {
+            ieExtend =  &srvPlmn->list.array[srvPlmnIdx]->iE_Extensions;
+            if(*ieExtend)
+            {
+               if((*ieExtend)->list.array)
+               {
+                  for(ieExtensionsLstIdx = 0; ieExtensionsLstIdx<(*ieExtend)->list.count; ieExtensionsLstIdx++)
+                  {
+                     if((*ieExtend)->list.array[ieExtensionsLstIdx])
+                     {
+                        switch((*ieExtend)->list.array[ieExtensionsLstIdx]->id )
+                        {
+                           case ProtocolIE_ID_id_TAISliceSupportList:
+                              {
+                                 if(buildSliceList(&(*ieExtend)->list.array[ieExtensionsLstIdx]->\
+                                          extensionValue.choice.SliceSupportList) != ROK)
+                                 {
+                                    DU_LOG("\nERROR  --> CU_STUB: procServedCellPlmnList(): Failed to build slice List");
+                                    return RFAILED;
+                                 }
+                              }
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+   return ROK;
+}
+/*******************************************************************
+*
+* @brief processing of F1 setup request
+*
+* @details
+*
+*    Function : procF1SetupReq 
+*
+*    Functionality:
+*         - processing of  F1 setup request
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+void procF1SetupReq(F1AP_PDU_t *f1apMsg)
+{
+   uint8_t ieIdx = 0, plmnidx=0, ret=ROK;
+   F1SetupRequest_t *f1SetupReq = NULLP;
+   GNB_DU_Served_Cells_Item_t *srvCellItem = NULLP; 
+   GNB_DU_Served_Cells_List_t *duServedCell = NULLP;
+
+   f1SetupReq = &f1apMsg->choice.initiatingMessage->value.choice.F1SetupRequest;
+   for(ieIdx=0; ieIdx < f1SetupReq->protocolIEs.list.count; ieIdx++)
+   {
+      switch(f1SetupReq->protocolIEs.list.array[ieIdx]->id)
+      {
+         case ProtocolIE_ID_id_gNB_DU_Served_Cells_List:
+           {
+               duServedCell = &f1SetupReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_Served_Cells_List;
+               if(duServedCell->list.array)
+               {
+                  for(plmnidx=0; plmnidx<duServedCell->list.count; plmnidx++)
+                  {
+                     if(duServedCell->list.array[plmnidx])
+                     {
+                        switch(duServedCell->list.array[plmnidx]->id)
+                        {
+                           case ProtocolIE_ID_id_GNB_DU_Served_Cells_Item:
+                           {
+                              srvCellItem =  &duServedCell->list.array[plmnidx]->value.choice.GNB_DU_Served_Cells_Item;
+                              ret = procServedCellPlmnList(&srvCellItem->served_Cell_Information.servedPLMNs);
+                           }
+                        }
+                     }
+                  }
+               }
+           }
+      }
+   }
+   if(ret == ROK)
+   {
+      BuildAndSendF1SetupRsp();
+   }
+   else
+   {
+       DU_LOG("\nERROR  --> CU_STUB: procF1SetupReq(): Failed to process F1 setup request");
+   }
+}
 /*******************************************************************
  *
  * @brief Handles received F1AP message and sends back response  
@@ -7879,7 +8050,7 @@ void F1APMsgHdlr(Buffer *mBuf)
                case InitiatingMessage__value_PR_F1SetupRequest:
                   {
                      DU_LOG("\nINFO  -->  F1AP : F1 setup request received");
-                     BuildAndSendF1SetupRsp();
+                     procF1SetupReq(f1apMsg);
                      break;
                   }
 
index 74d6847..4d7c4e1 100644 (file)
@@ -26,6 +26,8 @@
 #define CU_POOL 1
 #define MAX_DU_PORT 2
 #define DU_PORT 38472
+#define SD_SIZE   3 /*  As per the spec 38.473, SD size must be of size(3) */
+#define MAX_NUM_OF_SLICE 1024 /* As per the spec 38.473, maxnoofSliceItems = 1024*/
 
 /* allocate and zero out a static buffer */
 #define CU_ALLOC(_datPtr, _size)                             \
@@ -79,6 +81,13 @@ typedef struct CuSctpParams
    uint16_t    cuPort;
 }CuSctpParams;
 
+/* Single Network Slice Selection assistance Info */
+typedef struct snssai
+{
+   uint8_t sst;                /* Slice Type */
+   uint8_t sd[SD_SIZE];        /* Slice Differentiator */
+}Snssai;
+
 typedef struct cuCfgParams
 {
    uint32_t         cuId;
@@ -87,6 +96,8 @@ typedef struct cuCfgParams
    Plmn             plmn;
    EgtpParams       egtpParams;
    RrcVersion       rrcVersion;
+   uint8_t          numSnssaiSupported;
+   Snssai           *snssaiList[MAX_NUM_OF_SLICE];
 }CuCfgParams;
 CuCfgParams cuCfgParams; //global variable to hold all configs
 
index ac754e4..cf99c6e 100644 (file)
@@ -215,10 +215,7 @@ uint8_t readMacCfg()
    }
    else
    {
-      for(uint8_t idx=0; idx<encBufSize; idx++)
-      {
-        duCfgParam.macCellCfg.ssbCfg.mibPdu[idx]=encBuf[idx];
-      }
+      memcpy(&duCfgParam.macCellCfg.ssbCfg.mibPdu, encBuf,encBufSize);
    }
    duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
    duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
@@ -599,10 +596,23 @@ uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
 
 uint8_t readCfg()
 {
-   uint8_t i,j,k;
+   uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx;
+   uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
    uint32_t ipv4_du, ipv4_cu, ipv4_ric;
    MibParams mib;
-   Sib1Params sib1;    
+   Sib1Params sib1;
+   F1TaiSliceSuppLst *taiSliceSuppLst;
+   RrmPolicy  *rrmPolicy;
+
+   /* TODO Added these below variable for local testing, once we will receive the
+    * configuration from O1 we can remove these variable */
+   F1Snsaai snsaai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
+   ResourceType rsrcType = PRB;
+   RrmPolicyRatio policyRatio= {10,20,30};
+   PolicyMemberList memberList;
+   
+   memset(&memberList, 0, sizeof(PolicyMemberList));
+   memberList.snsaai =  snsaai[DEDICATED_SLICE_INDEX];
 
 #ifdef O1_ENABLE
    if( getStartupConfig(&g_cfg) != ROK )
@@ -676,14 +686,11 @@ uint8_t readCfg()
    sib1.tac = DU_TAC;
    sib1.ranac = DU_RANAC;
    sib1.cellIdentity = CELL_IDENTITY;
-   sib1.cellResvdForOpUse =\
-      PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
+   sib1.cellResvdForOpUse = PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
    sib1.connEstFailCnt = ConnEstFailureControl__connEstFailCount_n3;
-   sib1.connEstFailOffValidity =\
-      ConnEstFailureControl__connEstFailOffsetValidity_s120;
+   sib1.connEstFailOffValidity = ConnEstFailureControl__connEstFailOffsetValidity_s120;
    sib1.siSchedInfo.winLen = SI_SchedulingInfo__si_WindowLength_s5;
-   sib1.siSchedInfo.broadcastSta = \
-      SchedulingInfo__si_BroadcastStatus_broadcasting;
+   sib1.siSchedInfo.broadcastSta = SchedulingInfo__si_BroadcastStatus_broadcasting;
    sib1.siSchedInfo.preiodicity = SchedulingInfo__si_Periodicity_rf8;
    sib1.siSchedInfo.sibType = SIB_TypeInfo__type_sibType2;
    sib1.siSchedInfo.sibValTag = SIB1_VALUE_TAG;
@@ -692,154 +699,204 @@ uint8_t readCfg()
 
    duCfgParam.sib1Params = sib1;
 
-   for(i=0; i<DEFAULT_CELLS; i++)
+   for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
    { 
-      memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
+      memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
 
       /*Cell ID */
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
-      duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.nrPci = NR_PCI;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.cellId = NR_CELL_ID;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
 
       /* List of Available PLMN */
-      for(j=0;j<MAX_PLMN;j++)
+      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
       {
-        memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j], 0, sizeof(Plmn));
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[0] = PLMN_MCC0;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[1] = PLMN_MCC1;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mcc[2] = PLMN_MCC2;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[0] = PLMN_MNC0;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.plmn[j].mnc[1] = PLMN_MNC1;
+         /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
+          * followed by either 2 digit or 3 digits of mnc */ 
+
+         memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
+         sizeof(Plmn));
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
       }
       /* List of Extended PLMN */
-      for(j=0;j<MAX_PLMN;j++)
+      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
       {
-        memset(&duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j], 0, sizeof(Plmn));
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[0] = PLMN_MCC0;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[1] = PLMN_MCC1;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mcc[2] = PLMN_MCC2;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[0] = PLMN_MNC0;
-        duCfgParam.srvdCellLst[i].duCellInfo.cellInfo.extPlmn[j].mnc[1] = PLMN_MNC1;
+         /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
+          * followed by either 2 digit or 3 digits of mnc */ 
+
+         memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
       } 
-
+      /* List of Supporting Slices */
+      for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
+      {
+         taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].taiSliceSuppLst;
+
+         taiSliceSuppLst->pres = true;
+         taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
+
+         memset(&taiSliceSuppLst->snssai, 0, sizeof(F1Snsaai));
+         for(sliceIdx=0; sliceIdx<NUM_OF_SUPPORTED_SLICE; sliceIdx++)
+         {
+            DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(F1Snsaai));
+            if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
+            {
+               DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
+               return RFAILED;
+            }
+            memcpy(taiSliceSuppLst->snssai[sliceIdx], &snsaai[sliceIdx], sizeof(F1Snsaai));
+            
+            /* Checking rrmPolicy Slice list available or not */
+            if(!memcmp(&snsaai[sliceIdx], &memberList.snsaai, sizeof(F1Snsaai)))
+            {
+               rrmPolicy = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].rrmPolicy;
+               rrmPolicy->present = true;
+               rrmPolicy->rsrcType = rsrcType; 
+               rrmPolicy->memberList.snsaai = memberList.snsaai;
+               rrmPolicy->rrmPolicyRatio = policyRatio;
+            }
+         }
+      }
       /* TAC and EPSTAC */
-      duCfgParam.srvdCellLst[i].duCellInfo.tac = DU_TAC;
-      duCfgParam.srvdCellLst[i].duCellInfo.epsTac = DU_TAC; //to check and fill
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //to check and fill
       /* NR Mode info */
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
 
 #if 0
       /* NR Mode info */
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;          
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;          
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;                
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;        
 
-      for(j=0;j<MAXNRCELLBANDS;j++)
+      for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
       {
-        duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
-        for(k=0;k<MAXNRCELLBANDS;k++)
-        {
-           duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;  
-        }
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
+         NR_FREQ_BAND;
+         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
+         {
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
+            = SUL_BAND;        
+         }
       }
 #endif
-      for(j=0;j<MAXNRCELLBANDS;j++)
+      for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
       {
-        duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
-        for(k=0;k<MAXNRCELLBANDS;k++)
-        {
-           duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
-        }
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
+         nrFreqBand = NR_FREQ_BAND;
+         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
+         {
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
+            sulBand[bandIdx] = SUL_BAND;
+         }
       }
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
-      for(j=0;j<MAXNRCELLBANDS;j++)
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = SCS_15;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
+      for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
       {
-        duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].nrFreqBand = NR_FREQ_BAND;
-        for(k=0;k<MAXNRCELLBANDS;k++)
-        {
-           duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[j].sulBand[k] = SUL_BAND;
-        }
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
+         nrFreqBand = NR_FREQ_BAND;
+         for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
+         {
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
+            sulBand[bandIdx] = SUL_BAND;
+         }
       }
 
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_15;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = SCS_15;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
 
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_15;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = SCS_15;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
 
-#if 0
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrScs = SCS_15;
-      duCfgParam.srvdCellLst[i].duCellInfo.f1Mode.mode.tdd.nrTxBw.nrb = NRB_106;
-#endif
       /*Measurement Config and Cell Config */ 
-      duCfgParam.srvdCellLst[i].duCellInfo.measTimeCfg = TIME_CFG; 
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfg = TIME_CFG; 
 
-      duCfgParam.srvdCellLst[i].duCellInfo.cellDir = DL_UL; 
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL; 
 
-      duCfgParam.srvdCellLst[i].duCellInfo.cellType=CELL_TYPE;
+      duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
 
       /* Broadcast PLMN Identity */
-      for(j=0;j<MAXBPLMNNRMINUS1;j++)
+      for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
       { 
-        for(k=0;k<MAX_PLMN;k++)
-        {
-           memset(&duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k], 0, sizeof(Plmn));
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[0] = PLMN_MCC0;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[1] = PLMN_MCC1;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mcc[2] = PLMN_MCC2;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[0] = PLMN_MNC0;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].plmn[k].mnc[1] = PLMN_MNC1;                                         
-        }
-        /* Extended PLMN List */        
-        for(k=0;k<MAX_PLMN;k++)
-        {
-           memset(&duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k], 0, sizeof(Plmn));
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[0] = PLMN_MCC0;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[1] = PLMN_MCC1;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mcc[2] = PLMN_MCC2;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[0] = PLMN_MNC0;
-           duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].extPlmn[k].mnc[1] = PLMN_MNC1;
-        }
-
-        duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].tac = DU_TAC;
-        duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].nrCellId = NR_CELL_ID;
-        duCfgParam.srvdCellLst[i].duCellInfo.brdcstPlmnInfo[j].ranac = NR_RANAC;
+         for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
+         {
+            memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
+            0, sizeof(Plmn));
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
+            PLMN_MCC0;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
+            PLMN_MCC1;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
+            PLMN_MCC2;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
+            PLMN_MNC0;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
+            PLMN_MNC1;
+         }
+         /* Extended PLMN List */       
+         for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
+         {
+            memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx], 0, sizeof(Plmn));
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
+            duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
+            extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
+         }
+
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
+         duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
       }
 
       /*gnb DU System Info mib msg*/
       BuildMibMsg();
-      DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBufSize);
-      if(!(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg))
+      DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
+      if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
       {
-        DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
-        return RFAILED;
+         DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
+         return RFAILED;
       }
-      memcpy(duCfgParam.srvdCellLst[i].duSysInfo.mibMsg, encBuf, encBufSize);
-      duCfgParam.srvdCellLst[i].duSysInfo.mibLen = encBufSize;
+      memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
+      duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
 
       /*gnb DU System Info mib msg*/
       BuildSib1Msg();
-      DU_ALLOC(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg,\
-           encBufSize);
-      if(!(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg))
+      DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
+            encBufSize);
+      if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
       {
-        DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
-        return RFAILED;
+         DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
+         return RFAILED;
       }
-      memcpy(duCfgParam.srvdCellLst[i].duSysInfo.sib1Msg,\
-           encBuf,encBufSize);
-      duCfgParam.srvdCellLst[i].duSysInfo.sib1Len = encBufSize;
+      memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
+            encBuf,encBufSize);
+      duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
 
    }
 
@@ -875,6 +932,7 @@ uint8_t duReadCfg()
    Buffer *mBuf;
 
    memset(&duCfgParam, 0, sizeof(DuCfgParams));
+
    //Read configs into duCfgParams
    if(readCfg() != ROK)
    {
index fabeaaf..676e31f 100644 (file)
 #define MAX_F1_CONNECTIONS 65536    /* Max num of F1 connections */
 #define MAX_PLMN           1        /* Max num of broadcast PLMN ids */
 #define MAXNRARFCN         3279165  /* Maximum values of NRAFCN */
-#define MAXNRCELLBANDS     2       /* Maximum number of frequency bands */
+#define MAX_NRCELL_BANDS   2       /* Maximum number of frequency bands */
 #define MAX_NUM_OF_SLICE_ITEMS 1024     /* Maximum number of signalled slice support items */
-#define MAXBPLMNNRMINUS1   1       /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
+#define MAX_BPLMN_NRCELL_MINUS_1   1       /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
 #define MAXNUMOFSIBTYPES   32       /* Maximum number of SIB types */
 #define MAX_TNL_ASSOC      32       /* Max num of TNL Assoc between CU and DU */
 #define MAXCELLINENB       256      /* Max num of cells served by eNB */
 #define MAXNUMOFUACPERPLMN 64       /* Maximum number of signalled categories per PLMN */
 #define NR_RANAC           150      /* RANAC */
 #define DEFAULT_CELLS      1        /* Max num of broadcast PLMN ids */
-
+#define NUM_OF_SUPPORTED_SLICE  2
+#define DEDICATED_SLICE_INDEX   1 
+#define IE_EXTENSION_LIST_COUNT 1
 
 /* Macro definitions for MIB/SIB1 */
 #define SYS_FRAME_NUM 0
@@ -491,6 +493,12 @@ typedef enum
    PUSCH_MAPPING_TYPE_B,
 }puschMappingType;
 
+typedef enum
+{
+   PRB,
+   DRB,
+   RRC_CONNECTED_USERS
+}ResourceType;
 
 typedef struct f1RrcVersion
 {
@@ -595,14 +603,14 @@ typedef struct f1SulInfo
 typedef struct f1FreqBand
 {
    uint16_t   nrFreqBand;
-   uint16_t   sulBand[MAXNRCELLBANDS];
+   uint16_t   sulBand[MAX_NRCELL_BANDS];
 }F1FreqBand;
 
 typedef struct f1NrFreqInfo
 {
    uint32_t        nrArfcn;
    F1SulInfo  sulInfo;
-   F1FreqBand freqBand[MAXNRCELLBANDS];
+   F1FreqBand freqBand[MAX_NRCELL_BANDS];
 }F1NrFreqInfo;
 
 typedef struct f1NrFddInfo
@@ -651,7 +659,7 @@ typedef struct f1EutraModeInfo
 typedef struct f1Snsaai
 {
    uint8_t   sst;
-   uint32_t  sd;
+   uint8_t   sd[SD_SIZE];
 }F1Snsaai;
 
 typedef struct epIpAddr
@@ -665,16 +673,40 @@ typedef struct epIpAddrPort
    char   port[2];
 }EpIpAddrPort;
 
+typedef struct policyMemberList
+{
+   Plmn   plmn;
+   F1Snsaai snsaai;   
+}PolicyMemberList;
+
+typedef struct rrmPolicyRatio
+{
+   uint8_t policyMaxRatio;
+   uint8_t policyMinRatio;
+   uint8_t policyDedicatedRatio;
+}RrmPolicyRatio;
+
+typedef struct rrmPolicy
+{
+   bool present;
+   ResourceType     rsrcType;
+   PolicyMemberList memberList;
+   RrmPolicyRatio   rrmPolicyRatio;
+}RrmPolicy;
+
 typedef struct f1TaiSliceSuppLst
 {
    bool       pres;
-   F1Snsaai   snssai[MAX_NUM_OF_SLICE_ITEMS];   
+   uint8_t    numSupportedSlices;
+   F1Snsaai   *snssai[MAX_NUM_OF_SLICE_ITEMS];   
 }F1TaiSliceSuppLst;
 
 typedef struct f1SrvdPlmn
 {
-   Plmn              plmn;
-   F1TaiSliceSuppLst   taiSliceSuppLst;
+   Plmn   plmn;
+   Plmn   extPlmn;    /* Extended available PLMN list */
+   F1TaiSliceSuppLst taiSliceSuppLst;
+   RrmPolicy  rrmPolicy;
 }F1SrvdPlmn;
 
 typedef struct f1BrdcstPlmnInfo
@@ -690,8 +722,7 @@ typedef struct f1CellInfo
 {
    NrEcgi   nrCgi;                   /* Cell global Identity */
    uint32_t nrPci;                   /* Physical Cell Identity */
-   Plmn   plmn[MAX_PLMN];     /* Available PLMN list */
-   Plmn   extPlmn[MAX_PLMN];  /* Extended available PLMN list */
+   F1SrvdPlmn srvdPlmn[MAX_PLMN];
 }F1CellInfo;
 
 typedef struct f1DuCellInfo
@@ -703,7 +734,7 @@ typedef struct f1DuCellInfo
    uint8_t            measTimeCfg;  /* Measurement timing configuration */
    F1CellDir          cellDir;      /* Cell Direction */
    F1CellType         cellType;     /* Cell Type */
-   F1BrdcstPlmnInfo   brdcstPlmnInfo[MAXBPLMNNRMINUS1]; /* Broadcast PLMN Identity Info List */
+   F1BrdcstPlmnInfo   brdcstPlmnInfo[MAX_BPLMN_NRCELL_MINUS_1]; /* Broadcast PLMN Identity Info List */
 }F1DuCellInfo;
 
 typedef struct f1DuSysInfo
index 2ef7201..9336f81 100644 (file)
@@ -956,95 +956,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 = NUM_OF_SUPPORTED_SLICE;
    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;
-   (*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;
-   }
+      list.count = elementCnt;
    (*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;
 }
 /*******************************************************************
@@ -1406,10 +1418,9 @@ void FreeRrcVer(RRC_Version_t *rrcVer)
  * ****************************************************************/
 void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
 {
-   uint8_t   plmnCnt=1;
-   uint8_t  sliceId=0;
-   uint8_t  extensionCnt=1;
-   uint8_t  plmnIdx=0;
+   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;
@@ -1437,7 +1448,7 @@ void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
             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 * sizeof(uint8_t));
+               DU_FREE(servedPlmnItem->pLMN_Identity.buf, servedPlmnItem->pLMN_Identity.size);
 
                if(servedPlmnItem->iE_Extensions != NULLP)
                {
@@ -1445,38 +1456,47 @@ void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
                   {
                      if(servedPlmnItem->iE_Extensions->list.array[0] != NULLP)
                      {
-                        if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
-                              array != NULLP)
+                        if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                        SliceSupportList.list.array != NULLP)
                         {
-                           if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
-                                 array[sliceId] != NULLP)
+                           for(sliceIdx =0; sliceIdx<servedPlmnItem->iE_Extensions->list.array[0]->\
+                           extensionValue.choice.SliceSupportList.list.count; sliceIdx++)
                            {
-                              sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
-                                                 SliceSupportList.list.array[sliceId];
+                              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));
+                                 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));
-                              }
+                                 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[sliceId], sizeof(SliceSupportItem_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, sizeof(SliceSupportItem_t*));
+                           DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                           SliceSupportList.list.array, sizeof(SliceSupportItem_t*));
                         }
-                        DU_FREE(servedPlmnItem->iE_Extensions->list.array[0], sizeof(ServedPLMNs_ItemExtIEs_t));
+                        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->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[plmnIdx],\
+               sizeof(ServedPLMNs_Item_t));
             }
-            DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array, 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.choice.fDD != NULLP)
@@ -1484,10 +1504,10 @@ void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
             if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
                   freqBandListNr.list.array != NULLP)
             {
-               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->\
+               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*));
             }
 
             if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
@@ -1796,7 +1816,7 @@ uint8_t BuildAndSendF1SetupReq()
 
 void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
 {
-   uint8_t arrIdx=0,i=0;
+   uint8_t arrIdx=0, servedPlmnIdx=0, sliceLstIdx=0;
    ServedPLMNs_Item_t *servedPlmnItem = NULLP;
    SliceSupportItem_t *sliceSupportItem = NULLP;
 
@@ -1822,41 +1842,50 @@ void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
             {
                if(servedPlmnItem->iE_Extensions->list.array[arrIdx] != NULLP)
                {
-                  if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array != NULLP)
+                  if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                        list.array != NULLP)
                   {
-                     if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx] != NULLP)
+                     for(sliceLstIdx =0; sliceLstIdx<servedPlmnItem->iE_Extensions->list.array[arrIdx]->\
+                           extensionValue.choice.SliceSupportList.list.count; sliceLstIdx++)
                      {
-                        sliceSupportItem = modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->iE_Extensions->\
-                                           list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx];
-
-                        DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sliceSupportItem->sNSSAI.sST.size);
-                        if(sliceSupportItem->sNSSAI.sD != NULLP)
+                        if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                              list.array[sliceLstIdx] != NULLP)
                         {
-                           DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
-                           DU_FREE(sliceSupportItem->sNSSAI.sD,sizeof(OCTET_STRING_t));
+
+                           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[arrIdx], 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);
+                     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(i=0; i < servedPlmnItem->iE_Extensions->list.count ; i++)
+               for(servedPlmnIdx=0; servedPlmnIdx< servedPlmnItem->iE_Extensions->list.count ; servedPlmnIdx++)
                {
-                  DU_FREE(servedPlmnItem->iE_Extensions->list.array[i], sizeof(ServedPLMNs_ItemExtIEs_t ));
+                  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(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
+      for(servedPlmnIdx=0; servedPlmnIdx<modifyItem->served_Cell_Information.servedPLMNs.list.count; servedPlmnIdx++)
       {
-         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i], sizeof(ServedPLMNs_Item_t));
+         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);
+         modifyItem->served_Cell_Information.servedPLMNs.list.size);
    }
 
    if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
@@ -2006,119 +2035,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 = NUM_OF_SUPPORTED_SLICE; 
+   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;
 }