int sigtotal = 0;
char *sfile = NULL;
- if (engine_analysis) {
+ if (RunmodeGetCurrent() == RUNMODE_ENGINE_ANALYSIS) {
fp_engine_analysis_set = SetupFPAnalyzer();
rule_engine_analysis_set = SetupRuleAnalyzer();
}
ret = 0;
end:
- if (engine_analysis) {
+ if (RunmodeGetCurrent() == RUNMODE_ENGINE_ANALYSIS) {
if (rule_engine_analysis_set) {
CleanupRuleAnalyzer();
}
/** Run mode selected */
int run_mode = RUNMODE_UNKNOWN;
-/** engine_analysis. disabled(0) by default, unless enabled by the user by
- * running the engine with --engine-analysis */
-int engine_analysis = 0;
-
/** Engine mode: inline (ENGINE_MODE_IPS) or just
* detection mode (ENGINE_MODE_IDS by default) */
uint8_t engine_mode = ENGINE_MODE_IDS;
int list_keywords = 0;
int build_info = 0;
int conf_test = 0;
+ int engine_analysis = 0;
#ifdef UNITTESTS
coverage_unittests = 0;
suri->run_mode = RUNMODE_DUMP_CONFIG;
if (conf_test)
suri->run_mode = RUNMODE_CONF_TEST;
+ if (engine_analysis)
+ suri->run_mode = RUNMODE_ENGINE_ANALYSIS;
return TM_ECODE_OK;
}
/* Load the Host-OS lookup. */
SCHInfoLoadFromConfig();
- if (run_mode != RUNMODE_UNIX_SOCKET) {
+ if (suri.run_mode != RUNMODE_UNIX_SOCKET) {
DefragInit();
}
- if (run_mode == RUNMODE_UNKNOWN) {
- if (!engine_analysis && !(suri.run_mode == RUNMODE_CONF_TEST)) {
- usage(argv[0]);
- exit(EXIT_FAILURE);
- }
+ if (suri.run_mode == RUNMODE_UNKNOWN) {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
}
- if (engine_analysis) {
+ if (suri.run_mode == RUNMODE_ENGINE_ANALYSIS) {
SCLogInfo("== Carrying out Engine Analysis ==");
char *temp = NULL;
if (ConfGet("engine-analysis", &temp) == 0) {
exit(EXIT_FAILURE);
/* In offline mode delayed init of detect is a bad idea */
- if ((run_mode == RUNMODE_PCAP_FILE) ||
- (run_mode == RUNMODE_ERF_FILE) ||
- engine_analysis) {
+ if ((suri.run_mode == RUNMODE_PCAP_FILE) ||
+ (suri.run_mode == RUNMODE_ERF_FILE) ||
+ (suri.run_mode == RUNMODE_ENGINE_ANALYSIS)) {
suri.delayed_detect = 0;
} else {
ConfNode *denode = NULL;
if (de_ctx->failure_fatal)
exit(EXIT_FAILURE);
}
- if (engine_analysis) {
+ if (suri.run_mode == RUNMODE_ENGINE_ANALYSIS) {
exit(EXIT_SUCCESS);
}
}