- //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;
+
+ ieIdx = 0;
+ elementCnt = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst.numSupportedSlices;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->id =ProtocolIE_ID_id_TAISliceSupportList;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->criticality = Criticality_ignore;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.present = \
+ ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.count = elementCnt;
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.size = elementCnt * sizeof(SliceSupportItem_t *);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.size);
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+
+ for(sliceLstIdx =0; sliceLstIdx< elementCnt; sliceLstIdx++)
+ {
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx],sizeof( SliceSupportItem_t));
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->\
+ sNSSAI.sST.size);
+
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf[arrayIdx] = duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+ cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+ DU_ALLOC(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf,servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size);
+ if(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : fillServedPlmns(): Memory allocation failed");
+ return RFAILED;
+ }
+ memcpy(servedPlmn->list.array[arrayIdx]->\
+ iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[arrayIdx].duCellInfo.\
+ cellInfo.srvdPlmn[arrayIdx].taiSliceSuppLst.snssai[sliceLstIdx]->sd,\
+ servedPlmn->list.array[arrayIdx]->iE_Extensions->list.array[ieIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size);
+ }