*
* @params[in]
* Type of interface
- * Component action type
+ * Component Id
* Pointer to E2 component node to be searched
* @return CmLList
*
* ****************************************************************/
-E2NodeComponent *fetchE2NodeComponentInfo(InterfaceType interfaceType, uint8_t componentActionType, CmLList **e2ComponentNode)
+E2NodeComponent *fetchE2NodeComponentInfo(InterfaceType interfaceType, uint64_t componentId, CmLList **e2ComponentNode)
{
E2NodeComponent *e2NodeComponentInfo=NULLP;
while(*e2ComponentNode)
{
e2NodeComponentInfo = (E2NodeComponent*)((*e2ComponentNode)->node);
- if((e2NodeComponentInfo->interfaceType == interfaceType) && (e2NodeComponentInfo->componentActionType == componentActionType))
+ if((e2NodeComponentInfo->interfaceType == interfaceType) && (e2NodeComponentInfo->componentId == componentId))
{
-
break;
}
/*******************************************************************
*
- * @brief add or modify E2NodeComponent list
+ * @brief fill E2 node component rsp info
+ *
+ * @details
+ *
+ * Function : fillE2NodeComponentRspInfo
+ *
+ * Functionality: fill E2 Node Component rsp info
+ *
+ * @parameter
+ * Type of interface
+ * Component action type
+ * Size of buffer which needs to be store
+ * buffer string which needs to be store
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillE2NodeComponentRspInfo(InterfaceType interfaceType, uint64_t componentId, uint8_t action, uint8_t bufSize, char *bufString)
+{
+ E2NodeConfig *configInfo=NULLP;
+ E2NodeComponent *e2NodeComponentInfo= NULLP;
+ CmLList *node = NULLP;
+
+ e2NodeComponentInfo = fetchE2NodeComponentInfo(interfaceType, componentId, &node);
+ if(!e2NodeComponentInfo)
+ {
+ DU_LOG("\nERROR --> E2AP : Unable to find the node");
+ return RFAILED;
+ }
+
+ switch(action)
+ {
+ case E2_NODE_COMPONENT_ADD:
+ {
+ configInfo = e2NodeComponentInfo->addConfiguration;
+ break;
+ }
+ case E2_NODE_COMPONENT_UPDATE:
+ {
+ configInfo = e2NodeComponentInfo->updateConfiguration;
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : Invalid action %d received",action);
+ return RFAILED;
+ }
+ }
+
+ if(configInfo->componentRequestPart== NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : E2 node Component request part is not present");
+ return RFAILED;
+ }
+
+ configInfo->rspBufSize = bufSize;
+ DU_ALLOC(configInfo->componentResponsePart, bufSize);
+ if(configInfo->componentResponsePart == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed to store the encoding of rsp");
+ return RFAILED;
+ }
+ memcpy(configInfo->componentResponsePart, bufString, configInfo->rspBufSize);
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief add E2 node component req info
*
* @details
*
- * Function : addOrModifyE2NodeComponent
+ * Function : addE2NodeComponent
*
- * Functionality: add or modify E2NodeComponent list
+ * Functionality: add E2 node component req info
*
* @parameter
* Type of interface
* Component action type
- * boolean variable to check req or rsp msg type
* Size of buffer which needs to be store
* buffer string which needs to be store
* @return ROK - success
*
******************************************************************/
-uint8_t addOrModifyE2NodeComponent(InterfaceType interfaceType, uint8_t action, bool reqPart, uint8_t bufSize, char *bufString)
+uint8_t addE2NodeComponent(InterfaceType interfaceType, uint64_t componentId, uint8_t bufSize, char *bufString)
{
- E2NodeComponent *e2NodeComponentInfo= NULL;
+ E2NodeComponent *e2NodeComponentInfo= NULLP;
CmLList *node = NULLP;
- if(reqPart == true)
+ DU_ALLOC(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ if(!e2NodeComponentInfo)
{
- DU_ALLOC(e2NodeComponentInfo, sizeof(E2NodeComponent));
- if(!e2NodeComponentInfo)
- {
- DU_LOG("\nERROR --> E2AP : Memory allocation failed for e2NodeComponentInfo in %s",__func__);
- return RFAILED;
- }
- e2NodeComponentInfo->interfaceType =interfaceType;
- e2NodeComponentInfo->componentId=duCfgParam.duId;
- e2NodeComponentInfo->componentActionType = action;
- e2NodeComponentInfo->reqBufSize = bufSize;
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ return RFAILED;
+ }
+ e2NodeComponentInfo->interfaceType =interfaceType;
+ e2NodeComponentInfo->componentId=componentId;
- DU_ALLOC(e2NodeComponentInfo->componentRequestPart, bufSize);
- if(e2NodeComponentInfo->componentRequestPart == NULLP)
- {
- DU_LOG("\nERROR --> E2AP : Memory allocation failed for componentRequestPart");
- DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
- return RFAILED;
- }
- memcpy(e2NodeComponentInfo->componentRequestPart, bufString, e2NodeComponentInfo->reqBufSize);
- DU_ALLOC(node, sizeof(CmLList));
- if(node)
- {
- node->node = (PTR) e2NodeComponentInfo;
- cmLListAdd2Tail(&duCb.e2apDb.e2NodeComponentList, node);
- }
- else
- {
- DU_LOG("\nERROR --> E2AP : Memory allocation failed for e2NodeComponentList node");
- DU_FREE(e2NodeComponentInfo->componentRequestPart, bufSize);
- DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
- return RFAILED;
- }
+ DU_ALLOC(e2NodeComponentInfo->addConfiguration, sizeof(E2NodeConfig));
+ if(!e2NodeComponentInfo->addConfiguration)
+ {
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ return RFAILED;
+ }
+
+ e2NodeComponentInfo->addConfiguration->reqBufSize = bufSize;
+
+ DU_ALLOC(e2NodeComponentInfo->addConfiguration->componentRequestPart, bufSize);
+ if(e2NodeComponentInfo->addConfiguration->componentRequestPart == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ return RFAILED;
+ }
+ memcpy(e2NodeComponentInfo->addConfiguration->componentRequestPart, bufString,\
+ e2NodeComponentInfo->addConfiguration->reqBufSize);
+
+ DU_ALLOC(node, sizeof(CmLList));
+ if(node)
+ {
+ node->node = (PTR) e2NodeComponentInfo;
+ cmLListAdd2Tail(&duCb.e2apDb.e2NodeComponentList, node);
}
else
{
- if(duCb.e2apDb.e2NodeComponentList.count)
- {
- e2NodeComponentInfo = fetchE2NodeComponentInfo(interfaceType, action, &node);
- if(e2NodeComponentInfo->componentRequestPart== NULLP)
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ DU_FREE(e2NodeComponentInfo->addConfiguration->componentRequestPart, bufSize);
+ DU_FREE(e2NodeComponentInfo->addConfiguration, sizeof(E2NodeConfig));
+ DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief update E2 node component req info
+ *
+ * @details
+ *
+ * Function : updateE2NodeComponent
+ *
+ * Functionality: update E2 node component req info
+ *
+ * @parameter
+ * Type of interface
+ * Size of buffer which needs to be store
+ * buffer string which needs to be store
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+
+uint8_t updateE2NodeComponent(InterfaceType interfaceType, uint64_t componentId, uint8_t bufSize, char *bufString)
+{
+ E2NodeComponent *e2NodeComponentInfo= NULLP;
+ CmLList *node = NULLP;
+
+ e2NodeComponentInfo = fetchE2NodeComponentInfo(interfaceType, componentId, &node);
+ if(!e2NodeComponentInfo)
+ {
+ DU_LOG("\nERROR --> E2AP : Received null information in %s",__func__);
+ return RFAILED;
+ }
+
+ DU_ALLOC(e2NodeComponentInfo->updateConfiguration, sizeof(E2NodeConfig));
+ if(!e2NodeComponentInfo->updateConfiguration)
+ {
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ return RFAILED;
+ }
+
+ e2NodeComponentInfo->updateConfiguration->reqBufSize = bufSize;
+
+ DU_ALLOC(e2NodeComponentInfo->updateConfiguration->componentRequestPart, bufSize);
+ if(e2NodeComponentInfo->updateConfiguration->componentRequestPart == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed in %s at %d",__func__,__LINE__);
+ DU_FREE(e2NodeComponentInfo->updateConfiguration, sizeof(E2NodeConfig));
+ return RFAILED;
+ }
+
+ memcpy(e2NodeComponentInfo->updateConfiguration->componentRequestPart, bufString,\
+ e2NodeComponentInfo->updateConfiguration->reqBufSize);
+ return ROK;
+
+}
+
+/*******************************************************************
+ *
+ * @brief delete E2 node component req info
+ *
+ * @details
+ *
+ * Function : deleteE2NodeComponent
+ *
+ * Functionality: delete E2 node component req info
+ *
+ * @parameter
+ * Type of interface
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+
+uint8_t deleteE2NodeComponent(InterfaceType interfaceType, uint64_t componentId)
+{
+ E2NodeComponent *e2NodeComponentInfo= NULLP;
+ CmLList *node = NULLP;
+
+ e2NodeComponentInfo = fetchE2NodeComponentInfo(interfaceType, componentId, &node);
+ if(!e2NodeComponentInfo)
+ {
+ DU_LOG("\nERROR --> E2AP : Received null information in %s",__func__);
+ return RFAILED;
+ }
+
+ e2NodeComponentInfo->deleteConfiguration = true;
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief fill E2 node component req info
+ *
+ * @details
+ *
+ * Function : fillE2NodeComponentReqInfo
+ *
+ * Functionality: fill E2 node component req info
+ *
+ * @parameter
+ * Type of interface
+ * Component action type
+ * Size of buffer which needs to be store
+ * buffer string which needs to be store
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+
+uint8_t fillE2NodeComponentReqInfo(InterfaceType interfaceType, uint64_t componentId, uint8_t action, uint8_t bufSize, char *bufString)
+{
+ switch(action)
+ {
+ case E2_NODE_COMPONENT_ADD:
{
- DU_LOG("\nERROR --> E2AP : E2 node Component request part is not present");
- return RFAILED;
+ if(addE2NodeComponent(interfaceType, componentId, bufSize, bufString) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : Failed to add e2 node component");
+ return RFAILED;
+ }
+ break;
}
-
- e2NodeComponentInfo->rspBufSize = bufSize;
- DU_ALLOC(e2NodeComponentInfo->componentResponsePart, bufSize);
- if(e2NodeComponentInfo->componentResponsePart == NULLP)
+ case E2_NODE_COMPONENT_UPDATE:
+ {
+ if(updateE2NodeComponent(interfaceType, componentId, bufSize, bufString) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : Failed to update e2 node component");
+ return RFAILED;
+ }
+ break;
+ }
+ case E2_NODE_COMPONENT_DEL:
+ {
+ if(deleteE2NodeComponent(interfaceType, componentId) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : Failed to delete e2 node component");
+ return RFAILED;
+ }
+ break;
+ }
+ default:
{
- DU_LOG("\nERROR --> E2AP : Memory allocation failed to store the encoding of rsp");
+ DU_LOG("\nERROR --> E2AP : Invalid action %d received",action);
return RFAILED;
}
- memcpy(e2NodeComponentInfo->componentResponsePart, bufString, e2NodeComponentInfo->rspBufSize);
- return ROK;
- }
- else
- {
- DU_LOG("\nERROR --> E2AP : Unable to find the node");
- return RFAILED;
- }
- }
+ }
+
return ROK;
}
uint8_t fillE2NodeConfig(PTR e2NodeCfg, E2NodeComponent *e2NodeComponentInfo, ConfigType configType)
{
+ E2NodeConfig *e2NodeConfig=NULLP;
E2nodeComponentInterfaceType_t *interfaceType=NULLP;
E2nodeComponentID_t *componentID =NULLP;
E2nodeComponentConfiguration_t *configuration=NULLP;
interfaceType = &e2NodeAddItem->e2nodeComponentInterfaceType;
componentID = &e2NodeAddItem->e2nodeComponentID;
configuration = &e2NodeAddItem->e2nodeComponentConfiguration;
+ e2NodeConfig = e2NodeComponentInfo->addConfiguration;
break;
}
case CONFIG_MOD:
interfaceType = &e2NodeUpdateItem->e2nodeComponentInterfaceType;
componentID = &e2NodeUpdateItem->e2nodeComponentID;
configuration = &e2NodeUpdateItem->e2nodeComponentConfiguration;
+ e2NodeConfig = e2NodeComponentInfo->updateConfiguration;
break;
}
case CONFIG_DEL:
}
/* E2 Node Component Request Part */
- if(e2NodeComponentInfo->componentRequestPart)
+ if(e2NodeConfig->componentRequestPart)
{
- configuration->e2nodeComponentRequestPart.size = e2NodeComponentInfo->reqBufSize ;
+ configuration->e2nodeComponentRequestPart.size = e2NodeConfig->reqBufSize ;
DU_ALLOC(configuration->e2nodeComponentRequestPart.buf,\
configuration->e2nodeComponentRequestPart.size);
if(configuration->e2nodeComponentRequestPart.buf == NULLP)
}
memcpy(configuration->e2nodeComponentRequestPart.buf,\
- e2NodeComponentInfo->componentRequestPart, configuration->\
+ e2NodeConfig->componentRequestPart, configuration->\
e2nodeComponentRequestPart.size);
}
else
}
/* E2 Node Component Response Part */
- if(e2NodeComponentInfo->componentResponsePart)
+ if(e2NodeConfig->componentResponsePart)
{
- configuration->e2nodeComponentResponsePart.size = e2NodeComponentInfo->rspBufSize;
+ configuration->e2nodeComponentResponsePart.size = e2NodeConfig->rspBufSize;
DU_ALLOC(configuration->e2nodeComponentResponsePart.buf, configuration->e2nodeComponentResponsePart.size);
if(configuration->e2nodeComponentResponsePart.buf == NULLP)
{
DU_LOG("\nERROR --> E2AP: Memory allocation failed in function %s at line %d",__func__,__LINE__);
return RFAILED;
}
- memcpy(configuration->e2nodeComponentResponsePart.buf, e2NodeComponentInfo->componentResponsePart, configuration->\
+ memcpy(configuration->e2nodeComponentResponsePart.buf, e2NodeConfig->componentResponsePart, configuration->\
e2nodeComponentResponsePart.size);
}
else
{
/* Getting only those E2 node configuration from DuCb whose interface
* and action type is present in the received array */
- e2NodeComponentInfo = fetchE2NodeComponentInfo(e2NodeList[arrIdx].interface, e2NodeList[arrIdx].actionType, &node);
+ e2NodeComponentInfo = fetchE2NodeComponentInfo(e2NodeList[arrIdx].interface, e2NodeList[arrIdx].componentId, &node);
}
if(!e2NodeComponentInfo)
return RFAILED;
}
- e2NodeComponentInfo= fetchE2NodeComponentInfo(updateE2Node[arrIdx].interface, updateE2Node[arrIdx].actionType, &node);
+ e2NodeComponentInfo= fetchE2NodeComponentInfo(updateE2Node[arrIdx].interface, updateE2Node[arrIdx].componentId, &node);
if(!e2NodeComponentInfo)
{
DU_LOG("\nERROR --> E2AP : Received null e2NodeComponentInfo at line number %d",__LINE__);
return RFAILED;
}
- e2NodeComponentInfo= fetchE2NodeComponentInfo(updateE2Node[arrIdx].interface, updateE2Node[arrIdx].actionType, &node);
+ e2NodeComponentInfo= fetchE2NodeComponentInfo(updateE2Node[arrIdx].interface,updateE2Node[arrIdx].componentId, &node);
if(!e2NodeComponentInfo)
{
DU_LOG("\nERROR --> E2AP : Received null e2NodeComponentInfo at line number %d",__LINE__);
uint8_t BuildAndSendE2SetupReq()
{
uint8_t arrIdx = 0, elementCnt=0;
- uint8_t transId = 0, ret = ROK;
- bool memAllocFailed;
+ uint8_t transId = 0, ret = RFAILED;
+ bool memAllocFailed = false;
E2AP_PDU_t *e2apMsg = NULLP;
E2setupRequest_t *e2SetupReq = NULLP;
asn_enc_rval_t encRetVal; /* Encoder return value */
}
}
}
+
+/******************************************************************
+ *
+ * @brief handling of e2 noe config update ack ies
+ *
+ * @details
+ *
+ * Function :handleE2NodeConfigUpdateAckIes
+ *
+ * Functionality: handling of e2 noe config update ack ies
+ *
+ * @params[in]
+ * Pointer to the E2 Node cfg
+ * Procedure code
+ * @return void
+******************************************************************/
+
+void handleE2NodeConfigUpdateAckIes(PTR e2NodeCfg, uint8_t procedureCode)
+{
+ CmLList *node=NULLP;
+ E2NodeComponent *e2NodeComponentInfo=NULLP;
+ E2nodeComponentID_t *e2nodeComponentID=NULLP;
+ E2nodeComponentConfigRemovalAck_Item_t *removalAckItem=NULLP;
+ E2nodeComponentConfigUpdateAck_Item_t *updateAckItem=NULLP;
+ E2nodeComponentConfigAdditionAck_Item_t *additionAckItem=NULLP;
+
+ switch(procedureCode)
+ {
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck:
+ {
+ additionAckItem = (E2nodeComponentConfigAdditionAck_Item_t *)e2NodeCfg;
+ e2nodeComponentID = &additionAckItem->e2nodeComponentID;
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigUpdateAck:
+ {
+ updateAckItem = (E2nodeComponentConfigUpdateAck_Item_t*) e2NodeCfg;
+ e2nodeComponentID = &updateAckItem->e2nodeComponentID;
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigRemovalAck:
+ {
+ removalAckItem= (E2nodeComponentConfigRemovalAck_Item_t*)e2NodeCfg;
+ e2nodeComponentID = &removalAckItem->e2nodeComponentID;
+ break;
+ }
+ }
+
+ switch(e2nodeComponentID->present)
+ {
+ case E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1:
+ {
+ e2NodeComponentInfo = fetchE2NodeComponentInfo(F1, e2nodeComponentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.buf[0], &node);
+ if(!e2NodeComponentInfo)
+ {
+ DU_LOG("\nERROR --> E2AP : Received null e2NodeComponentInfo at line number %d",__LINE__);
+ return;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch(procedureCode)
+ {
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck:
+ {
+ DU_FREE(e2NodeComponentInfo->addConfiguration->componentRequestPart, e2NodeComponentInfo->addConfiguration->reqBufSize);
+ DU_FREE(e2NodeComponentInfo->addConfiguration->componentResponsePart, e2NodeComponentInfo->addConfiguration->rspBufSize);
+ DU_FREE(e2NodeComponentInfo->addConfiguration, sizeof(E2NodeConfig));
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigUpdateAck:
+ {
+ DU_FREE(e2NodeComponentInfo->updateConfiguration->componentRequestPart, e2NodeComponentInfo->updateConfiguration->reqBufSize);
+ DU_FREE(e2NodeComponentInfo->updateConfiguration->componentResponsePart, e2NodeComponentInfo->updateConfiguration->rspBufSize);
+ DU_FREE(e2NodeComponentInfo->updateConfiguration, sizeof(E2NodeConfig));
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigRemovalAck:
+ {
+ cmLListDelFrm(&duCb.e2apDb.e2NodeComponentList, node);
+ if(e2NodeComponentInfo->addConfiguration)
+ {
+ DU_FREE(e2NodeComponentInfo->addConfiguration->componentRequestPart, e2NodeComponentInfo->addConfiguration->reqBufSize);
+ DU_FREE(e2NodeComponentInfo->addConfiguration->componentResponsePart, e2NodeComponentInfo->addConfiguration->rspBufSize);
+ DU_FREE(e2NodeComponentInfo->addConfiguration, sizeof(E2NodeConfig));
+ }
+ if(e2NodeComponentInfo->updateConfiguration)
+ {
+ DU_FREE(e2NodeComponentInfo->updateConfiguration->componentRequestPart, e2NodeComponentInfo->updateConfiguration->reqBufSize);
+ DU_FREE(e2NodeComponentInfo->updateConfiguration->componentResponsePart, e2NodeComponentInfo->updateConfiguration->rspBufSize);
+ DU_FREE(e2NodeComponentInfo->updateConfiguration, sizeof(E2NodeConfig));
+ }
+ DU_FREE(node, sizeof(CmLList));
+ break;
+ }
+ }
+}
+
/******************************************************************
*
* @brief Processes E2 Setup Response sent by RIC
uint8_t arrIdx =0, transId=0, idx=0;
uint32_t recvBufLen;
E2setupResponse_t *e2SetRspMsg=NULL;
- CmLList *node=NULL;
- E2NodeComponent *e2NodeComponentInfo=NULL;
E2nodeComponentConfigAdditionAck_List_t *e2NodeCfgAckList=NULL;
E2nodeComponentConfigAdditionAck_ItemIEs_t *e2NodeAddAckItem=NULL;
for(idx =0; idx <e2NodeCfgAckList->list.count; idx++)
{
e2NodeAddAckItem = (E2nodeComponentConfigAdditionAck_ItemIEs_t*) e2NodeCfgAckList->list.array[idx];
- switch(e2NodeAddAckItem->value.choice.E2nodeComponentConfigAdditionAck_Item.e2nodeComponentID.present)
- {
- case E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1:
- {
- e2NodeComponentInfo = fetchE2NodeComponentInfo(F1, E2_NODE_COMPONENT_ADD, &node);
- if(!e2NodeComponentInfo)
- {
- DU_LOG("\nERROR --> E2AP : Received null e2NodeComponentInfo at line number %d",__LINE__);
- }
- else
- {
- cmLListDelFrm(&duCb.e2apDb.e2NodeComponentList, node);
- DU_FREE(e2NodeComponentInfo->componentRequestPart, e2NodeComponentInfo->reqBufSize);
- DU_FREE(e2NodeComponentInfo->componentResponsePart, e2NodeComponentInfo->rspBufSize);
- DU_FREE(e2NodeComponentInfo, sizeof(E2NodeComponent));
- DU_FREE(node, sizeof(CmLList));
- }
- break;
- }
- default:
- break;
- }
+ handleE2NodeConfigUpdateAckIes((PTR)&e2NodeAddAckItem->value.choice.E2nodeComponentConfigAdditionAck_Item,\
+ ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck);
}
break;
}
{
e2NodeComponentInfo = (E2NodeComponent*)node->node;
- if(e2NodeComponentInfo->componentRequestPart && e2NodeComponentInfo->componentResponsePart)
+ if(e2NodeComponentInfo->addConfiguration)
{
- switch(e2NodeComponentInfo->componentActionType)
- {
- case E2_NODE_COMPONENT_ADD:
- {
- e2NodeList.addE2Node[e2NodeList.addE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
- e2NodeList.addE2Node[e2NodeList.addE2NodeCount].actionType = e2NodeComponentInfo->componentActionType;
- e2NodeList.removeE2NodeCount++;
- break;
- }
- case E2_NODE_COMPONENT_UPDATE:
- {
- e2NodeList.updateE2Node[e2NodeList.updateE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
- e2NodeList.updateE2Node[e2NodeList.updateE2NodeCount].actionType = e2NodeComponentInfo->componentActionType;
- e2NodeList.updateE2NodeCount++;
- break;
-
- }
- case E2_NODE_COMPONENT_DEL:
- {
- e2NodeList.removeE2Node[e2NodeList.removeE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
- e2NodeList.removeE2Node[e2NodeList.removeE2NodeCount].actionType = e2NodeComponentInfo->componentActionType;
- e2NodeList.removeE2NodeCount++;
- break;
- }
- }
+ e2NodeList.addE2Node[e2NodeList.addE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
+ e2NodeList.addE2Node[e2NodeList.addE2NodeCount].componentId= e2NodeComponentInfo->componentId;
+ e2NodeList.addE2NodeCount++;
+ break;
+ }
+ if(e2NodeComponentInfo->updateConfiguration)
+ {
+ e2NodeList.updateE2Node[e2NodeList.updateE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
+ e2NodeList.updateE2Node[e2NodeList.updateE2NodeCount].componentId= e2NodeComponentInfo->componentId;
+ e2NodeList.updateE2NodeCount++;
+ break;
+ }
+ if(e2NodeComponentInfo->deleteConfiguration == true)
+ {
+ e2NodeList.removeE2Node[e2NodeList.removeE2NodeCount].interface = e2NodeComponentInfo->interfaceType;
+ e2NodeList.removeE2Node[e2NodeList.removeE2NodeCount].componentId = e2NodeComponentInfo->componentId;
+ e2NodeList.removeE2NodeCount++;
+ break;
}
node = node->next;
}
return;
}
+/*******************************************************************
+ *
+ * @brief Deallocate the memory allocated for E2 node configuration
+ * update ack msg by aper decoder
+ *
+ * @details
+ *
+ * Function : freeAperDecodingOfE2NodeConfigUpdateAck
+ *
+ * Functionality:
+ * - Deallocate the memory allocated for E2 node configuration
+ * update ack msg by aper decoder
+ *
+ * @params[in] E2AP_PDU_t *e2apMsg
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+void freeAperDecodingOfE2NodeConfigUpdateAck(E2nodeConfigurationUpdateAcknowledge_t *updateAckMsg)
+{
+ uint8_t arrIdx =0, e2NodeConfigIdx=0;
+ E2nodeComponentConfigUpdateAck_ItemIEs_t *updateAckItemIe=NULL;
+ E2nodeComponentConfigUpdateAck_List_t *updateAckList=NULL;
+ E2nodeComponentConfigRemovalAck_ItemIEs_t *removalAckItemIe=NULL;
+ E2nodeComponentConfigRemovalAck_List_t *removalAckList=NULL;
+ E2nodeComponentConfigAdditionAck_ItemIEs_t *additionAckItemIte=NULL;
+ E2nodeComponentConfigAdditionAck_List_t *additionAckList=NULL;
+
+ E2nodeComponentInterfaceF1_t *f1InterfaceInfo=NULLP;
+ if(updateAckMsg->protocolIEs.list.array != NULLP)
+ {
+ for(arrIdx = 0; arrIdx < updateAckMsg->protocolIEs.list.count; arrIdx++)
+ {
+ if(updateAckMsg->protocolIEs.list.array[arrIdx])
+ {
+ switch(updateAckMsg->protocolIEs.list.array[arrIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck:
+ {
+ additionAckList =&updateAckMsg->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigAdditionAck_List;
+ if(additionAckList->list.array)
+ {
+ for(e2NodeConfigIdx=0; e2NodeConfigIdx<additionAckList->list.count; e2NodeConfigIdx++)
+ {
+ additionAckItemIte = (E2nodeComponentConfigAdditionAck_ItemIEs_t*) additionAckList->list.array[e2NodeConfigIdx];
+ if(additionAckItemIte)
+ {
+ switch(additionAckItemIte->value.choice.E2nodeComponentConfigAdditionAck_Item.e2nodeComponentID.present)
+ {
+ case E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1:
+ {
+ f1InterfaceInfo = additionAckItemIte->value.choice.E2nodeComponentConfigAdditionAck_Item.e2nodeComponentID.choice.e2nodeComponentInterfaceTypeF1;
+ free(f1InterfaceInfo->gNB_DU_ID.buf);
+ free(f1InterfaceInfo);
+ break;
+ }
+ default:
+ break;
+ }
+ free(additionAckItemIte);
+ }
+ free(additionAckList->list.array);
+ }
+ break;
+ }
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigUpdateAck:
+ {
+ updateAckList =&updateAckMsg->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigUpdateAck_List;
+ if(updateAckList->list.array)
+ {
+ for(e2NodeConfigIdx=0; e2NodeConfigIdx<updateAckList->list.count; e2NodeConfigIdx++)
+ {
+ updateAckItemIe = (E2nodeComponentConfigUpdateAck_ItemIEs_t*) updateAckList->list.array[e2NodeConfigIdx];
+ if(updateAckItemIe)
+ {
+ switch(updateAckItemIe->value.choice.E2nodeComponentConfigUpdateAck_Item.e2nodeComponentID.present)
+ {
+ case E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1:
+ {
+ f1InterfaceInfo = updateAckItemIe->value.choice.E2nodeComponentConfigUpdateAck_Item.e2nodeComponentID.choice.e2nodeComponentInterfaceTypeF1;
+ free(f1InterfaceInfo->gNB_DU_ID.buf);
+ free(f1InterfaceInfo);
+ break;
+ }
+ default:
+ break;
+ }
+ free(updateAckItemIe);
+ }
+ }
+ free(updateAckList->list.array);
+ }
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigRemovalAck:
+ {
+ removalAckList =&updateAckMsg->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigRemovalAck_List;
+ if(removalAckList->list.array)
+ {
+ for(e2NodeConfigIdx=0; e2NodeConfigIdx<removalAckList->list.count; e2NodeConfigIdx++)
+ {
+ removalAckItemIe = (E2nodeComponentConfigRemovalAck_ItemIEs_t*) removalAckList->list.array[e2NodeConfigIdx];
+ if(removalAckItemIe)
+ {
+ switch(removalAckItemIe->value.choice.E2nodeComponentConfigRemovalAck_Item.e2nodeComponentID.present)
+ {
+ case E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1:
+ {
+ f1InterfaceInfo = removalAckItemIe->value.choice.E2nodeComponentConfigRemovalAck_Item.e2nodeComponentID.choice.e2nodeComponentInterfaceTypeF1;
+ free(f1InterfaceInfo->gNB_DU_ID.buf);
+ free(f1InterfaceInfo);
+ break;
+ }
+ default:
+ break;
+ }
+ free(removalAckItemIe);
+ }
+ }
+ free(removalAckList->list.array);
+ }
+ break;
+ }
+ }
+ free(updateAckMsg->protocolIEs.list.array[arrIdx]);
+ }
+ }
+ free(updateAckMsg->protocolIEs.list.array);
+ }
+}
+
+/******************************************************************
+ *
+ * @brief Processes the E2 node config update ack msg
+ *
+ * @details
+ *
+ * Function :procE2NodeConfigUpdateAck
+ *
+ * Functionality: Processes the E2 node config update ack msg
+ *
+ * @params[in] E2AP_PDU_t ASN decoded E2AP message
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+void procE2NodeConfigUpdateAck(E2AP_PDU_t *e2apMsg)
+{
+ uint8_t arrIdx =0;
+ uint16_t e2CfgIdx =0;
+ E2nodeConfigurationUpdateAcknowledge_t *e2NodeConfigUpdateAck =NULLP;
+ E2nodeComponentConfigUpdateAck_List_t *e2NodeConfigUpdateAckList=NULLP;
+ E2nodeComponentConfigUpdateAck_ItemIEs_t *e2NodeUpdateAckItem=NULLP;
+ E2nodeComponentConfigRemovalAck_List_t *e2NodeConfigRemovalAckList=NULLP;
+ E2nodeComponentConfigRemovalAck_ItemIEs_t *e2NodeRemovalAckItem=NULLP;
+ E2nodeComponentConfigAdditionAck_List_t *e2NodeConfigAdditionAckList=NULLP;
+ E2nodeComponentConfigAdditionAck_ItemIEs_t *e2NodeAdditionAckItem=NULLP;
+
+ e2NodeConfigUpdateAck = &e2apMsg->choice.successfulOutcome->value.choice.E2nodeConfigurationUpdateAcknowledge;
+
+ if(e2NodeConfigUpdateAck->protocolIEs.list.array)
+ {
+ for(arrIdx =0; arrIdx<e2NodeConfigUpdateAck->protocolIEs.list.count; arrIdx++)
+ {
+ switch(e2NodeConfigUpdateAck->protocolIEs.list.array[arrIdx]->id)
+ {
+ case ProtocolIE_IDE2_id_TransactionID:
+ {
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck:
+ {
+ e2NodeConfigAdditionAckList = &e2NodeConfigUpdateAck->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigAdditionAck_List;
+ if(e2NodeConfigAdditionAckList->list.array)
+ {
+ for(e2CfgIdx = 0; e2CfgIdx< e2NodeConfigAdditionAckList->list.count; e2CfgIdx++)
+ {
+ e2NodeAdditionAckItem = (E2nodeComponentConfigAdditionAck_ItemIEs_t*) e2NodeConfigAdditionAckList->list.array[e2CfgIdx];
+ handleE2NodeConfigUpdateAckIes((PTR)&e2NodeAdditionAckItem->value.choice.E2nodeComponentConfigAdditionAck_Item,\
+ ProtocolIE_IDE2_id_E2nodeComponentConfigAdditionAck);
+ }
+ }
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigUpdateAck:
+ {
+ e2NodeConfigUpdateAckList = &e2NodeConfigUpdateAck->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigUpdateAck_List;
+ if(e2NodeConfigUpdateAckList->list.array)
+ {
+ for(e2CfgIdx = 0; e2CfgIdx< e2NodeConfigUpdateAckList->list.count; e2CfgIdx++)
+ {
+ e2NodeUpdateAckItem = (E2nodeComponentConfigUpdateAck_ItemIEs_t*) e2NodeConfigUpdateAckList->list.array[e2CfgIdx];
+ handleE2NodeConfigUpdateAckIes((PTR)&e2NodeUpdateAckItem->value.choice.E2nodeComponentConfigUpdateAck_Item,\
+ ProtocolIE_IDE2_id_E2nodeComponentConfigUpdateAck);
+ }
+ }
+ break;
+ }
+ case ProtocolIE_IDE2_id_E2nodeComponentConfigRemovalAck:
+ {
+ e2NodeConfigRemovalAckList = &e2NodeConfigUpdateAck->protocolIEs.list.array[arrIdx]->value.choice.E2nodeComponentConfigRemovalAck_List;
+ if(e2NodeConfigRemovalAckList->list.array)
+ {
+ for(e2CfgIdx = 0; e2CfgIdx< e2NodeConfigRemovalAckList->list.count; e2CfgIdx++)
+ {
+ e2NodeRemovalAckItem = (E2nodeComponentConfigRemovalAck_ItemIEs_t*) e2NodeConfigRemovalAckList->list.array[e2CfgIdx];
+ handleE2NodeConfigUpdateAckIes((PTR)&e2NodeRemovalAckItem->value.choice.E2nodeComponentConfigRemovalAck_Item,\
+ ProtocolIE_IDE2_id_E2nodeComponentConfigRemovalAck);
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ freeAperDecodingOfE2NodeConfigUpdateAck(e2NodeConfigUpdateAck);
+}
+
/*******************************************************************
*
* @brief Handles received E2AP message and sends back response
}
break;
}
- case SuccessfulOutcomeE2__value_PR_E2nodeConfigurationUpdateAcknowledge:
- {
- DU_LOG("\nDEBUG --> E2AP : E2 node Config update ack message recevied");
- break;
- }
case SuccessfulOutcomeE2__value_PR_ResetResponseE2:
{
procResetResponse(e2apMsg);
procRicSubscriptionModificationConfirm(e2apMsg);
break;
}
-
+ case SuccessfulOutcomeE2__value_PR_E2nodeConfigurationUpdateAcknowledge:
+ {
+ procE2NodeConfigUpdateAck(e2apMsg);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> E2AP : Invalid type of E2AP_PDU_PR_successfulOutcome [%d]",\