+ E2nodeComponentInterfaceType_t *interfaceType=NULLP;
+ E2nodeComponentID_t *componentID =NULLP;
+ E2nodeComponentConfiguration_t *configuration=NULLP;
+ E2nodeComponentConfigAddition_Item_t *e2NodeAddItem=NULL;
+ E2nodeComponentConfigUpdate_Item_t *e2NodeUpdateItem =NULL;
+ E2nodeComponentConfigRemoval_Item_t *e2NodeRemovalItem=NULL;
+
+ switch(configType)
+ {
+ case CONFIG_ADD:
+ {
+ e2NodeAddItem = (E2nodeComponentConfigAddition_Item_t*)e2NodeCfg;
+ interfaceType = &e2NodeAddItem->e2nodeComponentInterfaceType;
+ componentID = &e2NodeAddItem->e2nodeComponentID;
+ configuration = &e2NodeAddItem->e2nodeComponentConfiguration;
+ break;
+ }
+ case CONFIG_MOD:
+ {
+ e2NodeUpdateItem = (E2nodeComponentConfigUpdate_Item_t *) e2NodeCfg;
+ interfaceType = &e2NodeUpdateItem->e2nodeComponentInterfaceType;
+ componentID = &e2NodeUpdateItem->e2nodeComponentID;
+ configuration = &e2NodeUpdateItem->e2nodeComponentConfiguration;
+ break;
+ }
+ case CONFIG_DEL:
+ {
+ e2NodeRemovalItem = (E2nodeComponentConfigRemoval_Item_t*) e2NodeCfg;
+ interfaceType = &e2NodeRemovalItem->e2nodeComponentInterfaceType;
+ componentID = &e2NodeRemovalItem->e2nodeComponentID;
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : Configuration type %d does not supported ", configType);
+ return RFAILED;
+ }
+ }
+ /* E2nodeComponentInterfaceType */
+ *interfaceType = convertInterfaceToE2ComponentInterfaceType(e2NodeComponentInfo->interfaceType);
+
+ /* We now only support the F1 interface out of these interfaces
+ * (NG,XN,E1,F1,W1,S1,X2), therefore only the F1 component identifier was filled in. */
+
+ if(*interfaceType == F1)
+ {
+ /* E2 Node Component ID */
+ componentID->present = E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1;
+ DU_ALLOC(componentID->choice.e2nodeComponentInterfaceTypeF1,sizeof(E2nodeComponentInterfaceF1_t));
+ if(componentID->choice.e2nodeComponentInterfaceTypeF1 == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP: Memory allocation failed in function %s at line %d",__func__,__LINE__);
+ return RFAILED;
+ }
+ componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.size = sizeof(uint8_t);
+ DU_ALLOC(componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.buf,\
+ componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.size);
+
+ if(componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.buf == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP: Memory allocation failed in function %s at line %d",__func__,__LINE__);
+ return RFAILED;
+ }
+ memcpy(componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.buf, &e2NodeComponentInfo->componentId,\
+ componentID->choice.e2nodeComponentInterfaceTypeF1->gNB_DU_ID.size);
+ }
+
+ if(configType == CONFIG_DEL)
+ {
+ /* We don't need to fill out the E2 Node Component Request and Response
+ * information in the case of CONFIG_DEL, therefore returning ROK from here. */
+ return ROK;
+ }