From 9610be940d43a65a221ad21cd7716796f6908e75 Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Wed, 22 Sep 2021 11:18:09 +0530 Subject: [PATCH] Implementation of Slice related configuration and Slice Discovery procedure [Jira id = ODUHIGH-369] Change-Id: If9bbc3117d861a08ac26abad4bc664fd8f15c718 Signed-off-by: lal.harshita --- src/cu_stub/cu_f1ap_msg_hdl.c | 175 +++++++++++++++- src/cu_stub/cu_stub.h | 11 ++ src/du_app/du_cfg.c | 292 ++++++++++++++++----------- src/du_app/du_cfg.h | 55 ++++-- src/du_app/du_f1ap_msg_hdl.c | 449 +++++++++++++++++++++++------------------- 5 files changed, 649 insertions(+), 333 deletions(-) diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 07e176c83..588d750ce 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -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; sliceListIdxlist.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; srvPlmnIdxlist.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; plmnidxlist.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; } diff --git a/src/cu_stub/cu_stub.h b/src/cu_stub/cu_stub.h index 74d684718..4d7c4e17a 100644 --- a/src/cu_stub/cu_stub.h +++ b/src/cu_stub/cu_stub.h @@ -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 diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index ac754e4a8..cf99c6e5a 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -215,10 +215,7 @@ uint8_t readMacCfg() } else { - for(uint8_t idx=0; idxpres = true; + taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE; + + memset(&taiSliceSuppLst->snssai, 0, sizeof(F1Snsaai)); + for(sliceIdx=0; sliceIdxsnssai[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 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) { diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index fabeaaf29..676e31f66 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -220,9 +220,9 @@ #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 */ @@ -231,7 +231,9 @@ #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 diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 2ef720114..9336f8158 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -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;plmnidxlist.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; sliceLstIdxlist.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; sliceIdxiE_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; sliceLstIdxiE_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;iserved_Cell_Information.servedPLMNs.list.count;i++) + for(servedPlmnIdx=0; servedPlmnIdxserved_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;ieIdxlist.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; } -- 2.16.6