+
+
+ /**
+ Interpret a xml file in order to create a memory xml document.
+ The xml file is based on this message DTD:
+
+ <pre>
+ <!ELEMENT message (avp*)>
+ <!ELEMENT avp (avp*)>
+
+ <!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-by-end-id CDATA #IMPLIED>
+ <!--
+ version: Diameter version. Sets '1' by default
+ name: Command name within working stack (dictionary identifier)
+
+ In order to get more coding capabilities, command code and flags could be established instead of former command name,
+ but neither of them are allowed if 'name' is provided (and vice versa):
+
+ code: Command code
+ flags: Command flags byte value (0-255) where standard bit set for flags is 'RPET rrrr': (R)equest, (P)roxiable, (E)rror, Potentially re-(T)ransmitted message and (r)eserved
+
+
+ application-id: Message application id
+ hop-by-hop-id: Message hop by hop id. Sets '0' by default
+ end-by-end-id: Message end by end id. Sets '0' by default
+ -->
+
+ <!ATTLIST avp name CDATA #IMPLIED code CDATA #IMPLIED vendor-code CDATA #IMPLIED flags CDATA #IMPLIED data CDATA #IMPLIED hex-data CDATA #IMPLIED>
+ <!--
+ name: Avp name within working stack (dictionary identifier)
+
+ In order to get more coding capabilities, avp code, vendor-id and flags could be established instead of former avp name,
+ but neither of them are allowed if 'name' is provided (and vice versa):
+
+ code: Avp code
+ vendor-code: Avp vendor code
+ flags: Avp flags byte value (0-255) where standard bit set for flags is 'VMPr rrrr': (V)endor-specific, (M)andatory, end to end encry(P)tion and r(eserved)
+
+
+ data: Natural string representation for avp data. Specially applicable with numbers and printable strings, but also
+ useful for certain formats which could be easily understandable in such friendly/smart representation. We will
+ achieve different human-readable strings depending on data format:
+
+ [ OctetString ] (if printable, but not recommended)
+ [ Integer32, Integer64, Unsigned32, Unsigned64, Float32, Float64 ] (normal number representation)
+ [ Time ] (NTP timestamp, normal number representation)
+ [ Address ] (auto detects IPv4 or IPv6 address version, then only ip address is specified: IPv4 with dots, IPv6 with colons)
+ [ UTF8String, DiameterIdentity, DiameterURI ] (printable)
+ [ IPFilterRule, QoSFilterRule ] (uses ASCII charset, printable)
+
+ New application formats must define specific natural representation for internal raw data
+
+ hex-data: Hexadecimal octet sequence representation (i.e. 'af012fb3', with even number of digits). Suitable for whatever kind
+ of diameter format, but mandatory for non printable information. OctetString usually transport non human-readable
+ data and should better be encoded within this field although being printable. Unknown avps (which fails identifying
+ provided name or code/vendor-code) must always use this representation.
+
+ Xml representation for decoded messages shows natural content except for 'OctetString' format and unknown avps. Anyway, when printable,
+ OctetString could show such information at data field apart from hex-data, because many implementations use this format to transport
+ readable-string data. In general, one of the data fields is mandatory except for 'Grouped' type (its data is another level of avps).
+ Application-specific formats must decide the way to represent its contents, being recommended to use a natural representation if possible,
+ because xml is read by humans with testing and monitoring purposes.
+ -->
+ </pre>
+
+ @param xmlDocument XML document allocated by the user of the function (anna::xml::DocumentMemory xmlDocument)
+ @param xmlPathFile Complete path file to the xml document which represents the diameter message
+ @see messageXmlDocumentFromXmlString
+
+ @warning Whatever you will do with the xml document, will be only valid inside the scope of such xml document.
+ For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using
+ the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
+ */
+ static void messageXmlDocumentFromXmlFile(anna::xml::DocumentFile &xmlDocument, const std::string & xmlPathFile) throw(anna::RuntimeException);
+
+ /**
+ Interpret xml string representation in order to create a memory xml document.
+ DTD validation is used in the same way that #messageXmlDocumentFromXmlFile does.
+
+ @param xmlDocument XML document allocated by the user of the function (anna::xml::DocumentMemory xmlDocument)
+ @param xmlString XML string representation of the diameter message
+ @see messageXmlDocumentFromXmlFile
+
+ @warning Whatever you will do with the xml document, will be only valid inside the scope of such xml document.
+ For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using
+ the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
+ */
+ static void messageXmlDocumentFromXmlString(anna::xml::DocumentFile &xmlDocument, const std::string &xmlString) throw(anna::RuntimeException);