Skip to content

Commit 955934e

Browse files
author
Pavel Siska
committed
ipfixprobed: update ipfixprobed script to support new yaml configuration
format
1 parent c00b643 commit 955934e

File tree

2 files changed

+69
-42
lines changed

2 files changed

+69
-42
lines changed

init/ipfixprobed

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
CONFFILE="/etc/ipfixprobe/$1.conf"
44

5-
if [ -e "$CONFFILE" ]; then
5+
parse_old_format() {
6+
# Parse the old format of the configuration file
67
source "$CONFFILE"
78
input=""
89
dpdkinput=""
@@ -131,7 +132,26 @@ if [ -e "$CONFFILE" ]; then
131132
fi
132133

133134
exec /usr/bin/ipfixprobe "${dpdkinput[@]}" $input $storage $process $output $telemetry $EXTRA_ARGS
135+
}
136+
137+
if [ -e "$CONFFILE" ]; then
138+
if grep -q 'INPUT\[' $CONFFILE; then
139+
echo "WARNING: Legacy configuration format detected. This format is obsolete and will be removed in version 5.2."
140+
echo "Please transition to the new YAML configuration format. For more details, visit: https://github.com/CESNET/ipfixprobe/blob/master/init/link0.conf.example"
141+
parse_old_format
142+
else
143+
command=$(python3 config2args.py --config $CONFFILE)
144+
status=$?
145+
146+
if [ $status -ne 0 ]; then
147+
echo "Cannot convert yaml config" >&2
148+
exit $status
149+
fi
150+
exec $command
151+
fi
134152
else
135153
echo "Configuration file '$CONFFILE' does not exist, exitting." >&2
136154
exit 1
137155
fi
156+
157+
exit 0

init/link0.conf.example

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,100 @@
11
# Input plugin configuration (input_plugin)
22
input_plugin:
3+
# IMPORTANT: Only one input plugin can be specified. Choose one of the following options:
4+
# raw, pcap_file, pcap_live, ndp, dpdk_ring, or dpdk.
5+
36
raw:
4-
interface: eth0 # Network interface name
5-
blocks_count: 2048 # Number of blocks in the circular buffer (power of 2)
6-
packets_in_block: 32 # Number of packets in each block (power of 2)
7+
interface: eth0 # Network interface name to capture traffic from [required]
8+
blocks_count: 2048 # Number of blocks in the circular buffer (must be a power of 2)
9+
packets_in_block: 32 # Number of packets per block (must be a power of 2)
710

811
pcap_file:
9-
file: /path/to/pcap/file.pcap # Path to the PCAP file
12+
file: /path/to/pcap/file.pcap # Path to the PCAP file to read from [required]
1013
bpf_filter: null # Optional BPF filter (e.g., "port 80"), null = no filter
1114

1215
pcap_live:
13-
interface: eth0 # Network interface for live capture
14-
bpf_filter: null # BPF filter, null = no filter
16+
interface: eth0 # Network interface for live packet capture [required]
17+
bpf_filter: null # Optional BPF filter (null = no filter)
1518
snap_length: 65535 # Maximum packet capture length
1619

1720
ndp:
18-
device: /dev/nfb0 # Device for packet capture
19-
queues: "0-15" # List of queues (e.g., "0,1,2-3,7")
21+
device: /dev/nfb0 # Device for packet capture (e.g., /dev/nfb0) [required]
22+
queues: "0-15" # List of queue IDs (e.g., "0,1,2-3,7") [required]
2023

2124
dpdk_ring:
22-
ring_name: ring0 # Name of the shared DPDK ring buffer
23-
eal_opts: null # EAL options (null = default)
24-
burst_size: 64 # Number of packets processed in each cycle
25+
ring_name: ring0 # Name of the shared DPDK ring buffer [required]
26+
eal_opts: null # EAL options (null = default options)
27+
burst_size: 64 # Number of packets processed in each burst (cycle)
2528

2629
dpdk:
27-
allowed_nics: "0000:00:00.0,0000:00:00.1" # List of allowed NICs (PCI addresses)
28-
burst_size: 64 # Number of packets processed in each cycle
29-
mempool_size: 8192 # Size of the memory pool (power of 2)
30-
rx_queues: 1 # Number of RX queues
31-
eal_opts: null # EAL options (null = default)
30+
allowed_nics: "0000:00:00.0,0000:00:00.1" # List of allowed NICs (PCI addresses) [required]
31+
burst_size: 64 # Number of packets processed in each burst (cycle)
32+
mempool_size: 8192 # Size of the memory pool (must be a power of 2)
33+
rx_queues: 1 # Number of RX (receive) queues
34+
eal_opts: null # EAL options (null = default options)
3235
mtu: null # Maximum Transmission Unit (defaults to RTE_ETHER_MAX_LEN)
3336

