}
}
}
+/*******************************************************************
+ *
+ * @brief Delete E2 component node list
+ *
+ * @details
+ *
+ * Function : deleteE2ComponentNodeList
+ *
+ * Functionality: Delete E2 component node list
+ *
+ * @params[in] E2 component node list
+ * @return void
+
+ *
+ ******************************************************************/
+
+void deleteE2ComponentNodeList(CmLListCp *componentList)
+{
+ E2NodeComponent *cfgInfo = NULLP;
+ CmLList *e2ComponentNode = NULLP;
+
+ CM_LLIST_FIRST_NODE(componentList, e2ComponentNode);
+ while(e2ComponentNode)
+ {
+ cfgInfo = (E2NodeComponent*)e2ComponentNode->node;
+ cmLListDelFrm(componentList, e2ComponentNode);
+ memset(cfgInfo, 0, sizeof(E2NodeComponent));
+ CM_LLIST_FIRST_NODE(componentList, e2ComponentNode);
+ }
+}
/*******************************************************************
*
deleteRicSubscriptionList(&ranFuncDb->subscriptionList);
}
}
-
- cmInetClose(&sctpCb.e2LstnSockFd);
+ deleteE2ComponentNodeList(&duDb->e2NodeComponent);
}
/*******************************************************************
{
case ProtocolIE_IDE2_id_TransactionID:
{
+ DU_LOG("\nINFO --> E2AP : Sending request to close the sctp connection");
+ cmInetClose(&sctpCb.e2LstnSockFd);
deleteE2NodeInfo(duDb);
- break;
+ exit(0);
}
default:
{
}while(true);
FreeE2RemovalResponse(e2apMsg);
- deleteE2NodeInfo(duDb);
return ret;
}
}
}
+/*******************************************************************
+ *
+ * @brief process the E2 Connection update ack
+ *
+ * @details
+ *
+ * Function : ProcE2ConnectionUpdateAck
+ *
+ * Functionality: Process E2 Connection update ack
+ *
+ * @params[in]
+ * du Id
+ * Pointer to Connection update ack
+ * @return void
+ *
+ ******************************************************************/
+
+void ProcE2ConnectionUpdateAck(uint32_t duId, E2connectionUpdateAcknowledge_t *connectionUpdateAck)
+{
+ uint16_t transId =0;
+ uint32_t ipAddress=0;
+ DuDb *duDb = NULLP;
+ uint8_t ieIdx = 0, duIdx =0, arrIdx=0;
+ E2connectionUpdate_Item_t *connectionSetupItem=NULLP;
+ E2connectionUpdate_ItemIEs_t *connectionSetupItemIe=NULLP;
+ E2connectionUpdate_List_t *connectionSetupList=NULLP;
+ E2connectionSetupFailed_Item_t *setupFailedItem =NULLP;
+ E2connectionSetupFailed_List_t *setupFailedList=NULLP;
+ E2connectionSetupFailed_ItemIEs_t *setupFailedItemIe =NULLP;
+
+ SEARCH_DU_DB(duIdx, duId, duDb);
+ if(duDb == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : duDb is not present for duId %d",duId);
+ return;
+ }
+
+ if(!connectionUpdateAck)
+ {
+ DU_LOG("\nERROR --> E2AP : connectionUpdateAck pointer is null");
+ return;
+ }
+
+ if(!connectionUpdateAck->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : connectionUpdateAck array pointer is null");
+ return;
+ }
+
+ for(ieIdx=0; ieIdx < connectionUpdateAck->protocolIEs.list.count; ieIdx++)
+ {
+ if(connectionUpdateAck->protocolIEs.list.array[ieIdx])
+ {
+ switch(connectionUpdateAck->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_TransactionID:
+ {
+ transId = connectionUpdateAck->protocolIEs.list.array[arrIdx]->value.choice.TransactionID;
+ if(transId>255)
+ {
+ DU_LOG("\nERROR --> E2AP : Received invalid trans id %d ",transId);
+ return;
+ }
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2connectionSetup:
+ {
+ connectionSetupList=&connectionUpdateAck->protocolIEs.list.array[ieIdx]->value.choice.E2connectionUpdate_List;
+ if(connectionSetupList->list.array)
+ {
+ for(arrIdx = 0; arrIdx< connectionSetupList->list.count; arrIdx++)
+ {
+ connectionSetupItemIe = (E2connectionUpdate_ItemIEs_t*)connectionSetupList->list.array[arrIdx];
+ connectionSetupItem = &connectionSetupItemIe->value.choice.E2connectionUpdate_Item;
+ bitStringToInt(&connectionSetupItem->tnlInformation.tnlAddress, &ipAddress);
+ if(ricCb.ricCfgParams.sctpParams.localIpAddr.ipV4Addr == ipAddress)
+ {
+ ricCb.ricCfgParams.sctpParams.usage = connectionSetupItem->tnlUsage;
+ }
+ }
+ }
+ break;
+ }
+
+ case ProtocolIE_IDE2_id_E2connectionSetupFailed:
+ {
+ setupFailedList=&connectionUpdateAck->protocolIEs.list.array[ieIdx]->value.choice.E2connectionSetupFailed_List;
+ if(setupFailedList->list.array)
+ {
+ for(arrIdx = 0; arrIdx< setupFailedList->list.count; arrIdx++)
+ {
+ setupFailedItemIe = (E2connectionSetupFailed_ItemIEs_t*)setupFailedList->list.array[arrIdx];
+ setupFailedItem = &setupFailedItemIe->value.choice.E2connectionSetupFailed_Item;
+ printE2ErrorCause(&setupFailedItem->cause);
+ }
+ }
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : Received Invalid Ie [%ld]", connectionUpdateAck->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ }
+}
+
+/******************************************************************
+ *
+ * @brief Processes the Ric Subs delete failure msg
+ *
+ * @details
+ *
+ * Function : procRicSubsDeleteFailure
+ *
+ * Functionality: Processes the Ric Subs delete failure msg
+ *
+ * @params[in]
+ * Ric Subs delete failure information
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void ProcRicSubsDeleteFailure(RICsubscriptionDeleteFailure_t *ricSubsDeleteFail)
+{
+ uint8_t ieIdx = 0;
+ uint16_t ranFuncId=0;
+ CauseE2_t *cause = NULLP;
+ RICrequestID_t ricRequestID;
+
+ if(!ricSubsDeleteFail)
+ {
+ DU_LOG("\nERROR --> E2AP : ricSubsDeleteFail pointer is null");
+ return;
+ }
+
+ if(!ricSubsDeleteFail->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : ricSubsDeleteFail array pointer is null");
+ return;
+ }
+
+ for(ieIdx=0; ieIdx < ricSubsDeleteFail->protocolIEs.list.count; ieIdx++)
+ {
+ if(ricSubsDeleteFail->protocolIEs.list.array[ieIdx])
+ {
+ switch(ricSubsDeleteFail->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_RICrequestID:
+ {
+ memcpy(&ricSubsDeleteFail->protocolIEs.list.array[ieIdx]->value.choice.RICrequestID, &ricRequestID, sizeof(RICrequestID_t));
+ DU_LOG("\nERROR --> E2AP : Received RicReqId %ld and InstanceId %ld", ricRequestID.ricRequestorID, ricRequestID.ricInstanceID);
+ break;
+ }
+ case ProtocolIE_IDE2_id_RANfunctionID:
+ {
+ ranFuncId = ricSubsDeleteFail->protocolIEs.list.array[ieIdx]->value.choice.RANfunctionID;
+ DU_LOG("\nERROR --> E2AP : Received ranfuncId %d", ranFuncId);
+ break;
+ }
+ case ProtocolIE_IDE2_id_CauseE2:
+ {
+ cause = &ricSubsDeleteFail->protocolIEs.list.array[ieIdx]->value.choice.CauseE2;
+ printE2ErrorCause(cause);
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : Received Invalid Ie [%ld]", ricSubsDeleteFail->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ }
+}
+
+
+/******************************************************************
+ *
+ * @brief Processes the Ric Subs delete rsp msg
+ *
+ * @details
+ *
+ * Function : ProcRicSubsDeleteRsp
+ *
+ * Functionality: Processes the Ric Subs delete rsp msg
+ *
+ * @params[in]
+ * Ric Subs delete rsp information
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void ProcRicSubsDeleteRsp(uint32_t duId, RICsubscriptionDeleteResponse_t *ricSubsDeleteRsp)
+{
+ uint8_t ieIdx = 0;
+ uint8_t duIdx= 0;
+ uint16_t ranFuncId=0;
+ RanFunction *ranFuncDb = NULLP;
+ RicRequestId ricReqId;
+ DuDb *duDb = NULLP;
+ RicSubscription *ricSubs = NULLP;
+ CmLList *ricSubsNode = NULLP;
+
+ SEARCH_DU_DB(duIdx, duId, duDb);
+ if(duDb == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : duDb is not present for duId %d",duId);
+ return;
+ }
+
+ if(!ricSubsDeleteRsp)
+ {
+ DU_LOG("\nERROR --> E2AP : ricSubsDeleteRsp pointer is null");
+ return;
+ }
+
+ if(!ricSubsDeleteRsp->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : ricSubsDeleteRsp array pointer is null");
+ return;
+ }
+ for(ieIdx=0; ieIdx < ricSubsDeleteRsp->protocolIEs.list.count; ieIdx++)
+ {
+ if(ricSubsDeleteRsp->protocolIEs.list.array[ieIdx])
+ {
+ switch(ricSubsDeleteRsp->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_RICrequestID:
+ {
+ ricReqId.requestorId = ricSubsDeleteRsp->protocolIEs.list.array[ieIdx]->value.choice.RICrequestID.ricRequestorID;
+ ricReqId.instanceId = ricSubsDeleteRsp->protocolIEs.list.array[ieIdx]->value.choice.RICrequestID.ricInstanceID;
+ break;
+ }
+ case ProtocolIE_IDE2_id_RANfunctionID:
+ {
+ ranFuncId = ricSubsDeleteRsp->protocolIEs.list.array[ieIdx]->value.choice.RANfunctionID;
+ ranFuncDb = fetchRanFuncFromRanFuncId(duDb, ranFuncId);
+ if(!ranFuncDb)
+ {
+ DU_LOG("\nERROR --> E2AP : Invalid Ran Function id %d received",ranFuncId);
+ return;
+ }
+
+ ricSubs = fetchSubsInfoFromRicReqId(ricReqId, ranFuncDb, &ricSubsNode);
+ if(ricSubs)
+ {
+ deleteRicSubscriptionNode(ricSubsNode);
+ DU_LOG("\nINFO --> E2AP : Ric subscription node deleted successfully");
+ }
+ else
+ {
+ DU_LOG("\nERROR --> E2AP : Ric subscription node is not present ");
+ return;
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+
/*******************************************************************
*
* @brief Handles received E2AP message and sends back response
ProcE2RemovalResponse(*duId, &e2apMsg->choice.successfulOutcome->value.choice.E2RemovalResponse);
break;
}
+ case SuccessfulOutcomeE2__value_PR_E2connectionUpdateAcknowledge:
+ {
+ ProcE2ConnectionUpdateAck(*duId, &e2apMsg->choice.successfulOutcome->value.choice.E2connectionUpdateAcknowledge);
+ break;
+ }
+ case SuccessfulOutcomeE2__value_PR_RICsubscriptionDeleteResponse:
+ {
+ ProcRicSubsDeleteRsp(*duId, &e2apMsg->choice.successfulOutcome->value.choice.RICsubscriptionDeleteResponse);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> E2AP : Invalid type of successfulOutcome message [%d]", \
ProcE2connectionUpdateFailure(&e2apMsg->choice.unsuccessfulOutcome->value.choice.E2connectionUpdateFailure);
break;
}
+ case UnsuccessfulOutcomeE2__value_PR_RICsubscriptionDeleteFailure:
+ {
+ ProcRicSubsDeleteFailure(&e2apMsg->choice.unsuccessfulOutcome->value.choice.RICsubscriptionDeleteFailure);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> E2AP : Invalid type of unsuccessfulOutcome message [%d]", \