Skip to content

Commit 3717722

Browse files
authored
Merge pull request #179 from CESNET/lz4-compression
Ipfix plugin: Add Lz4 compression
2 parents 5ba318c + a72a1b8 commit 3717722

File tree

11 files changed

+554
-29
lines changed

11 files changed

+554
-29
lines changed

.github/workflows/c-cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
sudo apt-get update
21-
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libunwind-dev libfuse3-dev fuse3 cmake
21+
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libunwind-dev libfuse3-dev fuse3 cmake liblz4-dev
2222
( git clone --depth 1 https://github.com/CESNET/nemea-framework /tmp/nemea-framework; cd /tmp/nemea-framework; ./bootstrap.sh &&./configure --bindir=/usr/bin/nemea/ -q &&make -j10 && sudo make install; sudo ldconfig)
2323
( git clone --depth 1 https://github.com/CESNET/nemea-modules /tmp/nemea-modules; cd /tmp/nemea-modules; ./bootstrap.sh &&./configure --bindir=/usr/bin/nemea/ -q &&make -j10 && sudo make install; )
2424
( git clone -b release --depth 1 https://github.com/CESNET/telemetry /tmp/telemetry; cd /tmp/telemetry; mkdir build && cd build; cmake -DCMAKE_INSTALL_PREFIX=/usr .. &&make -j10 && sudo make install; )

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
sudo apt-get update
33-
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libfuse3-dev fuse3 cmake
33+
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libfuse3-dev fuse3 cmake liblz4-dev
3434
( git clone --depth 1 https://github.com/CESNET/nemea-framework /tmp/nemea-framework; cd /tmp/nemea-framework; ./bootstrap.sh &&./configure --bindir=/usr/bin/nemea/ -q &&make -j10 && sudo make install; sudo ldconfig)
3535
( git clone -b release --depth 1 https://github.com/CESNET/telemetry /tmp/telemetry; cd /tmp/telemetry; mkdir build && cd build; cmake -DCMAKE_INSTALL_PREFIX=/usr .. &&make -j10 && sudo make install; )
3636
# Initializes the CodeQL tools for scanning.

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
sudo apt-get update
19-
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libfuse3-dev fuse3 cmake
19+
sudo apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libfuse3-dev fuse3 cmake liblz4-dev
2020
( git clone --depth 1 https://github.com/CESNET/nemea-framework /tmp/nemea-framework; cd /tmp/nemea-framework; ./bootstrap.sh &&./configure --bindir=/usr/bin/nemea/ -q &&make -j10 && sudo make install; sudo ldconfig)
2121
( git clone --depth 1 https://github.com/CESNET/nemea-modules /tmp/nemea-modules; cd /tmp/nemea-modules; ./bootstrap.sh &&./configure --bindir=/usr/bin/nemea/ -q &&make -j10 && sudo make install; )
2222
( git clone -b release --depth 1 https://github.com/CESNET/telemetry /tmp/telemetry; cd /tmp/telemetry; mkdir build && cd build; cmake -DCMAKE_INSTALL_PREFIX=/usr .. &&make -j10 && sudo make install; )

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ The output flow records are composed of information provided by the enabled plug
114114

115115
See `ipfixprobe -h output` for more information and complete list of output plugins and their parameters.
116116

117+
LZ4 compression:
118+
ipfix plugin supports LZ4 compression algorithm over tcp. See plugin's help for more information.
119+
117120
## Parameters
118121
### Module specific parameters
119122
- `-i ARGS` Activate input plugin (-h input for help)

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ AC_DEFINE_DIR([DEFAULTSOCKETDIR], [defaultsocketdir], [Default path to socket di
8383

8484
AC_CHECK_LIB(atomic, __atomic_store, [libatomic=yes], AC_MSG_ERROR([libatomic not found]))
8585

86+
PKG_CHECK_MODULES([LIBLZ4], [liblz4])
87+
CFLAGS="$LIBLZ4_CFLAGS $CFLAGS"
88+
CXXFLAGS="$LIBLZ4_CFLAGS $CXXFLAGS"
89+
LIBS="$LIBLZ4_LIBS $LIBS"
90+
8691
### gtest
8792
AC_ARG_WITH([gtest],
8893
AC_HELP_STRING([--with-gtest],[Compile ipfixprobe with gtest framework]),

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Section: net
33
Priority: standard
44
Maintainer: Tomas Cejka <[email protected]>
55
Build-Depends: autoconf (>=2.69), pkg-config, libtool, make (>=4.2.1), debhelper (>=9),
6-
openssl, libpcap-dev, libpcap0.8, libssl-dev, libatomic1
6+
openssl, libpcap-dev, libpcap0.8, libssl-dev, libatomic1, liblz4-dev
77
Standards-Version: 4.5.0
88
Homepage: https://github.com/CESNET/ipfixprobe
99
Vcs-Git: https://github.com/CESNET/ipfixprobe

init/ipfixprobed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ if [ -e "$CONFFILE" ]; then
118118
output_affinity="@$OUTPUT_WORKER_CPU"
119119
fi
120120

121-
output="-o ipfix$output_affinity;host=${HOST:-127.0.0.1};port=${PORT:-4739};id=${LINK:-0};dir=${DIR:-0};${UDP_PARAM};${NON_BLOCKING_TCP_PARAM};template=${TEMPLATE_REFRESH_RATE:-300}"
121+
LZ4_COMPRESSION_PARAM=""
122+
if [[ $LZ4_COMPRESSION == "yes" ]]; then
123+
LZ4_COMPRESSION_PARAM="lz4-compression";
124+
fi
125+
126+
output="-o ipfix$output_affinity;host=${HOST:-127.0.0.1};port=${PORT:-4739};id=${LINK:-0};dir=${DIR:-0};${UDP_PARAM};${NON_BLOCKING_TCP_PARAM};${LZ4_COMPRESSION_PARAM};template=${TEMPLATE_REFRESH_RATE:-300}"
122127

123128
telemetry=""
124129
if [ "$USE_FUSE" = "1" ]; then

init/link0.conf.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ TEMPLATE_REFRESH_RATE=300
197197
# Define output worker (thread) affinity, e.g. CPU core isolated from the scheduler
198198
#OUTPUT_WORKER_CPU=12
199199

200+
# Enable LZ4 compression (only with TCP)
201+
LZ4_COMPRESSION=no
202+
200203
####### Fuse telemetry
201204

202205
USE_FUSE=0

ipfixprobe.spec.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Vendor: CESNET, z.s.p.o.
5757
Packager: @USERNAME@ <@USERMAIL@>
5858
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
5959
Summary: IPFIX flow exporter with various extending IPFIX elements exported by plugins.
60-
Requires: libatomic fuse3 telemetry
61-
BuildRequires: gcc gcc-c++ make doxygen pkgconfig libatomic telemetry
60+
Requires: libatomic fuse3 telemetry lz4
61+
BuildRequires: gcc gcc-c++ make doxygen pkgconfig libatomic telemetry lz4-devel
6262
Provides: ipfixprobe
6363

6464
%if %{with ndp}

0 commit comments

Comments
 (0)