From d41734621d656518090ea17200fd5aba9c2de6ef Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:49:50 -0300 Subject: [PATCH] Add npcap --- CMakeLists.txt | 2 -- conanfile.py | 2 ++ src/inputs/pcap/CMakeLists.txt | 12 ------------ src/inputs/pcap/PcapInputStream.cpp | 2 +- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3f81655a..f691f797a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,7 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 ") set(CMAKE_POSITION_INDEPENDENT_CODE ON) -#set(CMAKE_VERBOSE_MAKEFILE ON) if(NOT MSVC) add_compile_options(-Wall -pedantic -W -Wextra -Wno-unknown-pragmas) endif() diff --git a/conanfile.py b/conanfile.py index e865676fd..a966087d1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -18,6 +18,8 @@ def requirements(self): self.requires("openssl/3.3.2") if self.settings.os != "Windows": self.requires("libpcap/1.10.4", force=True) + else: + self.requires("npcap/1.70") self.requires("opentelemetry-cpp/1.17.0") self.requires("pcapplusplus/23.09") self.requires("protobuf/5.27.0") diff --git a/src/inputs/pcap/CMakeLists.txt b/src/inputs/pcap/CMakeLists.txt index e333e70fe..6876f02da 100644 --- a/src/inputs/pcap/CMakeLists.txt +++ b/src/inputs/pcap/CMakeLists.txt @@ -2,14 +2,6 @@ message(STATUS "Input Module: Pcap") set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON) -if (WIN32) - find_package(npcap REQUIRED CONFIG) - set(ADDITIONAL_LIBS npcap::npcap) -else() - find_package(libpcap REQUIRED CONFIG) - set(ADDITIONAL_LIBS libpcap::libpcap) -endif() - corrade_add_static_plugin(VisorInputPcap ${CMAKE_CURRENT_BINARY_DIR} PcapInput.conf PcapInputModulePlugin.cpp @@ -23,12 +15,8 @@ target_include_directories(VisorInputPcap $ ) -message(STATUS "NPCAP_INCLUDE_DIRS: ${NPCAP_INCLUDE_DIRS}") -message(STATUS "ADDITIONAL_LIBS: ${ADDITIONAL_LIBS}") - target_link_libraries(VisorInputPcap PUBLIC - ${ADDITIONAL_LIBS} Visor::Core Visor::Lib::Utils ) diff --git a/src/inputs/pcap/PcapInputStream.cpp b/src/inputs/pcap/PcapInputStream.cpp index 308e65bf4..c1cbf1875 100644 --- a/src/inputs/pcap/PcapInputStream.cpp +++ b/src/inputs/pcap/PcapInputStream.cpp @@ -5,7 +5,7 @@ #include "PcapInputStream.h" #include "NetworkInterfaceScan.h" #include "ThreadName.h" -#include +#include #include #ifdef __GNUC__ #pragma GCC diagnostic push