X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fmain.cpp;h=6f2a6533851bde43ef661fca1bde878f957987b2;hb=0c533bf948a63d134c8001e16b15194b197cb99a;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=705d780f70b3596a222479ec7ad0dc3b3ab192cf;p=anna.git diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index e69de29..6f2a653 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -0,0 +1,58 @@ +// 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 + +// Project +#include +#include +#include + +// Process +#include + + +int main(int argc, const char** argv) { + anna::Logger::setLevel(anna::Logger::Warning); + anna::Logger::initialize("launcher", new TraceWriter("launcher.trace", 2048000)); + anna::time::functions::initialize(); // before application instantiation (it have a anna::time object) + anna::time::functions::setControlPoint(); // start control point (application lifetime) + Launcher app; + anna::http::functions::initialize(); + + try { + anna::CommandLine& commandLine(anna::CommandLine::instantiate()); + // General + commandLine.add("services", anna::CommandLine::Argument::Mandatory, "Services xml path file. Shall be validated against dtd schema written on warning traces: 'Services DTD schema'. Empty string or \"null\" name, to start without services (see help for management operation 'services')."); + commandLine.add("trace", anna::CommandLine::Argument::Optional, "Trace level (emergency, alert, critical, error, warning, notice, information, debug, local0..local7)"); + commandLine.add("cntDir", anna::CommandLine::Argument::Optional, "Counters directory. By default is the current execution directory. Warning: a counter file will be dump per record period; take care about the possible accumulation of files"); + commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report|result'); take care about the possible accumulation of files"); + commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure."); + commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided comma-separated concept id list, over './sample..csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved words \"all\"/\"none\" activates/deactivates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it)."); + commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every node configuration regarding traffic log in order to disable it and ease production or system test startup.", false); + + // Communications + commandLine.add("reconnectionPeriod", anna::CommandLine::Argument::Optional, "Milliseconds to recover diameter client-session when server connection has been broken. If missing, default value of 10000 will be assigned"); + commandLine.add("httpServer", anna::CommandLine::Argument::Optional, "HTTP Management interface address (using i.e. curl tool) in '
:' format. For example: 10.20.30.40:8080"); + commandLine.add("httpServerShared", anna::CommandLine::Argument::Optional, "Enables shared bind for HTTP Management interface address. It would be useful i.e. to allow a great amount of curl operations per second", false); + + // Automatic error answer + commandLine.add("ignoreErrors", anna::CommandLine::Argument::Optional, "Local server skips requests errors analysis which would prepare automatic answers for them when a problem is found. If no answer is programmed and entity is configured, a failed request would be forwarded (delegates at the end point) even if this parameter is missing", false); + + commandLine.initialize(argv, argc); + commandLine.verify(); + std::cout << commandLine.asString() << std::endl; + app.start(); + } catch(anna::Exception& ex) { + std::cout << ex.asString() << std::endl; + } + + return 0; +} +