Skip to content

Commit 1f73cd4

Browse files
committed
+++ xxx
1 parent c14e5d4 commit 1f73cd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+529
-956
lines changed

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3434

3535
option(ENABLE_RPMBUILD "Enable support for building RPM packages" ON)
3636

37-
option(ENABLE_INPUT_PCAP "Enable build of input PCAP plugin" ON)
38-
option(ENABLE_INPUT_DPDK "Enable build of input DPDK plugin" ON)
39-
option(ENABLE_INPUT_NFB "Enable build of input NFB plugin" ON)
40-
37+
option(ENABLE_INPUT_PCAP "Enable build of input PCAP plugin" ON)
38+
option(ENABLE_INPUT_DPDK "Enable build of input DPDK plugin" ON)
39+
option(ENABLE_INPUT_NFB "Enable build of input NFB plugin" ON)
40+
option(ENABLE_RPMBUILD "RPM build" ON)
41+
option(ENABLE_PROCESS_NETTISA "Enable build of nettisa process plugin" ON)
42+
option(ENABLE_PROCESS_EXPERIMENTAL "Enable build of additional process plugins" ON)
43+
option(ENABLE_OUTPUT_UNIREC "Enable build of unirec output plugin" ON)
4144

4245
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
4346
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g -O3")

cmake/dependencies.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
find_package(PkgConfig REQUIRED)
22

3+
find_package(unwind REQUIRED)
4+
find_package(atomic REQUIRED)
5+
find_package(lz4 REQUIRED)
6+
7+
find_package(Threads REQUIRED)
8+
if(NOT CMAKE_USE_PTHREADS_INIT)
9+
message(FATAL_ERROR "pthreads not found!")
10+
endif()
11+
312
if (ENABLE_INPUT_PCAP)
413
pkg_check_modules(PCAP REQUIRED libpcap)
514
endif()
@@ -11,3 +20,7 @@ endif()
1120
if (ENABLE_INPUT_NFB)
1221
find_package(NFB REQUIRED)
1322
endif()
23+
24+
if (ENABLE_OUTPUT_UNIREC)
25+
find_package(Nemea REQUIRED)
26+
endif()

cmake/modules/FindNemea.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO

cmake/modules/Findatomic.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Try to find libatomic
2+
# Once done, this will define
3+
#
4+
# ATOMIC_FOUND - system has libatomic
5+
# ATOMIC_LIBRARIES - libraries needed to use libatomic
6+
#
7+
8+
find_library(ATOMIC_LIBRARY
9+
NAMES atomic libatomic.so.1
10+
HINTS ${ATOMIC_ROOT}
11+
${CMAKE_INSTALL_LIBDIR})
12+
13+
include(FindPackageHandleStandardArgs)
14+
find_package_handle_standard_args (atomic
15+
REQUIRED_VARS ATOMIC_LIBRARY
16+
)
17+
18+
if (ATOMIC_FOUND AND NOT TARGET atomic::atomic)
19+
add_library(atomic::atomic STATIC IMPORTED)
20+
set_target_properties(atomic::atomic PROPERTIES
21+
IMPORTED_LOCATION "${ATOMIC_LIBRARY}"
22+
INTERFACE_INCLUDE_DIRECTORIES "${ATOMIC_INCLUDE_DIR}")
23+
target_compile_definitions(atomic::atomic INTERFACE UNWIND_FOUND)
24+
else()
25+
message(CRITICAL "Notice: atomic not found")
26+
add_library(atomic::atomic INTERFACE IMPORTED)
27+
endif()
28+
29+
unset(ATOMIC_LIBRARY)

cmake/modules/Findlz4.cmake

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Find lz4
2+
# Once done this will define
3+
#
4+
# LZ4_FOUND - system has liblz4
5+
# lz4::lz4 - cmake target
6+
7+
find_package(PkgConfig QUIET)
8+
if (PKG_CONFIG_FOUND)
9+
pkg_check_modules(PC_LZ4 QUIET lz4-devel)
10+
endif()
11+
12+
find_path (LZ4_INCLUDE_DIR
13+
NAMES lz4.h
14+
HINTS ${LZ4_ROOT} ${PC_LZ4_INCLUDEDIR} ${PC_LZ4_INCLUDE_DIRS}
15+
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
16+
)
17+
18+
find_library (LZ4_LIBRARY
19+
NAMES lz4
20+
HINTS ${LZ4_ROOT} ${PC_LZ4_LIBDIR} ${PC_LZ4_LIBRARY_DIRS}
21+
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
22+
)
23+
24+
mark_as_advanced (LZ4_INCLUDE_DIR LZ4_LIBRARY)
25+
26+
include (FindPackageHandleStandardArgs)
27+
# handle the QUIETLY and REQUIRED arguments and set Unwind_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args (lz4
30+
REQUIRED_VARS LZ4_INCLUDE_DIR LZ4_LIBRARY
31+
)
32+
33+
if (NOT TARGET lz4::lz4)
34+
add_library(lz4::lz4 STATIC IMPORTED)
35+
set_target_properties(lz4::lz4 PROPERTIES
36+
IMPORTED_LOCATION "${LZ4_LIBRARY}"
37+
INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}")
38+
target_compile_definitions(lz4::lz4 INTERFACE LZ4_FOUND)
39+
else()
40+
message(CRITICAL "lz4 was not found")
41+
add_library(lz4::lz4 INTERFACE IMPORTED)
42+
endif()
43+
44+
unset(LZ4_INCLUDE_DIR)
45+
unset(LZ4_LIBRARY)

