Skip to content

Commit

Permalink
Add npcap
Browse files Browse the repository at this point in the history
  • Loading branch information
leoparente committed Jan 10, 2025
1 parent 13b29a9 commit d417346
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 0 additions & 12 deletions src/inputs/pcap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,12 +15,8 @@ target_include_directories(VisorInputPcap
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

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
)
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/pcap/PcapInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "PcapInputStream.h"
#include "NetworkInterfaceScan.h"
#include "ThreadName.h"
#include <pcap/pcap.h>
#include <pcap.h>
#include <timer.hpp>
#ifdef __GNUC__
#pragma GCC diagnostic push
Expand Down

0 comments on commit d417346

Please sign in to comment.