- /* Extract following from 64 bit subscription-ID :
- * First 16 MSB is unused
- * Next 16 MSB = RAN-Function-ID
- * Next 16 MSB = Requestor-ID in RIC-Request-ID
- * Last 16 LSB = Instance-ID in RIC-Request-ID
- */
- ricReqId.instanceId = statsRsp->subscriptionId & 0xFFFF;
- ricReqId.requestorId = (statsRsp->subscriptionId >> 16) & 0xFFFF;
- ranFuncId = (statsRsp->subscriptionId >> 32) & 0xFFFF;
-
- /* Fetch RAN Function DB */
- if(duCb.e2apDb.ranFunction[ranFuncId-1].id == ranFuncId)
- {
- ranFuncDb = &duCb.e2apDb.ranFunction[ranFuncId-1];
- }
- else
- {
- DU_LOG("\nERROR --> DU_APP : DuProcMacStatsRsp: Invalid RAN Function ID[%d] with Subscription ID [%ld]", \
- ranFuncId, statsRsp->subscriptionId);
- DU_FREE_SHRABL_BUF(pst->region, pst->pool, statsRsp, sizeof(MacStatsRsp));
- return RFAILED;
- }
-
- /* Fetch subscription detail in RAN Function DB */
- CM_LLIST_FIRST_NODE(&ranFuncDb->subscriptionList, ricSubscriptionNode);
- while(ricSubscriptionNode)
- {
- ricSubscriptionInfo = (RicSubscription *)ricSubscriptionNode->node;
- if(ricSubscriptionInfo && (ricSubscriptionInfo->requestId.requestorId == ricReqId.requestorId) &&
- (ricSubscriptionInfo->requestId.instanceId == ricReqId.instanceId))
- {
- break;
- }
- ricSubscriptionNode = ricSubscriptionNode->next;
- }
-
- if(ricSubscriptionNode == NULLP)
- {
- DU_LOG("\nERROR --> DU_APP : DuProcMacStatsRsp: Subscription not found for Requestor ID [%d] Instance ID [%d]",\
- ricReqId.requestorId, ricReqId.instanceId);
- DU_FREE_SHRABL_BUF(pst->region, pst->pool, statsRsp, sizeof(MacStatsRsp));
- return RFAILED;
- }
-
- /* If no action is accepted
- * a. Remove subcription entry from RAN Function
- * b. Send RIC subscription failure */
- if(statsRsp->numGrpAccepted == 0)
- {
- duRejectAllStatsGroup(ranFuncDb, ricSubscriptionNode, statsRsp);
- }
-
- /* TODO :
- * If even 1 action is accepted :
- *
- * For accepted groups:
- * Mark scubscrbed-action's -> action = CONFIG_UNKNOWN
- * Add action ID to accpeted-action-list in Subscription response
- *
- * For rejected groups:
- * Remove entry from DU's RAN Function->subscription->actionList
- * Add Rejected action Id to reject-action-list created by DU APP while
- * processing of subscription request.
- *
- * Send subscription response with accepted and rejected action lists to
- * RIC
- */