+
+/*******************************************************************
+ *
+ * @brief delete ric subscription information
+ *
+ * @details
+ *
+ * Function : deleteRicSubscription
+ *
+ * Functionality: Process ric subscription information
+ *
+ * @params[in]
+ * Pointer to DU database
+ * @return void
+
+ *
+ ******************************************************************/
+void deleteRicSubscription(DuDb **duDb)
+{
+ RanFunction *ranFuncDb = NULLP;
+ uint16_t ranFuncIdx=0;
+
+ for(ranFuncIdx =0; ranFuncIdx<MAX_RAN_FUNCTION; ranFuncIdx++)
+ {
+ ranFuncDb = &(*duDb)->ranFunction[ranFuncIdx];
+ if(ranFuncDb->id > 0)
+ {
+ memset(&ranFuncDb->subscriptionList, 0,MAX_RIC_REQUEST*sizeof(RicSubscription));
+ ranFuncDb->numOfSubscription =0;
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief process the E2 Reset Response
+ *
+ * @details
+ *
+ * Function : ProcResetResponse
+ *
+ * Functionality: Process E2 Reset Response
+ *
+ * @params[in]
+ * du Id
+ * Pointer to reset response
+ * @return void
+ *
+ ******************************************************************/
+
+void ProcResetResponse(uint32_t duId, ResetResponseE2_t *resetRsp)
+{
+ uint8_t ieIdx = 0, duIdx =0;
+ DuDb *duDb = NULLP;
+
+ SEARCH_DU_DB(duIdx, duId, duDb);
+ if(duDb == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : duDb is not present for duId %d",duId);
+ return;
+ }
+
+ if(!resetRsp)
+ {
+ DU_LOG("\nERROR --> E2AP : resetRsp pointer is null");
+ return;
+ }
+
+ if(!resetRsp->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : resetRsp array pointer is null");
+ return;
+ }
+
+ for(ieIdx=0; ieIdx < resetRsp->protocolIEs.list.count; ieIdx++)
+ {
+ if(resetRsp->protocolIEs.list.array[ieIdx])
+ {
+ switch(resetRsp->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_TransactionID:
+ {
+ deleteRicSubscription(&duDb);
+ break;
+ }
+ case ProtocolIE_IDE2_id_CriticalityDiagnosticsE2:
+ {
+ break;
+ }
+ }
+ }
+ }
+}
+
+
+/*******************************************************************
+ *
+ * @brief process the E2 Reset Request
+ *
+ * @details
+ *
+ * Function : ProcResetRequest
+ *
+ * Functionality: Process E2 Reset Request
+ *
+ * @params[in]
+ * du Id
+ * Pointer to reset response
+ * @return void
+ *
+ ******************************************************************/
+
+void ProcResetRequest(uint32_t duId, ResetRequestE2_t *resetReq)
+{
+ uint8_t ieIdx = 0, duIdx =0, transId=0;
+ DuDb *duDb = NULLP;
+
+ SEARCH_DU_DB(duIdx, duId, duDb);
+ if(duDb == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : duDb is not present for duId %d",duId);
+ return;
+ }
+
+ if(!resetReq)
+ {
+ DU_LOG("\nERROR --> E2AP : resetReq pointer is null");
+ return;
+ }
+
+ if(!resetReq->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : resetReq array pointer is null");
+ return;
+ }
+
+ for(ieIdx=0; ieIdx < resetReq->protocolIEs.list.count; ieIdx++)
+ {
+ if(resetReq->protocolIEs.list.array[ieIdx])
+ {
+ switch(resetReq->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_TransactionID:
+ {
+ transId = resetReq->protocolIEs.list.array[ieIdx]->value.choice.TransactionID;
+ break;
+ }
+ case ProtocolIE_IDE2_id_CauseE2:
+ {
+ deleteRicSubscription(&duDb);
+ break;
+ }
+ }
+ }
+ }
+
+ if(BuildAndSendResetResponse(duId, transId) !=ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : Failed to build and send reset response");
+ }
+}