#include "odu_common_codec.h"
#include "cu_stub_sctp.h"
#include "cu_f1ap_msg_hdl.h"
+#include "legtp.h"
/*header files needed for Ue Context Setup */
#include<ProtocolIE-Field.h>
#include "ProtocolExtensionField.h"
#include "GBR-QosInformation.h"
#include "DRBs-ToBeSetupMod-List.h"
#include "DRBs-ToBeSetupMod-Item.h"
+#include "DRBs-Setup-Item.h"
+#include "DLUPTNLInformation-ToBeSetup-List.h"
+#include "DLUPTNLInformation-ToBeSetup-Item.h"
+#include "UPTransportLayerInformation.h"
+#include "GTPTunnel.h"
/* MACRO for CUtoDURRCInformation */
#define CELL_GRP_ID 1
#define DMRS_ADDITIONAL_POS 0 /* DMRS Additional poistion */
#define RES_ALLOC_TYPE 1 /* Resource allocation type */
#define FIVE_QI_VALUE 9 /*spec 23.501, Table 5.7.4-1*/
+
/*******************************************************************
*
* @brief Sends F1 msg over SCTP
*
* Functionality: Constructs the UL TnlInfo For DRB list
*
- * @params[in] ULUPTNLInformation_ToBeSetup_List_t *ulInfo
+ * @params[in] UPTNLInformation_ToBeSetup_List_t *ulInfo
*
* @return ROK - success
* RFAILED - failure
* ****************************************************************/
uint8_t BuildDRBSetup(DRBs_ToBeSetup_List_t *drbSet)
{
- uint8_t BuildQOSInforet;
- uint8_t BuildSNSSAIret;
- uint8_t BuildFlowsMapret;
- uint8_t BuildULTnlInforet;
- uint8_t idx;
- uint8_t drbCnt;
+ uint8_t BuildQOSInforet = 0,BuildSNSSAIret = 0, idx = 0;
+ uint8_t BuildFlowsMapret =0, BuildULTnlInforet =0, drbCnt = 0;
DRBs_ToBeSetup_Item_t *drbSetItem;
- drbCnt = 1;
+
+ drbCnt = MAX_DRB_SET;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt*sizeof(DRBs_ToBeSetup_ItemIEs_t *);
CU_ALLOC(drbSet->list.array,drbSet->list.size);
CU_ALLOC(drbSet->list.array[idx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
if(drbSet->list.array[idx] == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
- }
- idx = 0;
- drbSet->list.array[idx]->id = ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
- drbSet->list.array[idx]->criticality = Criticality_ignore;
- drbSet->list.array[idx]->value.present = \
- DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
- drbSetItem = &drbSet->list.array[idx]->value.choice.DRBs_ToBeSetup_Item;
- /*dRBID*/
- drbSetItem->dRBID = 1;
- /*qoSInformation*/
- drbSetItem->qoSInformation.present = QoSInformation_PR_choice_extension;
- CU_ALLOC(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
- if(drbSetItem->qoSInformation.choice.choice_extension == NULLP)
- {
- return RFAILED;
- }
- drbSetItem->qoSInformation.choice.choice_extension->id = \
- ProtocolIE_ID_id_DRB_Information;
- drbSetItem->qoSInformation.choice.choice_extension->criticality = \
- Criticality_ignore;
- drbSetItem->qoSInformation.choice.choice_extension->value.present = \
+
+ drbSet->list.array[idx]->id = ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
+ drbSet->list.array[idx]->criticality = Criticality_ignore;
+ drbSet->list.array[idx]->value.present = \
+ DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
+ drbSetItem = &drbSet->list.array[idx]->value.choice.DRBs_ToBeSetup_Item;
+ /*dRBID*/
+ drbSetItem->dRBID = idx + 1;
+ /*qoSInformation*/
+ drbSetItem->qoSInformation.present = QoSInformation_PR_choice_extension;
+ CU_ALLOC(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ if(drbSetItem->qoSInformation.choice.choice_extension == NULLP)
+ {
+ return RFAILED;
+ }
+ drbSetItem->qoSInformation.choice.choice_extension->id = \
+ ProtocolIE_ID_id_DRB_Information;
+ drbSetItem->qoSInformation.choice.choice_extension->criticality = \
+ Criticality_ignore;
+ drbSetItem->qoSInformation.choice.choice_extension->value.present = \
QoSInformation_ExtIEs__value_PR_DRB_Information;
- BuildQOSInforet = BuildQOSInfo(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.dRB_QoS);
- if(BuildQOSInforet != ROK)
- {
- return RFAILED;
- }
- /*SNSSAI*/
- BuildSNSSAIret = BuildSNSSAI(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.sNSSAI);
- if(BuildSNSSAIret != ROK)
- {
- return RFAILED;
- }
- /*Flows mapped to DRB List*/
- BuildFlowsMapret = BuildFlowsMap(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
- if(BuildFlowsMapret != ROK)
- {
- return RFAILED;
- }
- /*ULUPTNLInformation To Be Setup List*/
- BuildULTnlInforet = BuildULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
- if(BuildULTnlInforet != ROK)
- {
- return RFAILED;
- }
- /*RLCMode*/
- drbSetItem->rLCMode = RLCMode_rlc_um_bidirectional;
+ BuildQOSInforet = BuildQOSInfo(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.dRB_QoS);
+ if(BuildQOSInforet != ROK)
+ {
+ return RFAILED;
+ }
+ /*SNSSAI*/
+ BuildSNSSAIret = BuildSNSSAI(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.sNSSAI);
+ if(BuildSNSSAIret != ROK)
+ {
+ return RFAILED;
+ }
+ /*Flows mapped to DRB List*/
+ BuildFlowsMapret = BuildFlowsMap(&drbSetItem->qoSInformation.choice.\
+ choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
+ if(BuildFlowsMapret != ROK)
+ {
+ return RFAILED;
+ }
+ /*ULUPTNLInformation To Be Setup List*/
+ BuildULTnlInforet = BuildULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+ if(BuildULTnlInforet != ROK)
+ {
+ return RFAILED;
+ }
+ /*RLCMode*/
+ drbSetItem->rLCMode = RLCMode_rlc_um_bidirectional;
- /*UL Configuration*/
- CU_ALLOC(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
- if(drbSetItem->uLConfiguration == NULLP)
- {
- return RFAILED;
- }
- drbSetItem->uLConfiguration->uLUEConfiguration = ULUEConfiguration_no_data;
+ /*UL Configuration*/
+ CU_ALLOC(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
+ if(drbSetItem->uLConfiguration == NULLP)
+ {
+ return RFAILED;
+ }
+ drbSetItem->uLConfiguration->uLUEConfiguration = ULUEConfiguration_no_data;
+ }
return ROK;
}/* End of BuildDRBSetup*/
{
for(drbidx=0; drbidx<drbSet->list.count; drbidx++)
{
- if(drbidx==0&&drbSet->list.array[drbidx] != NULLP)
- {
- drbSetItem =&drbSet->list.array[drbidx]->value.choice.DRBs_ToBeSetup_Item;
- if(drbSetItem->qoSInformation.choice.choice_extension != NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI !=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
- flows_Mapped_To_DRB_List.list.array != NULLP)
- {
- for(flowidx=0;flowidx<drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
- flows_Mapped_To_DRB_List.list.count; flowidx++)
- {
- if(flowidx==0&&drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
- {
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
- {
- FreeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
- CU_FREE(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
-
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,\
- sizeof(MaxDataBurstVolume_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
- qoS_Characteristics.choice.non_Dynamic_5QI,sizeof(NonDynamic5QIDescriptor_t));
- }
- }
- if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
- {
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
- DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx],sizeof(Flows_Mapped_To_DRB_Item_t));
- }
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
- flows_Mapped_To_DRB_List.list.array,drbSetItem->qoSInformation.choice.choice_extension->value.\
- choice.DRB_Information.flows_Mapped_To_DRB_List.list.size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf,\
- drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD,\
- sizeof(OCTET_STRING_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf,\
- drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.size);
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,sizeof(MaxDataBurstVolume_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
- qoS_Characteristics.choice.non_Dynamic_5QI, sizeof(NonDynamic5QIDescriptor_t));
- }
- CU_FREE(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
- }
- }
- if(drbSet->list.array[drbidx]!=NULLP)
- {
- CU_FREE(drbSet->list.array[drbidx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
- }
+ if(drbSet->list.array[drbidx] != NULLP)
+ {
+ drbSetItem =&drbSet->list.array[drbidx]->value.choice.DRBs_ToBeSetup_Item;
+ if(drbSetItem->qoSInformation.choice.choice_extension != NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI !=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+ flows_Mapped_To_DRB_List.list.array != NULLP)
+ {
+ for(flowidx=0;flowidx<drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+ flows_Mapped_To_DRB_List.list.count; flowidx++)
+ {
+ if(flowidx==0&&drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow!=NULLP)
+ {
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume!=NULLP)
+ {
+ FreeULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
+ CU_FREE(drbSetItem->uLConfiguration,sizeof(ULConfiguration_t));
+
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,\
+ sizeof(MaxDataBurstVolume_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]->qoSFlowLevelQoSParameters.\
+ qoS_Characteristics.choice.non_Dynamic_5QI,sizeof(NonDynamic5QIDescriptor_t));
+ }
+ }
+ if(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx]!=NULLP)
+ {
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.\
+ DRB_Information.flows_Mapped_To_DRB_List.list.array[flowidx],sizeof(Flows_Mapped_To_DRB_Item_t));
+ }
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.\
+ flows_Mapped_To_DRB_List.list.array,drbSetItem->qoSInformation.choice.choice_extension->value.\
+ choice.DRB_Information.flows_Mapped_To_DRB_List.list.size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->buf,\
+ drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD->size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sD,\
+ sizeof(OCTET_STRING_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.buf,\
+ drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.sNSSAI.sST.size);
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume,sizeof(MaxDataBurstVolume_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,sizeof(AveragingWindow_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS.\
+ qoS_Characteristics.choice.non_Dynamic_5QI, sizeof(NonDynamic5QIDescriptor_t));
+ }
+ CU_FREE(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ }
+ CU_FREE(drbSet->list.array[drbidx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
+ }
}
CU_FREE(drbSet->list.array,drbSet->list.size);
}
{
if(ueSetReq->protocolIEs.list.array[ieId] != NULLP)
{
- CU_FREE(ueSetReq->protocolIEs.list.array[ieId],sizeof(UEContextSetupRequestIEs_t));
+ CU_FREE(ueSetReq->protocolIEs.list.array[ieId],sizeof(UEContextSetupRequestIEs_t));
}
}
CU_FREE(ueSetReq->protocolIEs.list.array,ueSetReq->protocolIEs.list.size);
}
CU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
- }
+ }
CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
}
return ret;
}/* End of BuildAndSendUeContextSetupReq*/
+/**********************************************************************
+ * @brief Function to extractTeId received in UE context setup Response
+ *
+ * @details
+ *
+ * Function : extractTeId
+ *
+ * Functionality:
+ * - Function to extract TeId
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ **********************************************************************/
+uint8_t extractTeId(DLUPTNLInformation_ToBeSetup_List_t *dlTnlInfo)
+{
+ uint8_t arrIdx = 0;
+ uint32_t teId = 0;
+ GTPTunnel_t *gtpDl = NULLP;
+ for(arrIdx =0; arrIdx < dlTnlInfo->list.count; arrIdx++)
+ {
+ if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.present == UPTransportLayerInformation_PR_gTPTunnel)
+ {
+ if(dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel != NULLP)
+ {
+ gtpDl = dlTnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel;
+ if(gtpDl->gTP_TEID.size > 0)
+ {
+ teIdStringToInt(gtpDl->gTP_TEID.buf, &teId);
+ }
+ else
+ DU_LOG("\nERROR --> EGTP: No TeId received");
+ return(teId);
+ }
+ }
+ }
+ return teId;
+}
+
+/****************************************************************
+ * @brief Function to add Drb tunnels
+ *
+ * @details
+ *
+ * Function : addDrbTunnels
+ *
+ * Functionality:
+ * - Function to add Drb tunnels
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t addDrbTunnels(uint8_t teId)
+{
+ uint8_t ret = ROK;
+ EgtpTnlEvt tnlEvt;
+
+ if(teId > MAX_TEID || teId < MIN_TEID)
+ {
+ DU_LOG("\nERROR --> EGTP : TEID(%x) OUT Of Range",teId);
+ }
+ memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
+ tnlEvt.action = EGTP_TNL_MGMT_ADD;
+ tnlEvt.lclTeid = teId;
+ tnlEvt.remTeid = teId;
+ ret = cuEgtpTnlMgmtReq(tnlEvt);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP : Tunnel management request failed for teId %x", teId);
+ }
+ return ROK;
+}
+
+/****************************************************************
+ * @brief Function to process Drb Setup List
+ *
+ * @details
+ *
+ * Function : procDrbSetupList
+ *
+ * Functionality:
+ * - Function to process DRB Setup List
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procDrbSetupList(DRBs_Setup_List_t *drbSetupList)
+{
+ uint8_t arrIdx = 0;
+ uint32_t teId = 0;
+ DRBs_Setup_ItemIEs_t *drbItemIe = NULLP;
+
+ if(drbSetupList != NULLP)
+ {
+ for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ {
+ drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
+ if(drbItemIe->value.present == DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item)
+ {
+ /* extracting teId */
+ teId = extractTeId(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
+ if(teId > 0)
+ {
+ if(addDrbTunnels(teId)== ROK)
+ {
+ DU_LOG("\nDEBUG --> EGTP: Tunnel Added for TeId %d", teId);
+ }
+ }
+ else
+ return RFAILED;
+ }
+ }
+ }
+ return ROK;
+}
+
+/****************************************************************
+ * @brief Function to process Ue Context Setup Response
+ *
+ * @details
+ *
+ * Function : procUeContextSetupResponse
+ *
+ * Functionality:
+ * - Function to process Ue Context Setup Response
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
uint8_t procUeContextSetupResponse(F1AP_PDU_t *f1apMsg)
{
uint8_t idx, duUeF1apId;
- UEContextSetupResponse_t *ueCtxtSetupRsp;
+ UEContextSetupResponse_t *ueCtxtSetupRsp = NULLP;
ueCtxtSetupRsp = &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
for(idx=0; idx < ueCtxtSetupRsp->protocolIEs.list.count; idx++)
duUeF1apId = ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
break;
}
+ case ProtocolIE_ID_id_DRBs_Setup_List:
+ {
+ /* Adding Tunnels for successful DRB */
+ procDrbSetupList(&ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.DRBs_Setup_List);
+ break;
+
+ }
}
}
ueCb[duUeF1apId-1].f1apMsgDb.dlRrcMsgCount++; /* keeping DL RRC Msg Count */
+ return ROK;
}
/****************************************************************
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)
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
case InitiatingMessage__value_PR_F1SetupRequest:
{
DU_LOG("\nINFO --> F1AP : F1 setup request received");
- BuildAndSendF1SetupRsp();
+ procF1SetupReq(f1apMsg);
break;
}
#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*/
+/*VALID Tunnel ID*/
+#define MIN_TEID 1 /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
+#define MAX_TEID 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
/* allocate and zero out a static buffer */
+
#define CU_ALLOC(_datPtr, _size) \
{ \
S16 _ret; \
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;
Plmn plmn;
EgtpParams egtpParams;
RrcVersion rrcVersion;
+ uint8_t numSnssaiSupported;
+ Snssai *snssaiList[MAX_NUM_OF_SLICE];
}CuCfgParams;
CuCfgParams cuCfgParams; //global variable to hold all configs
}
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;
pdcchCfg.searchSpcId = PDCCH_SEARCH_SPACE_ID;
pdcchCfg.ctrlRsrcSetId = PDCCH_CTRL_RSRC_SET_ID;
pdcchCfg.monitorSlotPrdAndOffPresent = \
+
SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
//pdcchCfg.monitorSlotPrdAndOff = \
SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
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 )
duCfgParam.egtpParams.destIp.ipV4Pres = TRUE;
duCfgParam.egtpParams.destIp.ipV4Addr = ipv4_cu;
duCfgParam.egtpParams.destPort = CU_EGTP_PORT;
- duCfgParam.egtpParams.minTunnelId = 0;
- duCfgParam.egtpParams.maxTunnelId = 10;
+ duCfgParam.egtpParams.minTunnelId = MIN_TEID;
+ duCfgParam.egtpParams.maxTunnelId = MAX_TEID;
duCfgParam.maxUe = 32; //TODO: Check
/* DU Info */
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;
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;
}
Buffer *mBuf;
memset(&duCfgParam, 0, sizeof(DuCfgParams));
+
//Read configs into duCfgParams
if(readCfg() != ROK)
{
#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
#define PDSCH_MCS_INDEX 20 /* For 64QAM, valid mcs index: 17-28 in 38.214 - Table 5.1.3.1-1*/
#define PUSCH_MCS_INDEX 10 /* For 16QAM, valid mcs index: 10-16 in 38.214 - Table 5.1.3.1-1*/
+/*VALID Tunnel ID*/
+#define MIN_TEID 1 /*[Spec 29.281,Sec 5.1]: All Zero TEIDs are never assigned for setting up GTP-U Tunnel*/
+#define MAX_TEID 10 /*[Spec 29.281]: Max limit is not mentioned but as per GTP-U Header Format, TEID occupies 4 octets */
typedef enum
{
GNBDU,
PUSCH_MAPPING_TYPE_B,
}puschMappingType;
+ typedef enum
+ {
+ PRB,
+ DRB,
+ RRC_CONNECTED_USERS
+ }ResourceType;
typedef struct f1RrcVersion
{
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
typedef struct f1Snsaai
{
uint8_t sst;
- uint32_t sd;
+ uint8_t sd[SD_SIZE];
}F1Snsaai;
typedef struct epIpAddr
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
{
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
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
* ****************************************************************/
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;
+ list.count = elementCnt;
(*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.size = sizeof(SliceSupportItem_t *);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array,sizeof(SliceSupportItem_t *));
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array == NULLP)
- {
- return RFAILED;
- }
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId],sizeof(SliceSupportItem_t));
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId] == NULLP)
- {
- return RFAILED;
- }
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.size = sizeof(uint8_t);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
- .list.array[sliceId]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
- extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.size);
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
- .list.array[sliceId]->sNSSAI.sST.buf == NULLP)
- {
- return RFAILED;
- }
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sST.buf[0] = 3;
+ list.size = (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.count * sizeof(SliceSupportItem_t *);
+
DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ list.array, elementCnt * sizeof(SliceSupportItem_t *));
if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD == NULLP)
+ list.array == NULLP)
{
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
return RFAILED;
}
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->size = 3*sizeof(uint8_t);
- DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf,(*ieExtend)->list.array[idx]->extensionValue.choice.\
- SliceSupportList.list.array[sliceId]->sNSSAI.sD->size);
- if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf == NULLP)
+
+ for(sliceLstIdx =0; sliceLstIdx<elementCnt; sliceLstIdx++)
{
- return RFAILED;
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx],sizeof(SliceSupportItem_t));
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size = sizeof(uint8_t);
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+ .list.array[sliceLstIdx]->sNSSAI.sST.buf,(*ieExtend)->list.array[idx]->\
+ extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.size);
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList\
+ .list.array[sliceLstIdx]->sNSSAI.sST.buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sST.buf[0] = duCfgParam.srvdCellLst[0].duCellInfo.\
+ cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sst;
+
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->size = 3 * sizeof(uint8_t);
+ DU_ALLOC((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, (*ieExtend)->list.array[idx]->extensionValue.choice.\
+ SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
+ if((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf == NULLP)
+ {
+ DU_LOG("ERROR --> DU_APP : BuildExtensions(): Memory allocation failed");
+ return RFAILED;
+ }
+ memcpy((*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
+ list.array[sliceLstIdx]->sNSSAI.sD->buf, duCfgParam.srvdCellLst[0].duCellInfo.\
+ cellInfo.srvdPlmn[0].taiSliceSuppLst.snssai[sliceLstIdx]->sd, (*ieExtend)->list.array[idx]->\
+ extensionValue.choice.SliceSupportList.list.array[sliceLstIdx]->sNSSAI.sD->size);
}
- sdId = 0;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 3;
- sdId++;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 6;
- sdId++;
- (*ieExtend)->list.array[idx]->extensionValue.choice.SliceSupportList.\
- list.array[sliceId]->sNSSAI.sD->buf[sdId] = 9;
return ROK;
}
/*******************************************************************
* ****************************************************************/
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;
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)
{
{
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)
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.\
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;
{
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)
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;
}
}
- //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)
- {
+
+ 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;
}
- 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)
+ for(sliceLstIdx =0; sliceLstIdx< elementCnt; sliceLstIdx++)
{
- 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;
+ 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);
}
- 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;
}
}
(ueCfgDb->numRlcLcs)++;
(ueCfgDb->numMacLcs)++;
+ DU_LOG("\nDEBUG -> DUAPP: extractRlcCfgToAddMod:RBType:%d, DrbID: %d,lcId:%d, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ rbType, rbId, lcId, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
}
//TODO: To send the failure cause in UeContextSetupRsp
return ROK;
&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs]);
ueCfgDb->numRlcLcs++;
ueCfgDb->numMacLcs++;
+ DU_LOG("\nDEBUG --> DUAPP: extractSrbListToSetup: SRBID: %d [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ srbItem->sRBID, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP: Failed at extractSrbListToSetup()");
*
* ****************************************************************/
-uint8_t extractDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
-uint8_t drbCount, DuUeCfg *ueCfgDb)
+uint8_t extractDrbListToSetup(DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
+uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap)
{
- uint8_t ret, drbIdx;
+ uint8_t ret, drbIdx, lcId = 0;
DRBs_ToBeSetup_Item_t *drbItem = NULLP;
DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
}
memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
-
+
+ lcId = getDrbLcId(drbBitMap);
+ if(lcId == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : InCorrect LCID extractDrbListToSetup()");
+ ret = RFAILED;
+ break;
+ }
if(drbCfg != NULL)
{
drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
ueCfgDb->numRlcLcs++;
ueCfgDb->numMacLcs++;
ueCfgDb->numDrb++;
+
+ DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetup:lcId:%x ,BitMap:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ lcId,*drbBitMap, ueCfgDb->numRlcLcs, ueCfgDb->numMacLcs, ueCfgDb->numDrb);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
* ****************************************************************/
uint8_t procF1UeContextSetupReq(F1AP_PDU_t *f1apMsg)
{
- uint8_t ret=0, ieIdx=0, ueIdx=0, lcId=0, cellIdx=0;
+ uint8_t ret=0, ieIdx=0, ueIdx=0, cellIdx=0;
bool ueCbFound = false;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0, bitRateSize=0;
DuUeCb *duUeCb = NULL;
}
case ProtocolIE_ID_id_DRBs_ToBeSetup_List:
{
- lcId = getDrbLcId(&duUeCb->drbBitMap);
- if(lcId != RFAILED)
- {
drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
- if(extractDrbListToSetup(lcId, drbCfg, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg))
+
+ if(extractDrbListToSetup(drbCfg, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
//TODO: Update the failure cause in ue context Setup Response
ret = RFAILED;
}
- }
- else
- ret = RFAILED;
break;
}
case ProtocolIE_ID_id_RRCContainer:
uint8_t procF1UeContextModificationReq(F1AP_PDU_t *f1apMsg)
{
UEContextModificationRequest_t *ueContextModifyReq = NULLP;
- uint8_t ret = ROK, ieIdx = 0, lcId =0,cellIdx=0, ueIdx=0;
+ uint8_t ret = ROK, ieIdx = 0, cellIdx=0, ueIdx=0;
DuUeCb *duUeCb = NULLP;
DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
{
duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
- lcId = getDrbLcId(&duUeCb->drbBitMap);
- if(lcId != RFAILED)
- {
DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
if(duUeCb->f1UeDb)
{
duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
choice.DRBs_ToBeSetupMod_List;
- if(extractDrbListToSetup(lcId, NULL, drbSetupModCfg ,drbSetupModCfg->list.count, \
- &duUeCb->f1UeDb->duUeCfg))
+ if(extractDrbListToSetup(NULL, drbSetupModCfg ,drbSetupModCfg->list.count, \
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
ret = RFAILED;
}
}
- }
break;
}
}