3437
# Storage configuration (storage)
3538
storage:
3639
cache:
37-
size_exponent: 20 # Cache size as a power of 2 (2^20)
38-
line_size_exponent: 4 # Cache line size as a power of 2 (2^4)
40+
size_exponent: 20 # Cache size as a power of 2 (e.g., 2^20)
41+
line_size_exponent: 4 # Cache line size as a power of 2 (e.g., 2^4)
3942
timeouts:
40-
active: 65 # Active timeout (in seconds)
41-
inactive: 300 # Inactive timeout (in seconds)
42-
split_biflow: true # Split biflow into uniflow (true/false)
43+
active: 65 # Active timeout duration (in seconds)
44+
inactive: 300 # Inactive timeout duration (in seconds)
45+
split_biflow: true # Whether to split biflow into uniflow (true/false)
4346

4447
fragmentation_cache:
4548
enabled: true # Enable fragmentation cache (true/false)
4649
size: 10007 # Fragmentation cache size (minimum 1)
47-
timeout: 3 # Timeout for fragments in cache (in seconds)
50+
timeout: 3 # Timeout for fragments in the cache (in seconds)
4851

4952
# List of active process plugins (process_plugins)
5053
process_plugins:
51-
- http
52-
- dns
53-
- quic
54-
- tls
55-
54+
- http # HTTP protocol plugin
55+
- dns # DNS protocol plugin
56+
- quic # QUIC protocol plugin
57+
- tls # TLS protocol plugin
58+
# ...
5659

5760
# Output plugin configuration (output_plugin)
5861
output_plugin:
62+
# IMPORTANT: Only one output plugin can be specified. Choose one of the following options:
63+
# ipfix, unirec, or text.
64+
5965
ipfix:
6066
collector:
61-
host: localhost # IPFIX collector address
62-
port: 4739 # Collector port
67+
host: localhost # IPFIX collector address [required]
68+
port: 4739 # IPFIX collector port [required]
6369
mtu: 1458 # Maximum size of IPFIX packets
6470
exporter:
65-
id: 0 # Exporter ID
66-
dir: 0 # Direction bit field value
71+
id: 0 # Exporter ID for IPFIX [required]
72+
dir: 0 # Direction bit field value (0 = incoming, 1 = outgoing)
6773

6874
protocol:
75+
# IMPORTANT: Only one protocol can be selected: udp or tcp.
6976
udp:
70-
template_refresh: 60 # Template refresh rate (for UDP only)
77+
template_refresh: 60 # Template refresh rate for UDP protocol (in seconds)
7178
tcp:
72-
non_blocking: false # Use non-blocking TCP socket
79+
non_blocking: false # Whether to use non-blocking TCP sockets (true/false)
7380

7481
compression:
7582
lz4:
76-
enabled: true # Enable LZ4 compression
77-
buffer_size: 4500 # Buffer size for LZ4 (default: mtu * 3)
83+
enabled: true # Enable LZ4 compression for IPFIX (true/false)
84+
buffer_size: 4500 # Buffer size for LZ4 compression (default: mtu * 3)
7885

7986
text:
80-
file: /path/to/output/file.txt # Path to output file (null = stdout)
87+
file: /path/to/output/file.txt # Path to output file (use null for stdout)
8188

8289
# Telemetry settings (telemetry)
8390
telemetry:
8491
appfs:
85-
enabled: true # Enable AppFS telemetry
86-
mount_point: /var/run/ipfixprobe/ # Mount point path
92+
enabled: true # Enable AppFS telemetry (true/false)
93+
mount_point: /var/run/ipfixprobe/ # Mount point for telemetry data storage
8794

8895
# General configuration (general)
8996
general:
9097
queues_size:
91-
input: 64 # Size of the input queue
92-
output: 16536 # Size of the output queue
93-
cpu_mask: 0x1 # CPU mask for processes
98+
input: 64 # Size of the input packet queue [required]
99+
output: 16536 # Size of the output packet queue [required]
100+
cpu_mask: 0x1 # CPU mask for process binding (use hexadecimal format)

0 commit comments

Comments
 (0)