test mode: parse interface list in test mode

pull/3520/head
Victor Julien 7 years ago
parent 77c7cf0211
commit 6781146556

@ -945,7 +945,7 @@ static TmEcode LoadYamlConfig(SCInstance *suri)
SCReturnInt(TM_ECODE_OK); SCReturnInt(TM_ECODE_OK);
} }
static TmEcode ParseInterfacesList(int runmode, char *pcap_dev) static TmEcode ParseInterfacesList(const int runmode, char *pcap_dev)
{ {
SCEnter(); SCEnter();
@ -2128,6 +2128,9 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
} }
/* save the runmode from the commandline (if any) */
suri->aux_run_mode = suri->run_mode;
if (list_app_layer_protocols) if (list_app_layer_protocols)
suri->run_mode = RUNMODE_LIST_APP_LAYERS; suri->run_mode = RUNMODE_LIST_APP_LAYERS;
if (list_keywords) if (list_keywords)
@ -2976,7 +2979,7 @@ int main(int argc, char **argv)
LogVersion(); LogVersion();
UtilCpuPrintSummary(); UtilCpuPrintSummary();
if (ParseInterfacesList(suricata.run_mode, suricata.pcap_dev) != TM_ECODE_OK) { if (ParseInterfacesList(suricata.aux_run_mode, suricata.pcap_dev) != TM_ECODE_OK) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

@ -132,6 +132,7 @@ PacketQueue trans_q[256];
typedef struct SCInstance_ { typedef struct SCInstance_ {
enum RunModes run_mode; enum RunModes run_mode;
enum RunModes aux_run_mode;
char pcap_dev[128]; char pcap_dev[128];
char *sig_file; char *sig_file;

Loading…
Cancel
Save