From 95a5bebb6a384f508fdd895ad3fbadfe7a91336d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 8 Feb 2012 06:36:05 -0500 Subject: [PATCH] Fix compilation without napatech tech support enabled. --- src/runmode-napatech.c | 11 +++++++---- src/runmode-napatech.h | 2 ++ src/source-napatech.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/runmode-napatech.c b/src/runmode-napatech.c index aa5759ce1b..52f487d7da 100644 --- a/src/runmode-napatech.c +++ b/src/runmode-napatech.c @@ -25,8 +25,6 @@ #include "alert-fastlog.h" #include "alert-prelude.h" -#include "alert-unified-log.h" -#include "alert-unified-alert.h" #include "alert-unified2-alert.h" #include "alert-debuglog.h" @@ -47,17 +45,19 @@ const char *RunModeNapatechGetDefaultMode(void) void RunModeNapatechRegister(void) { +#ifdef HAVE_NAPATECH default_mode = "auto"; RunModeRegisterNewRunMode(RUNMODE_NAPATECH, "auto", "Multi threaded Napatech mode", RunModeNapatechAuto2); return; +#endif } #define MAX_NAPATECH_DETECT 2 int RunModeNapatechAuto(DetectEngineCtx *de_ctx) { - +#ifdef HAVE_NAPATECH int i; uint16_t feed, cpu; char tname [128]; @@ -198,11 +198,12 @@ int RunModeNapatechAuto(DetectEngineCtx *de_ctx) { } } +#endif return 0; } int RunModeNapatechAuto2(DetectEngineCtx *de_ctx) { - +#ifdef HAVE_NAPATECH int i; uint16_t feed, cpu; char tname [128]; @@ -374,5 +375,7 @@ int RunModeNapatechAuto2(DetectEngineCtx *de_ctx) { } #endif } +#endif /* HAVE_NAPATECH */ return 0; } + diff --git a/src/runmode-napatech.h b/src/runmode-napatech.h index 9161a23ae8..98c2cc911f 100644 --- a/src/runmode-napatech.h +++ b/src/runmode-napatech.h @@ -23,7 +23,9 @@ #ifndef __RUNMODE_NAPATECH_H__ #define __RUNMODE_NAPATECH_H__ +#ifdef HAVE_NAPATECH #include "ntfeeds.h" +#endif int RunModeNapatechAuto(DetectEngineCtx *); void RunModeNapatechRegister(void); diff --git a/src/source-napatech.c b/src/source-napatech.c index 3d66accb99..33f451040e 100644 --- a/src/source-napatech.c +++ b/src/source-napatech.c @@ -64,7 +64,7 @@ void TmModuleNapatechDecodeRegister (void) { TmEcode NoNapatechSupportExit(ThreadVars *tv, void *initdata, void **data) { - SCLogError(SC_ERR_NAPTECH_NOSUPPORT, + SCLogError(SC_ERR_NAPATECH_NOSUPPORT, "Error creating thread %s: you do not have support for Napatech adapter " "enabled please recompile with --enable-napatech", tv->name); exit(EXIT_FAILURE);