|
|
|
@ -2925,11 +2925,15 @@ static void SuricataMainLoop(SCInstance *suri)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
SCInstanceInit(&suricata, argv[0]);
|
|
|
|
|
SuricataContext context;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Global initialization common to all runmodes.
|
|
|
|
|
*
|
|
|
|
|
* This can be used by fuzz targets.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
SuricataContext context;
|
|
|
|
|
int InitGlobal(void) {
|
|
|
|
|
context.SCLogMessage = SCLogMessage;
|
|
|
|
|
context.DetectEngineStateFree = DetectEngineStateFree;
|
|
|
|
|
context.AppLayerDecoderEventsSetEventRaw =
|
|
|
|
@ -2961,13 +2965,27 @@ int main(int argc, char **argv)
|
|
|
|
|
UtilSignalHandlerSetup(SIGUSR2, SIG_IGN);
|
|
|
|
|
if (UtilSignalBlock(SIGUSR2)) {
|
|
|
|
|
SCLogError(SC_ERR_INITIALIZATION, "SIGUSR2 initialization error");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ParseSizeInit();
|
|
|
|
|
RunModeRegisterRunModes();
|
|
|
|
|
|
|
|
|
|
/* Initialize the configuration module. */
|
|
|
|
|
ConfInit();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
SCInstanceInit(&suricata, argv[0]);
|
|
|
|
|
|
|
|
|
|
if (InitGlobal() != 0) {
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef OS_WIN32
|
|
|
|
|
/* service initialization */
|
|
|
|
|
if (WindowsInitService(argc, argv) != 0) {
|
|
|
|
@ -2975,9 +2993,6 @@ int main(int argc, char **argv)
|
|
|
|
|
}
|
|
|
|
|
#endif /* OS_WIN32 */
|
|
|
|
|
|
|
|
|
|
/* Initialize the configuration module. */
|
|
|
|
|
ConfInit();
|
|
|
|
|
|
|
|
|
|
if (ParseCommandLine(argc, argv, &suricata) != TM_ECODE_OK) {
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|