Improvements from anna fork
[anna.git] / example / diameter / launcher / Launcher.cpp
index e69de29..2175263 100644 (file)
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
+
+
+// Standard
+#include <sstream>      // std::istringstream
+#include <iostream>     // std::cout
+#include <math.h> // ceil
+#include <climits>
+#include <unistd.h> // chdir
+//#include <regex> TODO: use this from gcc4.9.0: http://stackoverflow.com/questions/8060025/is-this-c11-regex-error-me-or-the-compiler
+#include <stdio.h>
+
+// Project
+#include <anna/timex/Engine.hpp>
+#include <anna/statistics/Engine.hpp>
+#include <anna/diameter/codec/functions.hpp>
+#include <anna/diameter/codec/Engine.hpp>
+#include <anna/diameter/codec/EngineManager.hpp>
+#include <anna/http/Transport.hpp>
+#include <anna/diameter/stack/Engine.hpp>
+#include <anna/diameter/helpers/base/functions.hpp>
+#include <anna/time/functions.hpp>
+#include <anna/diameter.comm/ApplicationMessageOamModule.hpp>
+#include <anna/testing/defines.hpp>
+#include <anna/xml/xml.hpp>
+#include <anna/diameter.comm/OriginHost.hpp>
+#include <anna/diameter.comm/OriginHostManager.hpp>
+#include <Procedure.hpp>
+
+// Process
+#include <Launcher.hpp>
+#include <MyDiameterEngine.hpp>
+#include <anna/testing/TestManager.hpp>
+#include <anna/testing/TestCase.hpp>
+
+
+#define SIGUSR2_TASKS_INPUT_FILENAME "sigusr2.in"
+#define SIGUSR2_TASKS_OUTPUT_FILENAME "sigusr2.out"
+
+
+const char *ServicesDTD = "\
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
+<!-- Diameter services DTD -->\n\
+\n\
+<!ELEMENT services (stack*, node*)>\n\
+\n\
+<!ELEMENT stack EMPTY>\n\
+<!ATTLIST stack id CDATA #REQUIRED dictionary CDATA #REQUIRED validationMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED validationDepth (Complete | FirstError) #IMPLIED fixMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED ignoreFlagsOnValidation (yes | no) #IMPLIED>\n\
+<!--\n\
+   Stack record\n\
+\n\
+    id:                      Normally the id corresponds to the Application-Id for which the dictionary provided is designed\n\
+                             (in multistack applications, it shall be mandatory respect such association to know the stack used\n\
+                             for processed messages).\n\
+    dictionary:              Path to the dictionary file.\n\
+    validationMode:          Sets the validation mode. Default is 'AfterDecoding'.\n\
+    validationDepth:         Sets the validation depth. Default is 'FirstError'.\n\
+    fixMode:                 Sets the fix mode. Default is 'BeforeEncoding'.\n\
+    ignoreFlagsOnValidation: Ignore flags during message validation. Default is 'no'.\n\
+-->\n\
+\n\
+<!ELEMENT node EMPTY>\n\
+<!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED originRealm CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED cea CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>\n\
+<!--\n\
+   Node record\n\
+\n\
+   originHost:                              Node identifier as diameter application host name.\n\
+   applicationId:                           The Application-Id provided must exists as a registered 'stack id'.\n\
+   originRealm:                             Origin-Realm (domain-name internally used by default).\n\
+\n\
+\n\
+   - Diameter clients:\n\
+\n\
+   entity:                                  Target diameter entity (comma-separated '<address>:<port>' format).\n\
+                                            For example: 10.20.30.40:3868,10.20.30.41:3868. If missing, no entity will be enabled.\n\
+   entityServerSessions:                    Diameter entity server sessions (0: diameter entity disabled). Default value of 1.\n\
+   cer:                                     User defined CER path file to be encoded to establish diameter connections.\n\
+                                            If missing, will be harcoded.\n\
+   dwr:                                     User defined DWR path file to be encoded for diameter protocol keep alive.\n\
+                                            If missing, will be harcoded.\n\
+   tcpConnectDelay:                         Milliseconds to wait TCP connect to any server. If missing, default value of 200 will\n\
+                                            be assigned\n\
+   ceaTimeout:                              Milliseconds to wait CEA from diameter server. If missing, default value of 'answersTimeout'\n\
+                                            will be assigned.\n\
+   watchdogPeriod:                          Milliseconds for watchdog timer (Tw) for diameter keep-alive procedure. If missing, default\n\
+                                            value of 30000 will be assigned.\n\
+   balance:                                 Balance over entity servers instead of doing standard behaviour (first primary, secondary\n\
+                                            if fails, etc.). Default value 'no'.\n\
+   sessionBasedModelsClientSocketSelection: By default, round-robin will be applied for IEC model (SMS/MMS), and Session-Id Low Part\n\
+                                            will be analyzed for ECUR/SCUR model (data, voice and content). You could change ECUR/SCUR\n\
+                                            analysis behaviour providing 'SessionIdHighPart', 'SessionIdOptionalPart' (atoi applied;\n\
+                                            usually subscriber id data, i.e. MSISDN or IMSI) and 'RoundRobin' (also 'SessionIdLowPart').\n\
+\n\
+\n\
+   - Diameter servers:\n\
+\n\
+   diameterServer:                          Diameter own server address in '<address>:<port>' format. For example: 10.20.30.40:3868.\n\
+                                            If missing, no local server will be enabled.\n\
+   diameterServerSessions:                  Diameter own server available connections (0: diameter server disabled). Default value of 1.\n\
+                                            Negative value implies no limit accepting incoming connections.\n\
+   cea:                                     User defined CEA path file to be encoded to answer client CERs.\n\
+                                            If missing, will be harcoded.\n\
+   allowedInactivityTime:                   Milliseconds for the maximum allowed inactivity time on server sessions born over the\n\
+                                            local server before being reset. If missing, default value of 90000 will be assigned.\n\
+\n\
+\n\
+   - General:\n\
+\n\
+   answersTimeout:                          Milliseconds to wait pending application answers from diameter peers. If missing,\n\
+                                            default value of 10000 will be assigned.\n\
+   retries:                                 Expired responses will cause a number of request retransmissions. Disabled by default (0 retries).\n\
+   log:                                     Process log file (operations result, traffic log, etc.). By default '<originHost>.launcher.log'.\n\
+                                            Empty string or \"null\" name, to disable. Warning: there is no rotation for log files\n\
+                                            (use logrotate or whatever you consider).\n\
+   splitLog:                                Splits log file (appends to log filename, extensions with the type of event: see help on\n\
+                                            startup information-level traces). No log files for code/decode and load operations are created.\n\
+                                            Default value 'no'.\n\
+   detailedLog:                             Insert detailed information at log files (timestamps, communication resources, etc.). Useful\n\
+                                            to analyze the messages flow along the sockets (specially on 'balance' mode). Default 'no'.\n\
+   dumpLog:                                 Write to disk every incoming/outcoming message named as:\n\
+                                               '<unix ms timestamp>.<originHost>.<hop by hop>.<end to end>.<message code>.<request|answer>.<type of event>.xml'\n\
+                                            Default value 'no'.\n\
+   burstLog:                                Burst operations log file. By default '<originHost>.launcher.burst'. Empty string or \"null\" name, to disable.\n\
+                                            Warning: there is no rotation for log files (use logrotate or whatever). Output: dot (.) for each\n\
+                                            burst message sent/pushed, cross (x) for popped ones, and order number when multiple of 1% of burst\n\
+                                            list size, plus OTA requests when changed.\n\
+\n\
+-->\n\
+\n\
+";
+
+
+Launcher::Launcher() : anna::comm::Application("launcher", "DiameterLauncher", "1.1"), a_communicator(NULL) {
+  a_timeEngine = NULL;
+  a_counterRecorder = NULL;
+  a_admlMinResolution = 2 * anna::timex::Engine::minResolution; // 2*10 = 20 ms; 1000/20 = 50 ticks per second;
+  //a_admlMinResolution = (anna::Millisecond)100;
+  a_counterRecorderClock = NULL;
+
+  a_workingNode = NULL;
+
+  a_httpServerSocket = NULL;
+}
+
+
+std::string Launcher::getSignalUSR2InputFile() const throw() {
+  return (a_initialWorkingDirectory + "/" + SIGUSR2_TASKS_INPUT_FILENAME);
+}
+
+std::string Launcher::getSignalUSR2OutputFile() const throw() {
+  return (a_initialWorkingDirectory + "/" + SIGUSR2_TASKS_OUTPUT_FILENAME);
+}
+
+
+void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOperation) throw(anna::RuntimeException) {
+
+  CommandLine& cl(anna::CommandLine::instantiate());
+  bool allLogsDisabled = cl.exists("disableLogs");
+
+    //<!ATTLIST stack id CDATA #REQUIRED dictionary CDATA #REQUIRED>
+  const anna::xml::Attribute *id, *dictionary;
+
+  // <!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>
+  const anna::xml::Attribute *originHost, *appId, *originRealm, *cer, *dwr, *cea, *allowedInactivityTime, *tcpConnectDelay,
+  *answersTimeout, *ceaTimeout, *watchdogPeriod, *entity, *entityServerSessions,
+  *diameterServer, *diameterServerSessions, *balance, *sessionBasedModelsClientSocketSelection,
+  *retries, *log, *splitLog, *detailedLog, *dumpLog, *burstLog;
+  // Never clear services content from here (append new data from xml). At the moment no node removing is implemented in this process
+
+  // Stacks
+  anna::diameter::stack::Engine &stackEngine = anna::diameter::stack::Engine::instantiate();
+  anna::diameter::stack::Dictionary *d;
+  const anna::diameter::stack::Dictionary *bpd = NULL; // base protocol dictionary
+
+  // Codec engine manager:
+  anna::diameter::codec::EngineManager &em = anna::diameter::codec::EngineManager::instantiate();
+  anna::diameter::codec::Engine *ce;
+
+  ///////////////////////////////////////////
+  // APPLICATION MESSAGE OAM MODULE SCOPES //
+  ///////////////////////////////////////////
+  // We will register a scope per stack id registered. The counters will be dynamically registered at count method.
+  anna::diameter::comm::ApplicationMessageOamModule & appMsgOamModule = anna::diameter::comm::ApplicationMessageOamModule::instantiate();
+  appMsgOamModule.enableCounters(); // this special module is disabled by default (the only)
+  static int scope_id = 3;
+  unsigned int id_value;
+  std::string codecEngineName;
+
+  for(anna::xml::Node::const_child_iterator it = servicesNode->child_begin(); it != servicesNode->child_end(); it++) {
+    std::string nodeName = (*it)->getName();
+
+    if(nodeName == "stack") {
+      // Input data:
+      id = (*it)->getAttribute("id");
+      dictionary = (*it)->getAttribute("dictionary");
+      id_value = id->getIntegerValue();
+
+      if (stackEngine.getDictionary(id_value)) { // Ignore (but don't fail) dictionary load with same stack id already registered
+        LOGWARNING(anna::Logger::warning(anna::functions::asString("Ignore dictionary load for stack id already registered: %llu", id_value), ANNA_FILE_LOCATION));
+        continue;
+      }
+
+      try {
+        d = stackEngine.createDictionary(id_value, dictionary->getValue());
+        LOGDEBUG(anna::Logger::debug(anna::functions::asString("Created dictionary (%p) for stack id %llu", d, id_value), ANNA_FILE_LOCATION));
+
+        // OAM module for counters:
+        appMsgOamModule.createStackCounterScope(scope_id, id_value /* application-id */);
+        scope_id++;
+
+      } catch(anna::RuntimeException &ex) {
+        //_exit(ex.asString());
+        throw ex;
+      }
+
+      bpd = d; // base protocol dictionary in case of monostack. If multistack, will be calculated later
+
+      // Create codec engine and register it in the codec engine manager:
+      codecEngineName = anna::functions::asString("CodecEngineForStackId_%llu", id_value);
+      ce = new anna::diameter::codec::Engine(codecEngineName.c_str(), d);
+      em.registerCodecEngine(id_value, ce);
+
+      // Codec engine configuration:
+      const anna::xml::Attribute *vm_attr = (*it)->getAttribute("validationMode", false /* no exception */);
+      const anna::xml::Attribute *vd_attr = (*it)->getAttribute("validationDepth", false /* no exception */);
+      const anna::xml::Attribute *fm_attr = (*it)->getAttribute("fixMode", false /* no exception */);
+      const anna::xml::Attribute *if_attr = (*it)->getAttribute("ignoreFlagsOnValidation", false /* no exception */);
+
+      std::string vm_value = vm_attr ? vm_attr->getValue() : "AfterDecoding";
+      std::string vd_value = vd_attr ? vd_attr->getValue() : "FirstError";
+      std::string fm_value = fm_attr ? fm_attr->getValue() : "BeforeEncoding";
+
+      anna::diameter::codec::Engine::ValidationMode::_v vm;
+      if (vm_value == "BeforeEncoding") vm = anna::diameter::codec::Engine::ValidationMode::BeforeEncoding;
+      else if (vm_value == "AfterDecoding") vm = anna::diameter::codec::Engine::ValidationMode::AfterDecoding;
+      else if (vm_value == "Always") vm = anna::diameter::codec::Engine::ValidationMode::Always;
+      else if (vm_value == "Never") vm = anna::diameter::codec::Engine::ValidationMode::Never;
+      ce->setValidationMode(vm);
+
+      anna::diameter::codec::Engine::ValidationDepth::_v vd;
+      if (vd_value == "Complete") vd = anna::diameter::codec::Engine::ValidationDepth::Complete;
+      else if (vd_value == "FirstError") vd = anna::diameter::codec::Engine::ValidationDepth::FirstError;
+      ce->setValidationDepth(vd);
+
+      anna::diameter::codec::Engine::FixMode::_v fm;
+      if (fm_value == "BeforeEncoding") fm = anna::diameter::codec::Engine::FixMode::BeforeEncoding;
+      else if (fm_value == "AfterDecoding") fm = anna::diameter::codec::Engine::FixMode::AfterDecoding;
+      else if (fm_value == "Always") fm = anna::diameter::codec::Engine::FixMode::Always;
+      else if (fm_value == "Never") fm = anna::diameter::codec::Engine::FixMode::Never;
+      ce->setFixMode(fm);
+
+      bool if_value = (if_attr ? (if_attr->getValue() == "yes") : false);
+      ce->ignoreFlagsOnValidation(if_value);
+    }
+  }
+
+  // Show loaded stacks:
+  std::cout << "Stacks currently loaded:" << std::endl;
+  std::cout << anna::functions::tab(stackEngine.asString(false /* light */)) << std::endl;
+
+  // Basic checking for multistack:
+  bool multistack = (stackEngine.stack_size() > 1);
+  if (multistack) {
+    bpd = stackEngine.getDictionary(0);
+    if(!bpd)
+      throw anna::RuntimeException("In multistack applications is mandatory register a stack id = 0 using a dictionary which contains the needed elements to build base protocol messages (CER/A, DWR/A, DPR/A, STR/A, etc.)", ANNA_FILE_LOCATION);
+  }
+
+  // REALMS:
+  for(anna::xml::Node::const_child_iterator it = servicesNode->child_begin(); it != servicesNode->child_end(); it++) {
+    std::string nodeName = (*it)->getName();
+
+    if(nodeName == "node") {
+      // Input data:
+      originHost = (*it)->getAttribute("originHost");
+      appId = (*it)->getAttribute("applicationId");
+      originRealm = (*it)->getAttribute("originRealm", false /* no exception */);
+      cer = (*it)->getAttribute("cer", false /* no exception */);
+      dwr = (*it)->getAttribute("dwr", false /* no exception */);
+      cea = (*it)->getAttribute("cea", false /* no exception */);
+      allowedInactivityTime = (*it)->getAttribute("allowedInactivityTime", false /* no exception */);
+      tcpConnectDelay = (*it)->getAttribute("tcpConnectDelay", false /* no exception */);
+      answersTimeout = (*it)->getAttribute("answersTimeout", false /* no exception */);
+      ceaTimeout = (*it)->getAttribute("ceaTimeout", false /* no exception */);
+      watchdogPeriod = (*it)->getAttribute("watchdogPeriod", false /* no exception */);
+      entity = (*it)->getAttribute("entity", false /* no exception */);
+      entityServerSessions = (*it)->getAttribute("entityServerSessions", false /* no exception */);
+      diameterServer = (*it)->getAttribute("diameterServer", false /* no exception */);
+      diameterServerSessions = (*it)->getAttribute("diameterServerSessions", false /* no exception */);
+      balance = (*it)->getAttribute("balance", false /* no exception */); // (yes | no)
+      sessionBasedModelsClientSocketSelection = (*it)->getAttribute("sessionBasedModelsClientSocketSelection", false /* no exception */); // (SessionIdHighPart | SessionIdOptionalPart | RoundRobin)
+      retries = (*it)->getAttribute("retries", false /* no exception */);
+      log = (*it)->getAttribute("log", false /* no exception */);
+      splitLog = (*it)->getAttribute("splitLog", false /* no exception */); // (yes | no)
+      detailedLog = (*it)->getAttribute("detailedLog", false /* no exception */); // (yes | no)
+      dumpLog = (*it)->getAttribute("dumpLog", false /* no exception */); // (yes | no)
+      burstLog = (*it)->getAttribute("burstLog", false /* no exception */); // (yes | no)
+
+      // Basic checkings:
+      anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+      anna::diameter::comm::OriginHost *oh = ohm.getOriginHost(originHost->getValue());
+      if (oh) {
+        std::string msg = "Already registered such Origin-Host: "; msg += originHost->getValue();
+        throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
+      }
+
+      unsigned int applicationId = appId->getIntegerValue();
+      if (!stackEngine.getDictionary(applicationId)) {
+        std::string msg = "Cannot found a registered stack id with the value of applicationId provided: "; msg += appId->getValue();
+        throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
+      }
+
+      // Engine time measures checking & assignment:
+      anna::Millisecond allowedInactivityTimeMs(90000);
+      anna::Millisecond tcpConnectDelayMs(200);
+      anna::Millisecond answersTimeoutMs(10000);
+      anna::Millisecond ceaTimeoutMs(10000);
+      anna::Millisecond watchdogPeriodMs(30000);
+
+      if (allowedInactivityTime) allowedInactivityTimeMs = checkTimeMeasure("allowedInactivityTime", allowedInactivityTime->getValue());
+      if (tcpConnectDelay)       tcpConnectDelayMs =       checkTimeMeasure("tcpConnectDelay",       tcpConnectDelay->getValue());
+      if (answersTimeout)        answersTimeoutMs =        checkTimeMeasure("answersTimeout",        answersTimeout->getValue());
+      if (ceaTimeout)            ceaTimeoutMs =            checkTimeMeasure("ceaTimeout",            ceaTimeout->getValue());
+      if (watchdogPeriod)        watchdogPeriodMs =        checkTimeMeasure("watchdogPeriod",        watchdogPeriod->getValue());
+
+      // Checking command line parameters
+      std::string sessionBasedModelsType;
+      anna::diameter::comm::Entity::SessionBasedModelsType::_v sessionBasedModelsTypeEnum;
+      if(sessionBasedModelsClientSocketSelection) {
+        sessionBasedModelsType = sessionBasedModelsClientSocketSelection->getValue();
+       if (sessionBasedModelsType == "RoundRobin") {
+          sessionBasedModelsTypeEnum = anna::diameter::comm::Entity::SessionBasedModelsType::RoundRobin;
+       }
+       else if (sessionBasedModelsType == "SessionIdOptionalPart") {
+          sessionBasedModelsTypeEnum = anna::diameter::comm::Entity::SessionBasedModelsType::SessionIdOptionalPart;
+       }
+       else if (sessionBasedModelsType == "SessionIdHighPart") {
+          sessionBasedModelsTypeEnum = anna::diameter::comm::Entity::SessionBasedModelsType::SessionIdHighPart;
+       }
+       else if (sessionBasedModelsType == "SessionIdLowPart") {
+          sessionBasedModelsTypeEnum = anna::diameter::comm::Entity::SessionBasedModelsType::SessionIdLowPart;
+       }
+       else {
+          throw anna::RuntimeException("Parameter 'sessionBasedModelsClientSocketSelection' only accepts 'SessionIdLowPart'/'SessionIdHighPart'/'SessionIdOptionalPart'/'RoundRobin' as parameter values", ANNA_FILE_LOCATION);
+       }
+      }
+
+      int retransmissions = retries ? retries->getIntegerValue() : 0;
+      if(retransmissions < 0) {
+        throw anna::RuntimeException("Parameter 'retries' must be non-negative", ANNA_FILE_LOCATION);
+      }
+
+      /////////////////////////////////////////////////////////////////////////////////////////////
+      // Diameter communication engine:
+      std::string commEngineName = originHost->getValue() + "_DiameterCommEngine";
+      MyDiameterEngine *commEngine = new MyDiameterEngine(commEngineName.c_str(), bpd);
+      commEngine->setAutoBind(false);  // allow to create client-sessions without binding them, in order to set timeouts.
+      commEngine->setMaxConnectionDelay(tcpConnectDelayMs);
+      commEngine->setWatchdogPeriod(watchdogPeriodMs);
+      commEngine->setOriginHostName(originHost->getValue());
+      if (originRealm) commEngine->setOriginRealmName(originRealm->getValue());
+
+      // Origin host node:
+      a_workingNode = new anna::diameter::comm::OriginHost((anna::diameter::comm::Engine*)commEngine, applicationId);
+      a_workingNode->setRequestRetransmissions(retransmissions);
+      /////////////////////////////////////////////////////////////////////////////////////////////
+
+
+      // Diameter entity:
+      if(entity) {
+        int sessions = entityServerSessions ? entityServerSessions->getIntegerValue() : 1;
+
+        if(sessions > 0) {
+          // Number of sessions:
+          commEngine->setNumberOfClientSessionsPerServer(sessions);
+
+          // Client CER and DWR
+          std::string cerPathfile = cer ? cer->getValue() : "";
+          std::string dwrPathfile = dwr ? dwr->getValue() : "";
+          commEngine->setClientCERandDWR(cerPathfile, dwrPathfile);
+
+          // Register one entity for this engine:
+          a_workingNode->createEntity(entity->getValue(), ceaTimeoutMs, answersTimeoutMs);
+          a_workingNode->getEntity()->setSessionBasedModelsType(sessionBasedModelsTypeEnum);
+          a_workingNode->getEntity()->setBalance(balance ? (balance->getValue() == "yes") : false); // for sendings
+          if (eventOperation) a_workingNode->getEntity()->bind();
+        }
+      }
+
+      // Diameter Server:
+      if(diameterServer) {
+        // Server CEA
+        std::string ceaPathfile = cea ? cea->getValue() : "";
+
+        int sessions = diameterServerSessions ? diameterServerSessions->getIntegerValue() : 1;
+        a_workingNode->createDiameterServer(diameterServer->getValue(), sessions, allowedInactivityTimeMs, answersTimeoutMs, ceaPathfile);
+      }
+
+      // Logs:
+      if (!allLogsDisabled) {
+        std::string host = commEngine->getOriginHostName();
+        std::string s_log = host + ".launcher.log"; if (log) s_log = log->getValue();
+        bool b_splitLog = (splitLog ? (splitLog->getValue() == "yes") : false);
+        bool b_detailedLog = (detailedLog ? (detailedLog->getValue() == "yes") : false);
+        bool b_dumpLog = (dumpLog ? (dumpLog->getValue() == "yes") : false);
+        std::string s_burstLog = host + ".launcher.burst"; if (burstLog) s_burstLog = burstLog->getValue();
+        a_workingNode->setLogs(s_log, b_splitLog, b_detailedLog, b_dumpLog, s_burstLog);
+      }
+
+
+      // Lazy initialization for comm engine:
+      if (eventOperation) commEngine->lazyInitialize();
+
+      // Node and Codec Engine registration ///////////////////////////////////////////////////////
+      ohm.registerOriginHost(originHost->getValue(), a_workingNode);
+      /////////////////////////////////////////////////////////////////////////////////////////////
+    }
+  }
+
+  if (!uniqueOriginHost())
+    a_workingNode = NULL; // by default, mode auto
+
+  // Diameter comm engines which are loaded after application start (via management operation 'services') are not really started,
+  //  but this don't care because application startComponents() -> initialize() -> do_initialize() -> do nothing.
+  // And when stopped, running state is not checked and it will be stopped anyway.
+}
+
+
+void Launcher::loadServices(const std::string & xmlPathFile, bool eventOperation) throw(anna::RuntimeException) {
+
+  if (xmlPathFile == "null" || xmlPathFile == "") {
+    LOGWARNING(anna::Logger::warning("Ignoring services configuration on start: empty or 'null' string provided as xml file. Use management interface (operation 'services') in order to add services", ANNA_FILE_LOCATION));
+    return;
+  }
+
+  LOGDEBUG(
+      std::string trace = "Loading ADML services file '";
+  trace += xmlPathFile;
+  trace += "'";
+  anna::Logger::debug(trace, ANNA_FILE_LOCATION);
+  );
+  anna::xml::DocumentFile xmlDocument; // has private copy constructor defined but not implemented to avoid inhenrit/copy (is very heavy)
+  anna::xml::DTDMemory xmlDTD;
+  const anna::xml::Node *rootNode;
+  xmlDocument.initialize(xmlPathFile.c_str()); // fail here is i/o error
+  xmlDTD.initialize(ServicesDTD);
+  try {
+    rootNode = xmlDocument.parse(xmlDTD); // Parsing: fail here if xml violates dtd
+  }
+  catch (anna::RuntimeException &ex) {
+    LOGWARNING(
+        std::string msg = "Services DTD schema:\n\n";
+    msg += ServicesDTD;
+    anna::Logger::warning(msg, ANNA_FILE_LOCATION);
+    );
+    throw ex;
+  }
+
+  LOGDEBUG(
+      std::string trace = "Loaded XML file (";
+  trace += xmlPathFile;
+  trace += "):\n";
+  trace += anna::xml::Compiler().apply(rootNode);
+  anna::Logger::debug(trace, ANNA_FILE_LOCATION);
+  );
+  servicesFromXML(rootNode, eventOperation);
+}
+
+
+anna::Millisecond Launcher::checkTimeMeasure(const std::string &parameter, const std::string &value) throw(anna::RuntimeException) {
+
+  if(anna::functions::isLike("^[0-9]+$", value)) {  // para incluir numeros decimales: ^[0-9]+(.[0-9]+)?$
+    int msecs;
+    std::istringstream ( value ) >> msecs;
+
+    if(msecs > a_timeEngine->getMaxTimeout()) { // 600000 ms
+      std::string msg = "Configuration value for '";
+      msg += parameter;
+      msg += "' ("; msg += value; msg += " msecs) is greater than allowed max timeout for timming engine: ";
+      msg += anna::functions::asString(a_timeEngine->getMaxTimeout());
+      throw RuntimeException(msg, ANNA_FILE_LOCATION);
+    }
+
+    if(msecs > 300000) {
+      std::string msg = "Configuration value for '";
+      msg += parameter;
+      msg += "' ("; msg += value; msg += " msecs) is perhaps very big (over 5 minutes).";
+      LOGWARNING(anna::Logger::warning(msg, ANNA_FILE_LOCATION));
+    }
+
+    if(msecs <= a_timeEngine->getResolution()) {
+      std::string msg = "Configuration value for '";
+      msg += parameter;
+      msg += "' ("; msg += value; msg += " msecs) as any other time measure, must be greater than timming engine resolution: ";
+      msg += anna::functions::asString(a_timeEngine->getResolution());
+      throw RuntimeException(msg, ANNA_FILE_LOCATION);
+    }
+
+    return (anna::Millisecond)msecs; // ok
+  }
+
+  // Non-integer exception:
+  std::string msg = "Configuration error for '";
+  msg += parameter;
+  msg += "' = '";
+  msg += value;
+  msg += "': must be a non-negative integer number";
+  throw RuntimeException(msg, ANNA_FILE_LOCATION);
+}
+
+bool Launcher::setWorkingNode(const std::string &name) throw() {
+  bool result = false;
+
+  anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+  anna::diameter::comm::OriginHost *oh = ohm.getOriginHost(name);
+
+  if (oh) {
+    a_workingNode = const_cast<anna::diameter::comm::OriginHost*>(oh);
+    result = true;
+  }
+
+  return result;
+}
+
+anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &name) const throw(anna::RuntimeException) {
+  anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+  anna::diameter::comm::OriginHost *result = ohm.getOriginHost(name);
+
+  if (!result)
+  throw anna::RuntimeException(anna::functions::asString("There is no origin host registered as '%s' (set Origin-Host avp correctly or force a specific host with 'node' operation)", name.c_str()), ANNA_FILE_LOCATION);
+
+  return result;
+}
+
+anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException) {
+  std::string originHost = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue();
+  return (getOriginHost(originHost));
+}
+
+bool Launcher::uniqueOriginHost() const throw() {
+  anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+  return (ohm.size() == 1);
+}
+
+
+void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException) {
+  if (!a_operatedHost) // priority for working node by mean 'node' operation
+    a_operatedHost = getOriginHost(message);
+}
+
+anna::diameter::comm::OriginHost *Launcher::getWorkingNode() const throw(anna::RuntimeException) {
+  if(!a_workingNode)
+    throw anna::RuntimeException("Working node not identified (try to load services)", ANNA_FILE_LOCATION);
+
+  return a_workingNode;
+}
+
+anna::diameter::comm::OriginHost *Launcher::getOperatedHost() const throw(anna::RuntimeException) {
+  if(!a_operatedHost)
+    throw anna::RuntimeException("Node not identified (try to force a specific Origin-Host with 'node' operation)", ANNA_FILE_LOCATION);
+
+  return a_operatedHost;
+}
+
+MyDiameterEntity *Launcher::getOperatedEntity() const throw(anna::RuntimeException) {
+  MyDiameterEntity *result = (MyDiameterEntity *)(getOperatedHost()->getEntity());
+  if (!result)
+    throw anna::RuntimeException("No entity configured for the operated node", ANNA_FILE_LOCATION);
+  return result;
+}
+
+MyLocalServer *Launcher::getOperatedServer() const throw(anna::RuntimeException) {
+  MyLocalServer *result = (MyLocalServer *)(getOperatedHost()->getDiameterServer());
+  if (!result)
+    throw anna::RuntimeException("No local server configured for the operated node", ANNA_FILE_LOCATION);
+  return result;
+}
+
+MyDiameterEngine *Launcher::getOperatedEngine() const throw(anna::RuntimeException) {
+  return (MyDiameterEngine *)getOperatedHost()->getCommEngine(); // never will be NULL
+}
+
+void Launcher::initialize()
+throw(anna::RuntimeException) {
+  anna::comm::Application::initialize();
+  CommandLine& cl(anna::CommandLine::instantiate());
+  anna::comm::Communicator::WorkMode::_v workMode(anna::comm::Communicator::WorkMode::Single);
+  a_communicator = new MyCommunicator(workMode);
+  a_timeEngine = new anna::timex::Engine((anna::Millisecond)600000, a_admlMinResolution);
+  anna::testing::TestManager::instantiate().setTimerController(a_timeEngine);
+
+  // Counters record procedure:
+  const char *varname = "cntRecordPeriod";
+  anna::Millisecond cntRecordPeriod;
+  try {
+    cntRecordPeriod = (cl.exists(varname)) ? checkTimeMeasure(varname, cl.getValue(varname)) : (anna::Millisecond)300000;
+  }
+  catch(anna::RuntimeException &ex) {
+    if (cntRecordPeriod != 0) throw ex;
+  }
+
+  if(cntRecordPeriod != 0) {
+    a_counterRecorderClock = new MyCounterRecorderClock("Counters record procedure clock", cntRecordPeriod); // clock
+    std::string cntDir = ".";
+    if(cl.exists("cntDir")) cntDir = cl.getValue("cntDir");
+    a_counterRecorder = new MyCounterRecorder(cntDir + anna::functions::asString("/Counters.Pid%d", (int)getPid()));
+  }
+
+  // Testing framework:
+  std::string tmDir = ".";
+  if(cl.exists("tmDir")) tmDir = cl.getValue("tmDir");
+  anna::testing::TestManager::instantiate().setReportsDirectory(tmDir);
+
+  // Tracing:
+  if(cl.exists("trace"))
+    anna::Logger::setLevel(anna::Logger::asLevel(cl.getValue("trace")));
+
+  // Load launcher services:
+  loadServices(cl.getValue("services")); // before run (have components to be created)
+}
+
+void Launcher::run()
+throw(anna::RuntimeException) {
+  LOGMETHOD(anna::TraceMethod tm("Launcher", "run", ANNA_FILE_LOCATION));
+  CommandLine& cl(anna::CommandLine::instantiate());
+  anna::diameter::stack::Engine::instantiate();
+
+  // Start time:
+  a_start_time.setNow();
+
+  // Initial working directory:
+  char cwd[1024];
+  if (getcwd(cwd, sizeof(cwd)) == NULL)
+    throw anna::RuntimeException("Cannot retrieve initial working directory !!", ANNA_FILE_LOCATION);
+  a_initialWorkingDirectory = cwd;
+
+  // Statistics:
+  anna::statistics::Engine::instantiate().enable();
+
+  LOGINFORMATION(
+      // Help on startup traces:
+      anna::Logger::information(help(), ANNA_FILE_LOCATION);
+  // Test messages dtd:
+  std::string msg = "\n                     ------------- TESTMESSAGES DTD -------------\n";
+  msg += anna::diameter::codec::MessageDTD;
+  anna::Logger::information(msg, ANNA_FILE_LOCATION);
+  );
+
+  // HTTP Server:
+  if(cl.exists("httpServer")) {
+    anna::comm::Network& network = anna::comm::Network::instantiate();
+    std::string address;
+    int port;
+    anna::functions::getAddressAndPortFromSocketLiteral(cl.getValue("httpServer"), address, port);
+    //const anna::comm::Device* device = network.find(Device::asAddress(address)); // here provide IP
+    const anna::comm::Device* device = *((network.resolve(address)->device_begin())); // trick to solve
+    a_httpServerSocket = new anna::comm::ServerSocket(anna::comm::INetAddress(device, port), cl.exists("httpServerShared") /* shared bind */, &anna::http::Transport::getFactory());
+  }
+
+  ///////////////////////////////
+  // Diameter library COUNTERS //
+  ///////////////////////////////
+  anna::diameter::comm::OamModule & oamDiameterComm = anna::diameter::comm::OamModule::instantiate();
+  oamDiameterComm.initializeCounterScope(1);  // 1000 - 1999
+  oamDiameterComm.enableCounters();
+  oamDiameterComm.enableAlarms();
+  anna::diameter::codec::OamModule & oamDiameterCodec = anna::diameter::codec::OamModule::instantiate();
+  oamDiameterCodec.initializeCounterScope(2);  // 2000 - 2999
+  oamDiameterCodec.enableCounters();
+  oamDiameterCodec.enableAlarms();
+  /////////////////
+  // COMM MODULE //
+  /////////////////
+  /* Main events */
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestReceived, "" /* get defaults for enum type*/, 0 /*1000*/);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceived,                 "", 1 /*1001*/);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestReceivedOnClientSession, "", 2 /*1002*/);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceivedOnClientSession,  "", 3 /*1003*/);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestReceivedOnServerSession, "", 4 /* etc. */);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceivedOnServerSession,  "", 5);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOK,                  "", 6);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentNOK,                 "", 7);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentOK,                   "", 8);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentNOK,                  "", 9);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnClientSessionOK,   "", 10);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnClientSessionNOK,  "", 11);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentOnClientSessionOK,    "", 12);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentOnClientSessionNOK,   "", 13);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnServerSessionOK,   "", 14);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnServerSessionNOK,  "", 15);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentOnServerSessionOK,    "", 16);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerSentOnServerSessionNOK,   "", 17);
+  /* Diameter Base (capabilities exchange & keep alive) */
+  // as client
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CERSentOK,   "", 18);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CERSentNOK,  "", 19);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CEAReceived, "", 20);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWRSentOK,   "", 21);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWRSentNOK,  "", 22);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWAReceived, "", 23);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPRSentOK,   "", 24);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPRSentNOK,  "", 25);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPAReceived, "", 26);
+  // as server
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CERReceived, "", 27);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CEASentOK,   "", 28);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CEASentNOK,  "", 29);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWRReceived, "", 30);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWASentOK,   "", 31);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DWASentNOK,  "", 32);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPRReceived, "", 33);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPASentOK,   "", 34);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::DPASentNOK,  "", 35);
+  /* server socket operations (enable/disable listening port for any local server) */
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::ServerSocketsOpened, "", 36);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::ServerSocketsClosed, "", 37);
+  /* Connectivity */
+  // clients
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::UnableToDeliverOverEntity,                  "", 38);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverClientSession,          "", 39);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverClientSession,     "", 40);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverServer,                 "", 41);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverServer,            "", 42);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverEntity,                 "", 43);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverEntity,            "", 44);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverEngineForEntities,      "", 45);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverEngineForEntities, "", 46);
+  // servers
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::UnableToDeliverToClient,                                    "", 47);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostConnectionForServerSession,                             "", 48);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::UnbindConnectionForServerSessionDueToInactivityTimeAnomaly, "", 49);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::CreatedConnectionForServerSession,                          "", 50);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverLocalServer,                            "", 51);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverLocalServer,                       "", 52);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::LostAvailabilityOverEngineForLocalServers,                  "", 53);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RecoveredAvailabilityOverEngineForLocalServers,             "", 54);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentExpired,  "", 55);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnClientSessionExpired,  "", 56);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestSentOnServerSessionExpired,  "", 57);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestRetransmitted,  "", 58);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestRetransmittedOnClientSession,  "", 59);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::RequestRetransmittedOnServerSession,  "", 60);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceivedUnknown,  "", 61);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceivedOnClientSessionUnknown,  "", 62);
+  oamDiameterComm.registerCounter(anna::diameter::comm::OamModule::Counter::AnswerReceivedOnServerSessionUnknown,  "", 63);
+  //////////////////
+  // CODEC MODULE //
+  //////////////////
+  /* Avp decoding */
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpDecode__NotEnoughBytesToCoverAvpHeaderLength,                          "", 0 /*2000*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpDecode__IncoherenceBetweenActivatedVBitAndZeroedVendorIDValueReceived, "", 1 /*2001*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpDecode__IncorrectLength,                                               "", 2 /*2002*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpDecode__DataPartInconsistence,                                         "", 3 /*2003*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpDecode__UnknownAvpWithMandatoryBit,                                    "", 4 /*2004*/);
+  /* Message decoding */
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::MessageDecode__NotEnoughBytesToCoverMessageHeaderLength, "", 5 /*2005*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::MessageDecode__NotEnoughBytesToCoverMessageLength,       "", 6 /*2006*/);
+  /* Avp validation */
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpValidation__EnumeratedAvpWithValueDoesNotComplyRestriction, "", 10 /*2010*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::AvpValidation__AvpFlagsDoesNotFulfillTheDefinedFlagRules,      "", 11 /*2011*/);
+  /* Message validation */
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::MessageValidation__UnknownOperationUnableToValidate, "", 12 /*2012*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::MessageValidation__OperationHaveIncoherentFlags,     "", 13 /*2013*/);
+  /* Level validation */
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__MissingFixedRule,                                       "", 14 /*2014*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedRuleForCardinality,                               "", 15 /*2015*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedRuleForCardinalityLessThanNeeded,                 "", 16 /*2016*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedRuleForCardinalityMoreThanNeeded,                 "", 17 /*2017*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedGenericAvpRuleForCardinalityFoundDisregardedItem, "", 18 /*2018*/);
+  oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FoundDisregardedItemsAndGenericAVPWasNotSpecified,      "", 19 /*2019*/);
+
+
+  /////////////////////////////////
+  // Counter recorder associated //
+  /////////////////////////////////
+  if(a_counterRecorderClock) {
+    oamDiameterComm.setCounterRecorder(a_counterRecorder);
+    oamDiameterCodec.setCounterRecorder(a_counterRecorder);
+    anna::diameter::comm::ApplicationMessageOamModule::instantiate().setCounterRecorder(a_counterRecorder);
+    a_timeEngine->activate(a_counterRecorderClock); // start clock
+  }
+
+  /////////////////////////////
+  // Log statistics concepts //
+  /////////////////////////////
+  if(cl.exists("logStatisticSamples"))
+    logStatisticsSamples(cl.getValue("logStatisticSamples"));
+
+  // Start client connections //////////////////////////////////////////////////////////////////////////////////
+  MyDiameterEntity *entity;
+  anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+  for (diameter::comm::origin_hosts_it it = ohm.begin(); it != ohm.end(); it++) {
+    entity = (MyDiameterEntity *)(it->second->getEntity());
+    if (entity) entity->bind();
+  }
+
+  // Go into communicator poll
+  // Reconnection period (tcp reconnect retry time):
+  const char *varname = "reconnectionPeriod";
+  anna::Millisecond reconnectionPeriod = (cl.exists(varname)) ? checkTimeMeasure(varname, cl.getValue(varname)) : (anna::Millisecond)10000;
+
+  a_communicator->setRecoveryTime(reconnectionPeriod);
+  if(cl.exists("httpServer")) a_communicator->attach(a_httpServerSocket);  // HTTP
+  a_communicator->accept();
+}
+
+bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(anna::RuntimeException) {
+  // Get hex string
+  static char buffer[8192];
+  std::ifstream infile(pathfile.c_str(), std::ifstream::in);
+
+  if(infile.is_open()) {
+    infile >> buffer;
+    std::string hexString(buffer, strlen(buffer));
+    // Allow colon separator in hex string: we have to remove them before processing with 'fromHexString':
+    hexString.erase(std::remove(hexString.begin(), hexString.end(), ':'), hexString.end());
+    LOGDEBUG(
+        std::string msg = "Hex string (remove colons if exists): ";
+    msg += hexString;
+    anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+    );
+
+    anna::functions::fromHexString(hexString, db); // could launch exception
+    // Close file
+    infile.close();
+    return true;
+  }
+
+  return false;
+}
+
+bool Launcher::getContentFromFile(const std::string &pathfile, std::string &content) const throw(anna::RuntimeException) {
+
+  std::ifstream inFile(pathfile.c_str(), std::ifstream::in);
+  if(!inFile.good()) {
+    throw RuntimeException(anna::functions::asString("Unable to open file '%s'", pathfile.c_str()), ANNA_FILE_LOCATION);
+  }
+
+  std::stringstream strStream;
+  strStream << inFile.rdbuf(); //read the file
+  content = strStream.str(); // holds the content of the file
+  inFile.close();
+
+  return true;
+}
+
+void Launcher::resetStatistics() throw() {
+  if (a_workingNode) {
+    a_workingNode->getCommEngine()->resetStatistics();
+  }
+  else {
+    anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+    for (diameter::comm::origin_hosts_it it = ohm.begin(); it != ohm.end(); it++) {
+      it->second->getCommEngine()->resetStatistics();
+    }
+  }
+}
+
+void Launcher::resetCounters() throw() {
+  anna::diameter::comm::OamModule::instantiate().resetCounters();
+  anna::diameter::comm::ApplicationMessageOamModule::instantiate().resetCounters();
+  anna::diameter::codec::OamModule::instantiate().resetCounters();
+}
+
+void Launcher::signalTerminate() throw(anna::RuntimeException) {
+  LOGMETHOD(anna::TraceMethod tm("Launcher", "signalTerminate", ANNA_FILE_LOCATION));
+
+  forceCountersRecord();
+
+  a_communicator->terminate ();
+  comm::Application::signalTerminate ();
+}
+
+void Launcher::signalUSR2() throw(anna::RuntimeException) {
+
+  std::string inputFile = getSignalUSR2InputFile();
+  std::string outputFile = getSignalUSR2OutputFile();
+
+  LOGNOTICE(
+  std::string msg = "Captured signal SIGUSR2. Reading tasks at '";
+  msg += inputFile;
+  msg += "' (results will be written at '";
+  msg += outputFile;
+  msg += "')";
+  anna::Logger::notice(msg, ANNA_FILE_LOCATION);
+  );
+
+  // Operation:
+  std::string line;
+  std::string response_content;
+  std::ifstream in_file(inputFile);
+  std::ofstream out_file(outputFile);
+
+  if(!in_file.is_open()) throw RuntimeException("Unable to read tasks", ANNA_FILE_LOCATION);
+  if(!out_file.is_open()) throw RuntimeException("Unable to write tasks", ANNA_FILE_LOCATION);
+
+  while(getline(in_file, line)) {
+
+    // Ignore comments and blank lines:
+    if (line[0] == '#')  continue;
+    if (std::string::npos == line.find_first_not_of(" \t")) continue;
+
+    LOGDEBUG(
+        std::string msg = "Processing line: ";
+    msg += line;
+    anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+    );
+
+    try {
+      eventOperation(line, response_content);
+    } catch(RuntimeException &ex) {
+      ex.trace();
+    }
+
+    out_file << response_content << "\n";
+  }
+
+  in_file.close();
+  out_file << "EOF\n";
+  out_file.close();
+}
+
+std::string Launcher::help() const throw() {
+  std::string result = "\n";
+  result += "\n                     ------------- HELP -------------\n";
+  result += "\n";
+  result += "\nOVERVIEW";
+  result += "\n--------";
+  result += "\n";
+  result += "\nThe ADML (ANNA Diameter MultiHost Launcher) process is a multi-host node with client and server";
+  result += "\n capabilities as well as balancer (proxy) features. It could be used as diameter server (i.e. to";
+  result += "\n simulate PCRF nodes, OCS systems, etc.), as diameter client (GGSNs, DPIs, etc.), and balancer";
+  result += "\n systems to provide failover to external round-robin launchers. Also, auxiliary encoder/decoder/loader";
+  result += "\n function could be deployed to reinterpret certain external flow and send it to another process.";
+  result += "\n ";
+  result += "\nThe ANNA::diameter_comm built-in module provides a great set of characteristics as multiple connections";
+  result += "\n on both server and client side, definition for multiple-server entities (and not only two as standard";
+  result += "\n establish as minimum), separate statistics analyzer per each resource, automatic CER/CEA and DWR/DWA";
+  result += "\n generation, expiration control and many more features.";
+  result += "\n";
+  result += "\nThe ADML process can easily configure a many origin-host nodes as needed, which will have own endpoints.";
+  result += "\nYou should avoid loop configurations (client and server for that client) because automatic forwarding,";
+  result += "\n is implemented and this would get in a never ending cycle when a request is sent.";
+  result += "\n";
+  result += "\nProcess traces are dump on \"launcher.trace\" and could have any trace level (POSIX levels), usually";
+  result += "\n 'debug' or 'warning'. See ANNA documentation for more details.";
+  result += "\n";
+  result += "\nAs any other ANNA process, context dump could be retrieved sending SIGUSR1 signal:";
+  result += "\n   kill -10 <pid>";
+  result += "\n    or";
+  result += "\n   kill -s SIGUSR1 <pid>";
+  result += "\n    and then";
+  result += "\n   vi /var/tmp/anna.context.<pid>";
+  result += "\n";
+  result += "\nA complete xml report will show all the context information (counters, alarms, statistics,";
+  result += "\n handlers, diameter stacks, etc.), and a powerful log module could dump all the events";
+  result += "\n processed and flow information. Statistics could be analized at context dump and optionally";
+  result += "\n written to disk as sample files (useful for graphs and spreadsheet reports) with all the";
+  result += "\n measurements.";
+  result += "\n";
+  result += "\nAlso SIGUSR2 is handled for management purposes. We will talk later about this.";
+  result += "\n";
+  result += "\n";
+  result += "\nCOMMAND LINE";
+  result += "\n------------";
+  result += "\n";
+  result += "\nStart the launcher process without arguments in order to see all the startup configuration";
+  result += "\n posibilities, many of which could be modified on the air through the management interface";
+  result += "\n (we will talk later about this great feature). There is only one mandatory parameter which";
+  result += "\n is the services definition: --services <services xml file>. You must follow the dtd schema";
+  result += "\n to build a valid services xml file. Some basic examples are:";
+  result += "\n";
+  result += "\nClient configuration:";
+  result += "\n";
+  result += "\n<services>";
+  result += "\n  <!-- Stacks -->";
+  result += "\n  <stack id=\"0\" dictionary=\"dictionary.xml\"/>";
+  result += "\n";
+  result += "\n  <!-- Nodes -->";
+  result += "\n  <node originHost=\"ADML-client\" applicationId=\"0\" entity=\"localhost:3868\"/>";
+  result += "\n</services>";
+  result += "\n";
+  result += "\nServer configuration:";
+  result += "\n";
+  result += "\n<services>";
+  result += "\n  <!-- Stacks -->";
+  result += "\n  <stack id=\"0\" dictionary=\"dictionary.xml\"/>";
+  result += "\n";
+  result += "\n  <!-- Nodes -->";
+  result += "\n  <node originHost=\"ADML-server\" applicationId=\"0\" diameterServer=\"localhost:3868\"/>";
+  result += "\n</services>";
+  result += "\n";
+  result += "\nIf you act as a proxy or a translation agent, you need to combine both former setups, and probably";
+  result += "\n will need to program the answers to be replied through the operations interface. To balance the";
+  result += "\n traffic at your client side you shall use '--balance' and '--sessionBasedModelsClientSocketSelection'";
+  result += "\n arguments in order to define the balancing behaviour. To make hybrid setups you only must mix the nodes:";
+  result += "\n";
+  result += "\nClient and server configuration:";
+  result += "\n";
+  result += "\n<services>";
+  result += "\n  <!-- Stacks -->";
+  result += "\n  <stack id=\"16777236\" dictionary=\"dictionary_Rx.xml\"/>";
+  result += "\n  <stack id=\"16777238\" dictionary=\"dictionary_Gx.xml\"/>";
+  result += "\n  <stack id=\"0\" dictionary=\"dictionary_base.xml\"/>";
+  result += "\n";
+  result += "\n  <!-- Nodes -->";
+  result += "\n  <node originHost=\"ADML-Rx-client\" applicationId=\"16777236\" entity=\"localhost:3868\" cer=\"cer_Rx.xml\"/>";
+  result += "\n  <node originHost=\"ADML-Gx-client\" applicationId=\"16777238\" entity=\"localhost:3868\" cer=\"cer_Gx.xml\"/>";
+  result += "\n</services>";
+  result += "\n";
+  result += "\n";
+  result += "\nThe process builds automatically CER and DWR messages as a client, but you could specify your own";
+  result += "\n as shown in the hybrid former example. Note that the base protocol stack must be registered because";
+  result += "\n the configuration corresponds to a multistack process which change the stack using the application-id";
+  result += "\n processed (0 in the case of base protocol messages: CER, CEA, DWR, DWA, DPR, DPA).";
+  result += "\n";
+  result += "\nDYNAMIC OPERATIONS";
+  result += "\n------------------";
+  result += "\n";
+  result += "\nADML supports several operations which could be reconized via HTTP interface or SIGUSR2 caugh.";
+  result += "\nAn operation is specified by mean a string containing the operation name and needed arguments";
+  result += "\n separated by pipes. These are the available commands:";
+  result += "\n";
+  result += "\n--------------------------------------------------------------------------------------- General purpose";
+  result += "\n";
+  result += "\nhelp                                 This help.";
+  result += "\n";
+  result += "\n--------------------------------------------------------------------------------------- Node management";
+  result += "\n";
+  result += "\nnode[|<name>]                         Selects a context working node by mean a registered name (origin-host).";
+  result += "\n                                      All the subsequent operations will be forced to work with";
+  result += "\n                                      this node, which makes possible some rare scenarios like";
+  result += "\n                                      sending unexpected messages on remote peers. This is also";
+  result += "\n                                      useful for some operations in order to restrict the scope";
+  result += "\n                                      of action (statistics, communication visibility, etc.).";
+  result += "\n                                      Empty parameter will show the current configuration.";
+  result += "\n";
+  result += "\nnode_auto                             Returns to the default behaviour (smart node selection).";
+  result += "\n                                      Depending on the operation, this could imply a global";
+  result += "\n                                      action scope, affecting to all the registered hosts.";
+  result += "\n                                      This should be the normal configuration. Take into";
+  result += "\n                                      account that if you fix the working node, this could";
+  result += "\n                                      affect to things like test programming: communication";
+  result += "\n                                      resources will override those which would be inferred";
+  result += "\n                                      from programmed messages Origin-Host avps.";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------------------ Parsing operations";
+  result += "\n";
+  result += "\ncode|<source_file>|<target_file>     Encodes source file (pathfile) into target file (pathfile).";
+  result += "\ndecode|<source_file>|<target_file>   Decodes source file (pathfile) into target file (pathfile).";
+  result += "\nloadxml|<source_file>                Reinterpret xml source file (pathfile).";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------------------------- Hot changes";
+  result += "\n";
+  result += "\nservices[|source file]               Adds and starts the services specified in the xml file provided.";
+  result += "\n                                      (if missing, the file 'services.xml' will be used). This is used";
+  result += "\n                                      to load new nodes once the ADML is started, regardless if command";
+  result += "\n                                      line '--services' parameter was used or not. Those services which";
+  result += "\n                                      are not correctly loaded will be ignored to keep the process alive.";
+  result += "\n                                     If you need to load services as deltas, you must firstly load the";
+  result += "\n                                      diameter base dictionary with stack id 0, because all the nodes";
+  result += "\n                                      will use this dictionary to encode/decode base protocol messages";
+  result += "\n                                      managed by the communication engine.";
+  result += "\n";
+  result += "\ndiameterServerSessions|<integer>     Updates the maximum number of accepted connections to diameter";
+  result += "\n                                      server socket.";
+  result += "\ncontext[|target file]                Application context could also be written by mean this operation,";
+  result += "\n                                      and not only through SIGUSR1. If optional path file is missing,";
+  result += "\n                                      default '/var/tmp/anna.context.<pid>' will be used.";
+  result += "\ncollect                              Reset statistics and counters to start a new test stage of";
+  result += "\n                                      performance measurement. Context data can be written at";
+  result += "\n                                      '/var/tmp/anna.context.<pid>' by mean 'kill -10 <pid>'.";
+  result += "\n                                      or sending operation 'context|[target file]'.";
+  result += "\n                                     This operation applies over all the registered host nodes";
+  result += "\n                                      except if one specific working node has been set.";
+  result += "\nforceCountersRecord                  Forces dump to file the current counters of the process.";
+  result += "\nlog-statistics-samples|<list>        Log statistics samples for the provided comma-separated concept id";
+  result += "\n                                      list, over './sample.<concept id>.csv' files. For example: \"1,2\"";
+  result += "\n                                      will log concepts 1 and 2. Reserved words \"all\"/\"none\" activates/";
+  result += "\n                                      deactivates all registered statistics concept identifiers. That ids";
+  result += "\n                                      are shown at context dump.";
+  result += "\nchange-dir[|directory]               Changes the execution point which could be fine to ease some";
+  result += "\n                                     file system interaction tasks. Be care about some requirements";
+  result += "\n                                     (for example if you have a user defined counters directory as";
+  result += "\n                                     relative path this must exists from the new execution directory).";
+  result += "\n                                     If nothing provided, initial working directory will be restored.";
+  result += "\nshow-oam                             Dumps current counters of the process. This is also done at";
+  result += "\n                                      process context dump.";
+  result += "\nshow-stats                           Dumps statistics of the process. This is also done at process";
+  result += "\n                                      context dump.";
+  result += "\n";
+  result += "\n<visibility action>[|<address>:<port>][|socket id]";
+  result += "\n";
+  result += "\n       Actions: hide, show (update state) and hidden, shown (query state).";
+  result += "\n       Acts over a client session for messages delivery (except CER/A, DWR/A, DPR/A).";
+  result += "\n       If missing server (first parameter) all applications sockets will be affected.";
+  result += "\n       If missing socket (second parameter) for specific server, all its sockets will be affected.";
+  result += "\n";
+  result += "\n       All application client sessions are shown on startup, but standard delivery only use primary";
+  result += "\n        server ones except if fails. Balance configuration use all the allowed sockets. You could also";
+  result += "\n        use command line 'sessionBasedModelsClientSocketSelection' to force traffic flow over certain";
+  result += "\n        client sessions, but for this, hide/show feature seems easier.";
+  result += "\n";
+  result += "\n--------------------------------------------------------------------------------------- Flow operations";
+  result += "\n";
+  result += "\nsendxml2e|<source_file>    Sends xml source file (pathfile) through configured entity.";
+  result += "\nsendxml2c|<source_file>    Sends xml source file (pathfile) to client.";
+  result += "\nanswerxml2e[|source_file]  Answer xml source file (pathfile) for incoming request with same code from entity.";
+  result += "\n                           The answer is stored in a FIFO queue for a specific message code, then there are";
+  result += "\n                           as many queues as different message codes have been programmed.";
+  result += "\nanswerxml2c[|source_file]  Answer xml source file (pathfile) for incoming request with same code from client.";
+  result += "\n                           The answer is stored in a FIFO queue for a specific message code, then there are";
+  result += "\n                           as many queues as different message codes have been programmed.";
+  result += "\nanswerxml<2e/2c>           List programmed answers (to entity/client) if no parameter provided.";
+  result += "\nanswerxml<2e/2c>|dump      Write programmed answers (to entity/client) to file 'programmed_answer.<message code>.<sequence>',";
+  result += "\n                           where 'sequence' is the order of the answer in each FIFO code-queue of programmed answers.";
+  result += "\nanswerxml<2e/2c>|clear     Clear programmed answers (to entity/client).";
+  result += "\nanswerxml<2e/2c>|exhaust   Disable the corresponding queue rotation, which is the default behaviour.";
+  result += "\nanswerxml<2e/2c>|rotate    Enable the corresponding queue rotation, useful in performance tests.";
+  result += "\n                           Rotation consists in add again to the queue, each element retrieved for answering.";
+  result += "\n";
+  result += "\nSend operations are available using hexadecimal content (hex formatted files) which also allow to test";
+  result += "\nspecial scenarios (protocol errors):";
+  result += "\n";
+  result += "\nsendhex2e|<source_file>    Sends hex source file (pathfile) through configured entity.";
+  result += "\nsendhex2c|<source_file>    Sends hex source file (pathfile) to client.";
+  result += "\n";
+  result += "\nAnswer programming in hexadecimal is not really neccessary (you could use send primitives) and also";
+  result += "\n is intended to be used with decoded messages in order to replace things like hop by hop, end to end,";
+  result += "\n subscriber id, session id, etc. Anyway you could use 'decode' operation and then program the xml created.";
+  result += "\n";
+  result += "\nIf a request is received, answer map (built with 'answerxml<2e/2c>' operations) will be";
+  result += "\n checked to find a corresponding programmed answer to be replied(*). If no ocurrence is found,";
+  result += "\n or answer message was received, the message is forwarded to the other side (entity or client),";
+  result += "\n or nothing but trace when no peer at that side is configured. Answer to client have sense when";
+  result += "\n diameter server socket is configured, answer to entity have sense when entity does.";
+  result += "\n";
+  result += "\nIn the most complete situation (process with both client and server side) there are internally";
+  result += "\n two maps with N FIFO queues, one for each different message code within programmed answers.";
+  result += "\nOne map is for answers towards the client, and the other is to react entity requests. Then in";
+  result += "\n each one we could program different answers corresponding to different request codes received.";
+  result += "\n";
+  result += "\n(*) sequence values (hop-by-hop and end-to-end), Session-Id and Subscription-Id avps, are mirrored";
+  result += "\n    to the peer which sent the request. If user wants to test a specific answer without changing it,";
+  result += "\n    use sendxml<2e/2c>/sendhex<2e/2c> operations better than programming.";
+  result += "\n";
+  result += "\nBalance ('--balance' command line parameter) could be used to forward server socket receptions through";
+  result += "\n entity servers by mean a round-robin algorithm. Both diameter server socket and entity targets should";
+  result += "\n have been configured, that is to say: launcher acts as client and server. If no balance is used, an";
+  result += "\n standard delivery is performed: first primary entity server, secondary when fails, etc.";
+  result += "\n";
+  result += "\n--------------------------------------------------------------------------- Processing types (log tags)";
+  result += "\n";
+  result += "\nUsed as log file extensions (when '--splitLog' is provided on command line) and context preffixes on log";
+  result += "\n details when unique log file is dumped:";
+  result += "\n";
+  result += "\n   [sent2e/send2eError]   Send to entity (success/error)";
+  result += "\n   [sent2c/send2cError]   Send to client (success/error)";
+  result += "\n   [fwd2e/fwd2eError]     Forward to entity a reception from client (success/error)";
+  result += "\n   [fwd2c/fwd2cError]     Forward to client a reception from entity (success/error)";
+  result += "\n   [recvfc]               Reception from client";
+  result += "\n   [recvfe]               Reception from entity";
+  result += "\n   [req2c-expired]        A request sent to client has been expired";
+  result += "\n   [req2e-expired]        A request sent to entity has been expired";
+  result += "\n   [recvfc-ans-unknown]   Reception from client of an unknown answer (probably former [req2c-expired]";
+  result += "\n                           has been logged)";
+  result += "\n   [recvfe-ans-unknown]   Reception from entity of an unknown answer (probably former [req2e-expired]";
+  result += "\n                           has been logged)";
+  result += "\n   [retry]                Request retransmission";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------------------------- Burst tests";
+  result += "\n";
+  result += "\nIn order to simplify user experience, burst category operations are only allowed in single host node";
+  result += "\n configuration. Indeed, you could send messages with unmatched Origin-Host, and no warning is shown.";
+  result += "\nAll the operations are performed through the unique host: if you need to use more interfaces, you may";
+  result += "\n launch different ADML instances. Is nonsense to allow burst in a multi-host configured ADML, because";
+  result += "\n this feature is not able to coordinate the messages.";
+  result += "\n";
+  result += "\nburst|<action>[|parameter]     Used for performance testing, we first program diameter requests";
+  result += "\n                                messages in order to launch them from client side to the configured";
+  result += "\n                                diameter entity. We could start the burst with an initial load";
+  result += "\n                                (non-asynchronous sending), after this, a new request will be sent";
+  result += "\n                                per answer received or expired context. There are 10 actions: clear,";
+  result += "\n                                load, start, push, pop, stop, repeat, send, goto and look.";
+  result += "\n";
+  result += "\n   burst|clear                 Clears all loaded burst messages.";
+  result += "\n   burst|load|<source_file>    Loads the next diameter message into launcher burst.";
+  result += "\n   burst|start|<initial load>  Starts (or restarts if already in progress) the message sending with";
+  result += "\n                                a certain initial load.";
+  result += "\n   burst|push|<load amount>    Sends specific non-aynchronous load.";
+  result += "\n   burst|pop|<release amount>  Skip send burst messages in order to reduce over-the-air requests.";
+  result += "\n                               Popping all OTA requests implies burst stop because no more answer";
+  result += "\n                                will arrive to the process. Burst output file (--burstLog command";
+  result += "\n                                line parameter) shows popped messages with crosses (x). Each cross";
+  result += "\n                                represents one received answer for which no new request is sent.";
+  result += "\n   burst|stop                  Stops the burst cycle. You can resume pushing 1 load amount.";
+  result += "\n   burst|repeat[|[yes]|no]     Restarts the burst launch when finish. If initial load or push load";
+  result += "\n                                amount is greater than burst list size, they will be limited when";
+  result += "\n                                the list is processed except when repeat mode is enabled.";
+  result += "\n   burst|send|<amount>         Sends messages from burst list. The main difference with start/push";
+  result += "\n                                operations is that burst won't be awaken. Externally we could control";
+  result += "\n                                sending time (no request will be sent for answers).";
+  result += "\n   burst|goto|<order>          Updates current burst pointer position.";
+  result += "\n   burst|look[|order]          Show programmed burst message for order provided, current when missing.";
+  result += "\n";
+  result += "\n-------------------------------------------------------------------------------------- Advanced testing";
+  result += "\n";
+  result += "\n                           Burst mode only allows single interface interaction. For multiple interface";
+  result += "\n                            (origin-host) coordination, you could use the advanced test cases programming:";
+  result += "\n";
+  result += "\n";
+  result += "\n   test|<id>|<command>[|parameters]";
+  result += "\n";
+  result += "\n                           Adds a new step to the test case with provided identifier. If provided identifier";
+  result += "\n                            is not registered yet, a new test case will be created with that value and the";
+  result += "\n                            step will be added as the first. For a specific 'id', the steps are stored in";
+  result += "\n                            order as they are programmed. Check possible runtime exceptions when adding a";
+  result += "\n                            new step because those which fail, will be ignored/skipped during test case";
+  result += "\n                            programming giving an incomplete sequence invalid for the testing purpose.";
+  result += "\n";
+  result += "\n                           <id>: integer number, normally monotonically increased for each test case. Some external";
+  result += "\n                                 script/procedure shall clone a test case template in order to build a collection";
+  result += "\n                                 of independent and coherent test cases (normally same type) with different context";
+  result += "\n                                 values (Session-Id, Subscriber-Id, etc.).";
+  result += "\n";
+  result += "\n                           <command>: commands to be executed for the test id provided. Each command programmed";
+  result += "\n                                      constitutes a test case 'step', numbered from 1 to N, with an exception for";
+  result += "\n                                      'description' which is used to describe the test case:";
+  result += "\n";
+  result += "\n                              description|<description>  Sets a test case description. Test cases by default are";
+  result += "\n                                                          constructed with description 'Testcase_<id>'.";
+  result += "\n";
+  result += "\n                              ip-limit[|amount]          In-progress limit of test cases controlled from this test.";
+  result += "\n                                                         No new test cases will be launched over this value (test";
+  result += "\n                                                         manager tick work will be ignored). Zero-value is equivalent";
+  result += "\n                                                         to stop the clock tick, -1 is used to specify 'no limit' which";
+  result += "\n                                                         is the default. For missing amount, value of 1 is applied.";
+  result += "\n";
+  result += "\n                              timeout|<msecs>            Sets an asynchronous timer to restrict the maximum timeout";
+  result += "\n                                                          until last test step. Normally, this command is invoked";
+  result += "\n                                                          in the first step, anyway it measures the time from the";
+  result += "\n                                                          execution point whatever it is. The expiration will abort";
+  result += "\n                                                          the test if still running. One or more timeouts could be";
+  result += "\n                                                          programmed (not usual), but the more restrict will apply.";
+  result += "\n                                                         It is highly recommended to program a initial timeout step,";
+  result += "\n                                                          or the test case could be eternally in-progress.";
+  result += "\n";
+  result += "\n                              sendxml2e|<source_file>[|<step number>]";
+  result += "\n                                                         Sends xml source file (pathfile) to entity (it would be a";
+  result += "\n                                                          'forward' event if it came through local server endpoint).";
+  result += "\n                                                         Take into account that the xml message is encoded just on";
+  result += "\n                                                          call. The xml file is not longer needed neither interpreted";
+  result += "\n                                                          in case of modification, after calling this command.";
+  result += "\n                                                         The step number should be provided for answers to indicate";
+  result += "\n                                                          the 'wait for request' corresponding step. If you miss this";
+  result += "\n                                                          reference, the sequence information (hop-by-hop, end-to-end)";
+  result += "\n                                                          will be sent as they are in the answer xml message (realize";
+  result += "\n                                                          the difficulty of predicting these information). Be sure to";
+  result += "\n                                                          refer to a 'wait for request' step. Conditions like 'regexp'";
+  result += "\n                                                          (as we will see later) are not verified.";
+  result += "\n                                                         In the case of requests, the step number is used to force the";
+  result += "\n                                                          copy of Session-Id value from the referred step.";
+  result += "\n";
+  result += "\n                              sendxml2c|<source_file>[|<step number>]";
+  result += "\n                                                         Sends xml source file (pathfile) to client (it would be a";
+  result += "\n                                                          'forward' event if it came through remote server endpoint).";
+  result += "\n                                                         Same commented for 'sendxml2e' regarding the step number.";
+  result += "\n";
+  result += "\n                              delay|<msecs>              Blocking step until the time lapse expires. Useful to give ";
+  result += "\n                                                          some cadence control and time schedule for a specific case.";
+  result += "\n                                                         A value of 0 could be used as a dummy step.";
+  result += "\n";
+  result += "\n                              sh-command|<script>        External execution for script/executable via shell through a dedicated";
+  result += "\n                                                          thread, providing the command and parameters. You could use dynamic";
+  result += "\n                                                          variables ##<tag> to have more flexibility:";
+  result += "\n                                                             Test pool cycle id: "; result += SH_COMMAND_TAG_FOR_REPLACE__CYCLE_ID;
+  result += "\n                                                             Test case id:       "; result += SH_COMMAND_TAG_FOR_REPLACE__TESTCASE_ID;
+  result += "\n                                                             Test step id:       "; result += SH_COMMAND_TAG_FOR_REPLACE__TESTSTEP_ID;
+  result += "\n";
+  result += "\n                                                         For example, your command could be something like this:";
+  result += "\n                                                          insert_sql_"; result += SH_COMMAND_TAG_FOR_REPLACE__TESTCASE_ID; result += ".sh -db dbname --verbose";
+  result += "\n                                                             > /tmp/cycle-"; result += SH_COMMAND_TAG_FOR_REPLACE__CYCLE_ID;
+  result += ".testcase-"; result += SH_COMMAND_TAG_FOR_REPLACE__TESTCASE_ID;
+  result += ".teststep-"; result += SH_COMMAND_TAG_FOR_REPLACE__TESTSTEP_ID;
+  result += ".out";
+  result += "\n                                                         Try to redirect stdout and stderr to avoid ADML output contamination";
+  result += "\n                                                          with the possible outputs from the scripts. You could also put your";
+  result += "\n                                                          job in background although sh-command will return 0-value immediately.";
+  result += "\n";
+  result += "\n                              wait<fe/fc>-hex|<source_file>[|strict]";
+  result += "\n                                                         Wait condition, from entity (waitfe-hex) or client (waitfc-hex) to";
+  result += "\n                                                          match the hexadecimal representation for received messages against";
+  result += "\n                                                          source file (hex format). Fix mode must be enabled to avoid unexpected";
+  result += "\n                                                          matching behaviour. Specify 'strict' to use the hex content 'as is'.";
+  result += "\n                                                          If not, the hex content will be understood as whole message and then,";
+  result += "\n                                                          borders will be added (^<content>$) and sequence information bypassed";
+  result += "\n                                                          even for diameter answers.";
+  result += "\n";
+  result += "\n                              wait<fe/fc>-xml|<source_file>[|strict]";
+  result += "\n                                                         Wait condition from entity (waitfe-xml) or client (waitfc-xml) to";
+  result += "\n                                                          match the serialized xml content for received messages against";
+  result += "\n                                                          source file (xml representation). Fix mode must be enabled to avoid";
+  result += "\n                                                          unexpected matching behaviour. If you need a strict matching you";
+  result += "\n                                                          must add parameter 'strict', if not, regexp is built ignoring sequence";
+  result += "\n                                                          information (hop-by-hop-id=\"[0-9]+\" end-to-end-id=\"[0-9]+\") and";
+  result += "\n                                                          Origin-State-Id value.";
+  result += "\n                                                          All LF codes will be internally removed when comparison is executed";
+  result += "\n                                                          in order to ease xml content configuration.";
+  result += "\n";
+  result += "\n                              wait<fe/fc>|<condition>    Blocking step until condition is fulfilled. The message could";
+  result += "\n                                                          received from entity (waitfe) or from client (waitfc).";
+  result += "\n                                                         CPU cost is lower than former 'wait<fe/fc>-<xml|hex>' variants.";
+  result += "\n";
+  result += "\n                                          <condition>: Optional parameters which must be fulfilled to continue through the next step.";
+  result += "\n                                                       Any received message over diameter interfaces will be evaluated against the";
+  result += "\n                                                        corresponding test case starting from the current step until the first one";
+  result += "\n                                                        whose condition is fulfilled. If no condition is fulfilled the event will be";
+  result += "\n                                                        classified as 'uncovered' (normally a test case bad configuration, or perhaps";
+  result += "\n                                                        a real unexpected message).";
+
+  // TODO(***)
+  //  result += "\n                                        The way to identify the test case, is through registered Session-Id values for";
+  //  result += "\n                                         programmed requests. But this depends on the type of node. Acting as clients,";
+  //  result += "\n                                         requests received have Session-Id values which are already registered with";
+  //  result += "\n                                         one test case, causing an error if not found. Acting as servers, requests are";
+  //  result += "\n                                         received over a diameter local server from a client which are generating that";
+  //  result += "\n                                         Session-Id values. Then we know nothing about such values. The procedure in";
+  //  result += "\n                                         this case is find out a test case not-started containing a condition which";
+  //  result += "\n                                         comply with the incoming message, and reactivates it.";
+  // The other solution: register Session-Id values for answers send to client from a local diameter server.
+
+  result += "\n                                                       How to answer: a wait condition for a request will store the incoming message";
+  result += "\n                                                        which fulfills that condition. This message is useful together with the peer";
+  result += "\n                                                        connection source in a further send step configured with the corresponding";
+  result += "\n                                                        response. You could also insert a delay between wait and send steps to be";
+  result += "\n                                                        more realistic (processing time simulation in a specific ADML host node).";
+  result += "\n                                                        Always, a response send step will get the needed information from the most";
+  result += "\n                                                        recent wait step finding in reverse order (note that some race conditions";
+  result += "\n                                                        could happen if your condition is not specific enough).";
+
+  result += "\n";
+  result += "\n                                                       Condition format:";
+  result += "\n";
+  result += "\n                                                          [code]|[bitR]|[hopByHop]|[applicationId]|[sessionId]|[resultCode]|[msisdn]|[imsi]|[serviceContextId]";
+  result += "\n";
+  result += "\n                                                            code: integer number";
+  result += "\n                                                            bitR: 1 (request), 0 (answer)";
+  result += "\n                                                            hopByHop: integer number or request send step reference: #<step number>";
+  result += "\n";
+  result += "\n                                                                      Using the hash reference, you would indicate a specific wait condition";
+  result += "\n                                                                       for answers. The step number provided must correspond to any of the";
+  result += "\n                                                                       previous send commands (sendxml2e/sendxml2c) configured for a request.";
+  result += "\n                                                                      This 'hop-by-hop' variant eases the wait condition for answers in the";
+  result += "\n                                                                       safest way.";
+  result += "\n";
+  result += "\n                                                            applicationId: integer number";
+  result += "\n                                                            sessionId: string";
+  result += "\n                                                            resultCode: integer number";
+  result += "\n                                                            msisdn: string";
+  result += "\n                                                            imsi: string";
+  result += "\n                                                            serviceContextId: string";
+  result += "\n";
+  result += "\n                                                       Take into account these rules, useful in general:";
+  result += "\n";
+  result += "\n                                                          - Be as much specific as possible defining conditions to avoid ambiguity sending";
+  result += "\n                                                            messages out of context due to race conditions. Although you could program several";
+  result += "\n                                                            times similar conditions, some risky practices will throw a warning trace (if you";
+  result += "\n                                                            repeat the same condition within the same test case).";
+  result += "\n                                                          - Adding a ResultCode and/or HopByHop to the condition are only valid waiting answers.";
+  result += "\n                                                          - Requests hop-by-hop values must be different for all the test case requests.";
+  result += "\n                                                            RFC says that a hop by hop must be unique for a specific connection, something that";
+  result += "\n                                                            could be difficult to manage if we have multiple available connections from client";
+  result += "\n                                                            side endpoint (entity or local server), even if we would have only one connection but";
+  result += "\n                                                            several host interfaces. It is enough to configure different hop-by-hop values within";
+  result += "\n                                                            each test case, because on reception, the Session-Id is used to identify that test case.";
+  result += "\n";
+  result += "\n";
+  result += "\n";
+  result += "\n";
+  result += "\n                           Programming example:";
+  result += "\n";
+  result += "\n                              Basic Rx/Gx scenary: PCEF (Gx) - PCRF - AF (Rx)";
+  result += "\n";
+  result += "\n                              test|1|timeout|5000                  (step 1: whole time requirement is 5 seconds)";
+  result += "\n                              test|1|sendxml2e|CCR-I.xml           (step 2: imagine this xml uses the Session-Id 'SGx')";
+  result += "\n                              test|1|waitfe|272|0|||SGx|2001       (step 3: waits the CCA for the CCR-I with Result-Code = DIAMETER_SUCCESS)";
+  result += "\n                              test|1|sendxml2e|AAR-flows.xml       (step 4: imagine this xml uses the Session-Id 'SRx')";
+  result += "\n                              test|1|waitfe|265|0|||SRx|2001       (step 5: waits the AAA for the AAR-flows with Result-Code = DIAMETER_SUCCESS)";
+  result += "\n                              test|1|waitfe|258|1|||SGx            (step 6: waits the RAR (install policies) from the PCRF server)";
+  result += "\n                              test|1|sendxml2e|RAA-install.xml|6   (step 7: sends the response for the RAR)";
+  result += "\n                              test|1|sendxml2e|CCR-T.xml           (step 8: termination of the Gx session, imagine this xml puts hop-by-hop 'H1')";
+  result += "\n                              test|1|waitfe|272|0|H1||SGx|2001     (step 9: waits the CCA for the CCR-T with Result-Code = DIAMETER_SUCCESS and hop-by-hop 'H1')";
+  result += "\n                              test|1|waitfe|258|1|||SGx            (step 10: waits the RAR (remove policies) from the PCRF server)";
+  result += "\n                              test|1|sendxml2e|RAA-remove.xml|10   (step 11: sends the response for the RAR)";
+  result += "\n";
+  result += "\n                              Notes: We added an additional condition in step 9: the hop-by-hop. When we program the corresponding";
+  result += "\n                                      source request (CCR-T), we configured the value 'H1' for the hop-by-hop. This is an 'application";
+  result += "\n                                      value' because the real hop-by-hop transported through the client connection is managed by the";
+  result += "\n                                      diameter stack. But when returned, the transaction pool resolve the original value. This feature";
+  result += "\n                                      is necessary to ease the implementation of certain diameter agents (proxies for example). In our";
+  result += "\n                                      case, we could format the hop-by-hop values within the request templates with total freedom to";
+  result += "\n                                      improve the programmed conditions.";
+  result += "\n";
+  result += "\n                                     In the case of 'waiting for requests' is not such easy. Indeed, steps 6 and 10 will write a warning";
+  result += "\n                                      because they are the same condition. We know that we are not going to have any problem because";
+  result += "\n                                      such events are blocking-protected regarding logic-dependent messages (CCR-T), and race condition";
+  result += "\n                                      is absolutely strange in this case.";
+  result += "\n";
+  result += "\n                                     You could speed up the test case moving forward steps like 3 & 5, understood as non-strict requirements";
+  result += "\n                                      to continue testing. Anyway, remember that test cases should be as real as possible, and that there";
+  result += "\n                                      are many ways to increase the load rate as we will see in next section (test cases execution).";
+  result += "\n";
+  result += "\n                                     Other simplifications: the steps 3, 5 and 9 can be replaced by";
+  result += "\n";
+  result += "\n                                        test|1|waitfe||0|#2";
+  result += "\n                                        test|1|waitfe||0|#4";
+  result += "\n                                        test|1|waitfe||0|#8";
+  result += "\n";
+  result += "\n                                        which means that hop-by-hop must be retrieved from steps 2, 4 and 8 respectively,";
+  result += "\n                                        and the expected message shall be an answer. Normally you will add other conditions,";
+  result += "\n                                        for example a DIAMETER_SUCCESS result (adding 2001 as Result-Code).";
+  result += "\n";
+  result += "\nTest cases execution:";
+  result += "\n";
+  result += "\n";
+  result += "\n   test|ttps|<amount>            Starts/resume the provided number of test ticks per second (ttps). The ADML starts";
+  result += "\n                                 with the event trigger system suspended, and this operation is neccessary to begin";
+  result += "\n                                 those cases which need this time event (internal triggering). Some other test cases";
+  result += "\n                                 could be started through external events (first test case event could be programmed";
+  result += "\n                                 to wait specific message), but is not usual this external mode and neither usual to";
+  result += "\n                                 mix triggering types. Normally, you will pause/stop new test launchs providing 0 as";
+  result += "\n                                 ttps value, and also you could dynamically modify the load rate updating that value.";
+  result += "\n                                 If a test case has N messages then 'ttps * N' will be the virtual number of messages";
+  result += "\n                                 managed per second when no bottleneck exists.";
+  result += "\n";
+  result += "\n                                 Provide 0 in order to stop the timer triggering.";
+  result += "\n";
+  result += "\n                                 The timer manager resolution currently harcoded allows a maximum  of ";
+  result += anna::functions::asString(1000/a_admlMinResolution); result += " events";
+  result += "\n                                 per second. To reach greater rates ADML will join synchronously the needed number of";
+  result += "\n                                 new time-triggered test cases per a single event, writting a warning-level trace to";
+  result += "\n                                 advice about the risk of burst sendings and recommend launching multiple instances";
+  result += "\n                                 to achieve such load with a lower rate per instance.";
+  result += "\n";
+  result += "\n   test|next[|<sync-amount>]     Forces the execution of the next test case(s) without waiting for test manager tick.";
+  result += "\n                                 Provide an integer value for 'sync-amount' to send a burst synchronous amount of the";
+  result += "\n                                 next programmed test cases (1 by default). This event works regardless the timer tick";
+  result += "\n                                 function, but it is normally used with the test manager tick stopped.";
+  result += "\n";
+  result += "\n   test|ip-limit[|amount]        In-progress limit of test cases established from global context. This value will be";
+  result += "\n                                 overwritten if used at test case level when the corresponding test step is executed.";
+  result += "\n                                 Anyway, the meaning is the same in both contexts. But now, when the amount is missing,";
+  result += "\n                                 the limit and current amount of in-progress test cases will be shown.";
+  result += "\n";
+  result += "\n   test|goto|<id>                Updates current test pointer position.";
+  result += "\n";
+  result += "\n   test|look[|id]                Show programmed test case for id provided, current 'in-process' test case when missing.";
+  result += "\n                                 Test cases reports are not dumped on process context (too many information in general).";
+  result += "\n                                 The report contains context information in every moment: this operation acts as a snapshot.";
+  result += "\n";
+  result += "\n   test|interact|amount[|id]     Makes interactive a specific test case id. The amount is the margin of execution steps";
+  result += "\n                                 to be done. Normally, we will execute 'test|interact|0[|<test case id>]', which means that";
+  result += "\n                                 the test case is selected to be interactive, but no step is executed. Then you have to";
+  result += "\n                                 interact with positive amounts (usually 1), executing the provided number of steps if";
+  result += "\n                                 they are ready and fulfill the needed conditions. The value of 0, implies no execution";
+  result += "\n                                 steps margin, which could be useful to 'freeze' a test in the middle of its execution.";
+  result += "\n                                 You could also provide -1 to make it non-interactive resuming it from the current step.";
+  result += "\n                                 By default, current test case id is selected for interaction.";
+  result += "\n";
+  result += "\n   test|reset|<[soft]/hard>[|id] Reset the test case for id provided, all the tests when missing. It could be hard/soft:";
+  result += "\n                                 - hard: you probably may need to stop the load rate before. This operation initializes";
+  result += "\n                                         all test cases regardless their states.";
+  result += "\n                                 - soft: only for finished cases (those with 'Success' or 'Failed' states). It does not";
+  result += "\n                                         affect to test cases with 'InProgress' state.";
+  result += "\n";
+  result += "\n   test|repeats|<amount>         Restarts the whole programmed test list when finished the amount number of times (repeats";
+  result += "\n                                 forever if value -1 is provided). This is disabled by default (amount = 0): testing trigger";
+  result += "\n                                 system will enter suspended state until new ttps operation is received and a soft reset has";
+  result += "\n                                 been done before. Test cases state & data will be reset (when achieved again), but general";
+  result += "\n                                 statistics and counters will continue measuring until reset with 'collect' operation.";
+  result += "\n";
+  result += "\n   test|auto-reset|<soft|hard>   When cycling, current test cases can be soft (default) or hard reset. If no timeout has";
+  result += "\n                                 been configured for the test case, hard reset could prevent stuck on the next cycle for";
+  result += "\n                                 those test cases still in progress.";
+  result += "\n";
+  result += "\n   test|initialized              Shows the number of initialized test cases. Zero-value means that everything was processed";
+  result += "                                   or not initiated yet.\n";
+  result += "\n";
+  result += "\n   test|finished                 Shows the number of finished (successful or failed) test cases.";
+  result += "\n";
+  result += "\n   test|clear                    Clears all the programmed test cases and stop testing (if in progress).";
+  result += "\n";
+  result += "\n   test|junit                    Shows the junit report in the moment of execution.";
+  result += "\n";
+  result += "\n   test|summary-counts           Test manager counts report. Counts by state and prints total verdict.";
+  result += "\n";
+  result += "\n   test|summary-states           Test manager states report.";
+  result += "\n";
+  result += "\n   test|summary                  Test manager general report (number of test cases, counts by state, global configuration,";
+  result += "\n                                 forced in-progress limitation, reports visibility, etc.). Be careful when you have reports";
+  result += "\n                                 enabled because the programmed test cases dumps could be heavy (anyway you could enable the";
+  result += "\n                                 dumps separately, for any of the possible states: Initialized, InProgress, Failed, Success).";
+  result += "\n";
+  result += "\n   test|report|<initialized/in-progress/failed/success/[all]/none>[|[yes]|no]";
+  result += "\n";
+  result += "\n                                 Enables/disables report generation for a certain test case state: initialized, in-progress,";
+  result += "\n                                 failed or success (also 'all' and 'none' reserved words could be used). This applies to report";
+  result += "\n                                 summary (former described operation) and automatic dumps during testing where only failed or";
+  result += "\n                                 successful states will appear: every time a test case is finished its xml representation will";
+  result += "\n                                 be dump on a file under the execution directory (or the one configured in process command-line";
+  result += "\n                                 'tmDir') with the name:";
+  result += "\n";
+  result += "\n                                    'cycle-<cycle id>.testcase-<test case id>.xml'.";
+  result += "\n";
+  result += "\n                                 By default, all the states are disabled to avoid IO overload. In most of cases not all the";
+  result += "\n                                 tests are going to fail then you could enable only such failed dumps. Anyway you could set";
+  result += "\n                                 the reports visibility to fit your needs in a given situation.";
+  result += "\n";
+  result += "\n   test|report-hex[|[yes]|no]    Reports could include the diameter messages in hexadecimal format. Disabled by default.";
+  result += "\n";
+  result += "\n   test|dump-stdout[|[yes]|no]   Test manager information is dumped into stdout.";
+  result += "\n";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------------------- Dynamic procedure";
+  result += "\n";
+  result += "\ndynamic[|args]                   This launch an internal operation implemented in 'Procedure' class.";
+  result += "\n                                 Its default implementation does nothing, but you could create a dynamic";
+  result += "\n                                 library 'libanna_launcherDynamic.so' and replace the one in this project.";
+  result += "\n                                 One interesting application consists in the use of the diameter API and";
+  result += "\n                                 event operation to create a set of libraries as the testing framework.";
+  result += "\n                                 To execute each test case, the ADML process would be executed with a";
+  result += "\n                                 specific library path. But the main use would be the stress programming";
+  result += "\n                                 to achieve a great amount of cloned (even mixed) tests without using";
+  result += "\n                                 the management operation interface by mean http or signals: a single";
+  result += "\n                                 call to 'dynamic' would be enough to start a cascade of internally";
+  result += "\n                                 implemented operations.";
+  result += "\n                                 This operation accepts a generic string argument (piped or not, as you";
+  result += "\n                                 desire and depending on your procedure implementation).";
+  result += "\n";
+  result += "\n                                 This operation requires advanced programming and knowlegde of ANNA Diameter";
+  result += "\n                                 stack and testing framework, to take advantage of all the possibilities.";
+  result += "\n";
+  result += "\n";
+  result += "\n";
+  result += "\nUSING OPERATIONS INTERFACE";
+  result += "\n--------------------------";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------- Operations via HTTP interface";
+  result += "\n";
+  result += "\nAll the operations described above can be used through the optional HTTP interface. You only have";
+  result += "\n to define the http server at the command line with something like: '--httpServer localhost:9000'.";
+  result += "\nTo send the task, we shall build the http request body with the operation string. Some examples";
+  result += "\n using curl client could be:";
+  result += "\n";
+  result += "\n   curl -m 1 --data \"diameterServerSessions|4\" localhost:9000";
+  result += "\n   curl -m 1 --data \"code|ccr.xml\" localhost:9000";
+  result += "\n   curl -m 1 --data \"decode|ccr.hex\" localhost:9000";
+  result += "\n   curl -m 1 --data \"sendxml2e|ccr.xml\" localhost:9000";
+  result += "\n   etc.";
+  result += "\n";
+  result += "\n------------------------------------------------------------------------- Operations via SIGUSR2 signal";
+  result += "\n";
+  result += "\nThe alternative using SIGUSR2 signal requires the creation of the task(s) file which will be read at";
+  result += "\n signal event:";
+  result += "\n   echo \"<<operation>\" > "; result += getSignalUSR2InputFile();
+  result += "\n    then";
+  result += "\n   kill -12 <pid>";
+  result += "\n    or";
+  result += "\n   kill -s SIGUSR2 <pid>";
+  result += "\n    and then see the results:";
+  result += "\n   cat "; result += getSignalUSR2OutputFile();
+  result += "\n";
+  result += "\n   (this file is ended with EOF final line, useful managing huge batch files to ensure the job completion)";
+  result += "\n";
+  result += "\nYou could place more than one line (task) in the input file. Output reports will be appended in that";
+  result += "\n case over the output file. Take into account that all the content of the task file will be executed";
+  result += "\n sinchronously by the process. If you are planning traffic load, better use the asynchronous http";
+  result += "\n interface.";
+  result += "\n";
+  result += "\n";
+
+  return result;
+}
+
+
+void Launcher::logStatisticsSamples(const std::string &conceptsList) throw() {
+  anna::statistics::Engine &statEngine = anna::statistics::Engine::instantiate();
+
+  if(conceptsList == "all") {
+    if(statEngine.enableSampleLog(/* -1: all concepts */))
+      LOGDEBUG(anna::Logger::debug("Sample log activation for all statistic concepts", ANNA_FILE_LOCATION));
+  }
+  else if(conceptsList == "none") {
+      if(statEngine.disableSampleLog(/* -1: all concepts */))
+        LOGDEBUG(anna::Logger::debug("Sample log deactivation for all statistic concepts", ANNA_FILE_LOCATION));
+  } else {
+    anna::Tokenizer lst;
+    lst.apply(conceptsList, ",");
+
+    if(lst.size() >= 1) {
+      anna::Tokenizer::const_iterator tok_min(lst.begin());
+      anna::Tokenizer::const_iterator tok_max(lst.end());
+      anna::Tokenizer::const_iterator tok_iter;
+      int conceptId;
+
+      for(tok_iter = tok_min; tok_iter != tok_max; tok_iter++) {
+        conceptId = atoi(anna::Tokenizer::data(tok_iter));
+
+        if(statEngine.enableSampleLog(conceptId))
+          LOGDEBUG(anna::Logger::debug(anna::functions::asString("Sample log activation for statistic concept id = %d", conceptId), ANNA_FILE_LOCATION));
+      }
+    }
+  }
+}
+
+
+void Launcher::eventOperation(const std::string &operation, std::string &response_content) throw(anna::RuntimeException) {
+  LOGMETHOD(anna::TraceMethod tm("Launcher", "eventOperation", ANNA_FILE_LOCATION));
+  if (operation == "") return; // ignore
+  LOGDEBUG(anna::Logger::debug(anna::functions::asString("Operation: %s", operation.c_str()), ANNA_FILE_LOCATION));
+
+  // Default response:
+  response_content = "Operation processed with exception: ";
+  response_content += operation;
+  std::string opt_response_content = ""; // aditional response content
+  anna::DataBlock db_aux(true);
+  anna::diameter::codec::Message codecMsg; // auxiliary codec message
+
+  // Singletons:
+  anna::testing::TestManager &testManager = anna::testing::TestManager::instantiate();
+
+
+  ///////////////////////////////////////////////////////////////////
+  // Simple operations without arguments:
+
+  // Dynamic operation:
+  if(operation.find("dynamic") == 0) {
+    Procedure p(this);
+    int op_size = operation.size();
+    std::string args = ((operation.find("dynamic|") == 0) && (op_size > 8)) ? operation.substr(8) : "";
+    if (args == "" && op_size != 7)
+      throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+    try {
+      p.execute(args, response_content);
+    }
+    catch(anna::RuntimeException &ex) {
+      ex.trace();
+      response_content = ex.asString();
+      return;
+    }
+    return;
+  }
+
+  // Help:
+  if(operation == "help") {
+    response_content = help();
+    return;
+  }
+
+  // Reset performance data:
+  if(operation == "collect") {
+    resetCounters();
+    resetStatistics();
+    response_content = "All process counters & statistic information have been reset";
+    return;
+  }
+
+  // Counters dump on demand:
+  if(operation == "forceCountersRecord") {
+    forceCountersRecord();
+    response_content = "Current counters have been dump to disk";
+    return;
+  }
+
+  // OAM & statistics:
+  if(operation == "show-oam") {
+    anna::xml::Node root("root");
+    response_content = anna::xml::Compiler().apply(oamAsXML(&root));
+    return;
+  }
+  if(operation == "show-stats") {
+    anna::xml::Node root("root");
+    response_content = anna::xml::Compiler().apply(statsAsXML(&root));
+    return;
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  // Tokenize operation
+  Tokenizer params;
+  params.apply(operation, "|", "<null>" /* allow contiguous separators */);
+  int numParams = params.size() - 1;
+
+  // Get the operation type and parameters:
+  Tokenizer::const_iterator tok_iter = params.begin();
+  std::string opType = Tokenizer::data(tok_iter);
+  std::string param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11;
+  if(numParams >= 1) { tok_iter++; param1 = Tokenizer::data(tok_iter); }
+  if(numParams >= 2) { tok_iter++; param2 = Tokenizer::data(tok_iter); }
+  if(numParams >= 3) { tok_iter++; param3 = Tokenizer::data(tok_iter); }
+  // Tests conditions
+  if(numParams >= 4) { tok_iter++; param4 = Tokenizer::data(tok_iter); }
+  if(numParams >= 5) { tok_iter++; param5 = Tokenizer::data(tok_iter); }
+  if(numParams >= 6) { tok_iter++; param6 = Tokenizer::data(tok_iter); }
+  if(numParams >= 7) { tok_iter++; param7 = Tokenizer::data(tok_iter); }
+  if(numParams >= 8) { tok_iter++; param8 = Tokenizer::data(tok_iter); }
+  if(numParams >= 9) { tok_iter++; param9 = Tokenizer::data(tok_iter); }
+  if(numParams >= 10) { tok_iter++; param10 = Tokenizer::data(tok_iter); }
+  if(numParams >= 11) { tok_iter++; param11 = Tokenizer::data(tok_iter); }
+  // Remove '<null>' artificial token to ease further checkings:
+  if (param1 == "<null>") param1 = "";
+  if (param2 == "<null>") param2 = "";
+  if (param3 == "<null>") param3 = "";
+  if (param4 == "<null>") param4 = "";
+  if (param5 == "<null>") param5 = "";
+  if (param6 == "<null>") param6 = "";
+  if (param7 == "<null>") param7 = "";
+  if (param8 == "<null>") param8 = "";
+  if (param9 == "<null>") param9 = "";
+  if (param10 == "<null>") param10 = "";
+  if (param11 == "<null>") param11 = "";
+
+  // No operation has more than 2 arguments except 'test' ...
+  if(opType != "test" && numParams > 2)
+    throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+
+  // Check the number of parameters:
+  bool wrongBody = false;
+
+  if((opType == "change-dir") && (numParams > 1)) wrongBody = true;
+  if((opType == "log-statistics-samples") && (numParams != 1)) wrongBody = true;
+  if((opType == "node") && (numParams > 1)) wrongBody = true;
+
+  if((opType == "node_auto") && (numParams > 0)) wrongBody = true;
+
+  if(((opType == "code") || (opType == "decode")) && (numParams != 2)) wrongBody = true;
+
+  if(((opType == "sendxml2e") || (opType == "sendhex2e")) && (numParams != 1)) wrongBody = true;
+
+  if((opType == "burst") && (numParams < 1)) wrongBody = true;
+
+  if((opType == "test") && (numParams < 1)) wrongBody = true;
+
+  if(((opType == "sendxml2c") || (opType == "sendhex2c") || (opType == "loadxml") || (opType == "diameterServerSessions")) && (numParams != 1)) wrongBody = true;
+
+  if(wrongBody) {
+    // Launch exception
+    std::string msg = "Wrong body content format on HTTP Request for '";
+    msg += opType;
+    msg += "' operation (missing parameter/s). Use 'help' management command to see more information.";
+    throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
+  }
+
+  // Operations:
+  if(opType == "context") {
+    std::string contextFile = ((numParams == 1) ? param1 : anna::functions::asString("/var/tmp/anna.context.%05d", getPid()));
+    writeContext(contextFile);
+    response_content = anna::functions::asString("Context dumped on file '%s'", contextFile.c_str());
+    return;
+  }
+
+  if(opType == "log-statistics-samples") {
+    logStatisticsSamples(param1);
+    response_content = anna::functions::asString("Log statistics samples for '%s' concepts", param1.c_str());
+    return;
+  }
+
+  // Change execution directory:
+  if(opType == "change-dir") {
+    if (param1 == "") param1 = a_initialWorkingDirectory;
+    if (chdir(param1.c_str()) == 0)
+      response_content = "New execution directory configured: ";
+    else
+      response_content = "Cannot assign provided execution directory: ";
+
+    response_content += param1;
+    return;
+  }
+
+  if(opType == "services") {
+    std::string servicesFile = ((numParams == 1) ? param1 : "services.xml");
+    try {
+      loadServices(servicesFile, true /* bind entities */);
+    }
+    catch(anna::RuntimeException &ex) {
+      ex.trace();
+      response_content = anna::functions::asString("Loaded services from file '%s' with errors", servicesFile.c_str());
+      return;
+    }
+    response_content = anna::functions::asString("Loaded services from file '%s'", servicesFile.c_str());
+    return;
+  }
+
+  // Host switch:
+  if(opType == "node") {
+    if (param1 != "") {
+      if (setWorkingNode(param1)) response_content = anna::functions::asString("Forced node is now '%s'", param1.c_str());
+    }
+    else {
+      if (a_workingNode) {
+        response_content = "Working node is forced to be: \n\n";
+        response_content += a_workingNode->asXMLString();
+      }
+      else {
+        response_content = "Working node is automatic";
+      }
+    }
+    return;
+  }
+  if(opType == "node_auto") {
+    a_workingNode = NULL;
+    response_content = "Working node has been set to automatic";
+    return;
+  }
+
+  // Operated host from possible forced-working node:
+  a_operatedHost = a_workingNode ? a_workingNode /* priority */: NULL /* auto */;
+  // Use later:
+  //    If any message is managed: updateOperatedOriginHostWithMessage(codecMessage)
+  //    To operate, use the exception-protected methods which never will return NULL:
+  //         getOperatedHost(), getOperatedEntity(), getOperatedServer(), getOperatedEngine()
+
+
+  if(opType == "code") {
+    codecMsg.loadXML(param1);
+    std::string hexString = anna::functions::asHexString(codecMsg.code());
+    // write to outfile
+    std::ofstream outfile(param2.c_str(), std::ifstream::out);
+    outfile.write(hexString.c_str(), hexString.size());
+    outfile.close();
+  } else if(opType == "decode") {
+    // Get DataBlock from file with hex content:
+    if(!getDataBlockFromHexFile(param1, db_aux))
+      throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
+
+    // Decode
+    try { codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
+
+    std::string xmlString = codecMsg.asXMLString();
+    // write to outfile
+    std::ofstream outfile(param2.c_str(), std::ifstream::out);
+    outfile.write(xmlString.c_str(), xmlString.size());
+    outfile.close();
+  } else if((opType == "hide") || (opType == "show") || (opType == "hidden") || (opType == "shown")) {
+
+    if(param1 != "") {
+      if(param2 != "") {
+        std::string key = param1;
+        key += "|";
+        key += param2;
+
+        if(opType == "hide") getOperatedEngine()->findClientSession(key)->hide();
+
+        if(opType == "show") getOperatedEngine()->findClientSession(key)->show();
+
+        if(opType == "hidden") opt_response_content = getOperatedEngine()->findClientSession(key)->hidden() ? "true" : "false";
+
+        if(opType == "shown") opt_response_content = getOperatedEngine()->findClientSession(key)->shown() ? "true" : "false";
+      } else {
+        std::string address;
+        int port;
+        anna::functions::getAddressAndPortFromSocketLiteral(param1, address, port);
+
+        if(opType == "hide") getOperatedEngine()->findServer(address, port)->hide();
+
+        if(opType == "show") getOperatedEngine()->findServer(address, port)->show();
+
+        if(opType == "hidden") opt_response_content = getOperatedEngine()->findServer(address, port)->hidden() ? "true" : "false";
+
+        if(opType == "shown") opt_response_content = getOperatedEngine()->findServer(address, port)->shown() ? "true" : "false";
+      }
+    } else {
+      if(opType == "hide") getOperatedEntity()->hide();
+
+      if(opType == "show") getOperatedEntity()->show();
+
+      if(opType == "hidden") opt_response_content = getOperatedEntity()->hidden() ? "true" : "false";
+
+      if(opType == "shown") opt_response_content = getOperatedEntity()->shown() ? "true" : "false";
+    }
+  } else if((opType == "sendxml2e") || (opType == "sendhex2e")) {
+    anna::diameter::comm::Message *msg;
+
+    if(opType == "sendxml2e") {
+      codecMsg.loadXML(param1);
+      updateOperatedOriginHostWithMessage(codecMsg);
+      msg = getOperatedHost()->createCommMessage();
+      msg->clearBody();
+      try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); }  // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
+      msg->setBody(codecMsg.code());
+    } else {
+      // Get DataBlock from file with hex content:
+      if(!getDataBlockFromHexFile(param1, db_aux))
+        throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
+      msg = getOperatedHost()->createCommMessage();
+      msg->setBody(db_aux);
+      try { if(getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
+    }
+
+    bool success = getOperatedEntity()->send(msg);
+    getOperatedHost()->releaseCommMessage(msg);
+
+    // Detailed log:
+    if(getOperatedHost()->logEnabled()) {
+      anna::diameter::comm::Server *usedServer = getOperatedEntity()->getLastUsedResource();
+      anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL;
+      std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // shouldn't happen
+      getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail);
+    }
+  } else if((opType == "burst")) {
+
+    if (!uniqueOriginHost())
+      throw anna::RuntimeException("Burst category operations are only allowed in single host node configuration. This is only to simplify user experience.", ANNA_FILE_LOCATION);
+
+    // burst|clear                     clears all loaded burst messages.
+    // burst|load|<source_file>        loads the next diameter message into launcher burst.
+    // burst|start|<initial load>      starts the message sending with a certain initial load.
+    // burst|push|<load amount>        sends specific non-aynchronous load.
+    // burst|stop                      stops the burst cycle.
+    // burst|repeat|[[yes]|no]         restarts the burst launch when finish.
+    // burst|send|<amount>             send messages from burst list. The main difference with
+    //                                 start/push operations is that burst won't be awaken.
+    //                                 Externally we could control sending time (no request
+    //                                 will be sent for answers).
+    // burst|goto|<order>              Updates current burst pointer position.
+    // burst|look|<order>              Show programmed burst message for order provided, current when missing.
+
+    if(param1 == "clear") {
+      opt_response_content = "removed ";
+      opt_response_content += anna::functions::asString(getOperatedHost()->clearBurst());
+      opt_response_content += " elements";
+    } else if(param1 == "load") {
+      if(param2 == "") throw anna::RuntimeException("Missing xml path file for burst load operation", ANNA_FILE_LOCATION);
+
+      codecMsg.loadXML(param2);
+      if(codecMsg.isAnswer()) throw anna::RuntimeException("Cannot load diameter answers for burst feature", ANNA_FILE_LOCATION);
+      try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); }  // at least we need to see validation errors although it will continue loading (see validation mode configured in launcher)
+
+      int position = getOperatedHost()->loadBurstMessage(codecMsg.code());
+      opt_response_content = "loaded '";
+      opt_response_content += param2;
+      opt_response_content += "' file into burst list position ";
+      opt_response_content += anna::functions::asString(position);
+    } else if(param1 == "start") {
+      if(param2 == "") throw anna::RuntimeException("Missing initial load for burst start operation", ANNA_FILE_LOCATION);
+
+      int initialLoad = atoi(param2.c_str());
+      int processed = getOperatedHost()->startBurst(initialLoad);
+
+      if(processed > 0) {
+        opt_response_content = "initial load completed for ";
+        opt_response_content += anna::functions::entriesAsString(processed, "message");
+      }
+    } else if(param1 == "push") {
+      if(param2 == "") throw anna::RuntimeException("Missing load amount for burst push operation", ANNA_FILE_LOCATION);
+
+      int pushed = getOperatedHost()->pushBurst(atoi(param2.c_str()));
+
+      if(pushed > 0) {
+        opt_response_content = "pushed ";
+        opt_response_content += anna::functions::entriesAsString(pushed, "message");
+      }
+    } else if(param1 == "pop") {
+      if(param2 == "") throw anna::RuntimeException("Missing amount for burst pop operation", ANNA_FILE_LOCATION);
+
+      int releaseLoad = atoi(param2.c_str());
+      int popped = getOperatedHost()->popBurst(releaseLoad);
+
+      if(popped > 0) {
+        opt_response_content = "burst popped for ";
+        opt_response_content += anna::functions::entriesAsString(popped, "message");
+      }
+    } else if(param1 == "stop") {
+      int left = getOperatedHost()->stopBurst();
+
+      if(left != -1) {
+        opt_response_content += anna::functions::entriesAsString(left, "message");
+        opt_response_content += " left to the end of the cycle";
+      }
+    } else if(param1 == "repeat") {
+      if(param2 == "") param2 = "yes";
+
+      bool repeat = (param2 == "yes");
+      getOperatedHost()->repeatBurst(repeat);
+      opt_response_content += (repeat ? "repeat enabled" : "repeat disabled");
+    } else if(param1 == "send") {
+      if(param2 == "") throw anna::RuntimeException("Missing amount for burst send operation", ANNA_FILE_LOCATION);
+
+      int sent = getOperatedHost()->sendBurst(atoi(param2.c_str()));
+
+      if(sent > 0) {
+        opt_response_content = "sent ";
+        opt_response_content += anna::functions::entriesAsString(sent, "message");
+      }
+    } else if(param1 == "goto") {
+      if(param2 == "") throw anna::RuntimeException("Missing order position for burst goto operation", ANNA_FILE_LOCATION);
+
+      opt_response_content = getOperatedHost()->gotoBurst(atoi(param2.c_str()));
+    } else if(param1 == "look") {
+      int order = ((param2 != "") ? atoi(param2.c_str()) : -1);
+      opt_response_content = "\n\n";
+      opt_response_content += getOperatedHost()->lookBurst(order);
+    } else {
+      throw anna::RuntimeException("Wrong body content format on HTTP Request for 'burst' operation (unexpected action parameter). See help", ANNA_FILE_LOCATION);
+    }
+
+  } else if((opType == "test")) {
+    // test|<id>|<command>[|parameters]         Add a new step to the test case ...
+    // test|ttps|<amount>                       Starts/resume the provided number of time ticks per second (ttps). The ADML starts ...
+    // test|next[|<sync-amount>]                Forces the execution of the next test case(s) without waiting for test manager tick ...
+    // test|ip-limit[|amount]                   In-progress limit of test cases. No new test cases will be launched over this value ...
+    // test|repeats|<amount>                    Restarts the whole programmed test list when finished the amount number of times ...
+    // test|report|<initialized/in-progress/failed/success/[all]/none>[|[yes]|no]
+    //                                          Enables/disables report generation for a certain test case state: initialized, in-progress ...
+    // test|report-hex[|[yes]|no]               Reports could include the diameter messages in hexadecimal format. Disabled by default.
+    // test|goto|<id>                           Updates current test pointer position.
+    // test|look[|id]                           Show programmed test case for id provided, current when missing ...
+    // test|interact|amount|id                  Makes interactive a specific test case id. The amount is the margin of execution steps ...
+    // test|reset|<[soft]/hard>[|id]            Reset the test case for id provided, all the tests when missing ...
+    // test|auto-reset|<soft|hard>              When cycling, current test cases can be soft (default) or hard reset ...
+    // test|clear                               Clears all the programmed test cases.
+    // test|summary                             Test manager general report (number of test cases, counts by state ...
+
+
+    if(param1 == "ttps") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      bool success = ((param2 != "") ? testManager.configureTTPS(atoi(param2.c_str())) : false);
+      if (success) {
+        opt_response_content = "assigned new test launch rate to ";
+        opt_response_content += anna::functions::asString(atoi(param2.c_str()));
+        opt_response_content += " events per second";
+      }
+      else {
+        opt_response_content += "unable to configure the test rate provided";
+      }
+    }
+    else if (param1 == "next") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      int sync_amount = ((param2 != "") ? atoi(param2.c_str()) : 1);
+
+      if (sync_amount < 1)
+        throw anna::RuntimeException("The parameter 'sync-amount' must be a positive integer value", ANNA_FILE_LOCATION);
+
+      bool success = testManager.execTestCases(sync_amount);
+
+      opt_response_content = (success ? "" : "not completely " /* completed cycle and no repeats, rare case */);
+      opt_response_content += "processed ";
+      opt_response_content += anna::functions::asString(sync_amount);
+      opt_response_content += ((sync_amount > 1) ? " test cases synchronously" : " test case");
+    }
+    else if(param1 == "ip-limit") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      unsigned int limit;
+      if (param2 != "") {
+        limit = atoi(param2.c_str());
+        testManager.setInProgressLimit(limit);
+        opt_response_content = "new in-progress limit: ";
+        opt_response_content += (limit != UINT_MAX) ? anna::functions::asString(limit) : "<no limit>";
+      }
+      else {
+        opt_response_content = "in-progress limit amount: ";
+        limit = testManager.getInProgressLimit();
+        opt_response_content += (limit != UINT_MAX) ? anna::functions::asString(limit) : "<no limit>";
+        opt_response_content += "; currently there are ";
+        opt_response_content += anna::functions::asString(testManager.getInProgressCount());
+        opt_response_content += " test cases running";
+      }
+    }
+    else if(param1 == "repeats") {
+      if (numParams != 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+      int repeats = atoi(param2.c_str());
+      if (repeats < 0) repeats = -1;
+      testManager.setPoolRepeats(repeats);
+      std::string nolimit = (repeats != -1) ? "":" [no limit]";
+      opt_response_content += anna::functions::asString("Pool repeats: %d%s (current cycle: %d)", repeats, nolimit.c_str(), testManager.getPoolCycle());
+    }
+    else if(param1 == "report") {
+      if (numParams > 3)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") param2 = "all";
+      if(param3 == "") param3 = "yes";
+      bool enable = (param3 == "yes");
+
+      if(param2 == "initialized")
+        testManager.setDumpInitializedReports(enable);
+      else if(param2 == "in-progress")
+        testManager.setDumpInProgressReports(enable);
+      else if(param2 == "failed")
+        testManager.setDumpFailedReports(enable);
+      else if(param2 == "success")
+        testManager.setDumpSuccessReports(enable);
+      else if(param2 == "all") {
+        param2 = "any";
+        testManager.setDumpAllReports(enable);
+      }
+      else if(param2 == "none") {
+        enable = !enable;
+        param2 = "any";
+        testManager.setDumpAllReports(enable);
+      }
+      else
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      opt_response_content += (enable ? "report enabled " : "report disabled ");
+      opt_response_content += "for tests in '";
+      opt_response_content += param2;
+      opt_response_content += "' state";
+    }
+    else if(param1 == "report-hex") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") param2 = "yes";
+      testManager.setDumpHex((param2 == "yes"));
+      opt_response_content += (testManager.getDumpHex() ? "report includes hexadecimal messages" : "report excludes hexadecimal messages");
+    }
+    else if(param1 == "dump-stdout") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") param2 = "yes";
+      testManager.setDumpStdout((param2 == "yes"));
+      opt_response_content += (testManager.getDumpHex() ? "test manager dumps progress into stdout" : "test manager does not dump progress into stdout");
+    }
+    else if(param1 == "goto") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") throw anna::RuntimeException("Missing id for test goto operation", ANNA_FILE_LOCATION);
+      int id = atoi(param2.c_str());
+      if (testManager.gotoTestCase(id)) {
+        opt_response_content = "position updated for id provided (";
+      }
+      else {
+        opt_response_content = "cannot found test id (";
+      }
+      opt_response_content += anna::functions::asString(id);
+      opt_response_content += ")";
+    }
+    else if(param1 == "look") {
+      if (numParams > 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      int id = ((param2 != "") ? atoi(param2.c_str()) : -1);
+      anna::testing::TestCase *testCase = testManager.findTestCase(id);
+
+      if (testCase) {
+        response_content = testCase->asXMLString();
+        return;
+      }
+      else {
+        if (id == -1) {
+          opt_response_content = "no current test case detected (testing started ?)";
+        }
+        else {
+          opt_response_content = "cannot found test id (";
+          opt_response_content += anna::functions::asString(id);
+          opt_response_content += ")";
+        }
+      }
+    }
+    else if (param1 == "interact") {
+      if (numParams != 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      int amount = atoi(param2.c_str());
+      if (amount < -1)
+        throw anna::RuntimeException("Interactive amount must be -1 (to disable interactive mode) or a positive number.", ANNA_FILE_LOCATION);
+
+      int id = ((param3 != "") ? atoi(param3.c_str()) : -1);
+      anna::testing::TestCase *testCase = testManager.findTestCase(id);
+      if (testCase) {
+        if (amount == -1) {
+          testCase->makeInteractive(false);
+          opt_response_content = "interactive mode disabled";
+        }
+        else {
+          testCase->addInteractiveAmount(amount);
+          opt_response_content = "added interactive amount of ";
+          opt_response_content += anna::functions::asString(amount);
+          opt_response_content += " units";
+          if (amount == 0) opt_response_content += " (0: freezing a non-interactive testcase, no effect on already interactive)";
+        }
+        opt_response_content += " for test case id ";
+        opt_response_content += anna::functions::asString(id);
+      }
+      else {
+        opt_response_content = "cannot found test id (";
+        opt_response_content += anna::functions::asString(id);
+        opt_response_content += ")";
+      }
+    }
+    else if(param1 == "reset") {
+      if (numParams > 3)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if(param2 == "") param2 = "soft";
+     if (param2 != "soft" && param2 != "hard")
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      int id = ((param3 != "") ? atoi(param3.c_str()) : -1);
+      anna::testing::TestCase *testCase = ((id != -1) ? testManager.findTestCase(id) : NULL);
+
+      if (testCase) {
+        bool done = testCase->reset(param2 == "hard");
+        opt_response_content = "test ";
+        opt_response_content += param2;
+        opt_response_content += " reset for id ";
+        opt_response_content += anna::functions::asString(id);
+        opt_response_content += done ? ": done": ": not done";
+      }
+      else {
+        if (id == -1) {
+          bool anyReset = testManager.resetPool(param2 == "hard");
+          opt_response_content = param2; opt_response_content += " reset have been sent to all programmed tests: "; opt_response_content += anyReset ? "some/all have been reset" : "nothing was reset";
+        }
+        else {
+          opt_response_content = "cannot found test id (";
+          opt_response_content += anna::functions::asString(id);
+          opt_response_content += ")";
+        }
+      }
+    }
+    else if(param1 == "auto-reset") {
+      if (numParams != 2)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if (param2 != "soft" && param2 != "hard")
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      testManager.setAutoResetHard(param2 == "hard");
+      opt_response_content += anna::functions::asString("Auto-reset configured to '%s'", param2.c_str());
+    }
+    else if(param1 == "initialized") {
+      if (numParams > 1)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      opt_response_content = anna::functions::asString("%lu", testManager.getInitializedCount());
+    }
+    else if(param1 == "finished") {
+      if (numParams > 1)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      opt_response_content = anna::functions::asString("%lu", testManager.getFinishedCount());
+    }
+    else if(param1 == "clear") {
+      if (numParams > 1)
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+      if (testManager.clearPool()) {
+        opt_response_content = "all the programmed test cases have been dropped";
+      }
+      else {
+        opt_response_content = "there are not programmed test cases to be removed";
+      }
+    }
+    else if(param1 == "junit") {
+      response_content = testManager.junitAsXMLString();
+      return;
+    }
+    else if(param1 == "summary-counts") {
+      response_content = testManager.summaryCounts();
+      return;
+    }
+    else if(param1 == "summary-states") {
+      response_content = testManager.summaryStates();
+      return;
+    }
+    else if(param1 == "summary") {
+      response_content = testManager.asXMLString();
+      return;
+    }
+    else {
+      int id = atoi(param1.c_str());
+      if(id < 0)
+        throw anna::RuntimeException("Invalid test case identifier: must be a non-negative number", ANNA_FILE_LOCATION);
+
+      // PARAM: 1     2            3      4          5           6             7           8          9       10         11
+      // test|<id>|<command>
+      //             description|<description>
+      //             ip-limit[|<iplimit>]
+      //             timeout|    <msecs>
+      //             sendxml2e|  <file>[|<step number>]
+      //             sendxml2c|  <file>[|<step number>]
+      //             delay|      [msecs]
+      //             wait<fe/fc>|[code]|[bitR]|[hopByHop]|[applicationId]|[sessionId]|[resultCode]|[msisdn]|[imsi]|[serviceContextId]
+      //      wait<fe/fc>-answer|<step number>
+      //      wait<fe/fc>-xml   |<source_file>[|strict]
+      //      wait<fe/fc>-hex   |<source_file>[|strict]
+      if(param2 == "") throw anna::RuntimeException("Missing command for test id operation", ANNA_FILE_LOCATION);
+
+      // Commands:
+      if (param2 == "description") {
+        if (numParams > 3)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException("Missing description for test case", ANNA_FILE_LOCATION);
+        testManager.getTestCase(id)->setDescription(param3); // creates / reuses
+      }
+      else if (param2 == "ip-limit") {
+        if (numParams > 3)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        unsigned int limit = (param3 == "") ? 1 : atoi(param3.c_str());
+        testManager.getTestCase(id)->addIpLimit(limit); // creates / reuses
+      }
+      else if (param2 == "timeout") {
+        if (numParams > 3)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException("Missing milliseconds for 'timeout' command in test id operation", ANNA_FILE_LOCATION);
+        anna::Millisecond timeout = checkTimeMeasure("Test case timeout", param3);
+        testManager.getTestCase(id)->addTimeout(timeout); // creates / reuses
+      }
+      else if ((param2 == "sendxml2e")||(param2 == "sendxml2c")) {
+        if (numParams > 4)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException(anna::functions::asString("Missing xml file for '%s' command in test id operation", param2.c_str()), ANNA_FILE_LOCATION);
+        codecMsg.loadXML(param3);
+        LOGWARNING(
+          if (!codecMsg.isRequest() && (param4 == ""))
+            anna::Logger::warning("Step number has not been provided. Take into account that this answer message will be sent 'as is' and sequence information could be wrong at the remote peer", ANNA_FILE_LOCATION);
+        );
+
+        updateOperatedOriginHostWithMessage(codecMsg);
+        int stepNumber = ((param4 != "") ? atoi(param4.c_str()):-1);
+
+        if (param2 == "sendxml2e")
+          testManager.getTestCase(id)->addSendDiameterXml2e(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses
+        else
+          testManager.getTestCase(id)->addSendDiameterXml2c(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses
+      }
+      else if (param2 == "delay") {
+        if (numParams > 3)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException("Missing milliseconds for 'delay' command in test id operation", ANNA_FILE_LOCATION);
+        anna::Millisecond delay = ((param3 == "0" /* special case */) ? (anna::Millisecond)0 : checkTimeMeasure("Test case delay step", param3));
+        testManager.getTestCase(id)->addDelay(delay); // creates / reuses
+      }
+      else if ((param2 == "waitfe")||(param2 == "waitfc")) {
+        if (numParams > 11)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if (param3 != "" || param4 != "" || param5 != "" || param6 != "" || param7 != "" || param8 != "" || param9 != "" || param10 != "" || param11 != "") {
+          bool fromEntity = (param2.substr(4,2) == "fe");
+          testManager.getTestCase(id)->addWaitDiameter(fromEntity, param3, param4, param5, param6, param7, param8, param9, param10, param11);
+        }
+        else {
+          throw anna::RuntimeException(anna::functions::asString("Missing condition for '%s' command in test id operation", param2.c_str()), ANNA_FILE_LOCATION);
+        }
+      }
+      else if ((param2 == "waitfe-hex")||(param2 == "waitfc-hex")) {
+        if (numParams > 4)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException(anna::functions::asString("Missing hex file for '%s' command in test id operation", param2.c_str()), ANNA_FILE_LOCATION);
+
+        // Get DataBlock from file with hex content:
+        if(!getDataBlockFromHexFile(param3, db_aux))
+          throw anna::RuntimeException("Error reading hex content from file provided", ANNA_FILE_LOCATION);
+
+        // Hexadecimal representation read from file:
+        std::string regexp = anna::functions::asHexString(db_aux);
+
+        // optional 'full':
+        if(param4 != "strict") {
+          //// If request, we will ignore sequence data:
+          //if (anna::diameter::codec::functions::requestBit(db_aux))
+            regexp.replace (24, 16, "[0-9A-Fa-f]{16}");
+
+          regexp.insert(0, "^");
+          regexp += "$";
+        }
+
+        bool fromEntity = (param2.substr(4,2) == "fe");
+        testManager.getTestCase(id)->addWaitDiameterRegexpHex(fromEntity, regexp);
+      }
+      else if ((param2 == "waitfe-xml")||(param2 == "waitfc-xml")) {
+        if (numParams > 4)
+          throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException(anna::functions::asString("Missing xml file for '%s' command in test id operation", param2.c_str()), ANNA_FILE_LOCATION);
+
+        // Get xml content from file:
+        std::string regexp;
+        if(!getContentFromFile(param3, regexp))
+          throw anna::RuntimeException("Error reading xml content from file provided", ANNA_FILE_LOCATION);
+
+        // optional 'full':
+        if(param4 != "strict") {
+
+          // TODO: use this from gcc4.9.0: http://stackoverflow.com/questions/8060025/is-this-c11-regex-error-me-or-the-compiler
+/*
+          std::string s_from = "hop-by-hop-id=\"[0-9]+\" end-to-end-id=\"[0-9]+\"";
+          std::string s_to = s_from;
+          std::string s_from2 = "avp name=\"Origin-State-Id\" data=\"[0-9]+\"";
+          std::string s_to2 = s_from2;
+
+          try {
+            regexp = std::regex_replace (regexp, std::regex(s_from), s_to);
+            regexp = std::regex_replace (regexp, std::regex(s_from2), s_to2);
+          }
+          catch (const std::regex_error& e) {
+            throw anna::RuntimeException(e.what(), ANNA_FILE_LOCATION);
+          }
+
+*/
+          std::string::size_type pos, pos_1, pos_2;
+
+          pos = regexp.find("hop-by-hop-id=", 0u);
+          pos = regexp.find("\"", pos);
+          pos_1 = pos;
+          pos = regexp.find("\"", pos+1);
+          pos_2 = pos;
+          regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+
+          pos = regexp.find("end-to-end-id=", 0u);
+          pos = regexp.find("\"", pos);
+          pos_1 = pos;
+          pos = regexp.find("\"", pos+1);
+          pos_2 = pos;
+          regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+
+          pos = regexp.find("Origin-State-Id", 0u);
+          pos = regexp.find("\"", pos);
+          pos = regexp.find("\"", pos+1);
+          pos_1 = pos;
+          pos = regexp.find("\"", pos+1);
+          pos_2 = pos;
+          regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+
+          //regexp.insert(0, "^");
+          //regexp += "$";
+        }
+
+        bool fromEntity = (param2.substr(4,2) == "fe");
+        testManager.getTestCase(id)->addWaitDiameterRegexpXml(fromEntity, regexp);
+      }
+      else if (param2 == "sh-command") {
+        // Allow pipes in command:
+        //if (numParams > 4)
+        //  throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+        if(param3 == "") throw anna::RuntimeException("Missing script/executable command-line for 'sh-command' in test id operation", ANNA_FILE_LOCATION);
+        std::string token = "|sh-command|";
+        std::string command = operation.substr(operation.find(token) + token.size());
+        testManager.getTestCase(id)->addCommand(command); // creates / reuses
+      }
+      else {
+        throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+      }
+    }
+
+  } else if((opType == "sendxml2c") || (opType == "sendhex2c")) {
+    anna::diameter::comm::Message *msg;
+
+    if(opType == "sendxml2c") {
+      codecMsg.loadXML(param1);
+      updateOperatedOriginHostWithMessage(codecMsg);
+      msg = getOperatedHost()->createCommMessage();
+      msg->clearBody();
+      try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); }  // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
+
+      msg->setBody(codecMsg.code());
+    } else {
+      // Get DataBlock from file with hex content:
+      if(!getDataBlockFromHexFile(param1, db_aux))
+        throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
+      msg = getOperatedHost()->createCommMessage();
+      msg->setBody(db_aux);
+    }
+
+    bool success = getOperatedServer()->send(msg);
+    getOperatedHost()->releaseCommMessage(msg);
+
+    // Detailed log:
+    if(getOperatedHost()->logEnabled()) {
+      anna::diameter::comm::ServerSession *usedServerSession = getOperatedServer()->getLastUsedResource();
+      std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
+      getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
+    }
+  } else if(opType == "loadxml") {
+    codecMsg.loadXML(param1);
+    response_content = codecMsg.asXMLString();
+    return;
+  } else if(opType == "diameterServerSessions") {
+    int diameterServerSessions = atoi(param1.c_str());
+    getOperatedServer()->setMaxConnections(diameterServerSessions);
+
+  } else if(opType == "answerxml2c") {
+    if(param1 == "") { // programmed answers FIFO's to stdout
+      response_content = getOperatedServer()->getReactingAnswers()->asString("ANSWERS TO CLIENT");
+      return;
+    } else if (param1 == "rotate") {
+      getOperatedServer()->getReactingAnswers()->rotate(true);
+    } else if (param1 == "exhaust") {
+      getOperatedServer()->getReactingAnswers()->rotate(false);
+    } else if (param1 == "clear") {
+      getOperatedServer()->getReactingAnswers()->clear();
+    } else if (param1 == "dump") {
+      getOperatedServer()->getReactingAnswers()->dump("programmed_answer");
+    } else {
+      codecMsg.loadXML(param1);
+      updateOperatedOriginHostWithMessage(codecMsg);
+      anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+      LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
+
+      if(message->isRequest())
+        throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
+
+      int code = message->getId().first;
+      LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to client' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
+      getOperatedServer()->getReactingAnswers()->addMessage(code, message);
+    }
+  } else if(opType == "answerxml2e") {
+
+    if(param1 == "") { // programmed answers FIFO's to stdout
+      response_content = getOperatedEntity()->getReactingAnswers()->asString("ANSWERS TO ENTITY");
+      return;
+    } else if (param1 == "rotate") {
+      getOperatedEntity()->getReactingAnswers()->rotate(true);
+    } else if (param1 == "exhaust") {
+      getOperatedEntity()->getReactingAnswers()->rotate(false);
+    } else if (param1 == "clear") {
+      getOperatedEntity()->getReactingAnswers()->clear();
+    } else if (param1 == "dump") {
+      getOperatedEntity()->getReactingAnswers()->dump("programmed_answer");
+    } else {
+      codecMsg.loadXML(param1);
+      updateOperatedOriginHostWithMessage(codecMsg);
+      anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils
+      LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
+
+      if(message->isRequest())
+        throw anna::RuntimeException("Cannot program diameter requests. Answer type must be provided", ANNA_FILE_LOCATION);
+
+      int code = message->getId().first;
+      LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to entity' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
+      getOperatedEntity()->getReactingAnswers()->addMessage(code, message);
+    }
+  } else {
+    throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+  }
+
+  // HTTP response
+  response_content = "Operation correctly processed: "; response_content += operation;
+  if (opt_response_content != "") {
+    response_content += " => ";
+    response_content += opt_response_content;
+  }
+}
+
+anna::xml::Node* Launcher::asXML(anna::xml::Node* parent) const
+throw() {
+  anna::xml::Node* result = parent->createChild("launcher");
+  anna::comm::Application::asXML(result);
+  // Timming:
+  result->createAttribute("StartTime", a_start_time.asString());
+  result->createAttribute("InitialWorkingDirectory", a_initialWorkingDirectory);
+  result->createAttribute("SecondsLifeTime", anna::time::functions::lapsedMilliseconds() / 1000);
+  // Diameter:
+  anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate();
+  for (diameter::comm::origin_hosts_it it = ohm.begin(); it != ohm.end(); it++) {
+    it->second->asXML(result);
+  }
+
+  // Registered codec engines:
+  anna::diameter::codec::EngineManager &em = anna::diameter::codec::EngineManager::instantiate();
+  em.asXML(result);
+
+  // OAM & statistics:
+  oamAsXML(result);
+  statsAsXML(result);
+
+  // Testing: could be heavy if test case reports are enabled
+  anna::testing::TestManager::instantiate().asXML(result);
+
+  return result;
+}
+
+anna::xml::Node* Launcher::oamAsXML(anna::xml::Node* parent) const
+throw() {
+  anna::xml::Node* result = parent->createChild("Oam");
+
+  // OAM:
+  anna::diameter::comm::OamModule::instantiate().asXML(result);
+  anna::diameter::comm::ApplicationMessageOamModule::instantiate().asXML(result);
+  anna::diameter::codec::OamModule::instantiate().asXML(result);
+
+  return result;
+}
+
+anna::xml::Node* Launcher::statsAsXML(anna::xml::Node* parent) const
+throw() {
+  anna::xml::Node* result = parent->createChild("Statistics");
+
+  // Statistics:
+  anna::statistics::Engine::instantiate().asXML(result);
+
+  return result;
+}