instance: set system vs user mode

pull/3777/head
Victor Julien 6 years ago
parent 231496f165
commit 86ed5815cb

@ -492,6 +492,19 @@ int RunModeOutputFiledataEnabled(void)
return filedata_logger_count > 0;
}
bool IsRunModeSystem(enum RunModes run_mode_to_check)
{
switch (run_mode_to_check) {
case RUNMODE_PCAP_FILE:
case RUNMODE_ERF_FILE:
case RUNMODE_ENGINE_ANALYSIS:
return false;
break;
default:
return true;
}
}
bool IsRunModeOffline(int run_mode_to_check)
{
switch(run_mode_to_check) {

@ -90,6 +90,7 @@ int RunModeOutputFileEnabled(void);
int RunModeOutputFiledataEnabled(void);
/** bool indicating if run mode is offline */
bool IsRunModeOffline(int run_mode_to_check);
bool IsRunModeSystem(enum RunModes run_mode_to_check);
void RunModeEnablesBypassManager(void);
int RunModeNeedsBypassManager(void);

@ -2096,6 +2096,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
suri->run_mode = RUNMODE_ENGINE_ANALYSIS;
suri->offline = IsRunModeOffline(suri->run_mode);
suri->system = IsRunModeSystem(suri->run_mode);
ret = SetBpfString(optind, argv);
if (ret != TM_ECODE_OK)

@ -150,6 +150,7 @@ typedef struct SCInstance_ {
uint32_t userid;
uint32_t groupid;
#endif /* OS_WIN32 */
bool system;
int delayed_detect;
int disabled_detect;
int daemon;

Loading…
Cancel
Save