Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added snort3 & libdaq recipes #789

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 9357da2a5a829f7a0620e6c19835a65b7b02a8fb Mon Sep 17 00:00:00 2001
From: Khawaja Shaheryar <[email protected]>
Date: Tue, 20 Feb 2024 21:03:26 +0500
Subject: [PATCH] example: Use -lm for the fst module

If -lm is not passed in Makefile.am, the following is seen
| arm-yoe-linux-gnueabi-ld.lld: error: undefined symbol: ceilf
| >>> referenced by math.h:632 (/usr/include/c++/v1/math.h:632)
| >>> libdaq_static_fst_la-daq_fst.o:(std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<FstKey, FstNode*>, void*>*>, bool> std::__1::__hash_table<std::__1::__hash_value_type<FstKey, FstNode*>, std::__1::__unordered_map_hasher<FstKey, std::__1::__hash_value_type<FstKey, FstNode*>, FstKeyHash, std::__1::equal_to<FstKey>, true>, std::__1::__unordered_map_equal<FstKey, std::__1::__hash_value_type<FstKey, FstNode*>, std::__1::equal_to<FstKey>, FstKeyHash, true>, std::__1::allocator<std::__1::__hash_value_type<FstKey, FstNode*>>>::__emplace_unique_key_args<FstKey, std::__1::pair<FstKey const, FstNode*>>(FstKey const&, std::__1::pair<FstKey const, FstNode*>&&)) in archive ../modules/fst/.libs/libdaq_static_fst.a

Upstream-Status: Pending

Signed-off-by: Khawaja Shaheryar <[email protected]>
---
example/Makefile.am | 1 +
1 file changed, 1 insertion(+)

diff --git a/example/Makefile.am b/example/Makefile.am
index 0d5ca31..1eaa9e8 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -31,6 +31,7 @@ endif
if BUILD_FST_MODULE
daqtest_static_CFLAGS += -DBUILD_FST_MODULE
daqtest_static_LDADD += ${top_builddir}/modules/fst/libdaq_static_fst.la $(DAQ_FST_LIBS)
+daqtest_static_LDFLAGS += -lm
endif
if BUILD_NETMAP_MODULE
daqtest_static_CFLAGS += -DBUILD_NETMAP_MODULE
--
2.34.1

18 changes: 18 additions & 0 deletions meta-networking/recipes-connectivity/daq/libdaq_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SUMMARY = "LibDAQ: The Data AcQuisition Library"
DESCRIPTION = "LibDAQ is a pluggable abstraction layer for interacting with a data source (traditionally a network interface or network data plane)."
HOMEPAGE = "http://www.snort.org"
SECTION = "libs"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=79258250506422d064560a7b95b2d53e"

DEPENDS = "libdnet libpcap"

inherit autotools pkgconfig

SRC_URI = "git://github.com/snort3/libdaq.git;protocol=https;branch=master \
file://0001-example-Use-lm-for-the-fst-module.patch"
SRCREV = "c757aaae5a70d5bbb3239c5a16bca217a5aca651"

S = "${WORKDIR}/git"

FILES:${PN} += "${libdir}/daq/*.so"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 433a412fad2ab0383ac3c625d183a71684f2b97b Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Tue, 20 Feb 2024 15:35:14 -0800
Subject: [PATCH] cmake: Check for HP libunwind

This is to ensure that cmake does not detect LLVM unwinder, which
can provide the support for some HP unwinder functionality but not all
e.g. unw_strerror goes missing. By checking for libunwind-common.h in
tests we ensure that this test passes only with HP libunwind.

Upstream-Status: Inappropriate [OE-Specific]

Signed-off-by: Khem Raj <[email protected]>
---
cmake/FindLibunwind.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
index f66800a18..1ad66fc83 100644
--- a/cmake/FindLibunwind.cmake
+++ b/cmake/FindLibunwind.cmake
@@ -22,7 +22,7 @@ find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBUNWIND libunwind)

find_path(LIBUNWIND_INCLUDE_DIRS
- NAMES libunwind.h
+ NAMES libunwind-common.h
HINTS ${PC_LIBUNWIND_INCLUDE_DIRS}
)

--
2.43.2

44 changes: 44 additions & 0 deletions meta-networking/recipes-connectivity/snort/snort3_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
SUMMARY = "snort3"
DESCRIPTION = "snort3 - a free lightweight network intrusion detection system for UNIX and Windows."
HOMEPAGE = "http://www.snort.org/"
SECTION = "net"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"

PV = "3+git${SRCPV}"

DEPENDS = "flex-native bison-native hwloc libdaq libdnet libpcap libpcre libtirpc libunwind luajit zlib"

SRC_URI = "git://github.com/snort3/snort3.git;protocol=https;branch=master \
file://0001-cmake-Check-for-HP-libunwind.patch"
SRCREV = "e1760a8dbb829bb3fcf1a340ab6cc4bb80a47ecd"

S = "${WORKDIR}/git"

PACKAGES =+ "${PN}-scripts"

inherit cmake pkgconfig

EXTRA_OECMAKE += "\
-DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \
-DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines' \
"

do_install:append() {
sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/pkgconfig/snort.pc
}

FILES:${PN} += "${libdir}/snort/daq/*.so"

FILES:${PN}-scripts = "${bindir}/appid_detector_builder.sh"

RDEPENDS:${PN}-scripts += "bash"

# mips64/ppc/ppc64/riscv64/riscv32 is not supported in this release
COMPATIBLE_HOST:mipsarchn32 = "null"
COMPATIBLE_HOST:mipsarchn64 = "null"
COMPATIBLE_HOST:powerpc = "null"
COMPATIBLE_HOST:powerpc64 = "null"
COMPATIBLE_HOST:powerpc64le = "null"
COMPATIBLE_HOST:riscv64 = "null"
COMPATIBLE_HOST:riscv32 = "null"