Skip to content

Commit 936d3cb

Browse files
authored
Merge pull request #23 from CESNET/devel
Merge devel to master and bump version to 0.3.0
2 parents 0302f9c + b74793d commit 936d3cb

File tree

107 files changed

+11840
-91
lines changed

Some content is hidden

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

107 files changed

+11840
-91
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
image: ['ubuntu:18.04', 'ubuntu:20.04', 'debian:stretch', 'debian:buster', 'debian:bullseye', 'centos:7', 'centos:8']
11+
image:
12+
- 'ubuntu:18.04'
13+
- 'ubuntu:20.04'
14+
- 'debian:stretch'
15+
- 'debian:buster'
16+
- 'debian:bullseye'
17+
- 'centos:7'
18+
- 'quay.io/centos/centos:stream8'
19+
- 'oraclelinux:8'
1220

1321
name: Build on ${{ matrix.image }}
1422
container: ${{ matrix.image }}
1523
steps:
16-
- uses: actions/checkout@v1
1724

1825
# Dependencies ---------------------------------------------------------------------------
1926
- name: Install dependencies (Ubuntu/Debian)
@@ -23,14 +30,21 @@ jobs:
2330
apt-get -y install git gcc g++ cmake make libxml2-dev liblz4-dev libzstd-dev
2431
env:
2532
DEBIAN_FRONTEND: noninteractive
26-
- name: Install dependencies (CentOS)
27-
if: startsWith(matrix.image, 'centos')
33+
- name: Enable EPEL (CentOS)
34+
if: contains(matrix.image, 'centos')
2835
run: |
2936
yum -y install epel-release
37+
- name: Enable EPEL (Oracle Linxu)
38+
if: contains(matrix.image, 'oraclelinux')
39+
run: |
40+
dnf -y install oracle-epel-release-el8
41+
- name: Install dependencies (CentOS, Oracle Linux)
42+
if: contains(matrix.image, 'centos') || contains(matrix.image, 'oraclelinux')
43+
run: |
3044
yum -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel
31-
- name: Install depedencies (Fedora)
32-
if: startsWith(matrix.image, 'fedora')
33-
run: dnf -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel
45+
46+
# Checkout repository --------------------------------------------------------------------
47+
- uses: actions/checkout@v2
3448

3549
# Build ----------------------------------------------------------------------------------
3650
# Note: Unit tests are disabled on CentOS7 due to outdated GCC version

.github/workflows/package.yml

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ jobs:
1515
container: ${{ matrix.image }}
1616