cmake/modules/Findunwind.cmake

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Find unwind library
2+
# Once done this will define
3+
#
4+
# UNWIND_FOUND - system has libunwind
5+
# unwind::unwind - cmake target
6+
7+
find_package(PkgConfig QUIET)
8+
if (PKG_CONFIG_FOUND)
9+
pkg_check_modules(PC_UNWIND QUIET libunwind)
10+
endif()
11+
12+
find_path (UNWIND_INCLUDE_DIR
13+
NAMES unwind.h libunwind.h
14+
HINTS ${UNWIND_ROOT} ${PC_UNWIND_INCLUDEDIR} ${PC_UNWIND_INCLUDE_DIRS}
15+
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
16+
)
17+
18+
find_library (UNWIND_LIBRARY
19+
NAMES unwind
20+
HINTS ${UNWIND_ROOT} ${PC_UNWIND_LIBDIR} ${PC_UNWIND_LIBRARY_DIRS}
21+
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
22+
)
23+
24+
mark_as_advanced (UNWIND_INCLUDE_DIR UNWIND_LIBRARY)
25+
26+
include (FindPackageHandleStandardArgs)
27+
# handle the QUIETLY and REQUIRED arguments and set Unwind_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args (unwind
30+
REQUIRED_VARS UNWIND_INCLUDE_DIR UNWIND_LIBRARY
31+
)
32+
33+
if (UNWIND_FOUND AND NOT TARGET unwind::unwind)
34+
add_library(unwind::unwind STATIC IMPORTED)
35+
set_target_properties(unwind::unwind PROPERTIES
36+
IMPORTED_LOCATION "${UNWIND_LIBRARY}"
37+
INTERFACE_INCLUDE_DIRECTORIES "${UNWIND_INCLUDE_DIR}")
38+
target_compile_definitions(unwind::unwind INTERFACE UNWIND_FOUND)
39+
else()
40+
message(WARNING "Notice: UNWIND not found, no unwind support")
41+
add_library(unwind::unwind INTERFACE IMPORTED)
42+
endif()
43+
44+
unset(UNWIND_INCLUDE_DIR)
45+
unset(UNWIND_LIBRARY)

include/ipfixprobe/output.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace ipxp {
4141
/**
4242
* \brief Base class for flow exporters.
4343
*/
44-
class OutputPlugin : public Plugin
44+
class IPXP_API OutputPlugin : public Plugin
4545
{
4646
public:
4747
typedef std::vector<std::pair<std::string, ProcessPlugin *>> Plugins;
@@ -79,7 +79,7 @@ class OutputPlugin : public Plugin
7979
* @tparam Args The argument types for the factory.
8080
*/
8181
template<typename Base, typename... Args>
82-
class PluginFactory;
82+
class IPXP_API PluginFactory;
8383

8484
/**
8585
* @brief Type alias for the OutputPlugin factory.

include/ipfixprobe/process.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ProcessPlugin : public Plugin
125125
* @tparam Args The argument types for the factory.
126126
*/
127127
template<typename Base, typename... Args>
128-
class PluginFactory;
128+
class IPXP_API PluginFactory;
129129

130130
/**
131131
* @brief Type alias for the ProcessPlugin factory.

include/ipfixprobe/storage.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace ipxp {
4545
/**
4646
* \brief Base class for flow caches.
4747
*/
48-
class StoragePlugin : public Plugin
48+
class IPXP_API StoragePlugin : public Plugin
4949
{
5050
protected:
5151
ipx_ring_t *m_export_queue;
@@ -205,7 +205,7 @@ class StoragePlugin : public Plugin
205205
* @tparam Args The argument types for the factory.
206206
*/
207207
template<typename Base, typename... Args>
208-
class PluginFactory;
208+
class IPXP_API PluginFactory;
209209

210210
/**
211211
* @brief Type alias for the StoragePlugin factory.

pkg/rpm/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ if (ENABLE_INPUT_NFB)
3030
list(APPEND RPMBUILD_ARGS "--with" "input_nfb")
3131
endif()
3232

33+
if (ENABLE_PROCESS_NETTISA)
34+
list(APPEND RPMBUILD_ARGS "--with" "process_nettisa")
35+
endif()
36+
37+
if (ENABLE_PROCESS_EXPERIMENTAL)
38+
list(APPEND RPMBUILD_ARGS "--with" "process_experimental")
39+
endif()
40+
3341
configure_file("${SPEC_FILE_IN}" "${SPEC_FILE}" @ONLY)
3442

3543
add_custom_target(rpm

0 commit comments

Comments
 (0)