-/*******************************************************************
- *
- * @brief Converts DU specific failure cause to E2 interface
- * failure cause
- *
- * @details
- *
- * Function : convertDuCauseToE2Cause
- *
- * Functionality: Converts DU specific failure cause to E2
- * interface failure cause
- *
- * @params[in] DU specific failure cause
- * E2 specific failure cause
- *
- * @return void
- *
- * ****************************************************************/
-void convertDuCauseToE2Cause(CauseOfResult l2Cause, E2FailureCause *failureCause)
-{
- switch(l2Cause)
- {
- case PARAM_INVALID:
- {
- failureCause->causeType = E2_RIC_REQUEST;
- failureCause->cause = E2_ACTION_NOT_SUPPORTED;
- break;
- }
- case RESOURCE_UNAVAILABLE:
- {
- failureCause->causeType = E2_RIC_REQUEST;
- failureCause->cause = E2_FUNCTION_RESOURCE_LIMIT;
- break;
- }
- default:
- {
- failureCause->causeType = E2_RIC_REQUEST;
- failureCause->cause = E2_RIC_REQUEST_CAUSE_UNSPECIFIED;
- break;
- }
- }
-}
-
-/*******************************************************************
- *
- * @brief Rejects all actions received in a subscription request
- *
- * @details
- *
- * Function : duRejectAllStatsGroup
- *
- * Functionality: Rejects all actions received in a subscription
- * request by :
- * a. Removing the subscription entry from RAN function
- * b. Sending RIC Subscription Failure to RIC with appropriate
- * cause of failure
- *
- * @params[in] RAN Function DB
- * Subscription entry in RAN Function subscription list
- * Statistics Response from MAC
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t duRejectAllStatsGroup(RanFunction *ranFuncDb, CmLList *ricSubscriptionNode, MacStatsRsp *statsRsp)
-{
- uint8_t ret = ROK;
- RicRequestId requestId;
- E2FailureCause failureCause;
-
- /* Delete subcription from RAN Function */
- memcpy(&requestId, &((RicSubscription *)ricSubscriptionNode->node)->requestId, sizeof(RicRequestId));
- cmLListDelFrm(&ranFuncDb->subscriptionList, ricSubscriptionNode);
- DU_FREE(ricSubscriptionNode->node, sizeof(RicSubscription));
- DU_FREE(ricSubscriptionNode, sizeof(CmLList));
-
- convertDuCauseToE2Cause(statsRsp->statsGrpRejectedList[0].cause, &failureCause);
-
- /* Send RIC subscription failure to RIC */
- ret = BuildAndSendRicSubscriptionFailure(requestId, ranFuncDb->id, failureCause);
- return ret;
-}
-