X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fric_stub%2Fric_e2ap_msg_hdl.c;h=f9540ce22872433093867b01901a438876ad79db;hb=c371a26d48604a5d60686d9ca347e68671e69637;hp=86129983c15d3e8cc5e4a307e28ddd462011b960;hpb=2f98230fb83e03fcdd354a7754415155ba353f7d;p=o-du%2Fl2.git diff --git a/src/ric_stub/ric_e2ap_msg_hdl.c b/src/ric_stub/ric_e2ap_msg_hdl.c index 86129983c..f9540ce22 100644 --- a/src/ric_stub/ric_e2ap_msg_hdl.c +++ b/src/ric_stub/ric_e2ap_msg_hdl.c @@ -7134,6 +7134,92 @@ void ProcRicSubsDeleteFailure(RICsubscriptionDeleteFailure_t *ricSubsDeleteFail) } } + +/****************************************************************** + * + * @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 @@ -7297,6 +7383,11 @@ void E2APMsgHdlr(uint32_t *duId, Buffer *mBuf) 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]", \