+void anna::diameter::codec::functions::setPotentiallyReTransmittedMessageBit(const anna::DataBlock & db, bool activate) throw(anna::RuntimeException) {
+ if(db.getSize() < Message::HeaderLength) {
+ throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION);
+ }
+
+ char flags[1];
+ flags[0] = *(db.getData() + 4);
+ if(activate) flags[0] |= Message::TBitMask; else flags[0] &= (~Message::TBitMask);
+ memcpy((char *)(db.getData() + 4), flags, 1);
+}
+
+// XML parsers for diameter messages ///////////////////////////////////////////////////////////////////////////
+void anna::diameter::codec::functions::messageXmlDocumentFromXmlFile(anna::xml::DocumentFile &xmlDocument, const std::string & xmlPathFile) throw(anna::RuntimeException) {
+ LOGDEBUG(anna::Logger::debug(anna::functions::asString("Parsing diameter message from xml file '%s' into xml document", xmlPathFile.c_str()), ANNA_FILE_LOCATION));
+ xmlDocument.initialize(xmlPathFile.c_str()); // fail here is i/o error
+ const anna::xml::Node *rootNode = xmlDocument.parse(MessageDTDMemory); // Parsing: fail here if xml violates dtd
+ LOGDEBUG(
+ std::string trace = "Parsing OK from XML file '";
+ trace += xmlPathFile;
+ trace += "':\n";
+ trace += anna::xml::Compiler().apply(rootNode);
+ anna::Logger::debug(trace, ANNA_FILE_LOCATION);
+ );
+}