+/*******************************************************************
+ *
+ * @brief Fill ric style parmeters
+ *
+ * @details
+ *
+ * Function : parseRicStyle
+ *
+ * Functionality: Fill ric style 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 parseRicStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicStyle *ricStyle)
+{
+ char *tempName;
+ memset(ricStyle, 0, sizeof(RicStyle));
+
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE_TYPE")) && (cur->ns == ns))
+ {
+ ricStyle->styleType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns))
+ {
+ tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ strcpy((char*)ricStyle->name, tempName);
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORMAT_TYPE")) && (cur->ns == ns))
+ {
+ ricStyle->formatType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+ cur = cur -> next;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill measurement info parameters
+ *
+ * @details
+ *
+ * Function : parseMeasurementInfo
+ *
+ * Functionality: Fill measurement info 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 parseMeasurementInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmLListCp *measurementInfoList)
+{
+ CmLList *node;
+ char *tempName;
+ MeasurementInfoForAction *measurementInfoForAction;
+
+ DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
+ if(!measurementInfoForAction)
+ {
+ return RFAILED;
+ }
+
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns))
+ {
+ measurementInfoForAction->measurementTypeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns))
+ {
+ tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ strcpy((char*)measurementInfoForAction->measurementTypeName, tempName);
+ }
+
+ cur = cur -> next;
+ }
+
+ DU_ALLOC(node, sizeof(CmLList));
+ if(node)
+ {
+ node->node = (PTR) measurementInfoForAction;
+ cmLListAdd2Tail(measurementInfoList, node);
+ }
+ else
+ {
+ DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill report style parameters
+ *
+ * @details
+ *
+ * Function : parseReportStyle
+ *
+ * Functionality: Fill report style 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 parseReportStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicReportStyle *ricReportStyle)
+{
+ xmlNodePtr child = NULLP;
+ uint8_t numOfMeasurementInfo=0;
+ memset(ricReportStyle, 0, sizeof(RicReportStyle));
+
+ cur = cur->xmlChildrenNode;
+ while (cur != NULL)
+ {
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_STYLE")) && (cur->ns == ns))
+ {
+ if(parseRicStyle(doc, ns, cur, &ricReportStyle->reportStyle) != ROK)
+ {
+ return RFAILED;
+ }
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_MEASUREMENT_INFO")) && (cur->ns == ns))
+ {
+ numOfMeasurementInfo = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
+ }
+
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"MEASUREMENT_INFO_LIST")) && (cur->ns == ns))
+ {
+ 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;
+}
+