]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: bring back command line argument
authorJeff Lucovsky <jlucovsky@oisf.net>
Sun, 14 Jul 2024 13:20:24 +0000 (09:20 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 12 Oct 2024 09:03:34 +0000 (11:03 +0200)
Re-introduce support for command line argument "--napatech"

Issue: 7165

src/suricata.c

index 79fce452f31bf02abd2ed346942e3251663a1ee4..0de8039be1f07fb5ee85379d31456cd5bdce17e1 100644 (file)
@@ -711,6 +711,9 @@ static void PrintBuildInfo(void)
 #ifdef HAVE_PFRING
     strlcat(features, "PF_RING ", sizeof(features));
 #endif
+#ifdef HAVE_NAPATECH
+    strlcat(features, "NAPATECH ", sizeof(features));
+#endif
 #ifdef HAVE_AF_PACKET
     strlcat(features, "AF_PACKET ", sizeof(features));
 #endif
@@ -1645,6 +1648,14 @@ TmEcode SCParseCommandLine(int argc, char **argv)
                            " to receive packets using --dag.");
                 return TM_ECODE_FAILED;
 #endif /* HAVE_DAG */
+            } else if (strcmp((long_opts[option_index]).name, "napatech") == 0) {
+#ifdef HAVE_NAPATECH
+                suri->run_mode = RUNMODE_PLUGIN;
+#else
+                SCLogError("libntapi and a Napatech adapter are required"
+                           " to capture packets using --napatech.");
+                return TM_ECODE_FAILED;
+#endif /* HAVE_NAPATECH */
             } else if (strcmp((long_opts[option_index]).name, "pcap-buffer-size") == 0) {
 #ifdef HAVE_PCAP_SET_BUFF
                 if (ConfSetFinal("pcap.buffer-size", optarg) != 1) {