From 9a0bf0956b88e35282d5923dd5e06fc35b64c6dd Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 9 Apr 2013 11:34:12 +0200 Subject: [PATCH] suricata: list cuda cards in separate function --- src/suricata.c | 10 ++++++---- src/util-running-modes.c | 11 +++++++++++ src/util-running-modes.h | 3 +++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 953d114b08..f42d048875 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1326,6 +1326,12 @@ int main(int argc, char **argv) return SuriListAppLayerProtocols(); } +#ifdef __SC_CUDA_SUPPORT__ + if (list_cuda_cards) { + return SuriListCudaCards(); + } +#endif + #ifdef REVISION SCLogInfo("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(REVISION)); #elif defined RELEASE @@ -1341,10 +1347,6 @@ int main(int argc, char **argv) #ifdef __SC_CUDA_SUPPORT__ /* Init the CUDA environment */ SCCudaInitCudaEnvironment(); - if (list_cuda_cards) { - SCCudaListCards(); - exit(EXIT_SUCCESS); - } CudaBufferInit(); #endif diff --git a/src/util-running-modes.c b/src/util-running-modes.c index 439d27ffb4..073199b5eb 100644 --- a/src/util-running-modes.c +++ b/src/util-running-modes.c @@ -21,7 +21,9 @@ */ #include "suricata-common.h" +#include "config.h" #include "app-layer-detect-proto.h" +#include "util-cuda.h" int SuriListKeywords(const char *keyword_info) { @@ -37,3 +39,12 @@ int SuriListAppLayerProtocols() AppLayerListSupportedProtocols(); exit(EXIT_SUCCESS); } + +#ifdef __SC_CUDA_SUPPORT__ +int SuriListCudaCards() +{ + SCCudaInitCudaEnvironment(); + SCCudaListCards(); + exit(EXIT_SUCCESS); +} +#endif diff --git a/src/util-running-modes.h b/src/util-running-modes.h index e4a421c800..a2a97fedac 100644 --- a/src/util-running-modes.h +++ b/src/util-running-modes.h @@ -26,6 +26,9 @@ int SuriListKeywords(const char *keyword_info); int SuriListAppLayerProtocols(); +#ifdef __SC_CUDA_SUPPORT__ +int SuriListCudaCards(); +#endif #endif /* __UTIL_RUNNING_MODES_H__ */ -- 2.47.3