]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
suricata: list cuda cards in separate function
authorEric Leblond <eric@regit.org>
Tue, 9 Apr 2013 09:34:12 +0000 (11:34 +0200)
committerEric Leblond <eric@regit.org>
Mon, 29 Jul 2013 07:56:36 +0000 (09:56 +0200)
src/suricata.c
src/util-running-modes.c
src/util-running-modes.h

index 953d114b08a012a913331afa90834b02906f6222..f42d0488758c74338c6051f25bb6a047d1824430 100644 (file)
@@ -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
 
index 439d27ffb457febf78a6724e2cca054137bc4272..073199b5eb0da30d02ebab2ca3efe060127ce997 100644 (file)
@@ -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
index e4a421c8002735beceb2693f9071f3d71f03d381..a2a97fedacb90b22f09226254ab233908710400e 100644 (file)
@@ -26,6 +26,9 @@
 
 int SuriListKeywords(const char *keyword_info);
 int SuriListAppLayerProtocols();
+#ifdef __SC_CUDA_SUPPORT__
+int SuriListCudaCards();
+#endif
 
 
 #endif /* __UTIL_RUNNING_MODES_H__ */