#include "DLUPTNLInformation-ToBeSetup-Item.h"
#include "UPTransportLayerInformation.h"
#include "GTPTunnel.h"
+#include "QoSInformation.h"
/* MACRO for CUtoDURRCInformation */
#define CELL_GRP_ID 1
#define SCRAMBLING_ID NR_PCI
#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*/
+#define FIVE_QI_VALUE9 9 /*spec 23.501, Table 5.7.4-1*/
+#define FIVE_QI_VALUE8 8 /*spec 23.501, Table 5.7.4-1*/
/*******************************************************************
*
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildQOSInfo(QoSFlowLevelQoSParameters_t *drbQos)
+uint8_t BuildQOSInfo(QoSFlowLevelQoSParameters_t *drbQos, uint8_t actionType)
{
/* NonDynamic5QIDescriptor */
drbQos->qoS_Characteristics.present = QoS_Characteristics_PR_non_Dynamic_5QI;
return RFAILED;
}
/*FiveQI*/
- drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = FIVE_QI_VALUE;
+ if(actionType == ProtocolIE_ID_id_DRBs_ToBeModified_Item)
+ drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = FIVE_QI_VALUE8;
+ else
+ drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = FIVE_QI_VALUE9;
+
/*AveragingWindow*/
CU_ALLOC(drbQos->qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow,\
sizeof(AveragingWindow_t));
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildFlowsMap(Flows_Mapped_To_DRB_List_t *flowMap)
+uint8_t BuildFlowsMap(Flows_Mapped_To_DRB_List_t *flowMap , uint8_t actionType)
{
- uint8_t ret;
- uint8_t idx;
- uint8_t flowCnt;
+ uint8_t ret = ROK, idx = 0, flowCnt = 0;
+
flowCnt = 1;
flowMap->list.count = flowCnt;
flowMap->list.size = flowCnt * sizeof(Flows_Mapped_To_DRB_Item_t *);
CU_ALLOC(flowMap->list.array,flowMap->list.size);
if(flowMap->list.array == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for array in BuildFlowsMap()");
return RFAILED;
}
for(idx=0; idx<flowCnt; idx++)
CU_ALLOC(flowMap->list.array[idx],sizeof(Flows_Mapped_To_DRB_Item_t));
if(flowMap->list.array[idx] == NULLP)
{
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for arrayIdx[%d] in BuildFlowsMap()", idx);
+ return RFAILED;
}
}
idx = 0;
flowMap->list.array[idx]->qoSFlowIdentifier = 0;
- ret = BuildQOSInfo(&flowMap->list.array[idx]->qoSFlowLevelQoSParameters);
+ ret = BuildQOSInfo(&flowMap->list.array[idx]->qoSFlowLevelQoSParameters,\
+ actionType);
if(ret != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to Build QOS Info in BuildFlowsMap()");
return RFAILED;
}
return ROK;
ulInfo->list.size = ulCnt * sizeof(ULUPTNLInformation_ToBeSetup_Item_t *);
CU_ALLOC(ulInfo->list.array,ulInfo->list.size);
if(ulInfo->list.array == NULLP)
- {
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for array in BuildULTnlInfo()");
return RFAILED;
}
for(idx=0; idx<ulCnt; idx++)
CU_ALLOC(ulInfo->list.array[idx],sizeof(ULUPTNLInformation_ToBeSetup_Item_t));
if(ulInfo->list.array[idx] == NULLP)
{
- return RFAILED;
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for arrayIdx [%d] in BuildULTnlInfo()", idx);
+ return RFAILED;
}
}
idx = 0;
sizeof(GTPTunnel_t));
if(ulInfo->list.array[idx]->uLUPTNLInformation.choice.gTPTunnel == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for gTPTunnel in BuildULTnlInfo()");
return RFAILED;
}
ulInfo->list.array[idx]->uLUPTNLInformation.choice.gTPTunnel->\
if(ulInfo->list.array[idx]->uLUPTNLInformation.choice.gTPTunnel->\
transportLayerAddress.buf == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for gtp tunnel arrayIdx[%d] in BuildULTnlInfo()", idx);
return RFAILED;
}
/* NOTE: Below IP address must be changed if running on different IP configuration */
if(ulInfo->list.array[idx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf\
== NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for gtp tunnel buffer in BuildULTnlInfo()");
return RFAILED;
}
ulInfo->list.array[idx]->uLUPTNLInformation.choice.gTPTunnel->\
uint8_t BuildFlowsMapret =0, BuildULTnlInforet =0, drbCnt = 0;
DRBs_ToBeSetup_Item_t *drbSetItem;
- drbCnt = MAX_DRB_SET;
+ drbCnt = MAX_DRB_SET_UE_CONTEXT_SETUP_REQ;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt*sizeof(DRBs_ToBeSetup_ItemIEs_t *);
CU_ALLOC(drbSet->list.array,drbSet->list.size);
if(drbSet->list.array == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDRBSetup");
return RFAILED;
}
for(idx=0; idx<drbCnt; idx++)
CU_ALLOC(drbSet->list.array[idx],sizeof(DRBs_ToBeSetup_ItemIEs_t));
if(drbSet->list.array[idx] == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDRBSetup for arry idx [%d]", idx);
return RFAILED;
}
CU_ALLOC(drbSetItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
if(drbSetItem->qoSInformation.choice.choice_extension == NULLP)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed for QOS choice extension in BuildDRBSetup");
return RFAILED;
}
drbSetItem->qoSInformation.choice.choice_extension->id = \
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);
+ choice_extension->value.choice.DRB_Information.dRB_QoS,\
+ ProtocolIE_ID_id_DRBs_ToBeSetup_Item);
if(BuildQOSInforet != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to build QOS Info in BuildDRBSetup");
return RFAILED;
}
/*SNSSAI*/
choice_extension->value.choice.DRB_Information.sNSSAI);
if(BuildSNSSAIret != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to build SNSSAI Info in BuildDRBSetup");
return RFAILED;
}
/*Flows mapped to DRB List*/
BuildFlowsMapret = BuildFlowsMap(&drbSetItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
+ choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List,\
+ ProtocolIE_ID_id_DRBs_ToBeSetup_Item);
if(BuildFlowsMapret != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to build Flow Map Info in BuildDRBSetup");
return RFAILED;
}
/*ULUPTNLInformation To Be Setup List*/
BuildULTnlInforet = BuildULTnlInfo(&drbSetItem->uLUPTNLInformation_ToBeSetup_List);
if(BuildULTnlInforet != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to build tunnel Info in BuildDRBSetup");
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;
}
return ROK;
}/* End of BuildDRBSetup*/
CU_FREE(ulInfo->list.array,ulInfo->list.size);
}
}
+
+/*******************************************************************
+*
+* @brief Deletes the EGTP tunnel
+*
+* @details
+*
+* Function : deleteEgtpTunnel
+*
+* Functionality: Deletes the EGTP tunnel
+*
+* @params[in] uint8_t *buf
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t deleteEgtpTunnel(uint8_t *buf)
+{
+ uint32_t teId = 0;
+ EgtpTnlEvt tnlEvt;
+
+ teIdStringToInt(buf, &teId);
+ if(teId > MAX_TEID || teId < MIN_TEID)
+ {
+ DU_LOG("\nERROR --> EGTP : TEID(%d) OUT Of Range", teId);
+ return RFAILED;
+ }
+ memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
+ tnlEvt.action = EGTP_TNL_MGMT_DEL;
+ tnlEvt.lclTeid = teId;
+ tnlEvt.remTeid = teId;
+ if((cuEgtpTnlMgmtReq(tnlEvt)) != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP : Failed to delete tunnel Id %d", teId);
+ }
+ return ROK;
+}
+
/*******************************************************************
*
* @brief Builds the Uplink Tunnel Info
*
* @details
*
-* Function : BuildUlTnlInfoforDrb2
+* Function : BuildUlTnlInfoforSetupMod
*
* Functionality: Constructs the UL TnlInfo For DRB list
*
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildUlTnlInfoforDrb2(ULUPTNLInformation_ToBeSetup_List_t *ulInfo)
+uint8_t BuildUlTnlInfoforSetupMod(ULUPTNLInformation_ToBeSetup_List_t *ulInfo, uint8_t actionType)
{
uint8_t arrIdx;
uint8_t ulCnt;
CU_ALLOC(ulInfo->list.array,ulInfo->list.size);
if(ulInfo->list.array == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforDrb2");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforSetupMod");
return RFAILED;
}
for(arrIdx=0; arrIdx<ulCnt; arrIdx++)
CU_ALLOC(ulInfo->list.array[arrIdx],sizeof(ULUPTNLInformation_ToBeSetup_Item_t));
if(ulInfo->list.array[arrIdx] == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforDrb2");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforSetupMod");
return RFAILED;
}
}
sizeof(GTPTunnel_t));
if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforDrb2");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforSetupMod");
return RFAILED;
}
ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
transportLayerAddress.buf == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforDrb2");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforSetupMod");
return RFAILED;
}
if(ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf\
== NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforDrb2");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildUlTnlInfoforSetupMod");
return RFAILED;
}
ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
gTP_TEID.buf[1] = 0;
ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
gTP_TEID.buf[2] = 0;
- ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
- gTP_TEID.buf[3] = cuCfgParams.egtpParams.currTunnelId++;
+ if(actionType == ProtocolIE_ID_id_DRBs_ToBeModified_Item)
+ {
+ /*TODO: DRB context to be stored in CU STUB so that tunnel Id can be easily
+ * fetched based on the Drb Id */
+ ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ gTP_TEID.buf[3] = 2; /* Tunnel Id for Drb is 2. Hence passing the same TeId */
+ }
+ else
+ {
+ ulInfo->list.array[arrIdx]->uLUPTNLInformation.choice.gTPTunnel->\
+ gTP_TEID.buf[3] = cuCfgParams.egtpParams.currTunnelId++;
+ }
return ROK;
}/*End of BuildULTnlInfo*/
+
/*******************************************************************
*
-* @brief freeing the DRB 2 item
+* @brief freeing the DRB item
*
* @details
*
-* Function : FreeDrb2Item
+* Function : FreeDrbItem
*
-* Functionality: freeing the DRB 2 item
+* Functionality: freeing the DRB item
*
* @params[in] DRBs_ToBeSetupMod_Item_t *drbItem
*
*
* ****************************************************************/
-void FreeDrb2Item(DRBs_ToBeSetupMod_Item_t *drbItem)
+void FreeDrbItem(DRBs_ToBeSetupMod_Item_t *drbItem)
{
uint8_t arrIdx =0;
SNSSAI_t *snssai =NULLP;
CU_FREE(drbItem->uLConfiguration,sizeof(ULConfiguration_t));
}
}
+
/*******************************************************************
*
-* @brief filling the DRB 2 item
+* @brief filling the DRB setup Mod item
*
* @details
*
-* Function : FillDrb2Item
-*
-* Functionality: filling the DRB 2 item
+* Function : FillDrbItemToSetupMod
*
+* Functionality: filling the DRB setup Mod item
+*
+*
* @params[in] DRBs_ToBeSetupMod_Item_t *drbItem
*
* @return ROK - success
*
* ****************************************************************/
-uint8_t FillDrb2Item(DRBs_ToBeSetupMod_Item_t *drbItem)
+uint8_t FillDrbItemToSetupMod(uint8_t arrIdx, DRBs_ToBeSetupMod_Item_t *drbItem)
{
uint8_t ret = ROK;
/*Drb Id */
- drbItem->dRBID = DRB2;
+ drbItem->dRBID = arrIdx + DRB3;
/*qoSInformation*/
drbItem->qoSInformation.present = QoSInformation_PR_choice_extension;
CU_ALLOC(drbItem->qoSInformation.choice.eUTRANQoS, sizeof(EUTRANQoS_t));
if(drbItem->qoSInformation.choice.eUTRANQoS)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrb2Item");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrbItemToSetupMod");
return RFAILED;
}
drbItem->qoSInformation.choice.eUTRANQoS->qCI = QCI;
CU_ALLOC(drbItem->qoSInformation.choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
if(drbItem->qoSInformation.choice.choice_extension == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrb2Item");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrbItemToSetupMod");
return RFAILED;
}
drbItem->qoSInformation.choice.choice_extension->id = ProtocolIE_ID_id_DRB_Information;
drbItem->qoSInformation.choice.choice_extension->criticality = Criticality_ignore;
drbItem->qoSInformation.choice.choice_extension->value.present = QoSInformation_ExtIEs__value_PR_DRB_Information;
- ret = BuildQOSInfo(&drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS);
+ ret = BuildQOSInfo(&drbItem->qoSInformation.choice.choice_extension->value.choice.DRB_Information.dRB_QoS,\
+ ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
if(ret != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildQOSInfo failed");
/*Flows mapped to DRB List*/
ret = BuildFlowsMap(&drbItem->qoSInformation.choice.\
- choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List);
+ choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List,\
+ ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
if(ret != ROK)
{
DU_LOG("\nERROR --> F1AP : BuildFlowsMap failed");
}
/*ULUPTNLInformation To Be Setup List*/
- ret = BuildUlTnlInfoforDrb2(&drbItem->uLUPTNLInformation_ToBeSetup_List);
+ ret = BuildUlTnlInfoforSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List, ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
if(ret != ROK)
{
- DU_LOG("\nERROR --> F1AP : BuildUlTnlInfoforDrb2 failed");
+ DU_LOG("\nERROR --> F1AP : BuildUlTnlInfoforSetupMod failed");
return RFAILED;
}
/*RLCMode*/
drbItem->rLCMode = RLCMode_rlc_um_bidirectional;
-
- /*UL Configuration*/
- CU_ALLOC(drbItem->uLConfiguration,sizeof(ULConfiguration_t));
- if(drbItem->uLConfiguration == NULLP)
- {
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrb2Item");
- return RFAILED;
- }
- drbItem->uLConfiguration->uLUEConfiguration = ULUEConfiguration_no_data;
return ROK;
}
+
/*******************************************************************
*
* @brief Builds the DRB to be Setup Mod ItemIes
*
* ****************************************************************/
-uint8_t FillDrbItemList(struct DRBs_ToBeSetupMod_ItemIEs *drbItemIe)
+uint8_t FillDrbItemList(uint8_t arrIdx, struct DRBs_ToBeSetupMod_ItemIEs *drbItemIe)
{
drbItemIe->id = ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item;
drbItemIe->criticality = Criticality_reject;
drbItemIe->value.present = DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item;
- if(FillDrb2Item(&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item)) != ROK)
+ if(FillDrbItemToSetupMod(arrIdx, (&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item))) != ROK)
{
- DU_LOG("\nERROR --> F1AP : FillDrb2Item failed");
+ DU_LOG("\nERROR --> F1AP : FillDrbItemToSetupMod failed");
return RFAILED;
}
return ROK;
if(arrIdx == 0)
{
drbItemIe = (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx];
- FreeDrb2Item(&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item));
+ FreeDrbItem(&(drbItemIe->value.choice.DRBs_ToBeSetupMod_Item));
}
CU_FREE(drbSet->list.array[arrIdx], sizeof(DRBs_ToBeSetupMod_ItemIEs_t));
}
}
-
/*******************************************************************
*
* @brief Builds the DRB to be Setup Mod list
*
* @details
*
-* Function : BuildDrbToBeSetupModList
+* Function : BuildDrbToBeSetupList
*
* Functionality: Constructs the DRB to be Setup Mod list
*
*
* ****************************************************************/
-uint8_t BuildDrbToBeSetupModList(DRBs_ToBeSetupMod_List_t *drbSet)
+uint8_t BuildDrbToBeSetupList(DRBs_ToBeSetupMod_List_t *drbSet)
{
uint8_t ret = ROK;
uint8_t arrIdx =0;
uint8_t drbCnt =0;
- drbCnt = 1;
+ drbCnt = MAX_DRB_SET_UE_CONTEXT_MOD_REQ;
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt * sizeof(DRBs_ToBeSetupMod_ItemIEs_t *);
CU_ALLOC(drbSet->list.array, drbSet->list.size);
if(drbSet->list.array == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList");
return RFAILED;
}
+
for(arrIdx=0; arrIdx<drbCnt; arrIdx++)
{
CU_ALLOC(drbSet->list.array[arrIdx], sizeof(DRBs_ToBeSetupMod_ItemIEs_t));
if(drbSet->list.array[arrIdx] == NULLP)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupModList");
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList for array idx [%d]", arrIdx);
return RFAILED;
}
}
- arrIdx=0;
- ret = FillDrbItemList((DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]);
+ arrIdx = 0;
+ ret = FillDrbItemList(arrIdx, (DRBs_ToBeSetupMod_ItemIEs_t *)drbSet->list.array[arrIdx]);
if(ret != ROK)
{
DU_LOG("\nERROR --> F1AP : FillDrbItemList failed");
return ret;
}
+
+/*******************************************************************
+*
+* @brief Filling the DRB to be modified item
+*
+* @details
+*
+* Function : FillDrbToBeModItem
+*
+* Functionality: filling the DRB to be modified item
+*
+* @params[in] DRBs_ToBeModified_Item_t *drbItem
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t FillDrbToBeModItem(DRBs_ToBeModified_Item_t *drbItem)
+{
+ uint8_t ret = ROK;
+
+ /*Drb Id */
+ drbItem->dRBID = DRB2;
+
+ /*qoSInformation*/
+ drbItem->qoSInformation = NULLP;
+ CU_ALLOC(drbItem->qoSInformation, sizeof(QoSInformation_t));
+ if(drbItem->qoSInformation != NULLP)
+ {
+ drbItem->qoSInformation->present = QoSInformation_PR_choice_extension;
+
+ switch(drbItem->qoSInformation->present)
+ {
+ case QoSInformation_PR_NOTHING:
+ {
+ break;
+ }
+ case QoSInformation_PR_eUTRANQoS:
+ {
+
+ CU_ALLOC(drbItem->qoSInformation->choice.eUTRANQoS, sizeof(EUTRANQoS_t));
+ if(drbItem->qoSInformation->choice.eUTRANQoS)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrbToBeModItem");
+ return RFAILED;
+ }
+ drbItem->qoSInformation->choice.eUTRANQoS->qCI = QCI;
+ drbItem->qoSInformation->choice.eUTRANQoS->allocationAndRetentionPriority.priorityLevel =
+ PriorityLevel_no_priority;
+
+ drbItem->qoSInformation->choice.eUTRANQoS->allocationAndRetentionPriority.pre_emptionCapability =
+ Pre_emptionCapability_may_trigger_pre_emption;
+
+ drbItem->qoSInformation->choice.eUTRANQoS->allocationAndRetentionPriority.pre_emptionVulnerability =
+ Pre_emptionVulnerability_pre_emptable;
+
+ break;
+ }
+ case QoSInformation_PR_choice_extension:
+ {
+ CU_ALLOC(drbItem->qoSInformation->choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ if(drbItem->qoSInformation->choice.choice_extension == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in FillDrbItemToSetupMod");
+ return RFAILED;
+ }
+
+ drbItem->qoSInformation->choice.choice_extension->id = ProtocolIE_ID_id_DRB_Information;
+ drbItem->qoSInformation->choice.choice_extension->criticality = Criticality_ignore;
+ drbItem->qoSInformation->choice.choice_extension->value.present = QoSInformation_ExtIEs__value_PR_DRB_Information;
+ ret = BuildQOSInfo(&drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.dRB_QoS,\
+ ProtocolIE_ID_id_DRBs_ToBeModified_Item);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildQOSInfo failed");
+ return RFAILED;
+ }
+
+ /*SNSSAI*/
+ ret = BuildSNSSAI(&drbItem->qoSInformation->choice.\
+ choice_extension->value.choice.DRB_Information.sNSSAI);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildSNSSAI failed");
+ return RFAILED;
+ }
+
+ /*Flows mapped to DRB List*/
+ ret = BuildFlowsMap(&drbItem->qoSInformation->choice.\
+ choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List,\
+ ProtocolIE_ID_id_DRBs_ToBeModified_Item);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildFlowsMap failed");
+ return RFAILED;
+ }
+ }
+ }
+ }/* End of QoS */
+
+ /*ULUPTNLInformation To Be Setup List*/
+ ret = BuildUlTnlInfoforSetupMod(&drbItem->uLUPTNLInformation_ToBeSetup_List,\
+ ProtocolIE_ID_id_DRBs_ToBeModified_Item);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : BuildUlTnlInfoforSetupMod failed");
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Builds the DRB to be modified Item IE
+*
+* @details
+*
+* Function : FillDrbToBeModItemList
+*
+* Functionality: Constructs the DRB to be modified Mod Item Ies
+*
+* @params[in] struct DRBs_ToBeModified_ItemIEs *drbItemIe
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t FillDrbToBeModItemList(struct DRBs_ToBeModified_ItemIEs *drbItemIe)
+{
+ drbItemIe->id = ProtocolIE_ID_id_DRBs_ToBeModified_Item;
+ drbItemIe->criticality = Criticality_reject;
+ drbItemIe->value.present = DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item;
+ if(FillDrbToBeModItem(&(drbItemIe->value.choice.DRBs_ToBeModified_Item)) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : FillDrbToBeModItem failed");
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Builds the DRB to be modified list
+*
+* @details
+*
+* Function : BuildDrbToBeModList
+*
+* Functionality: Constructs the DRB to be modified list
+*
+* @params[in] DRBs_ToBeModified_List_t *drbSet
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t BuildDrbToBeModifiedList(DRBs_ToBeModified_List_t *drbSet)
+{
+ uint8_t ret = ROK;
+ uint8_t arrIdx =0;
+ uint8_t drbCnt =0;
+
+ drbCnt = 1;
+ drbSet->list.count = drbCnt;
+ drbSet->list.size = drbCnt * sizeof(DRBs_ToBeModified_ItemIEs_t *);
+ CU_ALLOC(drbSet->list.array, drbSet->list.size);
+ if(drbSet->list.array == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeModifiedList");
+ return RFAILED;
+ }
+ for(arrIdx=0; arrIdx<drbCnt; arrIdx++)
+ {
+ CU_ALLOC(drbSet->list.array[arrIdx], sizeof(DRBs_ToBeModified_ItemIEs_t));
+ if(drbSet->list.array[arrIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildDrbToBeSetupList");
+ return RFAILED;
+ }
+ }
+
+ arrIdx=0;
+ ret = FillDrbToBeModItemList((DRBs_ToBeModified_ItemIEs_t *)drbSet->list.array[arrIdx]);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : FillDrbToBeModItemList failed");
+ }
+
+ return ret;
+}
+
+/*******************************************************************
+*
+* @brief freeing the DRB item
+*
+* @details
+*
+* Function : FreeModifiedDrbItem
+*
+* Functionality: freeing the DRB 2 item
+*
+* @params[in] DRBs_ToBeSetupMod_Item_t *drbItem
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+void FreeModifiedDrbItem(DRBs_ToBeModified_Item_t *drbItem)
+{
+ uint8_t arrIdx =0;
+ SNSSAI_t *snssai =NULLP;
+ Flows_Mapped_To_DRB_List_t *flowMap = NULLP;
+
+ if(drbItem->qoSInformation != NULLP)
+ {
+ switch(drbItem->qoSInformation->present)
+ {
+ case QoSInformation_PR_NOTHING:
+ break;
+ case QoSInformation_PR_eUTRANQoS:
+ {
+ if(drbItem->qoSInformation->choice.eUTRANQoS)
+ {
+ CU_FREE(drbItem->qoSInformation->choice.eUTRANQoS, sizeof(EUTRANQoS_t));
+ }
+ break;
+ }
+ case QoSInformation_PR_choice_extension:
+ {
+ if(drbItem->qoSInformation->choice.choice_extension)
+ {
+ FreeQOSInfo(&drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.dRB_QoS);
+
+ snssai = &drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.sNSSAI;
+ if(snssai->sST.buf)
+ {
+ CU_FREE(snssai->sST.buf,snssai->sST.size);
+ }
+ if(snssai->sD)
+ {
+ if(snssai->sD->buf)
+ {
+ CU_FREE(snssai->sD->buf,snssai->sD->size);
+ }
+ CU_FREE(snssai->sD,sizeof(OCTET_STRING_t));
+ }
+
+ flowMap = &drbItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information.flows_Mapped_To_DRB_List;
+ if(flowMap->list.array)
+ {
+ for(arrIdx=0; arrIdx<flowMap->list.count; arrIdx++)
+ {
+ if(flowMap->list.array[arrIdx] )
+ {
+ FreeQOSInfo(&flowMap->list.array[arrIdx]->qoSFlowLevelQoSParameters);
+ CU_FREE(flowMap->list.array[arrIdx],sizeof(Flows_Mapped_To_DRB_Item_t));
+ }
+ }
+ CU_FREE(flowMap->list.array,flowMap->list.size);
+ }
+
+ CU_FREE(drbItem->qoSInformation->choice.choice_extension,sizeof(QoSInformation_ExtIEs_t));
+ }
+ break;
+ }
+ }
+ }
+ FreeUlTnlInfoforDrb2(&drbItem->uLUPTNLInformation_ToBeSetup_List);
+ if(drbItem->uLConfiguration)
+ {
+ CU_FREE(drbItem->uLConfiguration,sizeof(ULConfiguration_t));
+ }
+}
+
+/*******************************************************************
+*
+* @brief free the DRB to be modfified list
+*
+* @details
+*
+* Function : FreeDrbToBeModifiedList
+*
+* Functionality: free the DRB to be Setup Mod list
+*
+* @params[in] FreeDrbToBeModifiedList_t *drbSet
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+void FreeDrbToBeModifiedList(DRBs_ToBeModified_List_t *drbSet)
+{
+ uint8_t arrIdx =0;
+ struct DRBs_ToBeModified_ItemIEs *drbItemIe;
+
+ if(drbSet->list.array)
+ {
+ for(arrIdx=0; arrIdx<drbSet->list.count ; arrIdx++)
+ {
+ if(drbSet->list.array[arrIdx] != NULLP)
+ {
+ drbItemIe = (struct DRBs_ToBeModified_ItemIEs *)drbSet->list.array[arrIdx];
+ FreeModifiedDrbItem(&(drbItemIe->value.choice.DRBs_ToBeModified_Item));
+ CU_FREE(drbSet->list.array[arrIdx], sizeof(DRBs_ToBeModified_ItemIEs_t));
+ }
+ }
+ CU_FREE(drbSet->list.array, drbSet->list.size);
+ }
+
+}
+
/*******************************************************************
*
* @brief free the UeContextModification Request
{
if(f1apMsg->choice.initiatingMessage)
{
- UeContextModifyReq =&f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
- if(UeContextModifyReq->protocolIEs.list.array)
- {
- for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
- {
- if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
- {
- ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
- switch(ieId)
- {
- case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
- break;
- case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
- {
- FreeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->value.\
- choice.DRBs_ToBeSetupMod_List);
- break;
- }
- }
- CU_FREE(UeContextModifyReq->protocolIEs.list.array[arrIdx], sizeof(UEContextModificationRequest_t));
- }
- }
- CU_FREE(UeContextModifyReq->protocolIEs.list.array, UeContextModifyReq->protocolIEs.list.size);
- }
- CU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
+ UeContextModifyReq =&f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
+ if(UeContextModifyReq->protocolIEs.list.array)
+ {
+ for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
+ {
+ if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
+ {
+ ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
+ switch(ieId)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ break;
+ case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+ {
+ FreeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->value.\
+ choice.DRBs_ToBeSetupMod_List);
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_ToBeModified_List:
+ {
+ FreeDrbToBeModifiedList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->value.\
+ choice.DRBs_ToBeSetupMod_List);
+ break;
+ }
+
+ }
+ CU_FREE(UeContextModifyReq->protocolIEs.list.array[arrIdx], sizeof(UEContextModificationRequest_t));
+ }
+ }
+ CU_FREE(UeContextModifyReq->protocolIEs.list.array, UeContextModifyReq->protocolIEs.list.size);
+ }
+ CU_FREE(f1apMsg->choice.initiatingMessage, sizeof(InitiatingMessage_t));
}
CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
}
ueContextModifyReq =&f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
- elementCnt = 3;
+ elementCnt = 4;
ueContextModifyReq->protocolIEs.list.count = elementCnt;
ueContextModifyReq->protocolIEs.list.size = elementCnt*sizeof(UEContextModificationRequest_t *);
UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_UE_F1AP_ID = ueId;
+ /* DRB to be setup list */
ieIdx++;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_ToBeSetupMod_List;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present =\
UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List;
- ret = BuildDrbToBeSetupModList(&(ueContextModifyReq->protocolIEs.list.array[ieIdx]->\
+ ret = BuildDrbToBeSetupList(&(ueContextModifyReq->protocolIEs.list.array[ieIdx]->\
value.choice.DRBs_ToBeSetupMod_List));
+
+ /* DRB to be modified list */
+ ieIdx++;
+ ueContextModifyReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_ToBeModified_List;
+ ueContextModifyReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present =\
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List;
+ ret = BuildDrbToBeModifiedList(&(ueContextModifyReq->protocolIEs.list.array[ieIdx]->\
+ value.choice.DRBs_ToBeModified_List));
+
+ /* TODO: DRB to be release list */
+
if(ret != ROK)
{
break;
ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.size);
if(!ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf)
{
- DU_LOG("\nERROR --> F1AP : Memory allocation for BuildAndSendUeContextSetupReq failed");
+ DU_LOG("\nERROR --> F1AP : Memory allocation for BuildAndSendUeContextReleaseCommand failed");
break;
}
memset(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer.buf, 0, bufLen);
return ROK;
}
+/****************************************************************
+ * @brief Function to process Drb Setup Mod List
+ *
+ * @details
+ *
+ * Function : procDrbSetupModList
+ *
+ * Functionality:
+ * - Function to process DRB Setup Mod List
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList)
+{
+ uint8_t arrIdx = 0;
+ uint32_t teId = 0;
+ struct DRBs_SetupMod_ItemIEs *drbItemIe = NULLP;
+
+ if(drbSetupList != NULLP)
+ {
+ for(arrIdx = 0; arrIdx < drbSetupList->list.count; arrIdx++)
+ {
+ drbItemIe = ((struct DRBs_SetupMod_ItemIEs *)drbSetupList->list.array[arrIdx]);
+ if(drbItemIe->value.present == DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item)
+ {
+ /* extracting teId */
+ teId = extractTeId(&drbItemIe->value.choice.DRBs_SetupMod_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 processing of GNB_DU_Served_Cells Plmn list information
}
return ROK;
}
+
+/****************************************************************
+ * @brief Function to process Ue Context Modification Response
+ *
+ * @details
+ *
+ * Function : procUeContextModificationResponse
+ *
+ * Functionality:
+ * - Function to process Ue Context Modification Response
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procUeContextModificationResponse(F1AP_PDU_t *f1apMsg)
+{
+ uint8_t idx, duUeF1apId;
+ UEContextModificationResponse_t *ueCtxtModRsp = NULLP;
+ ueCtxtModRsp = &f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
+
+ for(idx=0; idx < ueCtxtModRsp->protocolIEs.list.count; idx++)
+ {
+ switch(ueCtxtModRsp->protocolIEs.list.array[idx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ duUeF1apId = ueCtxtModRsp->protocolIEs.list.array[idx]->value.choice.GNB_DU_UE_F1AP_ID;
+ break;
+ }
+ case ProtocolIE_ID_id_DRBs_SetupMod_List:
+ {
+ /* Adding Tunnels for successful DRB */
+ procDrbSetupModList(&ueCtxtModRsp->protocolIEs.list.array[idx]->value.choice.DRBs_SetupMod_List);
+ break;
+
+ }
+ }
+ }
+ return ROK;
+}
+
/*******************************************************************
*
* @brief processing of F1 setup request
DU_LOG("\nERROR --> CU_STUB: procF1SetupReq(): Failed to process F1 setup request");
}
}
+
/*******************************************************************
*
* @brief Handles received F1AP message and sends back response
case SuccessfulOutcome__value_PR_UEContextModificationResponse:
{
DU_LOG("\nINFO --> F1AP : UE Context Modification Response received");
+ procUeContextModificationResponse(f1apMsg);
break;
}
case SuccessfulOutcome__value_PR_UEContextReleaseComplete:
DU_ALLOC_SHRABL_BUF(macLcToAdd->drbQos, sizeof(DrbQosInfo));
if(macLcToAdd->drbQos == NULLP)
{
- DU_LOG("\nERROR --> DUAPP:Memory failed at allocating DrbQos at extractDrbCfg()");
+ DU_LOG("\nERROR --> DUAPP:Memory failed at allocating DrbQos at extractDrbQosCfg()");
return RFAILED;
}
DU_ALLOC_SHRABL_BUF(macLcToAdd->snssai, sizeof(Snssai));
if(macLcToAdd->snssai == NULLP)
{
- DU_LOG("\nERROR --> DUAPP : Memory failed at allocating SNSSAI at extractDrbCfg()");
+ DU_LOG("\nERROR --> DUAPP : Memory failed at allocating SNSSAI at extractDrbQosCfg()");
return RFAILED;
}
}
* @return void
*
* ****************************************************************/
-uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem,DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\
-LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo)
+uint8_t extractDrbCfg(DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem,\
+DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, UpTnlCfg *upTnlInfo)
{
DRB_Information_t *drbInfo = NULLP;
}
}
}
+ else if(drbModItem != NULLP)
+ {
+ if(extractUpTnlInfo(drbModItem->dRBID, CONFIG_MOD, &drbModItem->uLUPTNLInformation_ToBeSetup_List,\
+ upTnlInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> DUAPP : Failed to extract tunnel Cfg at extractDrbCfg()");
+ return RFAILED;
+ }
+ if(drbModItem->qoSInformation != NULLP)
+ {
+ if(drbModItem->qoSInformation->present == QoSInformation_PR_choice_extension)
+ {
+ if(drbModItem->qoSInformation->choice.choice_extension->value.present ==\
+ QoSInformation_ExtIEs__value_PR_DRB_Information)
+ {
+ drbInfo = &drbModItem->qoSInformation->choice.choice_extension->value.choice.DRB_Information;
+ if(extractDrbQosCfg(drbInfo , macLcToAdd) != ROK)
+ {
+ DU_LOG("\nERROR --> DUAPP : Failed to extract qos Cfg at extractDrbCfg()");
+ return RFAILED;
+ }
+ }
+ }
+ }
+ }
return ROK;
}
* ****************************************************************/
uint8_t extractMacRbCfg(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbCfg,\
-DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
+DRBs_ToBeSetupMod_Item_t *drbSetupModCfg, DRBs_ToBeModified_Item_t *drbModCfg, LogicalChannelConfig_t *ulLcCfg, LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
if(drbCfg != NULLP)
{
- if(extractDrbCfg(drbCfg, NULL, lcCfg, upTnlInfo) != ROK)
+ if(extractDrbCfg(drbCfg, NULL, NULL, lcCfg, upTnlInfo) != ROK)
{
DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()");
return RFAILED;
}
else if(drbSetupModCfg != NULLP)
{
- if(extractDrbCfg(NULL, drbSetupModCfg, lcCfg, upTnlInfo) != ROK)
+ if(extractDrbCfg(NULL, drbSetupModCfg, NULL, lcCfg, upTnlInfo) != ROK)
+ {
+ DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()");
+ return RFAILED;
+ }
+ }
+ else if(drbModCfg != NULLP)
+ {
+ if(extractDrbCfg(NULL, NULL, drbModCfg, lcCfg, upTnlInfo) != ROK)
{
DU_LOG("ERROR --> F1AP : Failed to build Drb Qos at extractMacRbCfg()");
return RFAILED;
*
* ****************************************************************/
-uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType,\
-DRBs_ToBeSetup_Item_t *drbItem, DRBs_ToBeSetupMod_Item_t *drbSetupModItem, LogicalChannelConfig_t *ulLcCfg,\
+uint8_t procMacLcCfg(uint8_t lcId, uint8_t rbType, uint8_t configType, DRBs_ToBeSetup_Item_t *drbItem,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LogicalChannelConfig_t *ulLcCfg,\
LcCfg *lcCfg, UpTnlCfg *upTnlInfo)
{
uint8_t ret = ROK;
lcCfg->configType = configType;
if(rbType == RB_TYPE_SRB)
{
- ret = extractMacRbCfg(lcId, NULL,NULL, ulLcCfg, lcCfg, NULL);
+ ret = extractMacRbCfg(lcId, NULL, NULL, NULL, ulLcCfg, lcCfg, NULL);
}
else if(rbType == RB_TYPE_DRB)
{
if(drbItem != NULL)
- ret = extractMacRbCfg(lcId, drbItem, NULL, ulLcCfg, lcCfg, upTnlInfo);
+ ret = extractMacRbCfg(lcId, drbItem, NULL, NULL, ulLcCfg, lcCfg, upTnlInfo);
else if(drbSetupModItem != NULL)
- ret = extractMacRbCfg(lcId, NULL, drbSetupModItem, ulLcCfg, lcCfg, upTnlInfo);
+ ret = extractMacRbCfg(lcId, NULL, drbSetupModItem, NULL, ulLcCfg, lcCfg, upTnlInfo);
+ else if(drbModItem != NULL)
+ ret = extractMacRbCfg(lcId, NULL, NULL, drbModItem, ulLcCfg, lcCfg, upTnlInfo);
}
return ret;
}
memset(&ueCfgDb->macLcCfg[idx], 0, sizeof(LcCfg));
memset(&ueCfgDb->rlcLcCfg[idx], 0, sizeof(RlcBearerCfg));
procRlcLcCfg(rbId, lcId, rbType, rlcMode, CONFIG_UNKNOWN, f1RlcCfg, &(ueCfgDb->rlcLcCfg[idx]));
- if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK)
+ if(procMacLcCfg(lcId, rbType, CONFIG_UNKNOWN, NULL, NULL, NULL, macUlLcCfg, &ueCfgDb->macLcCfg[idx], NULL) != ROK)
{
DU_LOG("\nERROR --> DU APP : Failed while filling MAC LC config at extractRlcCfgToAddMod()");
return RFAILED;
procRlcLcCfg(srbItem->sRBID, srbItem->sRBID, RB_TYPE_SRB, RLC_AM, CONFIG_ADD, NULL, rlcLcToAdd);
/* Filling MAC INFO */
- ret = procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, macLcToAdd, NULL);
+ ret = procMacLcCfg(srbItem->sRBID, RB_TYPE_SRB, CONFIG_ADD, NULL,NULL, NULL, NULL, macLcToAdd, NULL);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> F1AP : Failed at MAC LC Cfg in procSrbListToSetup()");
*
* @details
*
- * Function : procDrbListToSetup
+ * Function : procDrbListToSetupMod
*
* Functionality: Fills Drb List received by CU
* for both MAC and RLC
*
* ****************************************************************/
-uint8_t procDrbListToSetup(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\
-DRBs_ToBeSetupMod_Item_t *drbSetupModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo)
+uint8_t procDrbListToSetupMod(uint8_t lcId, DRBs_ToBeSetup_Item_t *drbItem,\
+DRBs_ToBeSetupMod_Item_t *drbSetupModItem, DRBs_ToBeModified_Item_t *drbModItem, LcCfg *macLcToAdd, RlcBearerCfg *rlcLcToAdd, UpTnlCfg *upTnlInfo)
{
if(drbItem != NULLP)
procRlcLcCfg(drbItem->dRBID, lcId, RB_TYPE_DRB, drbItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
/* Filling MAC INFO */
- if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, drbItem, NULL, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
{
- DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
return RFAILED;
}
}
{
procRlcLcCfg(drbSetupModItem->dRBID, lcId, RB_TYPE_DRB, drbSetupModItem->rLCMode, CONFIG_ADD, NULL, rlcLcToAdd);
- if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, NULL, drbSetupModItem, NULL, macLcToAdd, upTnlInfo) != ROK)
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_ADD, NULL, drbSetupModItem, NULL, NULL, macLcToAdd, upTnlInfo) != ROK)
{
- DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
+ return RFAILED;
+ }
+ }
+ else if(drbModItem != NULLP)
+ {
+ /* Drb to Mod IEs doesnot have rlcMode to be modified
+ * in ASN. Hence no change in RLC configurations */
+ if(procMacLcCfg(lcId, RB_TYPE_DRB, CONFIG_MOD, NULL, NULL, drbModItem, NULL, macLcToAdd, upTnlInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at RLC LC Cfg in procDrbListToSetupMod()");
return RFAILED;
}
}
*
* @details
*
- * Function : extractDrbListToSetup
+ * Function : extractDrbListToSetupMod
*
* Functionality: extract Drb List received by CU
* for both MAC and RLC
*
* ****************************************************************/
-uint8_t extractDrbListToSetup(DRBs_ToBeSetup_List_t *drbCfg,DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
-uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap)
+uint8_t extractDrbListToSetupMod(DRBs_ToBeSetup_List_t *drbCfg, DRBs_ToBeSetupMod_List_t *drbSetupModCfg,\
+ DRBs_ToBeModified_List_t *drbModCfg, uint8_t drbCount, DuUeCfg *ueCfgDb, uint32_t *drbBitMap)
{
uint8_t ret, drbIdx, lcId = 0;
DRBs_ToBeSetup_Item_t *drbItem = NULLP;
DRBs_ToBeSetupMod_ItemIEs_t *drbSetupModItem = NULLP;
+ DRBs_ToBeModified_ItemIEs_t *drbModItem = NULLP;
ret = ROK;
if(drbCount > 0)
{
if(ueCfgDb->numMacLcs > MAX_NUM_LC)
{
- DU_LOG("\nERROR --> F1AP : MAX LC Reached in MAC at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : MAX LC Reached in MAC at extractDrbListToSetupMod()");
ret = RFAILED;
break;
}
if(ueCfgDb->numRlcLcs > MAX_NUM_LC)
{
- DU_LOG("\nERROR --> F1AP : MAX LC Reached in RLC at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : MAX LC Reached in RLC at extractDrbListToSetupMod()");
ret = RFAILED;
break;
}
memset(&ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], 0, sizeof(LcCfg));
memset(&ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], 0, sizeof(RlcBearerCfg));
- lcId = getDrbLcId(drbBitMap);
- if(lcId == RFAILED)
+ if(drbModCfg != NULLP)
{
- DU_LOG("\nERROR --> F1AP : InCorrect LCID extractDrbListToSetup()");
- ret = RFAILED;
- break;
- }
- if(drbCfg != NULL)
- {
- drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
- ret = procDrbListToSetup(lcId, drbItem, NULL, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
- &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
+ drbModItem = (DRBs_ToBeModified_ItemIEs_t *) drbModCfg->list.array[drbIdx];
+ lcId = fetchLcId(drbModItem->value.choice.DRBs_ToBeModified_Item.dRBID);
+ if(lcId < MIN_DRB_LCID)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed fetching LCID %d in extractDrbListToSetupMod() for Modified List", lcId);
+ break;
+ }
+ ret = procDrbListToSetupMod(lcId, NULL, NULL, &(drbModItem->value.choice.DRBs_ToBeModified_Item),\
+ &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
+ &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
if(ret == RFAILED)
{
- DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for Modified List");
break;
}
+
}
- else if(drbSetupModCfg != NULL)
+ else
{
- drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
- ret = procDrbListToSetup(lcId, NULL, &(drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item) ,\
- &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
- &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
- if(ret == RFAILED)
+ lcId = getDrbLcId(drbBitMap);
+ if(lcId == RFAILED)
{
- DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> F1AP : InCorrect LCID extractDrbListToSetupMod()");
+ ret = RFAILED;
break;
}
+ if(drbCfg != NULL)
+ {
+ drbItem = &drbCfg->list.array[drbIdx]->value.choice.DRBs_ToBeSetup_Item;
+ ret = procDrbListToSetupMod(lcId, drbItem, NULL, NULL, &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs],\
+ &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs], &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetup List");
+ break;
+ }
+ }
+ else if(drbSetupModCfg != NULL)
+ {
+ drbSetupModItem = (DRBs_ToBeSetupMod_ItemIEs_t *) drbSetupModCfg->list.array[drbIdx];
+ ret = procDrbListToSetupMod(lcId, NULL, &(drbSetupModItem->value.choice.DRBs_ToBeSetupMod_Item), NULL,\
+ &ueCfgDb->macLcCfg[ueCfgDb->numMacLcs], &ueCfgDb->rlcLcCfg[ueCfgDb->numRlcLcs],\
+ &ueCfgDb->upTnlInfo[ueCfgDb->numDrb]);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod() for DrbSetupMod List");
+ break;
+ }
+ }
+ ueCfgDb->numRlcLcs++;
}
- ueCfgDb->numRlcLcs++;
ueCfgDb->numMacLcs++;
ueCfgDb->numDrb++;
- DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetup:lcId:%x ,BitMap:%x, [RLC,MAC,NumDrb]:[%x,%x,%x]",\
+ DU_LOG("\nDEBUG --> DUAPP: extractDrbListToSetupMod: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()");
+ DU_LOG("\nERROR --> F1AP : Failed at extractDrbListToSetupMod()");
break;
}
}
{
drbCfg = &ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.DRBs_ToBeSetup_List;
- if(extractDrbListToSetup(drbCfg, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
+ if(extractDrbListToSetupMod(drbCfg, NULL, NULL, drbCfg->list.count, &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
- DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod()");
//TODO: Update the failure cause in ue context Setup Response
ret = RFAILED;
}
uint8_t ret = ROK, ieIdx = 0, cellIdx=0, ueIdx=0;
DuUeCb *duUeCb = NULLP;
DRBs_ToBeSetupMod_List_t *drbSetupModCfg;
+ DRBs_ToBeModified_List_t *drbModifiedCfg;
uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
ueContextModifyReq = &f1apMsg->choice.initiatingMessage->value.choice.UEContextModificationRequest;
break;
}
case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
+ case ProtocolIE_ID_id_DRBs_ToBeModified_List:
{
for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
{
{
duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ if(duUeCb->f1UeDb == NULLP)
+ {
DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
- if(duUeCb->f1UeDb)
+ }
+ if(duUeCb->f1UeDb)
+ {
+ duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List)
{
- duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
drbSetupModCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
choice.DRBs_ToBeSetupMod_List;
- if(extractDrbListToSetup(NULL, drbSetupModCfg ,drbSetupModCfg->list.count, \
- &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
+
+ if(extractDrbListToSetupMod(NULL, drbSetupModCfg, NULL, drbSetupModCfg->list.count,\
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
{
- DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetup()");
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbSetupModList");
ret = RFAILED;
}
}
+
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present == \
+ UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List)
+
+ {
+ drbModifiedCfg = &ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.\
+ choice.DRBs_ToBeModified_List;
+ if(extractDrbListToSetupMod(NULL, NULL, drbModifiedCfg, drbSetupModCfg->list.count,\
+ &duUeCb->f1UeDb->duUeCfg, &duUeCb->drbBitMap))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed at extractDrbListToSetupMod() for DrbModifiedList");
+ ret = RFAILED;
+ }
+ }
+ }
break;
}
}