Change case values to their corresponding enum values

remotes/origin/master-1.0.x
Gerardo Iglesias Galvan 16 years ago committed by Victor Julien
parent e917065e26
commit 5471baf8f4

@ -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; }

@ -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
*/

@ -11,6 +11,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#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:

Loading…
Cancel
Save