From d32b28c85e37912631f81a9682d82f4da64be136 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sun, 14 Jul 2024 09:20:24 -0400 Subject: [PATCH] napatech: bring back command line argument Re-introduce support for command line argument "--napatech" Issue: 7165 --- src/suricata.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/suricata.c b/src/suricata.c index 79fce452f3..0de8039be1 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -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) {