}
}
+/******************************************************************
+ *
+ * @brief Delete e2 node information from the database
+ *
+ * @details
+ *
+ * Function : removeE2NodeInformation
+ *
+ * Functionality: Delete e2 node information from the database
+ *
+ * @params[in]
+ *
+ * @return void
+ *
+******************************************************************/
+void removeE2NodeInformation()
+{
+ uint16_t ranFuncIdx = 0;
+
+ DU_LOG("\nINFO --> E2AP : Deleting all the E2 node configuration");
+ for(ranFuncIdx=0; ranFuncIdx<MAX_RAN_FUNCTION; ranFuncIdx++)
+ {
+ if(duCb.e2apDb.ranFunction[ranFuncIdx].id >0)
+ {
+ deleteRicSubscriptionList(&(duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList));
+ memset(&(duCb.e2apDb.ranFunction[ranFuncIdx].pendingSubsRspInfo), 0, MAX_PENDING_SUBSCRIPTION_RSP*sizeof(PendingSubsRspInfo));
+ }
+ }
+ memset(&duCb.e2apDb.ricId, 0, sizeof(GlobalRicId));
+ duCb.e2apDb.numOfTNLAssoc = 0;
+ memset(&duCb.e2apDb.tnlAssoc, 0, MAX_TNL_ASSOCIATION*sizeof(TNLAssociation));
+ cmInetClose(&ricParams.sockFd);
+ memset(&ricParams, 0, sizeof(DuSctpDestCb));
+}
/**********************************************************************
End of file
**********************************************************************/
}while(true);
FreeE2RemovalResponse(e2apMsg);
+ removeE2NodeInformation();
return ret;
}
void procE2RemovalRequest(E2AP_PDU_t *e2apMsg)
{
- uint8_t arrIdx =0, transId =0, count =0;
+ uint8_t arrIdx =0, transId =0;
E2FailureCause failureCause;
E2RemovalRequest_t *removalReq=NULLP;
DU_LOG("\nINFO --> E2AP : E2 Removal request received");
removalReq = &e2apMsg->choice.initiatingMessage->value.choice.E2RemovalRequest;
- count =removalReq->protocolIEs.list.count;
for(arrIdx=0; arrIdx<removalReq->protocolIEs.list.count; arrIdx++)
{
switch(removalReq->protocolIEs.list.array[arrIdx]->id)
}
}
+/*******************************************************************
+ *
+ * @brief process the E2 node information from ric db
+ *
+ * @details
+ *
+ * Function : deleteE2NodeInfo
+ *
+ * Functionality: process the E2 node information from ric db
+ *
+ * @params[in]
+ * du Id
+ *
+ * @return void
+ *
+ ******************************************************************/
+void deleteE2NodeInfo(DuDb *duDb)
+{
+ uint16_t ranFuncIdx =0;
+ RanFunction *ranFuncDb=NULLP;
+
+ DU_LOG("\nINFO --> E2AP : Removing all the E2 node information");
+ for(ranFuncIdx = 0; ranFuncIdx < MAX_RAN_FUNCTION; ranFuncIdx++)
+ {
+ ranFuncDb = &duDb->ranFunction[ranFuncIdx];
+ if(ranFuncDb->id > 0)
+ {
+ deleteRicSubscriptionList(&ranFuncDb->subscriptionList);
+ }
+ }
+
+ cmInetClose(&sctpCb.e2LstnSockFd);
+}
+
+/*******************************************************************
+ *
+ * @brief process the E2 Removal Response
+ *
+ * @details
+ *
+ * Function : ProcRemovalResponse
+ *
+ * Functionality: Process E2 Removal Response
+ *
+ * @params[in]
+ * du Id
+ * Pointer to removal response
+ * @return void
+ *
+ ******************************************************************/
+
+void ProcRemovalResponse(uint32_t duId, E2RemovalResponse_t *removalRsp)
+{
+ uint8_t ieIdx = 0, duIdx =0;
+ DuDb *duDb = NULLP;
+ RanFunction *ranFuncDb = NULLP;
+ uint16_t ranFuncIdx = 0;
+
+ SEARCH_DU_DB(duIdx, duId, duDb);
+ if(duDb == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : duDb is not present for duId %d",duId);
+ return;
+ }
+
+ if(!removalRsp)
+ {
+ DU_LOG("\nERROR --> E2AP : removalRsp pointer is null");
+ return;
+ }
+
+ if(!removalRsp->protocolIEs.list.array)
+ {
+ DU_LOG("\nERROR --> E2AP : removalRsp array pointer is null");
+ return;
+ }
+
+ for(ieIdx=0; ieIdx < removalRsp->protocolIEs.list.count; ieIdx++)
+ {
+ if(removalRsp->protocolIEs.list.array[ieIdx])
+ {
+ switch(removalRsp->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_TransactionID:
+ {
+ deleteE2NodeInfo(duDb);
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : Received Invalid Ie [%ld]", removalRsp->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ }
+}
+
/*******************************************************************
*
* @brief Handles received E2AP message and sends back response
}
case SuccessfulOutcomeE2__value_PR_E2RemovalResponse:
{
+ ProcRemovalResponse(*duId, &e2apMsg->choice.successfulOutcome->value.choice.E2RemovalResponse);
break;
}
default: