Skip to content

Commit 8fa1273

Browse files
author
Damir Zainullin
committed
CTT - Update CMakeLists
1 parent 6b53741 commit 8fa1273

File tree

8 files changed

+120
-16
lines changed

8 files changed

+120
-16
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ option(ENABLE_OUTPUT_UNIREC "Enable build of output UNIREC plugin"
1919
option(ENABLE_PROCESS_EXPERIMENTAL "Enable build of experimental process plugins" OFF)
2020
option(ENABLE_MILLISECONDS_TIMESTAMP "Compile ipfixprobe with miliseconds timestamp precesion" OFF)
2121
option(ENABLE_NEMEA "Enable build of NEMEA plugins" OFF)
22+
option(ENABLE_CTT "Enable support of conaction tracking table" OFF)
2223

2324
option(ENABLE_RPMBUILD "Enable build of RPM package" ON)
2425
option(ENABLE_TESTS "Build tests (make test)" OFF)
@@ -49,6 +50,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
4950
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
5051
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb3")
5152

53+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
54+
5255
include(cmake/dependencies.cmake)
5356

5457
add_subdirectory(external)

cmake/dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (ENABLE_INPUT_DPDK)
1515
pkg_check_modules(DPDK REQUIRED libdpdk)
1616
endif()
1717

18-
if (ENABLE_INPUT_NFB)
18+
if (ENABLE_INPUT_NFB OR ENABLE_CTT)
1919
find_package(NFB REQUIRED)
2020
find_package(NUMA REQUIRED)
2121
endif()

src/plugins/input/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ endif()
1111
if (ENABLE_INPUT_NFB)
1212
add_subdirectory(nfb)
1313
endif()
14+
15+
if (ENABLE_CTT)
16+
add_subdirectory(nfb-meta)
17+
endif()

src/plugins/input/nfb/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ add_library(ipfixprobe-input-nfb MODULE
66
src/ndpHeader.hpp
77
src/ndpReader.cpp
88
src/ndpReader.hpp
9+
src/ndpCore.hpp
10+
src/ndpCore.cpp
911
../parser/parser.cpp
1012
../parser/parser.hpp
1113
)

src/plugins/process/CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
add_subdirectory(common)
21
add_subdirectory(basicplus)
32
add_subdirectory(bstats)
4-
add_subdirectory(icmp)
5-
add_subdirectory(vlan)
3+
add_subdirectory(common)
4+
add_subdirectory(dns)
5+
add_subdirectory(dnssd)
66
add_subdirectory(flowHash)
7-
add_subdirectory(osquery)
7+
add_subdirectory(http)
8+
add_subdirectory(icmp)
89
add_subdirectory(idpContent)
9-
add_subdirectory(phists)
10-
add_subdirectory(pstats)
11-
add_subdirectory(ovpn)
12-
add_subdirectory(wg)
13-
add_subdirectory(ssdp)
14-
add_subdirectory(ssaDetector)
1510
add_subdirectory(mqtt)
16-
add_subdirectory(dns)
17-
add_subdirectory(dnssd)
1811
add_subdirectory(netbios)
12+
add_subdirectory(ovpn)
13+
add_subdirectory(osquery)
1914
add_subdirectory(passiveDns)
20-
add_subdirectory(smtp)
15+
add_subdirectory(phists)
16+
add_subdirectory(pstats)
2117
add_subdirectory(quic)
18+
add_subdirectory(smtp)
19+
add_subdirectory(ssaDetector)
20+
add_subdirectory(ssdp)
2221
add_subdirectory(tls)
23-
add_subdirectory(http)
22+
add_subdirectory(vlan)
23+
add_subdirectory(wg)
2424

2525
if (ENABLE_PROCESS_EXPERIMENTAL)
2626
add_subdirectory(sip)

src/plugins/storage/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
add_subdirectory(cache)
1+
if (!ENABLE_CTT)
2+
add_subdirectory(cache)
3+
endif()
4+
5+
if (ENABLE_CTT)
6+
add_subdirectory(cache-ctt)
7+
endif()
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
project(ipfixprobe-storage-cache-ctt VERSION 1.0.0 DESCRIPTION "ipfixprobe-storage-cache-ctt plugin")
2+
3+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
4+
5+
add_library(ipfixprobe-storage-cache-ctt MODULE
6+
src/cacheCtt.hpp
7+
src/cacheCtt.cpp
8+
src/cacheOptParserCtt.hpp
9+
src/cacheOptParserCtt.cpp
10+
src/cttController.hpp
11+
src/cttController.cpp
12+
src/flowRecordCtt.hpp
13+
src/flowRecordCtt.cpp
14+
src/cttRemoveQueue.hpp
15+
src/cttRemoveQueue.cpp
16+
../cache/src/cache.hpp
17+
../cache/src/cache.cpp
18+
../cache/src/cacheOptParser.hpp
19+
../cache/src/cacheOptParser.cpp
20+
../cache/src/cacheRowSpan.hpp
21+
../cache/src/cacheStats.hpp
22+
../cache/src/flowKey.hpp
23+
../cache/src/flowKeyFactory.hpp
24+
../cache/src/flowRecord.hpp
25+
../cache/src/flowRecord.cpp
26+
../cache/src/fragmentationCache/fragmentationCache.cpp
27+
../cache/src/fragmentationCache/fragmentationCache.hpp
28+
../cache/src/fragmentationCache/fragmentationKeyData.hpp
29+
../cache/src/fragmentationCache/fragmentationTable.cpp
30+
../cache/src/fragmentationCache/fragmentationTable.hpp
31+
../cache/src/fragmentationCache/ringBuffer.hpp
32+
../cache/src/fragmentationCache/timevalUtils.hpp
33+
../cache/src/xxhash.c
34+
../cache/src/xxhash.h
35+
)
36+
37+
add_compile_definitions(maybe_virtual=virtual)
38+
39+
set_target_properties(ipfixprobe-storage-cache-ctt PROPERTIES
40+
CXX_VISIBILITY_PRESET hidden
41+
VISIBILITY_INLINES_HIDDEN YES
42+
)
43+
44+
target_compile_options(ipfixprobe-storage-cache-ctt PRIVATE
45+
$<$<CONFIG:Release>: -O4 -flto=auto -fwhole-program>
46+
)
47+
48+
target_include_directories(ipfixprobe-storage-cache-ctt PRIVATE
49+
${CMAKE_SOURCE_DIR}/include/
50+
)
51+
52+
target_link_libraries(ipfixprobe-storage-cache-ctt PRIVATE
53+
telemetry::telemetry
54+
telemetry::appFs
55+
ctt
56+
feta
57+
)
58+
59+
install(TARGETS ipfixprobe-storage-cache-ctt
60+
LIBRARY DESTINATION "${INSTALL_DIR_LIB}/ipfixprobe/storage/"
61+
)
62+
63+
set(LIB_CTT_KEY_SIZE "0" CACHE STRING "Set the custom size value for cttctl")
64+
set(LIB_CTT_STATE_SIZE "0" CACHE STRING "Set the custom size value for cttctl")
65+
set(LIB_CTT_STATE_MASK_SIZE "0" CACHE STRING "Set the custom size value for cttctl")
66+
67+
add_definitions(
68+
-DLIB_CTT_VERSION_MAJOR=${VERSION_MAJOR}
69+
-DLIB_CTT_VERSION_MINOR=${VERSION_MINOR}
70+
-DLIB_CTT_KEY_SIZE=${LIB_CTT_KEY_SIZE}
71+
-DLIB_CTT_STATE_SIZE=${LIB_CTT_STATE_SIZE}
72+
-DLIB_CTT_STATE_MASK_SIZE=${LIB_CTT_STATE_MASK_SIZE}
73+
)
74+

src/plugins/storage/cache/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
55
add_library(ipfixprobe-storage-cache MODULE
66
src/cache.hpp
77
src/cache.cpp
8+
src/cacheOptParser.hpp
9+
src/cacheOptParser.cpp
10+
src/cacheRowSpan.hpp
11+
src/cacheStats.hpp
12+
src/flowKey.hpp
13+
src/flowKeyFactory.hpp
14+
src/flowRecord.hpp
15+
src/flowRecord.cpp
816
src/fragmentationCache/fragmentationCache.cpp
917
src/fragmentationCache/fragmentationCache.hpp
1018
src/fragmentationCache/fragmentationKeyData.hpp
@@ -16,17 +24,24 @@ add_library(ipfixprobe-storage-cache MODULE
1624
src/xxhash.h
1725
)
1826

27+
add_compile_definitions(maybe_virtual=) # No need for virtual functions if ctt cache is not being compiled
28+
1929
set_target_properties(ipfixprobe-storage-cache PROPERTIES
2030
CXX_VISIBILITY_PRESET hidden
2131
VISIBILITY_INLINES_HIDDEN YES
2232
)
2333

34+
target_compile_options(ipfixprobe-storage-cache PRIVATE
35+
$<$<CONFIG:Release>: -O4 -flto=auto -fopt-info-optimized -fopt-info-inline>
36+
)
37+
2438
target_include_directories(ipfixprobe-storage-cache PRIVATE
2539
${CMAKE_SOURCE_DIR}/include/
2640
)
2741

2842
target_link_libraries(ipfixprobe-storage-cache PRIVATE
2943
telemetry::telemetry
44+
telemetry::appFs
3045
)
3146

3247
install(TARGETS ipfixprobe-storage-cache

0 commit comments

Comments
 (0)