From 5471baf8f4ca0e286059e3334468233c94de5f40 Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Fri, 18 Dec 2009 14:51:35 +0100 Subject: [PATCH] Change case values to their corresponding enum values --- src/suricata.c | 10 ---------- src/suricata.h | 10 ++++++++++ src/util-daemon.c | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index b83983dd78..c129a49cd3 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -98,16 +98,6 @@ volatile sig_atomic_t sigterm_count = 0; #define EIDPS_STOP 0x08 #define EIDPS_KILL 0x10 -/* Run mode. */ -enum { - MODE_UNKNOWN = 0, - MODE_PCAP_DEV, - MODE_PCAP_FILE, - MODE_PFRING, - MODE_NFQ, - MODE_UNITTEST -}; - static uint8_t sigflags = 0; static void SignalHandlerSigint(/*@unused@*/ int sig) { sigint_count = 1; sigflags |= EIDPS_SIGINT; } diff --git a/src/suricata.h b/src/suricata.h index 852c8c02cf..0ec31ef8d5 100644 --- a/src/suricata.h +++ b/src/suricata.h @@ -31,6 +31,16 @@ uint32_t dbg_maxpending; SCMutex mutex_pending; SCCondT cond_pending; +/* Run mode */ +enum { + MODE_UNKNOWN = 0, + MODE_PCAP_DEV, + MODE_PCAP_FILE, + MODE_PFRING, + MODE_NFQ, + MODE_UNITTEST +}; + /* preallocated packet structures here * XXX move to the packetpool queue handler code */ diff --git a/src/util-daemon.c b/src/util-daemon.c index 2b6176b4cd..535e672812 100644 --- a/src/util-daemon.c +++ b/src/util-daemon.c @@ -11,6 +11,7 @@ #include #include +#include "eidps.h" #include "eidps-common.h" #include "util-daemon.h" #include "util-debug.h" @@ -96,13 +97,13 @@ static void SetupLogging () { int CheckValidDaemonModes (int daemon, int mode) { if (daemon) { switch (mode) { - case 1: + case MODE_PCAP_DEV: SCLogDebug("ERROR: pcap live mode cannot run as daemon"); return 0; - case 2: + case MODE_PCAP_FILE: SCLogDebug("ERROR: pcap offline mode cannot run as daemon"); return 0; - case 5: + case MODE_UNITTEST: SCLogDebug("ERROR: unittests cannot run as daemon"); return 0; default: