From 7f250a814a8ded8c4e7b87dce3ca54e53dc4b3d6 Mon Sep 17 00:00:00 2001 From: Pablo Rincon Date: Sun, 31 Jan 2010 19:47:36 +0100 Subject: [PATCH] Fixing redeclaration of run_mode --- src/flow.c | 3 +++ src/suricata.c | 4 +++- src/suricata.h | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/flow.c b/src/flow.c index 695f00a732..8cd2d7c7dd 100644 --- a/src/flow.c +++ b/src/flow.c @@ -46,6 +46,9 @@ static int FlowClearMemory(Flow *,uint8_t ); int FlowSetProtoFreeFunc(uint8_t, void (*Free)(void *)); int FlowSetFlowStateFunc (uint8_t , int (*GetProtoState)(void *)); +/* Run mode selected at suricata.c */ +extern int run_mode; + /** \brief Update the flows position in the queue's * \param f Flow to requeue. * \todo if we have a flow state func rely on that soly diff --git a/src/suricata.c b/src/suricata.c index da04b65c9f..887f62de93 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -107,6 +107,9 @@ volatile sig_atomic_t sigterm_count = 0; static uint8_t sigflags = 0; +/* Run mode selected */ +int run_mode = MODE_UNKNOWN; + static void SignalHandlerSigint(/*@unused@*/ int sig) { sigint_count = 1; sigflags |= SURICATA_SIGINT; } static void SignalHandlerSigterm(/*@unused@*/ int sig) { sigterm_count = 1; sigflags |= SURICATA_SIGTERM; } static void SignalHandlerSighup(/*@unused@*/ int sig) { sighup_count = 1; sigflags |= SURICATA_SIGHUP; } @@ -300,7 +303,6 @@ void usage(const char *progname) int main(int argc, char **argv) { int opt; - int run_mode = MODE_UNKNOWN; char *pcap_file = NULL; char *pcap_dev = NULL; char *pfring_dev = NULL; diff --git a/src/suricata.h b/src/suricata.h index 6d0e27ea8e..00cc8ddec8 100644 --- a/src/suricata.h +++ b/src/suricata.h @@ -41,8 +41,6 @@ enum { MODE_NFQ, MODE_UNITTEST }; -/* Run mode selected */ -int run_mode; /* preallocated packet structures here * XXX move to the packetpool queue handler code