+ child = cur->xmlChildrenNode;
+ while(child != NULL)
+ {
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"MEASUREMENT_INFO")) && (child->ns == ns))
+ {
+ if(parseMeasurementInfo(doc, ns, child, &ricReportStyle->measurementInfoList) != ROK)
+ {
+ return RFAILED;
+ }
+ }
+ child = child -> next;
+ }
+ }
+
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill RAN function name parameters
+ *
+ * @details
+ *
+ * Function : parseRanFuncName
+ *
+ * Functionality: Fill RAN function name parmeters
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * Pointer to structure to be filled
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseRanFuncName(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunctionName *ranFunctionName)
+{
+ char *tempShortName;
+ char *tempServiceModelOid;
+ char *tempDiscription;
+
+ memset(ranFunctionName, 0, sizeof(RanFunctionName));
+
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SHORT_NAME")) && (cur->ns == ns))
+ {
+ tempShortName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ strcpy((char*)ranFunctionName->shortName, tempShortName);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEVICE_MODEL_OID")) && (cur->ns == ns))
+ {
+ tempServiceModelOid =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ strcpy((char*)ranFunctionName->serviceModelOID, tempServiceModelOid);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESCRIPTION")) && (cur->ns == ns))
+ {
+ tempDiscription =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ strcpy((char*)ranFunctionName->description, tempDiscription);
+ }
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill RAN function parameters
+ *
+ * @details
+ *
+ * Function : parseRanFunctionParams
+ *
+ * Functionality: Fill RAN function parmeters
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * Pointer to structure to be filled
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseRanFunctionParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunction *ranFunction)
+{
+ xmlNodePtr child = NULLP;
+ uint8_t eventTriggerStyleIdx=0, reportStyleIdx=0;
+
+ memset(ranFunction, 0, sizeof(RanFunction));
+
+ cur = cur->xmlChildrenNode;
+
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns))
+ {
+ ranFunction->id = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_NAME")) && (cur->ns == ns))
+ {
+ if(parseRanFuncName(doc, ns, cur, &ranFunction->name) != ROK)
+ {
+ return RFAILED;
+ }
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"REVISION_COUNTER")) && (cur->ns == ns))
+ {
+ ranFunction->revisionCounter = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED")) && (cur->ns == ns))
+ {
+ ranFunction->numOfEventTriggerStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE_LIST")) && (cur->ns == ns))
+ {
+ child = cur->xmlChildrenNode;
+ while(child != NULL)
+ {
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE")) && (child->ns == ns))
+ {
+ if(parseRicStyle(doc, ns, child,&ranFunction->eventTriggerStyleList[eventTriggerStyleIdx]) != ROK)
+ {
+ return RFAILED;
+ }
+ eventTriggerStyleIdx++;
+
+ }
+ child = child -> next;
+ }
+
+ }
+
+ child = NULLP;
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_REPORT_STYLE_SUPPORTED")) && (cur->ns == ns))
+ {
+ ranFunction->numOfReportStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"REPORT_STYLE_SUPPORTED_LIST")) && (cur->ns == ns))
+ {
+ child = cur->xmlChildrenNode;
+ while(child != NULL)
+ {
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"REPORT_STYLE")) && (child->ns == ns))
+ {
+ if(parseReportStyle(doc, ns, child,&ranFunction->reportStyleList[reportStyleIdx]) != ROK)
+ {
+ return RFAILED;
+ }
+ reportStyleIdx++;
+
+ }
+ child = child -> next;
+ }
+
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_HEADER_FORMAT")) && (cur->ns == ns))
+ {
+ ranFunction->ricIndicationHeaderFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_MESSAGE_FORMAT")) && (cur->ns == ns))
+ {
+ ranFunction->ricIndicationMessageFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill E2 config Parameters
+ *
+ * @details
+ *
+ * Function : parseE2ConfigParams
+ *
+ * Functionality: Fill E2 config Parmeters
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * Pointer to structure to be filled
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb *e2apDb)
+{
+ uint8_t tnlIdx=0,ranFuncIdx=0;
+ xmlNodePtr child = NULLP;
+
+ memset(e2apDb, 0, sizeof(E2apDb));
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_NODE_ID")) && (cur->ns == ns))
+ {
+ e2apDb->e2NodeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_TNL_ASSOC")) && (cur->ns == ns))
+ {
+ e2apDb->numOfTNLAssoc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"TNL_ASSOC_LIST")) && (cur->ns == ns))
+ {
+ child = cur->xmlChildrenNode;
+ while(child != NULL)
+ {
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"TNL_ASSOC")) && (child->ns == ns))
+ {
+ if(parseTnlAssoc(doc, ns, child,&e2apDb->tnlAssoc[tnlIdx]) != ROK)
+ {
+ return RFAILED;
+ }
+ tnlIdx++;
+
+ }
+ child = child -> next;
+ }
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_RAN_FUNCTION")) && (cur->ns == ns))
+ {
+ e2apDb->numOfRanFunction = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_LIST")) && (cur->ns == ns))
+ {
+ child = cur->xmlChildrenNode;
+ while(child != NULL)
+ {
+ if ((!xmlStrcmp(child->name, (const xmlChar *)"RAN_FUNCTION")) && (child->ns == ns))
+ {
+ if(parseRanFunctionParams(doc, ns, child,&e2apDb->ranFunction[ranFuncIdx]) != ROK)
+ {
+ return RFAILED;
+ }
+ cmLListInit(&e2apDb->ranFunction[ranFuncIdx].subscriptionList);
+ ranFuncIdx++;
+
+ }
+ child = child -> next;
+ }
+ }
+
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill Global config Parameters
+ *
+ * @details
+ *
+ * Function : parseGlobalConfigParams
+ *
+ * Functionality: Fill Global config Parmeters
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * Pointer to structure to be filled
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseGlobalConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
+{
+
+ memset(&gConfigInfo, 0, sizeof(GConfiguration));
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RADIO_FRAME_DURATION")) && (cur->ns == ns))
+ {
+ gConfigInfo.gRadioFrameDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns))
+ {
+ gConfigInfo.gUeThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns))
+ {
+ gConfigInfo.gSnssaiThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_DL")) && (cur->ns == ns))
+ {
+ gConfigInfo.gPhyDeltaDl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_UL")) && (cur->ns == ns))
+ {
+ gConfigInfo.gPhyDeltaUl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Free the memory allocate for slice supported list
+ *
+ * @details
+ *
+ * Function : parseDuCfgParams
+ *
+ * Functionality: Free the memory allocate for slice supported list
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeSliceSuppLst(SupportedSliceList *sliceSuppLst)
+{
+ uint8_t sliceIdx=0;
+
+ if(sliceSuppLst->numSupportedSlices&&sliceSuppLst->snssai)
+ {
+ for(sliceIdx=0;sliceIdx<sliceSuppLst->numSupportedSlices;sliceIdx++)
+ {
+ if(sliceSuppLst->snssai)
+ {
+ if(sliceSuppLst->snssai[sliceIdx])
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, sliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+ sliceSuppLst->snssai, (sliceSuppLst->numSupportedSlices) * sizeof(Snssai*));
+ }
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Free the memory allocate in parseDuCfgParams
+ *
+ * @details
+ *
+ * Function : parseDuCfgParams
+ *
+ * Functionality: Free the memory allocate in parseDuCfgParams
+ *
+ * @return void
+ *
+ * ****************************************************************/
+void freeDuCfgParams()
+{
+ uint8_t ranFuncIdx=0,reportStyleIdx=0;
+ uint8_t policyIdx = 0,memIdx=0;
+ MacSliceRrmPolicy *rrmPolicy =NULLP;
+ MacSliceCfgReq *macSliceCfgReq=NULLP;
+ F1DuSysInfo *sysInfo;
+ CsiRsCfg *csiRsCfg;
+ RanFunction *ranFunction;
+ RicReportStyle *ricReportStyle;
+ CmLListCp *measurementInfoList;
+ CmLList *measInfoNode = NULLP;
+
+ if(duCfgParam.duName)
+ {
+ DU_FREE(duCfgParam.duName, strlen(duCfgParam.duName));
+ }
+
+ freeSliceSuppLst(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].suppSliceList);
+ csiRsCfg=&duCfgParam.macCellCfg.csiRsCfg;
+ if(csiRsCfg->csiFreqDomainAlloc)
+ {
+ DU_FREE(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t));
+ }
+ if(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu)
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+ duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen);
+ }
+
+ if(duCb.e2apDb.numOfRanFunction)
+ {
+ for(ranFuncIdx=0;ranFuncIdx<duCb.e2apDb.numOfRanFunction;ranFuncIdx++)
+ {
+ ranFunction=&duCb.e2apDb.ranFunction[ranFuncIdx];
+ for(reportStyleIdx=0;reportStyleIdx<ranFunction->numOfReportStyleSupported;reportStyleIdx++)
+ {
+ ricReportStyle=&ranFunction->reportStyleList[reportStyleIdx];
+ measurementInfoList=&ricReportStyle->measurementInfoList;
+ CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode);
+ while(measInfoNode)
+ {
+ MeasurementInfoForAction *measurementInfoForAction;
+ measurementInfoForAction= (MeasurementInfoForAction*)measInfoNode->node;
+ cmLListDelFrm(measurementInfoList, measInfoNode);
+ DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
+ DU_FREE(measInfoNode, sizeof(CmLList));
+ CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode);
+ }
+ }
+ }
+ }
+
+ freeSliceSuppLst(&duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst);
+ sysInfo=&duCfgParam.srvdCellLst[0].duSysInfo;
+ if(sysInfo->mibMsg)
+ {
+ DU_FREE(sysInfo->mibMsg, sysInfo->mibLen);
+ }
+ if(sysInfo->sib1Msg)
+ {
+ DU_FREE(sysInfo->sib1Msg, sysInfo->sib1Len);
+ }
+
+ macSliceCfgReq=&duCfgParam.tempSliceCfg;
+ if(macSliceCfgReq->listOfRrmPolicy)
+ {
+ for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
+ {
+ if (macSliceCfgReq->listOfRrmPolicy[policyIdx])
+ {
+ rrmPolicy=macSliceCfgReq->listOfRrmPolicy[policyIdx];
+ if(rrmPolicy->rRMPolicyMemberList)
+ {
+ for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
+ {
+ if (rrmPolicy->rRMPolicyMemberList[memIdx])
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\
+ rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList));
+ }
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,rrmPolicy->rRMPolicyMemberList,\
+ rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
+ }
+
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+ macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
+ }
+ }
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
+ macSliceCfgReq->listOfRrmPolicy, macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
+ }
+}
+
+
+/*******************************************************************
+ *
+ * @brief Fill DU Config Parmeters
+ *
+ * @details
+ *
+ * Function : parseDuCfgParams
+ *
+ * Functionality:
+ *
+ * @params[in] XML document pointer
+ * XML namespace
+ * Current node in XML
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
+{
+ uint8_t ret=ROK;
+ char *tempDuName = "";
+ char *duIpV4Addr;
+ char *cuIpV4Addr;
+ char *ricIpV4Addr;
+ CmInetIpAddr duIp;
+ CmInetIpAddr cuIp;
+ CmInetIpAddr ricIp;
+
+ cur = cur->xmlChildrenNode;
+ while(cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
+ {
+ if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
+ {
+ ret = RFAILED;
+ break;
+ }
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns))
+ {
+ duCb.gnbId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_ID")) && (cur->ns == ns))
+ {
+ duCfgParam.duId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_NAME")) && (cur->ns == ns))
+ {
+ tempDuName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ DU_ALLOC(duCfgParam.duName, strlen(tempDuName));
+ if(!duCfgParam.duName)
+ {
+ DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
+ ret = RFAILED;
+ break;
+ }
+ strcpy((char*)duCfgParam.duName, tempDuName);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns))
+ {
+ duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+#ifdef O1_ENABLE