1717
steps:
18-
- uses: actions/checkout@v1
19-
- name: Define global variables
20-
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip"
21-
shell: bash
22-
env:
23-
IMAGE: ${{ matrix.image }}
24-
id: vars
18+
- uses: actions/checkout@v2
19+
- name: Define variables
20+
uses: actions/github-script@v5
21+
with:
22+
script: |
23+
const sha = context.sha.substring(0, 8);
24+
const image = `${{ matrix.image }}`
25+
const distro = image.split('/').pop().replace(/:/g,'_');
26+
const zip = `libfds-${distro}-${sha}`;
27+
core.exportVariable('ZIP_FILE', zip);
2528
2629
# Dependencies ---------------------------------------------------------------------------
2730
- name: Install dependencies (Ubuntu/Debian)
@@ -38,61 +41,70 @@ jobs:
3841
mkdir build && cd build
3942
cmake .. -DPACKAGE_BUILDER_DEB=On -DCPACK_PACKAGE_CONTACT="GitHub actions <[email protected]>"
4043
make deb
41-
- name: Pack DEB packages
42-
working-directory: 'build/pkg/deb/debbuild/'
43-
run: zip "$GITHUB_WORKSPACE/$ZIP_FILE" *.deb *.ddeb *.tar.gz *.dsc
44-
env:
45-
ZIP_FILE: ${{ steps.vars.outputs.zip_file }}
4644
- name: Archive DEB packages
4745
if: github.event_name == 'push'
48-
uses: actions/upload-artifact@v1
46+
uses: actions/upload-artifact@v2
4947
with:
50-
name: ${{ steps.vars.outputs.zip_file }}
51-
path: ${{ steps.vars.outputs.zip_file }}
48+
name: ${{ env.ZIP_FILE }}
49+
path: |
50+
build/pkg/deb/debbuild/*.deb
51+
build/pkg/deb/debbuild/*.ddeb
52+
build/pkg/deb/debbuild/*.tar.gz
53+
build/pkg/deb/debbuild/*.dsc
5254
5355
rpm:
5456
# Try to build RPM packages
5557
runs-on: ubuntu-latest
5658
strategy:
5759
fail-fast: false
5860
matrix:
59-
image: ['centos:7', 'centos:8']
61+
image:
62+
- 'centos:7'
63+
- 'quay.io/centos/centos:stream8'
64+
- 'oraclelinux:8'
6065

6166
name: Build RPMs on ${{ matrix.image }}
6267
container: ${{ matrix.image }}
6368

6469
steps:
65-
- uses: actions/checkout@v1
66-
- name: Define global variables
67-
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip"
68-
env:
69-
IMAGE: ${{ matrix.image }}
70-
id: vars
70+
- name: Define variables
71+
uses: actions/github-script@v5
72+
with:
73+
script: |
74+
const sha = context.sha.substring(0, 8);
75+
const image = `${{ matrix.image }}`
76+
const distro = image.split('/').pop().replace(/:/g,'_');
77+
const zip = `libfds-${distro}-${sha}`;
78+
core.exportVariable('ZIP_FILE', zip);
7179
7280
# Dependencies ---------------------------------------------------------------------------
73-
- name: Install dependencies (CentOS)
74-
if: startsWith(matrix.image, 'centos')
81+
- name: Enable EPEL (CentOS)
82+
if: contains(matrix.image, 'centos')
7583
run: |
7684
yum -y install epel-release
85+
- name: Enable EPEL (Oracle Linxu)
86+
if: contains(matrix.image, 'oraclelinux')
87+
run: |
88+
dnf -y install oracle-epel-release-el8
89+
- name: Install dependencies (CentOS, Oracle Linux)
90+
if: contains(matrix.image, 'centos') || contains(matrix.image, 'oraclelinux')
91+
run: |
7792
yum -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel rpm-build
78-
- name: Install depedencies (Fedora)
79-
if: startsWith(matrix.image, 'fedora')
80-
run: dnf -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel rpm-build
93+
94+
# Checkout repository --------------------------------------------------------------------
95+
- uses: actions/checkout@v2
8196

8297
# Build ----------------------------------------------------------------------------------
8398
- name: Build RPM packages
8499
run: |
85100
mkdir build && cd build
86101
cmake .. -DPACKAGE_BUILDER_RPM=On -DCPACK_PACKAGE_CONTACT="GitHub actions <[email protected]>"
87102
make rpm
88-
- name: Pack RPM packages
89-
working-directory: 'build/pkg/rpm/rpmbuild'
90-
run: zip -r "$GITHUB_WORKSPACE/$ZIP_FILE" RPMS SRPMS
91-
env:
92-
ZIP_FILE: ${{ steps.vars.outputs.zip_file }}
93103
- name: Archive RPM packages
94104
if: github.event_name == 'push'
95-
uses: actions/upload-artifact@v1
105+
uses: actions/upload-artifact@v2
96106
with:
97-
name: ${{ steps.vars.outputs.zip_file }}
98-
path: ${{ steps.vars.outputs.zip_file }}
107+
name: ${{ env.ZIP_FILE }}
108+
path: |
109+
build/pkg/rpm/rpmbuild/RPMS/
110+
build/pkg/rpm/rpmbuild/SRPMS/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ cmake-build-release/
1010
# JetBrains files
1111
.idea/
1212

13+
# VS Code files
14+
.vscode/
15+
16+
1317
# Prerequisites
1418
*.d
1519

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ endif()
1313

1414
# Versions and other informations
1515
set(LIBFDS_VERSION_MAJOR 0)
16-
set(LIBFDS_VERSION_MINOR 2)
17-
set(LIBFDS_VERSION_PATCH 1)
16+
set(LIBFDS_VERSION_MINOR 3)
17+
set(LIBFDS_VERSION_PATCH 0)
1818
set(LIBFDS_VERSION
1919
${LIBFDS_VERSION_MAJOR}.${LIBFDS_VERSION_MINOR}.${LIBFDS_VERSION_PATCH})
2020

config/system/aliases.xml

Lines changed: 98 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,31 @@
2020
</aggregation>
2121
</element>
2222

23+
<!-- Number of bytes -->
24+
<element>
25+
<name>Bytes</name>
26+
<alias>bytes</alias>
27+
28+
<source>
29+
<id>iana:octetDeltaCount</id>
30+
</source>
31+
32+
<aggregation>
33+
<method>sum</method>
34+
<order>descendent</order>
35+
</aggregation>
36+
</element>
37+
2338
<!-- Source IP address (IPv4 or IPv6) -->
2439
<element>
2540
<name>SRC IP</name>
41+
<alias>src ip</alias>
2642
<alias>srcip</alias>
43+
<alias>src host</alias>
2744
<alias>srchost</alias>
2845

2946
<!-- possible data types: ipv4Address/ipv6Address -->
30-
<source mode="anyOf">
47+
<source mode="firstOf">
3148
<id>iana:sourceIPv4Address</id>
3249
<id>iana:sourceIPv6Address</id>
3350
</source>
@@ -36,11 +53,13 @@
3653
<!-- Destination IP address (IPv4 or IPv6) -->
3754
<element>
3855
<name>DST IP</name>
56+
<alias>dst ip</alias>
3957
<alias>dstip</alias>
58+
<alias>dst host</alias>
4059
<alias>dsthost</alias>
4160

4261
<!-- possible data types: ipv4Address/ipv6Address -->
43-
<source mode="anyOf">
62+
<source mode="firstOf">
4463
<id>iana:destinationIPv4Address</id>
4564
<id>iana:destinationIPv6Address</id>
4665
</source>
@@ -54,8 +73,10 @@
5473

5574
<!-- possible data types: ipv4Address/ipv6Address -->
5675
<source mode="anyOf">
57-
<id>@srcip</id>
58-
<id>@dstip</id>
76+
<id>iana:sourceIPv4Address</id>
77+
<id>iana:sourceIPv6Address</id>
78+
<id>iana:destinationIPv4Address</id>
79+
<id>iana:destinationIPv6Address</id>
5980
</source>
6081
</element>
6182

@@ -64,7 +85,6 @@
6485
<name>Flow Start</name>
6586
<alias>flowstart</alias>
6687

67-
<dataType>dateTimeMilliseconds</dataType>
6888
<aggregation>
6989
<method>min</method>
7090
<order>ascendent</order>
@@ -83,7 +103,6 @@
83103
<name>Flow End</name>
84104
<alias>flowend</alias>
85105

86-
<dataType>dateTimeMilliseconds</dataType>
87106
<aggregation>
88107
<method>max</method>
89108
<order>ascendent</order>
@@ -97,47 +116,90 @@
97116
</source>
98117
</element>
99118

100-
<!-- Flow duration (calculation example) -->
101119
<element>
102-
<name>Duration</name>
103-
<alias>duration</alias>
120+
<name>Protocol</name>
104121

105-
<dataType>dateTimeMilliseconds</dataType>
106-
<aggregation>
107-
<method>sum</method>
108-
<order>descendent</order>
109-
</aggregation>
122+
<alias>protocol</alias>
123+
<alias>proto</alias>
110124

111-
<source mode="firstOf">
112-
<!-- First, try to calculate the duration -->
113-
<calculated expr="$1 - $2">
114-
<arg id="1">@flowEnd</arg>
115-
<arg id="2">@flowStart</arg>
116-
</calculated>
117-
<!-- If calculation failed, try to find other elements -->
118-
<id>iana:flowDurationMilliseconds</id>
119-
<id>iana:flowDurationMicroseconds</id>
125+
<source>
126+
<id>iana:protocolIdentifier</id>
120127
</source>
121128
</element>
122129

123-
<!-- Bytes per second (another calculated value) -->
124130
<element>
125-
<name>Bytes per second</name>
126-
<alias>bps</alias>
131+
<name>IPv4 Address</name>
127132

128-
<dataType>float64</dataType>
129-
<aggregation>
130-
<method>sum</method>
131-
<order>descendent</order>
132-
</aggregation>
133+
<alias>ip4</alias>
134+
<alias>ipv4</alias>
135+
<alias>ipv4addr</alias>
136+
<alias>ipv4address</alias>
137+
138+
<source>
139+
<id>iana:sourceIPv4Address</id>
140+
<id>iana:destinationIPv4Address</id>
141+
</source>
142+
</element>
143+
144+
<element>
145+
<name>IPv6 Address</name>
146+
147+
<alias>ip6</alias>
148+
<alias>ipv6</alias>
149+
<alias>ipv6addr</alias>
150+
<alias>ipv6address</alias>
151+
152+
<source>
153+
<id>iana:sourceIPv6Address</id>
154+
<id>iana:destinationIPv6Address</id>
155+
</source>
156+
</element>
157+
158+
<element>
159+
<name>Port</name>
160+
161+
<alias>port</alias>
162+
163+
<source>
164+
<id>iana:sourceTransportPort</id>
165+
<id>iana:destinationTransportPort</id>
166+
</source>
167+
</element>
168+
169+
<element>
170+
<name>Source Port</name>
171+
172+
<alias>srcport</alias>
173+
<alias>sourceport</alias>
174+
<alias>src port</alias>
175+
176+
<source>
177+
<id>iana:sourceTransportPort</id>
178+
</source>
179+
</element>
180+
181+
<element>
182+
<name>Destination Port</name>
183+
184+
<alias>dstport</alias>
185+
<alias>destport</alias>
186+
<alias>destinationport</alias>
187+
<alias>dst port</alias>
133188

134189
<source>
135-
<calculated expr="($1 * 1000) / $2">
136-
<arg id="1">iana:octetDeltaCount</arg>
137-
<arg id="2">@duration</arg>
138-
</calculated>
190+
<id>iana:destinationTransportPort</id>
139191
</source>
140192
</element>
193+
194+
<element>
195+
<name>TCP Flags</name>
196+
197+
<alias>tcpflags</alias>
198+
199+
<source>
200+
<id>iana:tcpControlBits</id>
201+
</source>
202+
</element>
203+
141204
</ipfix-aliases>
142205

143-
<!-- TODO: How to express "net a.b.c.d/XX"? -->

0 commit comments

Comments
 (0)