增加pcap解析工具(#4033 #4034)

This commit is contained in:
a839419160
2024-11-22 17:43:15 +08:00
committed by GitHub
parent 8868320301
commit 326b475beb
5 changed files with 405 additions and 0 deletions

23
cmake/FindPCAP.cmake Normal file
View File

@@ -0,0 +1,23 @@
# - Try to find libpcap
#
# Once done this will define
# PCAP_FOUND - System has libpcap
# PCAP_INCLUDE_DIRS - The libpcap include directories
# PCAP_LIBRARIES - The libpcap library
# Find libpcap
FIND_PATH(
PCAP_INCLUDE_DIRS
NAMES pcap.h
)
FIND_LIBRARY(
PCAP_LIBRARIES
NAMES pcap
)
message(STATUS "PCAP LIBRARIES: " ${PCAP_LIBRARIES})
message(STATUS "PCAP INCLUDE DIRS: " ${PCAP_INCLUDE_DIRS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCAP DEFAULT_MSG PCAP_LIBRARIES PCAP_INCLUDE_DIRS)