62 lines
1.5 KiB
C++
Executable File
62 lines
1.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* main for VulnerabilityStateGenerator
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Baeuerle, SLSE, 2016-08-09
|
|
*/
|
|
|
|
#include <QtNetwork/QHostAddress>
|
|
#include <QtNetwork/QNetworkInterface>
|
|
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
|
#include <nglapplication/nglcoreapplication.h>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
|
#include "main_handler.h"
|
|
|
|
class CmdLineParser : public LtsCommandLineParser::LtsCommandLineParser
|
|
{
|
|
public:
|
|
CmdLineParser()
|
|
: LtsCommandLineParser()
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
NGLCoreApplication app(argc, argv);
|
|
CmdLineParser options;
|
|
|
|
if (!options.init())
|
|
return -1;
|
|
|
|
// Check alle 30 Sekunden
|
|
app.createLogger("VSG ", "log4cxx_vsg.props");
|
|
VulnerabilityStateGenerator::MainHandler mainHandler;
|
|
|
|
NGL::INGLLogger &logger = app.logger("main");
|
|
|
|
int iRet = -1;
|
|
if (!mainHandler.init(options.domainId(), options.exerciseId()))
|
|
{
|
|
ERROR_LOG(logger) << "Could not init MainHandler\n"
|
|
<< "Please make shure, that the following procs are running:\n"
|
|
<< "svcParticipantManagement -d " << options.domainId() << " -e 0\n"
|
|
<< "svcParticipantManagement -d " << options.domainId() << " -e " << options.exerciseId() << "\n"
|
|
<< "... shutting down";
|
|
return iRet;
|
|
}
|
|
|
|
STARTUP_LOG(logger);
|
|
|
|
iRet = app.exec();
|
|
|
|
SHUTDOWN_LOG(logger);
|
|
|
|
return iRet;
|
|
}
|