X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fdu_app%2Fdu_e2ap_mgr.c;h=eabc0d6b2972908be725bdafa21b9eec01165eb8;hb=c371a26d48604a5d60686d9ca347e68671e69637;hp=e003e2ffdc10a4f3edf81349c9859f069f601c7b;hpb=203a75d30fe226a5496af4a0bc50ea0671e32df3;p=o-du%2Fl2.git diff --git a/src/du_app/du_e2ap_mgr.c b/src/du_app/du_e2ap_mgr.c index e003e2ffd..eabc0d6b2 100644 --- a/src/du_app/du_e2ap_mgr.c +++ b/src/du_app/du_e2ap_mgr.c @@ -1432,6 +1432,105 @@ void fetchRicSubsToBeDeleted(CmLListCp *ricSubsToBeDelList) } } +/****************************************************************** + * + * @brief Delete e2 node information from the database + * + * @details + * + * Function : removeE2NodeInformation + * + * Functionality: Delete e2 node information from the database + * + * @params[in] + * + * @return void + * +******************************************************************/ +void removeE2NodeInformation() +{ + uint16_t ranFuncIdx = 0; + + DU_LOG("\nINFO --> E2AP : Deleting all the E2 node configuration"); + for(ranFuncIdx=0; ranFuncIdx0) + { + deleteRicSubscriptionList(&(duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList)); + memset(&(duCb.e2apDb.ranFunction[ranFuncIdx].pendingSubsRspInfo), 0, MAX_PENDING_SUBSCRIPTION_RSP*sizeof(PendingSubsRspInfo)); + } + } + memset(&duCb.e2apDb.ricId, 0, sizeof(GlobalRicId)); + duCb.e2apDb.numOfTNLAssoc = 0; + memset(&duCb.e2apDb.tnlAssoc, 0, MAX_TNL_ASSOCIATION*sizeof(TNLAssociation)); + memset(&ricParams, 0, sizeof(DuSctpDestCb)); +} + +/******************************************************************* + * + * @brief Extract statistics received from DU layers and delete + * Ric subscription info + * + * @details + * + * Function :e2ProcStatsDeleteRsp + * + * Functionality: Extract statistics received from DU layers + * and delete ric subscription iformation form db + * + * @params[in] Statistics delete rsp from MAC + * @return ROK-success + * RFAILED-failure + * + * ****************************************************************/ +uint8_t e2ProcStatsDeleteRsp(MacStatsDeleteRsp *statsDeleteRsp) +{ + RanFunction *ranFuncDb = NULLP; + CmLList *ricSubscriptionNode = NULLP; + RicSubscription *ricSubscriptionInfo = NULLP; + E2FailureCause failureCause; + + /* Fetch RAN Function and Subscription DB using subscription Id received + * in statistics delete response */ + if(fetchSubsInfoFromSubsId(statsDeleteRsp->subscriptionId, &ranFuncDb, &ricSubscriptionNode, &ricSubscriptionInfo) != ROK) + { + DU_LOG("\nERROR --> E2AP : e2ProcStatsDeleteRsp: Failed to fetch subscriprtion details"); + return RFAILED; + } + + deleteRicSubscriptionNode(ricSubscriptionNode); + + if(statsDeleteRsp->result == MAC_DU_APP_RSP_NOK) + { + if(statsDeleteRsp->status == STATS_ID_NOT_FOUND) + { + failureCause.causeType =E2_RIC_REQUEST; + failureCause.cause = E2_REQUEST_INFORMATION_UNAVAILABLE; + } + else + { + failureCause.causeType = E2_MISCELLANEOUS; + failureCause.cause = E2_MISCELLANEOUS_CAUSE_UNSPECIFIED; + } + + if(BuildAndSendRicSubscriptionDeleteFailure(ricSubscriptionInfo->ranFuncId, ricSubscriptionInfo->requestId, failureCause) != ROK) + { + DU_LOG("\nERROR --> E2AP : e2ProcStatsDeleteRsp: failed to build and send ric subs delete failure"); + return RFAILED; + } + } + else + { + if(BuildAndSendRicSubscriptionDeleteResponse(ricSubscriptionInfo->ranFuncId, ricSubscriptionInfo->requestId) != ROK) + { + DU_LOG("\nERROR --> E2AP : e2ProcStatsDeleteRsp: failed to build and send ric subs delete rsp"); + return RFAILED; + } + } + + return ROK; +} + /********************************************************************** End of file **********************************************************************/