+/*******************************************************************
+ *
+ * @brief Find all RIC subscriptions to be deleted in all RAN
+ * Functions
+ *
+ * @details
+ *
+ * Function : fetchRicSubsToBeDeleted
+ *
+ * Functionality: Find all RIC subscriptions to be deleted in all
+ * RAN functions and store in a temporary list
+ *
+ * @parameter Temporary list to store subscriptions to be deleted
+ * @return void
+ *
+ ******************************************************************/
+void fetchRicSubsToBeDeleted(CmLListCp *ricSubsToBeDelList)
+{
+ uint16_t ranFuncIdx = 0;
+ CmLList *subsNode = NULLP;
+ CmLList *subsToDelNode = NULLP;
+
+ for(ranFuncIdx = 0; ranFuncIdx < MAX_RAN_FUNCTION; ranFuncIdx++)
+ {
+ if(duCb.e2apDb.ranFunction[ranFuncIdx].id > 0)
+ {
+ CM_LLIST_FIRST_NODE(&duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList, subsNode);
+ while(subsNode)
+ {
+ if(((RicSubscription *)subsNode->node)->action == CONFIG_DEL)
+ {
+ DU_ALLOC(subsToDelNode, sizeof(CmLList));
+ if(!subsToDelNode)
+ {
+ DU_LOG("\nERROR --> E2AP : %s: Memory allocation failure at %d", __func__, __LINE__);
+ return;
+ }
+ subsToDelNode->node = subsNode->node;
+ cmLListAdd2Tail(ricSubsToBeDelList, subsToDelNode);
+ }
+ subsToDelNode = NULLP;
+ subsNode = subsNode->next;
+ }
+ }
+ }
+}
+