From: Victor Julien Date: Wed, 1 Jun 2016 18:08:47 +0000 (+0200) Subject: instance: use enum for runmode X-Git-Tag: suricata-3.1RC1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2131%2Fhead;p=thirdparty%2Fsuricata.git instance: use enum for runmode --- diff --git a/src/runmodes.h b/src/runmodes.h index d935b9a3fe..0f1884e990 100644 --- a/src/runmodes.h +++ b/src/runmodes.h @@ -24,7 +24,7 @@ #define __RUNMODES_H__ /* Run mode */ -enum { +enum RunModes { RUNMODE_UNKNOWN = 0, RUNMODE_PCAP_DEV, RUNMODE_PCAP_FILE, diff --git a/src/suricata.c b/src/suricata.c index 8b3abd84a7..e53d6ea0a0 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2110,6 +2110,8 @@ static int FinalizeRunMode(SCInstance *suri, char **argv) case RUNMODE_UNKNOWN: usage(argv[0]); return TM_ECODE_FAILED; + default: + break; } /* Set the global run mode */ run_mode = suri->run_mode; diff --git a/src/suricata.h b/src/suricata.h index 1edd129d81..337305361d 100644 --- a/src/suricata.h +++ b/src/suricata.h @@ -119,6 +119,8 @@ enum { #define IS_SURI_HOST_MODE_SNIFFER_ONLY(host_mode) ((host_mode) == SURI_HOST_IS_SNIFFER_ONLY) #define IS_SURI_HOST_MODE_ROUTER(host_mode) ((host_mode) == SURI_HOST_IS_ROUTER) +#include "runmodes.h" + /* queue's between various other threads * XXX move to the TmQueue structure later */ @@ -127,7 +129,7 @@ PacketQueue trans_q[256]; SCDQDataQueue data_queues[256]; typedef struct SCInstance_ { - int run_mode; + enum RunModes run_mode; char pcap_dev[128]; char *sig_file;