add ether support for mac os x (#775)

Depends on pcap (e.g. with Wireshark)
build with
#cmake .. -G"CodeBlocks - Unix Makefiles" -DBACDL_ETHERNET=ON -DBACDL_BIP=OFF -DBAC_ROUTING=OFF
run as normal user (not root) like Wireshark
This commit is contained in:
Patrick Grimm
2024-09-23 18:51:13 +02:00
committed by GitHub
parent a0ffd96f8f
commit 55a242361d
2 changed files with 429 additions and 0 deletions
+22
View File
@@ -681,6 +681,28 @@ elseif(APPLE)
ports/bsd/datetime-init.c
ports/bsd/mstimer-init.c
ports/bsd/stdbool.h)
if(BACDL_ETHERNET)
FIND_PATH(PCAP_INCLUDE pcap.h)
if(NOT PCAP_INCLUDE)
message(WARNING "BACNET: pcap.h header file not found")
else()
message(STATUS "BACNET: pcap Include:...................\"${PCAP_INCLUDE}\"")
endif()
FIND_LIBRARY(PCAP_LIBRARIES NAMES pcap)
if(NOT PCAP_LIBRARIES)
message(WARNING "BACNET: libpcap not found")
else()
message(STATUS "BACNET: pcap Lib:.......................\"${PCAP_LIBRARIES}\"")
endif()
if(PCAP_INCLUDE AND PCAP_LIBRARIES)
include_directories(${PCAP_INCLUDE})
link_libraries(${PCAP_LIBRARIES})
target_sources(${PROJECT_NAME} PRIVATE
ports/bsd/ethernet.c
)
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
message(STATUS "BACNET: building for FreeBSD")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd)