From 331dcb479351e2b2357458364de12736d1c739c6 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 12:41:17 +0100 Subject: [PATCH 01/94] Remove ChangeLog Github release message will replace it --- ChangeLog | 317 ------------------------------------------------------ 1 file changed, 317 deletions(-) delete mode 100644 ChangeLog diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 18668f249..000000000 --- a/ChangeLog +++ /dev/null @@ -1,317 +0,0 @@ -2025-02-14 ipfixprobe-4.16.0 - * Parser: Fix packet parsing issue when --with-pcap is enabled - * DPDK: Increase default mempool size from 4096 to 8192 - * DPDK: Set RX queue size as (mempool size / 2) - * DPDK: Fix multiple DPDK telemetry files registration - -2024-12-27 ipfixprobe-4.15.0 - * dpdk: Add DPDK telemetry - * dpdk: add DPDK port telemetry - * dpdk: fix RSS configuration - * ipfix-elements: fix NTP_USEC_TO_FRAC macro - * docs: revision of web page - * README: update telemetry section - -2024-11-14 ipfixprobe-4.14.0 - * dpdk: set mempool size as rx queue size - -2024-10-17 ipfixprobe-4.13.0 - * usability: introduce docker/podman container to convert PCAP files to CSV - * IPFIX: fix order of TCP options flags - * basicplus: update TCP options mask across flow packets - * utils: introduce memcpy_le32toh() for ipfix representation - * wg: fix parsing and exporting byte order (IPFIX) - * DPDK-ring: optimization: prefetch; read timestamp from HW metadata if available - * cache: optimization - prefetch - * IPv6: fix header parsing - * DPDK&DPDK-ring: fix use of parse_packet(), skip invalid packets causing crash - -2024-08-28 ipfixprobe-4.12.0 - * ipfix plugin: support lz4 compression - * ipfixprobe: possibility to set workers affinity - * parser: fix ipv6 extension header parsing - * telemetry: supports telemetry over appFs - * build: c++ standard gnu++17 - * dpdk: set mtu, fixes - * mqtt: new process plugin - * tls plugin: fix, extract more flow details - * ndp: support new firmware timestamps - * flowcache: introduce fragmentation cache - * QUIC: refactor, extract more flow details - -2023-10-30 ipfixprobe-4.11.1 - * minor bugfixes to build on openwrt - -2023-10-18 ipfixprobe-4.11.0 - * ipfix - propose new variable (ipfix template refresh rate) - * vlan plugin: fix ipfix output - -2023-10-03 ipfixprobe-4.10.0 - * dpdk: improvement of config and init script - * QUIC: bugfixes and checks - * GRE: add new plugin to export GRE tunnel information - * VLAN: add new plugin to export VLAN information - * Flow Hash: add new plugin to export Flow Hash field - * Nettisa: optimization - skip for short flows - * icmp: add new plugin to export ICMP information - * flow cache: improve hashing to incorporate VLAN info - * bugfixes - templates and byte encoding (HTTP) - * statistics: improved monitoring capabality, added additional statistics - -2023-07-21 ipfixprobe-4.9.2 - * NetTiSA: Fix time comparison, handle Nan values - -2023-07-18 ipfixprobe-4.9.1 - * NetTiSA: Add new NetTisa process plugin - * OVPN: Imporovments (Added rtp header validation function, Improve detection) - * HTTP: Add parsing HTTP response headers server and set-cookie names - * ICMP: Add new ICMP process plugin - * Code format: Changing uncrustify to clang format - -2023-06-01 ipfixprobe-4.9.0 - * flow cache: add VLAN ID to the flow key - * SSADetector: detect SYN-SYNACK-ACK sequence to detect VPN within exiting connection - * ovpn: enhanced algorithm to minimize false positives - * optimization: do not export some additional info for short flows - * dpdk: allow running as a secondary DPDK process, reading from mring - * dpdk: allow reading from multiple port of the network interface - * init: improve config & service to set `lcores` - -2023-05-16 ipfixprobe-4.8.0 - * DPDK: bugfix of HW timestamps - * DPDK: compliance, different constant names - * pstats: bugfix of recognition of zero length packets - * SSADetector: add new plugin to detect possible SYN-SYNACK-ACK - -2023-03-27 ipfixprobe-4.7.4 - * Support parsing of ipv6 mobility header - * Support TLS v1.3 - * Support of extracting TLS version from handshake extension - -2023-02-13 ipfixprobe-4.7.3 - * Stats: Improve Input & Output pugin stats - * Tls: fix buffer overflow error (causes crashing) - -2022-12-29 ipfixprobe-4.7.2 - * rpm hotfix: disable automatic setting of hardening flags - * dpdk: bugfixes - * dpdk: changed RSS setting to use IP only - * improved ipfixprobed - -2022-12-12 ipfixprobe-4.7.1 - * http: Removed trailing '\r' from HTTP exported fields - * tcp: fixed seq&ack tracking - * dpdk: reworked plugin - -2022-10-03 ipfixprobe-4.7.0 - * dpdk: support for multi-queues - * dpdk: improved config file and init script - * flexprobe: changed flexprobe packet conversion to zero-copy mode - * build: bugfix - fixed missing -PIC - * tls: bugfix - replaced bad data type - -2022-07-26 ipfixprobe-4.6.0 - * QUIC: refactor plugin, version 2 added - * Zero-copy packet processing - * deb: add config files to generate deb package - * xxhash update - * Remove std::future feature for workers terminations - -2022-03-11 ipfixprobe-4.5.0 - * Fixed variable-length IE IPFIX export (quic, http, tls) - * QUIC plugin: Export of new information elements in QUIC plugin - * FIXED wrong export reason - * FIXED mistakes in README - * enhancement: PHists, PStats do not export data for single-packet flow - * turris: add CPP if macros to skip debug prints - -2022-02-14 ipfixprobe-4.4.0 - * added DLT_RAW link-layer support - * bugfixes - uninitialized variable (unirec output), flow duplication - * IPFIX elements update and cleanup - -2022-02-01 ipfixprobe-4.3.0 - * QUIC: FIXed wrong openssl linking on centos 7. - * Changed configuration of Copr RPM package. - -2022-01-31 ipfixprobe-4.2.0 - * Fixed invalid order of ipfix elements for TLS plugin. - -2022-01-27 ipfixprobe-4.1.0 - * Added wireguard module - * Replace stringstream due to performance issues - * Fixed build of RPM package - -2021-12-16 ipfixprobe-4.0.0 - * Reworked ipfxprobe parameter passing - * quic: Parsing quic protocol - * tests: Added several tests - * Bug fixes, memory leaks fixes - * Documentation improved - * Code refactoring - -2021-08-18 ipfixprobe-3.2.1 - * bugfix parser overflows due bug in old version of libpcap - -2021-07-28 ipfixprobe-3.2.0 - * improved code doc - * tlsplugin: fixed out of bounds write to an array - * ipfix: Minor changes - -2021-07-23 ipfixprobe-3.1.1 - * systemd: added restart on failure - * added stacktrace print on segmentation fault - * added export of flowEndReason IPFIX field - * rpm: packages are compiled with libunwind - -2021-07-21 ipfixprobe-3.1.0 - * http: updated HTTP IPFIX element identifiers - * ghactions: add coverity and codecov - * improved systemd service - * build: fixed errors on turris and tplink - -2021-06-08 ipfixprobe-3.0.0 - * added multi-thread version of ipfixprobe - * added wireguard plugin - * support cygwin compatibility - * bugfixes: RTSP plugin, build, memory - * updated tests - test for WireGuard plugin - -2021-02-27 ipfixprobe-2.19.0 - * added phist plugin - histograms of packets - * added bstats plugin - burst characteristics of flows - * added netbios support - * improved basic fields - * bugfixes: build, payload size - * maintenance: improved IPFIX basiclist representation - * updated tests - new timestamp precision - -2020-11-01 ipfixprobe-2.18.0 - * add IDPContent plugin (initial data from packet payload) - * updated create_plugin.sh - * improved systemd service - * maintenance - -2020-09-20 ipfixprobe-2.17.1 - * add TLS plugin - -2020-08-24 ipfixprobe-2.16.0 - * migration from nemea-modules - -2020-07-30 nemea-modules-2.16.0 - * flow_meter: - bugfixes, biflow support, added ppi feature, ssdp and dns-sd - improvements, added ovpn plugin, maintenance of plugins - -2020-04-21 nemea-modules-2.15.0 - * flow_meter: - minor bugfixes - -2019-04-21 nemea-modules-2.11.0 - * flow_meter: - Updated test references because of MAC UniRec type conversion. - * flow_meter&ipfixprobe: - Improved build - linker parameters. - -2019-02-25 nemea-modules-2.10.0 - * rpm: - Add ipfixprobe module, the simplified flow_meter. - -2018-09-18 nemea-modules-2.8.0 - * flow_meter: - Change HTTP template: compatibility with CESNET/FlowMon settings - -2018-03-20 Nemea-modules-2.6.2 - * flow_meter: - added export of DNS PTR - added SMTP plugin - modified some test scripts - -2017-07-24 Nemea-modules-2.5.7 - * flow_meter: - long IPFIX option (by Ulrik Haugen) - file attributes in spec (by Ulrik Haugen) - -2017-07-11 Nemea-modules-2.5.6 - * flow_meter: - fix build with older gcc - -2017-06-30 Nemea-modules-2.5.5 - * flow_meter: - parser is now parsing packets without transport layer - -2017-06-08 Nemea-modules-2.5.4 - * flow_meter: - flow cache hash function changed to xxHash - added handler for SIGPIPE signal - add support for IPv6 address in -x parameter - added export to IPFIX - optimizations - simplifications - bugfixes - -2017-03-01 Nemea-modules-2.5.3 - * flow_meter: - added -O option (see documentation) - bash completion feature - BUGFIX distcheck failed - added traffic filtering using -F parameter - default timeout on output interfaces set to HALF_WAIT - fixed exporting expired flows while no packets are captured - added output unirec field description to README - -2017-02-05 Nemea-modules-2.5.2 - * flow_meter: - add support: IPv6 extension headers - add support: double tagged frames (VLAN) - optimizations - bugfixes - -2016-10-07 Nemea-modules-2.5.0 - * flow_meter - extended tests coverage - updated README - many bugfixes and overall improvements - -2016-10-04 Nemea-modules-2.4.2 - * flow_meter: - added arp plugin - bugfixes in http and ntp plugin - -2016-08-05 Nemea-modules-2.4.1 - * flow_meter: - code revision - memory optimizations - fixing byte order issues - -2016-07-28 Nemea-modules-2.4.0 - * flow_meter: - optimization and improvement - add NTP plugin - -2016-04-03 Nemea-modules-2.3.4 - * flow_meter bugfixed - - -2016-03-20 Nemea-modules-2.3.3 - * flow_meter sip plugin bugfixed - no longer causes segfault - - -2016-03-10 Nemea-modules-2.3 - * documentation for creating flow_meter plugins - - -2016-02-16 Nemea-modules-2.1 - * Contained modules: - anonymizer - debug_sender - flow_meter - flowcounter - logger - logreplay - merger - nfreader - report2idea - traffic_repeater - unirecfilter - From 5b36a19e8c1d3dd71bfc531997e0aa314dcda610 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 12:42:17 +0100 Subject: [PATCH 02/94] Remove NEWS --- NEWS | 820 ----------------------------------------------------------- 1 file changed, 820 deletions(-) delete mode 100644 NEWS diff --git a/NEWS b/NEWS deleted file mode 100644 index 85d678bfd..000000000 --- a/NEWS +++ /dev/null @@ -1,820 +0,0 @@ -2025-02-06 (Pavel Siska): Parser - Fix packet parsing issue when --with-pcap is enabled Ensure correct packet parsing for input modules like dpdk, dpdk-ring, and nfb when compiled with --with-pcap. Previously, the parser relied on opt->datalink, which these inputs do not set, leading to incorrect layer detection. Now, it correctly defaults to Ethernet when necessary. -2025-02-06 (Pavel Siska): Dpdk - increase default mempool size from 4096 to 8192 -2025-02-06 (Pavel Siska): Dpdk - set RX queue size as (mempool size / 2) -2025-01-02 (Pavel Siska): dpdk: fix multiple dpdk telemetry files registration - -2024-12-27 (Pavel Siska): dpdk: Add DPDK telemetry -2024-12-27 (Pavel Siska): dpdk: add DPDK port telemetry -2024-12-27 (Pavel Siska): dpdk: add compatible definition macro to dpdkCompact Add RTE_ETH_RSS_GENEVE macro -2024-12-27 (Pavel Siska): dpdk: fix RSS configuration -2024-12-27 (Pavel Siska): dpdk: Add dpdkCompact - compatibility definitions for DPDK versions -2024-12-16 (Pavel Siska): README - update build requirements -2024-12-16 (Pavel Siska): configure.ac - add checks for telemetry and appfs libraries - Added AC_CHECK_LIB for 'telemetry' and 'appfs' to verify library availability. - Ensured 'LIBS' includes '-lappFs -ltelemetry' for proper linking. - Updated RPM dependencies by appending 'telemetry' to RPM_REQUIRES and RPM_BUILDREQ. -2024-12-09 (Jan Sobol): ipfix-elements: fix NTP_USEC_TO_FRAC macro Use standard conversion to ntp timestamps as in https://tickelton.gitlab.io/articles/ntp-timestamps/. -2024-11-28 (Pavel Siska): Readme - update telemetry docs -2024-11-25 (Karel Hynek): docs: fix jekyll links -2024-11-25 (Karel Hynek): docs: fix jekyll base url and update docs description -2024-11-25 (Karel Hynek): docs: fix centering in the website footer -2024-11-20 (Tomas Cejka): docs: revision of web page -2024-11-15 (Karel Hynek): doc: FIX GitHub logo in footer -2024-11-15 (Karel Hynek): README: FIX ipfixprobe logo and link to documentation -2024-11-15 (Karel Hynek): Introduce doc using Jekyll & Update README (#232) - -2024-11-12 (Jan Sobol): dpdkDevice: use mempool size as rx queue size instead of burst size -2024-11-12 (Jan Sobol): dpdk: reduce value of DEFAULT_MBUF_POOL_SIZE to use it also as rx queue size - -2024-10-17 (Tomas Cejka): doc: include generated Doxyfile to create documentation -2024-10-17 (Tomas Cejka): doc: add doxygen comment for parse_packet() -2024-10-16 (Jan Sobol): dpdk-ring - fix checking if any packet has actually been parsed -2024-10-16 (Jan Sobol): dpdk - fix checking if any packet has actually been parsed -2024-10-02 (Damir Zainullin): Fix IPv6 header parsing -2024-09-30 (Pavel Šiška): Merge pull request #220 from CESNET/prefetch-optimizations -2024-09-30 (Pavel Šiška): Merge pull request #219 from CESNET/dpdk-ring-metadata-timestamp -2024-09-30 (Pavel Šiška): Merge pull request #215 from CESNET/new-version -2024-09-26 (Jan Sobol): cache - prefetch flow records before checking their expiration -2024-09-26 (Jan Sobol): dpdk-ring - prefetch dequeued packets before processing -2024-09-25 (Jan Sobol): dpdk-ring - read timestamp from hw metadata if available -2024-09-20 (Tomas Cejka): Merge pull request #216 from CESNET/ipfixprobe-docker-wrapper -2024-09-19 (Tomas Cejka): dist: include docker/ files into distribution archive -2024-09-19 (Jan Sobol): wg - fix parsing and exporting byte order -2024-09-19 (Jan Sobol): utils - introduce memcpy_le32toh function -2024-09-18 (Jan Sobol): basicplus test - fix reference values of tcp options -2024-09-18 (Jan Sobol): basicplus - update tcp options mask across flow packets -2024-09-18 (Jan Sobol): parser - fix order of tcp options flags according to ipfix standard https://www.iana.org/assignments/ipfix/ipfix.xhtml, entity 209 - tcpOptions -2024-09-17 (Jaroslav Pesek): process container - introduce docker/podman container wrapper for processing pcaps to csvs - -2024-08-28 (Pavel Siska): ipfixprobed - add new option LZ4_COMPRESSION to init script and config example -2024-08-28 (Pavel Siska): README.md - add LZ4 compression info -2024-08-28 (Jakub Antonín Štigler): ipfix plugin: add lz4 compression -2024-08-23 (Tomas Cejka): actions: add lz4 package for build -2024-08-23 (Tomas Cejka): debian: add lz4 dependency -2024-08-23 (Tomas Cejka): build: add dependency on liblz4 due to IPFIX compression feature -2024-08-19 (Jan Sobol): ipfixprobed - introduce EXTRA_ARGS to specify any global ipfixprobe parameters -2024-08-19 (Jan Sobol): ipfixprobed - consistency of DPDK_OPTS parameter with examples and dpdk-ring -2024-08-19 (Jan Sobol): ipfixprobed - make DPDK_LCORES parameter optional -2024-08-19 (Jan Sobol): ipfixprobed - introduce DPDK_INPUT_WORKER_CPUS and OUTPUT_WORKER_CPU parameters to set workers affinity -2024-08-19 (Jan Sobol): ipfixprobed - fix duplicate rows around exec part -2024-08-19 (Jan Sobol): introduce parameter to set affinity CPU list -2024-08-19 (Jan Sobol): introduce ability to define CPU affinity for input and output workers -2024-08-19 (Jan Sobol): utils - introduce vec2str utility -2024-08-18 (Damir Zainullin): Fix ipv6 extension header parsing -2024-08-16 (Pavel Siska): ipfixprobed - add new option NON_BLOCKING_TCP to init script and config example -2024-08-16 (Pavel Siska): ipfix - add option to use non-blocking TCP socket -2024-08-16 (Pavel Siska): README.md - add telemetry section -2024-08-16 (Pavel Siska): github-ci - add build requirements -2024-08-16 (Pavel Siska): parser-stats - add parser stats to input plugins -2024-08-16 (Pavel Siska): introduce output queue telemetry -2024-08-16 (Pavel Siska): ipfixprobed - add telemetry to init script -2024-08-16 (Pavel Siska): integrate fuse telemetry to ipfixprobe -2024-08-16 (Pavel Siska): ipfixprobe spec file - add telemetry library as dependency -2024-08-16 (Pavel Siska): dpdk-ring - introduce support for plugin telemetry -2024-08-16 (Pavel Siska): ndp - introduce support for plugin telemetry -2024-08-16 (Pavel Siska): dpdk - introduce support for plugin telemetry -2024-08-16 (Pavel Siska): InputPlugin - introduce telemetry support for base plugin -2024-08-16 (Pavel Siska): parser-stats - introduce structure of Parser stats -2024-08-16 (Pavel Siska): FragmentationCache - introduce support for plugin telemetry -2024-08-16 (Pavel Siska): flowCache - introduce support for storage plugin telemetry -2024-07-29 (Pavel Siska): StoragePlugin - introduce telemetry support for base plugin -2024-07-29 (Pavel Siska): telemetry-utils - introduce TelemetryUtils class -2024-07-29 (Pavel Siska): Makefile - set ipfixprobe c++ standard to gnu++17 -2024-07-16 (Damir Zainullin): Fix code formatting -2024-07-08 (Karel Hynek): phists - FIX IPT calculation for negative IPT -2024-07-04 (Damir Zainullin): Add MQTT plugin description to README -2024-07-04 (Damir Zainullin): Add get_text() for mqtt plugin -2024-07-03 (Damir Zainullin): Change c++ version to c++17 -2024-07-03 (Damir Zainullin): Add mqtt plugin tests -2024-07-03 (Damir Zainullin): Add mqtt process plugin -2024-06-20 (Jan Sobol): dpdk - call rte_eth_dev_set_mtu to set MTU on interface The MTU setting in rte_eth_dev_configure turned out to be insufficient. -2024-06-20 (Jan Sobol): dpdk - fix mbuf dataroom size MTU is increased by eth header len. -2024-06-11 (Jan Sobol): dpdk - update DEFAULT_MBUF_BURST_SIZE to 64 which is default value for input packet queue -2024-06-04 (Tomas Cejka): github-action: insert CODECOV_TOKEN into pipeline -2024-06-04 (Tomas Cejka): github-actions: increase version of codecov-action -2024-06-04 (Karel Hynek): tls plugin: fix extensionlists IPFIX enterprise number -2024-05-31 (Jan Sobol): dpdk - configure MTU size in dpdkDevice -2024-05-31 (Jan Sobol): dpdk - introduce MTU parameter -2024-05-31 (jmuecke): Update README -2024-05-29 (Karel Hynek): Update reference test file -2024-05-28 (jmuecke): Update IE IDs -2024-05-27 (jmuecke): extract CH TLS extensions -2024-04-22 (Pavel Siska): test - update reference file of quic test -2024-04-16 (jmuecke): Only act on first retry packet -2024-04-12 (Pavel Siska): quic - fix code format -2024-04-03 (Pavel Siska): dpdk - update memory pool creation to use device socket ID -2024-02-20 (jmuecke): Change payload_len only if previously modified. -2024-02-20 (Pavel Siska): ndp - refactored processing of timestamps Ndp plugin is now able to process timestamps from different fw packet headers. If fw timestamp is invalid SW timestamp is used. -2024-02-20 (Pavel Siska): ndp - set booted firmware and timestamp position information -2024-02-15 (Karel Hynek): QUIC - Fix IPFIX IDs for basic list elements -2024-02-13 (jmuecke): Return proper QUIC version. -2024-02-12 (Karel Hynek): QUIC - Avoid source buffer overflow in crypto frame copy -2024-02-12 (Karel Hynek): QUIC - Fix payload len underflow, when smaller than expected -2024-02-12 (Karel Hynek): QUIC - Fix required output IPFIX buffer size -2024-01-24 (jmuecke): Fix text output -2024-01-23 (jmuecke): Restrict TLS extraction to alpn and quic_transport parameters -2024-01-18 (jmuecke): tested and improved quic module -2023-12-16 (Pavel Valach): tests/functional/wg: added more regular traffic, also with max length 1420 -2023-12-16 (Pavel Valach): process/wg: do not check if transport data length is divisible by 16 -2023-11-07 (Jakub Antonín Štigler): Fragmentation cache - Add parameters to service -2023-11-07 (Jakub Antonín Štigler): Add missing include -2023-11-07 (Pavel Siska): FlowCache - integrate fragmentation cache -2023-11-07 (Pavel Siska): fragmentationCache - introduce fragmentation Cache class -2023-11-07 (Pavel Siska): fragmentationCache - introduce FragmentationTable class -2023-11-07 (Pavel Siska): fragmentationCache - introduce Fragmentation data structures -2023-11-07 (Pavel Siska): fragmentationCache - introduce utilities for timeval structure -2023-11-07 (Pavel Siska): FragmentationCache - introduce Ring Buffer class -2023-11-07 (Pavel Siska): parser - support extraction of IPv4/6 packet fragmentation info -2023-11-02 (jmuecke): Fix processing of version negotiation eliciting version. -2023-11-02 (jmuecke): quic versions: Support all versions triggering vns. -2023-11-02 (jmuecke): vn: Add server port before flushing flow -2023-11-02 (jmuecke): Export detected quic server port. -2023-11-02 (jmuecke): Enforce CID lengths are within the defined spec. Parse packet type last. -2023-11-02 (jmuecke): Add quic packet type information for each datagram. -2023-11-01 (jmuecke): 0-RTT collect client CID. But no other CIDs or version. -2023-10-31 (jmuecke): Use correct type for CID fields. -2023-10-31 (jmuecke): VN: Add QUIC extension if FLOW_FLUSH. Version = VN is not an error. -2023-10-31 (jmuecke): Fix IPFIX ID collision of QUIC_ZERO_RTT. -2023-10-26 (jmuecke): QUIC: Extract more QUIC flow details - -2023-10-25 (Tomas Cejka): openwrt: fix missing byteorder in RTP plugin -2023-10-25 (Tomas Cejka): openwrt: add missing include of time.h - -2023-10-17 (Pavel Siska): ipfix - propose new variables (ipfix template refresh rate) to control init by ipfixprobed The description of new variables was added into link0.conf.example: TEMPLATE_REFRESH_RATE -2023-10-17 (Pavel Siska): ipfix - add configuration option for template refresh rate (UDP) -2023-10-17 (Pavel Siska): vlan plugin: fix invalid return code from fill_ipfix() -2023-09-14 (Jakub Antonín Štigler): mpls - add description to readme -2023-09-14 (Jakub Antonín Štigler): Introduce mpls plugin -2023-09-14 (Jakub Antonín Štigler): ipfix - Add mpls label element -2023-09-14 (Jakub Antonín Štigler): Parser - extract mpls -2023-09-14 (Jakub Antonín Štigler): Packet - Add mpls field - -2023-10-03 (Tomas Cejka): Merge pull request #185 from CESNET/dpdkinit -2023-09-30 (Tomas Cejka): dpdk: propose new variables to control init by ipfixprobed -2023-09-25 (SiskaPavel): Merge pull request #184 from CESNET/vlan_plugin_ipfix_fix -2023-09-25 (Pavel Siska): ipfix-elements - add missing vlan plugin ipfix template -2023-09-21 (Tomas Cejka): Merge pull request #183 from CESNET/fix-build-fedora38+ -2023-09-21 (Pavel Siska): stats - add missing include -2023-09-19 (Karel Hynek): Merge pull request #181 from CESNET/quic_fix -2023-09-13 (Karel Hynek): QUIC: Code reformat -2023-09-13 (Karel Hynek): QUIC: Added buffer overflow checks -2023-08-08 (SiskaPavel): Merge pull request #176 from CESNET/flow-hash-plugin -2023-08-08 (Jakub Antonín Štigler): Plugin template - fix method specifiers -2023-08-08 (Jakub Antonín Štigler): Flow Hash - update readme -2023-08-08 (Jakub Antonín Štigler): Flow Hash - implement plugin -2023-08-07 (Tomas Cejka): Merge pull request #178 from CESNET/debupdate -2023-08-07 (Tomas Cejka): update debian package version -2023-08-04 (Tomas Cejka): Merge pull request #177 from CESNET/parse-gre -2023-08-03 (Jakub Antonín Štigler): GRE - remove wrong throw in parser -2023-08-03 (Jakub Antonín Štigler): Flow cache - export hash to flow -2023-08-03 (Jakub Antonín Štigler): Flow - Add hash field -2023-08-02 (SiskaPavel): Merge pull request #144 from BonnyAD9/support-gre-protocol -2023-08-02 (SiskaPavel): Merge pull request #162 from BonnyAD9/export-vlan-id -2023-08-02 (Jakub Antonín Štigler): Merge branch 'master' into export-vlan-id -2023-08-02 (Jakub Antonín Štigler): GRE: integrate into parser -2023-08-02 (Jakub Antonín Štigler): GRE: parse gre protocol -2023-08-01 (Jakub Antonín Štigler): VLAN: Update readme -2023-08-01 (Jakub Antonín Štigler): VLAN: Update tests -2023-08-01 (Jakub Antonín Štigler): VLAN: Implement plugin -2023-08-01 (SiskaPavel): Merge pull request #165 from BonnyAD9/icmp-plugin -2023-07-27 (Karel Hynek): Merge pull request #175 from CESNET/http_ipfixtemplate_bugfix -2023-07-27 (Karel Hynek): HTTP: Bugfix in IPFIX template. -2023-07-25 (Karel Hynek): Merge pull request #174 from CESNET/nettisa_improvment -2023-07-25 (Karel Hynek): Nettisa: Added functional tests -2023-07-24 (Karel Hynek): Nettisa: Removing one-packet nettisa flow export -2023-07-21 (SiskaPavel): Merge pull request #173 from CESNET/new_version -2023-07-12 (Jakub Antonín Štigler): icmp: fix byte order -2023-06-15 (Jakub Antonín Štigler): VLAN: Add includes - -2023-07-20 (Josef Koumar): NetTiSA: Handle NaN values -2023-07-18 (Pavel Siska): Nettisa - fix invalid time conversion -2023-07-18 (Pavel Siska): utils - add function that convert struct timeval to microseconds -2023-07-18 (Pavel Siska): utils - fix static_assert function to c++11 standard - -2023-07-17 (Pavel Siska): NetTiSA: Add NetTiSA into README.md -2023-07-17 (Pavel Siska): NetTiSA: Add NetTiSA to Makefile -2023-07-17 (Pavel Siska): NetTiSA: Add NetTiSA plugin -2023-07-17 (Pavel Siska): NetTiSA: Add NetTiSA IPFIX elements -2023-07-17 (Pavel Siska): utils - format code with clang-format -2023-07-17 (Pavel Siska): Byte-utils - introduce htonf() function to convert float to network order -2023-07-14 (Karel Hynek): OVPN: Code reformat -2023-07-14 (Karel Hynek): OVPN: checking datapackets for RTP validity to reduce false positives -2023-07-14 (Karel Hynek): OVPN: Added rtp header validation function -2023-07-14 (Karel Hynek): OVPN plugin: Improve detection for flows with large small number packets -2023-07-07 (Jakub Magda): Add new HTTP fields to README.md -2023-07-07 (Karel Hynek): HTTP: Updated functional tests -2023-07-07 (Karel Hynek): HTTP: Added missing pointer check -2023-07-07 (Karel Hynek): HTTP: Code reformat -2023-07-07 (Karel Hynek): HTTP: FIXED invalid pointer check -2023-06-28 (Karel Hynek): Changing uncrustify to clang format -2023-06-17 (Tomas Cejka): actions: update to actions/checkout@v3 -2023-06-17 (Tomas Cejka): coverity: update to actions/checkout@v3 -2023-06-15 (Jakub Magda): Add parsing HTTP response headers server and set-cookie names -2023-06-06 (Jakub Antoní Stigler): Update functional test references -2023-06-01 (jaroslavpesek): dpdk - updated README.md for multiport read -2023-05-23 (Jakub Antoní Stigler): improve readablility -2023-04-25 (Jakub Antoní Stigler): Add icmp to README -2023-04-25 (Jakub Antoní Stigler): remove icmp from parser -2023-04-25 (Jakub Antoní Stigler): Implement fill functions in icmp -2023-04-25 (Jakub Antoní Stigler): Add binaries to gitignore -2023-04-25 (Jakub Antoní Stigler): Implement ICMP plugin -2023-04-25 (Jakub Antoní Stigler): generate empty icmp plugin - -2023-05-30 (jaroslavpesek): Merge pull request #157 from CESNET/dpdk-port -2023-05-29 (Pavel Siska): Ipfixprobed - support dpdk option `lcores` -2023-05-29 (Pavel Siska): Ipfixprobed - remove dpdk option `cpu_mask` -2023-05-29 (Pavel Siska): Dpdk - refactor dpdk, support multiple port read -2023-05-29 (Pavel Siska): Dpdk - introduce DpdkDevice class -2023-05-29 (Pavel Siska): Dpdk - introduce dpdk Mbuf wrapper class -2023-05-26 (Tomas Cejka): Merge pull request #155 from BonnyAD9/add-vlan-to-flow-key -2023-05-26 (Jakub Antonín Štigler): Merge branch 'CESNET:master' into add-vlan-to-flow-key -2023-05-26 (Tomas Cejka): Merge pull request #156 from CESNET/coverity-1 -2023-05-26 (Tomas Cejka): Update coverity.yml -2023-05-24 (Jakub Antonín Štigler): add VLAN ID to flow key -2023-05-19 (Tomas Cejka): Merge pull request #141 from CESNET/dpdk-ring-reader -2023-05-19 (jaroslavpesek): Apply code style suggestions from code review -2023-05-19 (jaroslavpesek): Apply copyright suggestions from code review -2023-05-19 (Tomas Cejka): Merge pull request #152 from CESNET/ovpn_enhacment -2023-05-19 (Karel Hynek): Added min_pckt_export_treshold constant -2023-05-19 (Karel Hynek): Update minor coding-style issue -2023-05-19 (Tomas Cejka): Merge pull request #154 from CESNET/update_licence -2023-05-19 (Karel Hynek): Update licence terms -2023-05-17 (Tomas Cejka): Merge pull request #153 from CESNET/release -2023-05-16 (Karel Hynek): Minor coding style update -2023-05-16 (Karel Hynek): Minor coding style update -2023-05-16 (Karel Hynek): SSA: Updated readme -2023-05-16 (Karel Hynek): SSADetector: Bugfix, improved memory consumption -2023-05-16 (Karel Hynek): Enhancment, do not export bstats for short flows -2023-05-16 (Karel Hynek): Merge pull request #149 from CESNET/ssadetector_plugin -2023-05-16 (Karel Hynek): Merge pull request #151 from CESNET/bstats_enhancment -2023-05-16 (Karel Hynek): Minor coding style update -2023-05-16 (Karel Hynek): Minor coding style update -2023-05-05 (Karel Hynek): SSA: Updated readme -2023-05-05 (Karel Hynek): SSADetector: Bugfix, improved memory consumption -2023-05-05 (Karel Hynek): Ovpn: added updated test reference -2023-05-05 (Karel Hynek): Enhancment, do not export bstats for short flows -2023-05-05 (Karel Hynek): Enhancment: Do not export ovpn field for short flows. -2023-05-05 (Karel Hynek): Enhancment: Contrain ovpn data packet on minimal size -2023-03-27 (jaroslavpesek): dpdk: new input plugin for reading via dpdk rings as secondary dpdk process - -2023-05-05 (SiskaPavel): Merge pull request #148 from CESNET/dpdk-version -2023-05-05 (Pavel Siska): dpdk - support HW timestamp only when metadata are available -2023-05-04 (Pavel Siska): Dpdk - support different constant names acros dpdk versions -2023-04-18 (SiskaPavel): Merge pull request #146 from CESNET/ssadetector_plugin -2023-04-18 (SiskaPavel): Merge pull request #143 from BonnyAD9/http-invalid-method -2023-04-18 (Karel Hynek): Merge pull request #145 from CESNET/pstats_zerolen_fix -2023-04-18 (Karel Hynek): SSADetector: Updated coding style, Removed unnamed constants -2023-04-17 (Karel Hynek): PSTATS BUGFIX: Fixed zero-len packets recognition -2023-04-04 (Jakub Antonín Štigler): Increase the method field size in http -2023-03-27 (Jakub Antonín Štigler): Set back the default size of http method -2023-03-27 (Jakub Antonín Štigler): parse http requests with invalid header -2023-03-27 (SiskaPavel): Merge pull request #142 from CESNET/new_version -2023-03-15 (Karel Hynek): SSADetector: Added functional tests -2023-03-15 (Karel Hynek): SSADetector: Added ext record modification methods -2023-03-15 (Karel Hynek): SSADetector: Added transition functions to detection automaton -2023-03-15 (Karel Hynek): SSADetector: SSADetectorRecord EXT completely defined -2023-03-15 (Karel Hynek): SSADetector: Added pkt table structure -2023-03-15 (Karel Hynek): SSADetector: Added pkt entry structure -2023-03-15 (jirakja7): SSADetector plugin: initial files. - -2023-03-20 (Jakub Antonín Štigler): Skip ipv6 mobility header -2023-03-15 (Karel Hynek): Updated .gitignore -2023-03-13 (Karel Hynek): tls: Updated tls test reference -2023-03-13 (Karel Hynek): tls: Updated test pcap to contain tls 1.3 -2023-03-13 (Karel Hynek): TLS: Updated Recognition of Server Hello stage -2023-03-10 (Andrej Lukacovic): Support of extracting TLS version from handshake extension -2022-12-20 (Tomas Cejka): Improved description of output - -2023-02-13 (Pavel Siska): Specify Output plugin bytes stats to L4 layer size. -2023-02-13 (Pavel Siska): Added total counter to Input plugin statistics which sumarize values over all input plugins -2023-02-02 (Pavel Siska): Tls - fix buffer overflow when parsing TLS SNI field - -2022-12-29 (Tomas Cejka): rpm: hotfix - disable automatic setting of hardening flags -2022-12-24 (Tomas Cejka): Merge pull request #133 from CESNET/dpdk-check-caps -2022-12-22 (Tomas Cejka): dpdk: bugfix HW timestamp capability check -2022-12-22 (Tomas Cejka): Merge pull request #132 from CESNET/dpdk-check-caps -2022-12-22 (SiskaPavel): Merge pull request #131 from CESNET/active-timeout-overtime-#123 -2022-12-22 (Tomas Cejka): dpdk: check capabilities and skip unsupported features -2022-12-21 (xsiska12): Cache: fixed export of flow with longer duration than active timeout -2022-12-21 (SiskaPavel): Merge pull request #129 from CESNET/dpdk-update -2022-12-21 (xsiska12): Dpdk: set Dpdk datalink to zero -2022-12-21 (xsiska12): Dpdk: removed setting of lcore thread affinity -2022-12-21 (xsiska12): Dpdk: Removed invalid packet block indexing -2022-12-21 (xsiska12): Dpdk: return Result::TIMEOUT when no packets are read -2022-12-21 (xsiska12): Dpdk: set first argument of rte_eal_init() function to program name (argv[0]) -2022-12-20 (Tomas Cejka): Merge pull request #127 from CESNET/ipfix_dir_bit_field -2022-12-20 (xsiska12): ipfix: Changed data type of dir_bit_field to uint32_t -2022-12-19 (Tomas Cejka): Merge pull request #116 from CESNET/cejkato2-patch-1 codecov action fixed -2022-12-19 (Tomas Cejka): Update c-cpp.yml -2022-12-19 (Tomas Cejka): codecov: update version of gh action -2022-12-19 (Tomas Cejka): Update ipfixprobed -2022-12-19 (Tomas Cejka): Merge pull request #115 from CESNET/dpdkinit -2022-12-19 (Tomas Cejka): Merge branch 'master' into dpdkinit -2022-12-18 (Tomas Cejka): init: add DPDK variables and improve ipfixprobed script -2022-12-16 (Tomas Cejka): Merge pull request #114 from CESNET/dpdk-rss -2022-12-16 (Tomas Cejka): Merge pull request #113 from CESNET/doc-fix-example -2022-12-16 (xsiska12): dpdk: changed input of RSS to IP addresses only -2022-12-16 (Tomas Cejka): Update README.md -2022-12-14 (Tomas Cejka): Merge pull request #112 from CESNET/dpdkhelp_fixtypo -2022-12-14 (Karel Hynek): Merge pull request #111 from CESNET/release -2022-12-13 (Tomas Cejka): doc: improved readme - DPDK example -2022-12-13 (Tomas Cejka): dpdk: fixed typo in help - -2022-12-05 (Karel Hynek): Merge pull request #110 from CESNET/tcp_seq_ack_fix -2022-12-05 (Tomas Cejka): Merge pull request #109 from CESNET/HTTPS_plugin_fix -2022-12-05 (Karel Hynek): FIX: Parsing TCP SEQ and TCP ACK numbers -2022-11-25 (Karel Hynek): BUGFIX: Removed trailing '\r' from HTTP exported fields -2022-11-24 (SiskaPavel): Merge pull request #108 from CESNET/dpdk-rework -2022-11-22 (xsiska12): dpdk: updated README -2022-11-22 (xsiska12): dpdk - rework dpdk plugin -2022-10-14 (Tomas Cejka): Merge pull request #105 from CESNET/dpdk-older-version-support -2022-10-03 (xsiska12): dpdk: support dpdk version < 21.11 -2022-10-03 (SiskaPavel): Merge pull request #104 from CESNET/new_version - -2022-10-03 (Tomas Cejka): Merge pull request #103 from CESNET/dpdk-queues -2022-10-03 (xsiska12): dpdk: Updated README.md -2022-10-03 (xsiska12): dpdk: added DPDK into daemon wrapper and example config -2022-10-03 (xsiska12): DPDK: added support of multi queues packets reading -2022-09-13 (SiskaPavel): Merge pull request #102 from CESNET/flexprobe-zerocopy -2022-09-12 (xsiska12): flexprobe: Changed flexprobe packet conversion to zero copy mode -2022-09-02 (Karel Hynek): Merge pull request #100 from CESNET/bugfix_relocation -2022-08-13 (Tomas Cejka): build: BUGFIX dangerous relocation -2022-08-05 (Tomas Cejka): Merge pull request #99 from CESNET/openwrt-bugfix-quic -2022-08-05 (Tomas Cejka): tls: BUGFIX replaced unknown uint with size_t, add missing header file -2022-07-27 (Karel Hynek): Merge pull request #98 from CESNET/new_version - -2022-07-26 (OndrejSedlacek): SSDP Plugin: Fixed payload handling. -2022-07-26 (Andrej Lukacovic): QUIC: parse_header variables changed to const, decrypt_header copies from original pkt payload -2022-07-26 (Karel Hynek): Updated copyright and license in QUIC and TLS plugins/parsers -2022-07-26 (Karel Hynek): Refactor: Fixed coding style in QUIC and TLS process plugins, parsers -2022-07-26 (Karel Hynek): Refactor: NEW class TLS parser for QUIC and TLS plugins -2022-07-26 (Andrej Lukacovic): QUIC: Refactor and updates in expand_label method -2022-07-26 (Andrej Lukacovic): QUIC: changed copy whole packet payload to copy only header -2022-07-26 (Pavel Siska): Quic: Fixed payload buffer overflow -2022-07-26 (Andrej Lukacovic): QUIC: Version 2 added -2022-07-26 (Andrej Lukacovic): QUIC: changed server side return value, quic_check_initial bool fixed -2022-07-26 (Andrej Lukacovic): QUIC: remove unused vars, copy raw quic data into buffer -2022-07-26 (Andrej Lukacovic): QUIC: moved version parsing -2022-07-26 (Andrej Lukacovic): QUIC: comments/rfc links -2022-07-26 (Andrej Lukacovic): QUIC: ack1,ack2,connection_close frames parsing added, refactor of supported implementation/versions (partially supported Qv2) -2022-07-26 (Andrej Lukacovic): QUIC: refactor and checked decryption -2022-07-26 (Andrej Lukacovic): QUIC: refactor, dynamic array removed -2022-07-25 (Pavel Siska): ssdp: Check payload length during parsing. -2022-07-25 (Pavel Siska): smtp: Check payload length during parsing. -2022-07-25 (Pavel Siska): rtsp: Check payload length during parsing. -2022-07-25 (Pavel Siska): http: Check payload length during parsing. -2022-07-25 (Pavel Siska): common.hpp: Added payload length checker function. -2022-07-25 (Pavel Siska): Added common.hpp file with strnstr function. -2022-07-24 (Pavel Siska): STEM: changed number of packets to read from interface. -2022-07-24 (Pavel Siska): RAW: changed number of packets to read from interface. -2022-07-24 (Pavel Siska): PCAP: changed number of packets to read from interface. -2022-07-24 (Pavel Siska): Changed allocation of PacketBlock structure. -2022-07-24 (Pavel Siska): Removed memcpy of packet in parser. -2022-07-11 (Tomas Cejka): deb: add config files to generate deb package -2022-06-30 (Karel Hynek): FIXed unprotected string.erase() methods. -2022-06-21 (Tomas Cejka): pcap: add support for DLT_LINUX_SLL2 datalink layer -2022-05-21 (Pavel Siska): Merge input and storage workers thread. -2022-05-19 (Tomas Cejka): doc: improve description/example for DPDK -2022-05-19 (xsiska12): Remove std::future feature for workers terminations -2022-05-18 (Roman Vrana): Added InterfaceIn for Flexprobe data -2022-05-18 (Roman Vrana): Added DPDK run example -2022-04-25 (Karel Hynek): xxhash update -2022-04-19 (Roman Vrana): Added version check for MTU setting -2022-04-19 (Roman Vrana): DPDK interface fix -2022-03-24 (root): Fixed data type of active/inactive timeout in init config -2022-03-05 (Štěpán Šimek): process/create_plugin.sh fix - -2022-03-11 (xsiska12): QUIC plugin: Updated coding style -2022-03-11 (xsiska12): TLS plugin: Updated coding style -2022-03-11 (xsiska12): QUIC plugin: Updated coding style -2022-03-11 (Karel Hynek): HTTP Plugin: Updated coding style -2022-03-11 (Karel Hynek): QUIC: Updated IPFIX elements export -2022-03-11 (Karel Hynek): Fixed wrong minimal buffer len calculation in HTTP plugin -2022-03-10 (Karel Hynek): FIXED HTTP plugin variable-length IE IPFIX export -2022-03-10 (Karel Hynek): FIXED TLS plugin variable-length IE IPFIX export -2022-03-10 (Karel Hynek): Added new function for variable-length IE IPFIX export -2022-03-10 (Karel Hynek): FIXED wrong export reason -2022-03-09 (Andrej Lukacovic): FIXED: check for version negotiation packet and check for allocated memory borders while using memcpy -2022-03-09 (Karel Hynek): FIXED mistakes in README -2022-03-02 (Karel Hynek): enhancement: PHists, PStats do not export data for single-packet flow -2022-03-02 (Karel Hynek): Added ability to remove extension's memory associated with flow -2022-03-02 (Andrej Lukacovic): QUIC: Fixed test reference -2022-02-24 (Andrej Lukacovic): Feature: Parsing Google UA extension and frame reassemble -2022-02-20 (Andrej Lukacovic): Feature: Parsing Google UA Extension and frame reassemble (addted test pcaps) -2022-02-20 (Andrej Lukacovic): Feature: Parsing Google UA extension and frame reassemble -2022-02-17 (Andrej Lukacovic): initial -2022-02-16 (Andrej Lukacovic): initial -2022-02-15 (Tomas Cejka): turris: add CPP if macros to skip debug prints -2022-02-14 (Tomas Cejka): Create LICENSE - -2022-02-14 (Tomas Cejka): Merge pull request #68 from CESNET/unirec_output_fix -2022-02-14 (Tomas Cejka): Merge pull request #69 from CESNET/ipfix_elements_fix -2022-02-14 (Tomas Cejka): Merge pull request #67 from koumajos/add_raw_format -2022-02-13 (Tomas Cejka): ipfix-elements: cleaned TLS elements -2022-02-11 (Karel Hynek): Fixed uninitialised variable in unirec output -2022-02-11 (Tomas Cejka): ipfix-elements: fixed comments and WireGuard ids -2022-02-10 (Karel Hynek): fixed unirec interface flow duplication when multiple plugins enabled -2022-02-08 (Josef Koumar): Add DLT_RAW format of PCAP -2022-02-01 (SiskaPavel): Merge pull request #66 from CESNET/new_version - -2022-02-01 (Karel Hynek): QUIC: FIXed wrong openssl linking on centos 7. -2022-01-31 (xsiska12): Changed configuration of Copr RPM package. - -2022-01-31 (xsiska12): Fixed invalid order of ipfix elements for TLS plugin. - -2022-01-26 (xsiska12): Fixed undeclared variable. -2022-01-26 (xsiska12): Replace std::stringstream due to performance issues on multi-thread usage Change precision of ntp test -2022-01-20 (Pavel Valach): tests/functional/wg: added sporadic DNS detection test -2022-01-20 (Pavel Valach): process/wg: account for possible misdetection of DNS traffic -2022-01-20 (Pavel Valach): process/wg: pre_update: set confidence level to 0 if it cannot be WG -2021-12-29 (Tomas Cejka): rpm: fixed build RPM package -2021-12-21 (Jiri Havranek): stats: fixed issues reported by coverity -2021-12-21 (Jiri Havranek): stats: code improvements -2021-12-18 (Jiri Havranek): removed unused header file -2021-12-17 (Jiri Havranek): ssdp: added missing extension id registration -2021-12-17 (Jiri Havranek): ipfix: added contraints for number of process plugins -2021-12-17 (Jiri Havranek): added fd check before close -2021-12-16 (xsiska12): ipfixprobe: increased version, updated ChangeLog, released RPM package - -2021-12-16 (xsiska12): Set --enable-legacy-ssl to yes|no in spec file according to OS version -2021-12-16 (Karel Hynek): fixed quic plugin compilation on CENTOS7 with --enable-legacy-ssl flag. -2021-12-14 (Karel Hynek): Added the ability to specify active/inactive timeout in init config -2021-11-22 (Jiri Havranek): text: added extension support -2021-11-22 (Jiri Havranek): tls: added code description -2021-11-22 (Jiri Havranek): check for system_error when creating threads -2021-11-22 (Jiri Havranek): text: ignore mac param now have better description -2021-11-22 (Jiri Havranek): stem: removed TODOs -2021-11-22 (Jiri Havranek): removed TODOs and unused code as no longer needed -2021-11-22 (Jiri Havranek): quic: moved byte utility functions to general header -2021-11-22 (Jiri Havranek): configure: quic is enabled by default -2021-11-16 (Jiri Havranek): added example loadable plugin to Makefile.am -2021-11-09 (Jiri Havranek): Update process/smtp.hpp -2021-11-09 (Jiri Havranek): Update aminclude.am -2021-11-09 (Jiri Havranek): Update aminclude.am -2021-11-09 (Jiri Havranek): Update README.md -2021-11-09 (Jiri Havranek): fixed typo in Makefile.am -2021-11-09 (Jiri Havranek): configure: moved stem, flexprobe and dpdk options at the end -2021-11-09 (Jiri Havranek): configure: removed unused Makefile entry -2021-11-08 (Jiri Havranek): configure: removed old fragment -2021-11-04 (Roman Vrana): Added licence headers -2021-11-03 (Roman Vrana): Added DPDK interface and Flexprobe StEm testing interface -2021-11-02 (Roman Vrana): Added plugins for processing Flexprobe data -2021-10-23 (Jiri Havranek): cache: fixed unexported records being overwritten causing leaks -2021-10-20 (Jiri Havranek): ipfix: flush data on termination -2021-10-20 (Jiri Havranek): ipfix: count dropped flows from packets also -2021-10-20 (Jiri Havranek): ipfix: print verbose error when getaddrinfo fails -2021-10-20 (Jiri Havranek): ipfix: prevent termination when TCP conn fails at beginning -2021-10-20 (Jiri Havranek): ipfix: fixed getaddrinfo memory leak -2021-10-20 (Jiri Havranek): tls: reset record when parsing fails -2021-10-19 (Jiri Havranek): ipfix: set default mtu to 1458 -2021-10-19 (Jiri Havranek): quic: can be now conditionaly build -2021-10-18 (Jiri Havranek): fixed more issues reported by codeQL -2021-10-18 (Jiri Havranek): increased version -2021-10-18 (Jiri Havranek): tests: added unirec unit test -2021-10-18 (Jiri Havranek): fixed issues reported by coverity -2021-10-18 (Jiri Havranek): fixed issues reported by codeQL -2021-10-18 (Jiri Havranek): added missing file documentation -2021-10-17 (Jiri Havranek): added initializers in storage worker -2021-10-17 (Jiri Havranek): tests: added unit tests in gtest framework -2021-10-15 (Jiri Havranek): raw: changed poll timeout to 0, nonblocking -2021-10-15 (Jiri Havranek): fixed export of flow when reading from offline source -2021-10-15 (Jiri Havranek): quic: code refactoring -2021-10-13 (Jiri Havranek): configure: added openssl-devel check -2021-10-12 (Jiri Havranek): improved help string -2021-10-11 (Jiri Havranek): updated README.md -2021-10-07 (Jiri Havranek): added termination check of storage and output plugins -2021-10-07 (Jiri Havranek): fixed early termination when reading from multiple offline inputs -2021-10-07 (Jiri Havranek): replaced global vars with shared futures for termination -2021-10-07 (Jiri Havranek): configure: added check for TPACKET_V3 -2021-10-07 (Jiri Havranek): cache: added option to split biflows -2021-10-07 (Jiri Havranek): ipfix: added conditional compilation of timestamp precision -2021-10-04 (Jiri Havranek): quic: updated coding style -2021-10-04 (Jiri Havranek): uncrustify: updated coding rule -2021-10-04 (Andrej Lukacovic): quic: fixed packet decryption not working for some messages -2021-10-04 (Andrej Lukacovic): quic: payload decryption buffer is now allocated only once -2021-10-01 (Jiri Havranek): updated README.md -2021-10-01 (Jiri Havranek): fixed issues reported by coverity -2021-09-27 (Jiri Havranek): quic: added test -2021-09-27 (Jiri Havranek): quic: removed TODOs, fixed typo -2021-09-27 (Jiri Havranek): quic: adding only one sni record from now -2021-09-27 (Jiri Havranek): quic: reworked adding new record -2021-09-26 (Jiri Havranek): quic: invalid header length fix -2021-09-26 (Jiri Havranek): quic: added UDP constraint for flow -2021-09-26 (Jiri Havranek): quic: simplified initial packet check -2021-09-26 (Jiri Havranek): quic: added check of payload size when parsing data -2021-09-26 (Jiri Havranek): quic: simplified condition -2021-09-26 (Jiri Havranek): quic: fixed memory leaks -2021-09-23 (Jiri Havranek): ipfixprobed: fixed UDP param -2021-09-23 (Andrej Lukacovic): quic: added traffic sample -2021-09-23 (Karel Hynek): quic: new plugin -2021-09-13 (Jiri Havranek): tls: ALPN is now retrieved from server packet -2021-09-09 (Jiri Havranek): cache: removed unused macros -2021-09-08 (Jiri Havranek): raw: fixed block return when processing left packets -2021-09-08 (Jiri Havranek): raw: added aditional build checks -2021-09-08 (Karel Hynek): Fixed include zeros option in phists plugin -2021-09-07 (Jiri Havranek): fixed typos -2021-09-04 (Jiri Havranek): ndp: removed unnecessary check -2021-09-04 (Jiri Havranek): ndp: fixed potentional segfault -2021-09-04 (Jiri Havranek): ndp: fixed memory leak -2021-09-03 (Jiri Havranek): benchmark: added seed parameter -2021-09-03 (Jiri Havranek): benchmark: added constraint for minimal pkt size -2021-09-03 (Jiri Havranek): benchmark: fixed packet limit check -2021-09-03 (Jiri Havranek): ipfix: added member initializer -2021-09-03 (Jiri Havranek): ipfixprobe: clean memory when printing plugin help -2021-09-03 (Jiri Havranek): benchmark: fixed mode parameter check -2021-09-03 (Jiri Havranek): ipfix: fixed default value for udp option -2021-09-03 (Jiri Havranek): added option parser description to constructor -2021-09-02 (Jiri Havranek): cache: fixed cache size parameter -2021-09-02 (Jiri Havranek): ipfixprobe: fixed parameter initializer -2021-09-02 (Jiri Havranek): systemd: updated scripts -2021-09-02 (Jiri Havranek): ndp: fixed compilation issues -2021-09-02 (Jiri Havranek): ipfix: fixed id parameter -2021-09-02 (Jiri Havranek): ipfix: return error when connection to collector fails -2021-09-02 (Jiri Havranek): dnssd: fixed txt parameter -2021-09-02 (Jiri Havranek): cygwin compatibility -2021-09-02 (Jiri Havranek): updated github workflows -2021-09-02 (Jiri Havranek): configure.ac: added --with-raw --with-pcap --with-flowlinesize -2021-09-02 (Jiri Havranek): added initializers to plugin pointers -2021-09-02 (Jiri Havranek): raw: fixed use of strncpy -2021-09-02 (Jiri Havranek): raw: removed packet_handler function -2021-09-02 (Jiri Havranek): tls: added check for null payload -2021-09-02 (Jiri Havranek): benchmark: fixed packet generation -2021-09-01 (Jiri Havranek): fixed error messages printed when loading plugin fails -2021-09-01 (Jiri Havranek): added public inheritance to record extensions classes -2021-09-01 (Jiri Havranek): updated create_plugin.sh -2021-08-31 (Jiri Havranek): throw error when load .so file fails -2021-08-31 (Jiri Havranek): text: fixed ingore mac param -2021-08-31 (Jiri Havranek): removed packet indicator, refactoring -2021-08-31 (Jiri Havranek): reworked packet and flow structures -2021-08-31 (Jiri Havranek): fixed loading of external plugins in form of .so file -2021-08-30 (Jiri Havranek): removed unused parameter -2021-08-30 (Jiri Havranek): updated README.md -2021-08-30 (Jiri Havranek): updated create_plugin.sh -2021-08-30 (Jiri Havranek): output: added text output plugin -2021-08-30 (Jiri Havranek): input: added raw plugin for reading from raw sockets -2021-08-30 (Jiri Havranek): input: added benchmark plugin -2021-08-30 (Jiri Havranek): removed hardcoded flow extension type identifiers -2021-08-30 (Jiri Havranek): reworked module -2021-07-21 (Jiri Havranek): tls: added ALPN field export - -2021-08-17 (Karel Hynek): Merge pull request #43 from CESNET/parser-segfault -2021-08-17 (Jiri Havranek): fixed segfault in parser caused by pcap_dispatch() ignoring max packet count -2021-07-28 (Karel Hynek): Merge pull request #42 from CESNET/new_version - -2021-07-28 (Jiri Havranek): changed signal stop variable -2021-07-28 (Jiri Havranek): ipfix: enum constants are used when getting template -2021-07-28 (Jiri Havranek): ipfix: added static checks for max extension count -2021-07-28 (Jiri Havranek): tlsplugin: fixed out of bounds write to an array -2021-07-28 (Jiri Havranek): improved code doc -2021-07-28 (xsiska12): ipfixprobe: increased version, updated ChangeLog, released RPM package -2021-07-28 (xsiska12): ipfixprobe: increased version, updated ChangeLog, released RPM package -2021-07-28 (Tomas Cejka): http: updated HTTP IPFIX element identifiers -2021-07-28 (Tomas Cejka): ghactions: codeql: install dependencies for build -2021-07-28 (Tomas Cejka): ghactions: add codeql template -2021-07-28 (Tomas Cejka): ghactions: limit coverity scan to coverity branch and PR to master -2021-07-28 (Tomas Cejka): ghactions: add coverage flags for codecov build -2021-07-28 (Tomas Cejka): ghactions: add codecov -2021-07-28 (Tomas Cejka): ghactions: add coverity - -2021-07-23 (Jiri Havranek): improved class variables naming -2021-07-21 (Jiri Havranek): rpm: packages are compiled with libunwind -2021-07-15 (Jiri Havranek): configure: added missing HAVE_LIBUNWIND macro define -2021-07-15 (Jiri Havranek): added missing with condition in rpm spec file -2021-07-15 (Jiri Havranek): fixed uninitialized members reported by coverity -2021-07-15 (Jiri Havranek): fixed null pointer dereferences reported by coverity -2021-07-15 (Jiri Havranek): fixed uninitialized members reported by coverity -2021-07-15 (Jiri Havranek): fixed integer handling issues reported by coverity -2021-07-15 (Jiri Havranek): configure: added --with-unwind option -2021-07-14 (Jiri Havranek): fixed stacktrace message -2021-07-14 (Jiri Havranek): ghactions: updated list of installed packages -2021-07-14 (Jiri Havranek): added stacktrace print on segmentation fault -2021-07-14 (Jiri Havranek): added export of flowEndReason IPFIX field -2021-07-14 (Jiri Havranek): systemd: added restart on failure - -2021-07-20 (Tomas Cejka): http: updated HTTP IPFIX element identifiers -2021-07-16 (Tomas Cejka): ghactions: codeql: install dependencies for build -2021-07-16 (Tomas Cejka): ghactions: add codeql template -2021-07-16 (Tomas Cejka): ghactions: limit coverity scan to coverity branch and PR to master -2021-07-15 (Tomas Cejka): ghactions: add coverage flags for codecov build -2021-07-15 (Tomas Cejka): ghactions: add codecov -2021-07-14 (Tomas Cejka): ghactions: add coverity -2021-06-24 (Jiri Havranek): added compile time checks for cache and cache line sizes -2021-06-24 (Jiri Havranek): systemd: added configuration option CACHE_SIZE -2021-06-22 (Jiri Havranek): ndp: fixed compilation -2021-06-21 (Jiri Havranek): pstats: fixed invalid timestamps being exported on bigendian arch -2021-06-21 (Jiri Havranek): fixed issues with endianess -2021-06-21 (Jiri Havranek): moved packet headers to headers.h file -2021-06-21 (Jiri Havranek): added header file for u_char type -2021-06-21 (Jiri Havranek): fixed segfault when using flow cache stats plugin -2021-06-21 (Jiri Havranek): configure: added flowcachesize parameter -2021-06-18 (Jiri Havranek): fixed invalid timestamps when exporting in IPFIX format -2021-06-17 (Jiri Havranek): smtp: fixed buffer overflow when parsing some fields -2021-06-17 (Jiri Havranek): http: fixed buffer overflow when parsing method -2021-06-17 (Jiri Havranek): http: fixed parsing of header lines -2021-05-30 (Tomas Cejka): build: tplink: problem with endian checks in header file -2021-05-30 (Tomas Cejka): build: fixed errors on turris, missing header time.h, missing u_char - -2021-06-08 (Jiri Havranek): fixed missing constant in older libpcap versions -2021-05-15 (Jiri Havranek): stats are not printed when until init phase ends -2021-05-15 (Jiri Havranek): cygwin compatibility modifications -2021-05-14 (Pavel Valach): wgplugin: preallocate RecordExtWG -2021-05-10 (Pavel Valach): README: added WG (WireGuard) section -2021-05-10 (Pavel Valach): wgplugin: parse_wg: fix coding style -2021-05-10 (Pavel Valach): Makefile.am: included wg-sample.pcap in EXTRA_DIST -2021-04-27 (Pavel Valach): tests: wgplugin - added handshake with cookie reply (under load) -2021-04-27 (Pavel Valach): tests/test_reference/wg: fixed order of flows and zeroized LINK_BIT_FIELD -2021-04-27 (Pavel Valach): tests: added test for WireGuard plugin -2021-04-27 (Pavel Valach): wgplugin.parse_wg: use switch statement instead of else ifs -2021-04-27 (Pavel Valach): wgplugin: removed debug lines -2021-04-27 (Pavel Valach): wgplugin: added WG_CONF_LEVEL field to indicate whether this is WireGuard packet or not -2021-04-26 (Pavel Valach): wgplugin: add strict length checks for packet types -2021-04-24 (Jiri Havranek): cache: export TCP flows when ports are reused -2021-04-24 (Jiri Havranek): pstats: added seq overflow check when skipping TCP retransmissions -2021-04-23 (Jiri Havranek): fixed ndp compilation -2021-04-23 (Jiri Havranek): refactored input plugins, improved coding style -2021-04-23 (Jiri Havranek): improved coding style -2021-04-23 (Jiri Havranek): removed ARP plugin -2021-04-21 (Jiri Havranek): pstats: fixed packet retransmission detection -2021-04-18 (Karel Hynek): BUGFIX: Corrected calculation of histograms -2021-04-16 (Jiri Havranek): pstats: added new option skipdup to not include TCP retransmissions in plugin output -2021-04-13 (Pavel Valach): wgplugin: added cstring import -2021-04-10 (Pavel Valach): wgplugin: split flows during new handshakes -2021-04-09 (Pavel Valach): wgplugin: delete useless comparison -2021-04-09 (Pavel Valach): wgplugin: assign src_peer and dst_peer properly -2021-04-08 (Pavel Valach): wgplugin: do not flush the flow after recognition -2021-04-01 (Jiri Havranek): fixed infinity loop when parsing TCP options -2021-03-28 (Pavel Valach): wgplugin.h, wgplugin.cpp: initialize types to zeros -2021-03-28 (Pavel Valach): wgplugin.cpp: memcpy for sender and receiver fields wgplugin.h: implemented fillUnirec -2021-03-24 (Tomas Cejka): ipfixprobed: extend service to support list of interfaces -2021-03-24 (Tomas Cejka): ipfixprobed: extend service to support list of interfaces -2021-03-24 (Jiri Havranek): fixed segfault when using unirec output -2021-03-24 (Jiri Havranek): improved module arguments -2021-03-22 (Jiri Havranek): fixed -c parameter -2021-03-22 (Pavel Valach): WGPlugin: fixed packet type check during parsing -2021-03-22 (Pavel Valach): WGPlugin: specifically checking for zeroes in header now -2021-03-22 (Pavel Valach): WGPlugin: implement basic post_update -2021-03-22 (Pavel Valach): First attempt of Wireguard parsing code -2021-03-21 (Pavel Valach): First iteration of WireGuard detection plugin -2021-03-17 (Jiri Havranek): tests: added additional path to search for logger executable -2021-03-17 (Jiri Havranek): improved help string for -n parameter -2021-03-17 (Jiri Havranek): removed flow_meter references -2021-03-17 (Jiri Havranek): ipfiexporter: added configurable MTU -2021-03-16 (Jiri Havranek): fixed ipfix export dropping flow records sometimes -2021-03-11 (Karel Hynek): PHISTS: fixed typo in README -2021-03-10 (Jiri Havranek): fixed some inactive flows not being exported -2021-03-10 (Jiri Havranek): fixed last flow in export queue not being exported -2021-03-10 (Jiri Havranek): added status message for each input -2021-03-10 (Jiri Havranek): fixed memory leaks -2021-03-10 (Jiri Havranek): removed unused code -2021-03-09 (Jiri Havranek): added output rate limiting -2021-03-01 (Jiri Havranek): ndpreader: fixed unexpected end of capture -2021-02-14 (Karel Hynek): Uncrustyfy now checks for spaces after if,for,switch... -2021-02-11 (Jiri Havranek): fixed segfault -2021-02-11 (Jiri Havranek): fixed initialization of ndp reader counters -2021-02-11 (Jiri Havranek): improved user messages -2021-02-10 (Jiri Havranek): fixed last packet block not being read when reading from file -2021-02-10 (Jiri Havranek): fixed build -2021-02-10 (Jiri Havranek): separated input and storage plugins to separated threads -2021-02-06 (Jiri Havranek): added deduplication of exported flows in ipifx export -2021-02-06 (Jiri Havranek): fixed RTSP plugin ipfix export -2021-02-06 (Jiri Havranek): fixed RTSP plugin cleanup -2021-02-06 (Jiri Havranek): fixed inactive timeout check -2021-01-27 (Jiri Havranek): changed strategy of checking inactive timeout -2021-01-23 (Jiri Havranek): flow export separated to another thread - -2021-02-24 (Jiri Havranek): phist: improved coding style -2021-02-24 (Karel Hynek): PHISTS: Changed histogram array type: uint16* -> uint32* -2021-02-24 (Karel Hynek): PHISTS: added creation of size histogram for individual directions, added creation of IPT histograms for individual directions -2021-02-24 (Karel Hynek): PHISTS: incorporated plugin into ipfixprobe FIX main -2021-02-24 (Karel Hynek): PHISTS: modified README -2021-02-24 (Karel Hynek): PHISTS: added tests FIX test -2021-02-24 (Karel Hynek): PHISTS: added creation of size histogram for individual directions, added creation of IPT histograms for individual directions -2021-02-24 (Karel Hynek): PHISTS: incorporated plugin into ipfixprobe FIX main -2021-02-24 (Karel Hynek): PHISTS: Initial commit -2021-02-16 (Karel Hynek): BSTATS: Improved coding style -2021-02-16 (Karel Hynek): BSTATS: Moved RecordExtBSTATS initialisation to constructor -2021-02-16 (Karel Hynek): BSTATS: changed burst size calculation -2021-02-16 (Karel Hynek): BSTATS: updated readme -2021-02-16 (Karel Hynek): BSTATS: added plugin tests -2021-02-16 (Karel Hynek): BSTATS: added ipfix export -2021-02-16 (Karel Hynek): BSTATS: implemented burst recognition and their export to unirec -2021-02-13 (Karel Hynek): BSTATS: plugin creation -2021-02-12 (Jiri Havranek): fixed parsing of malformed packets -2021-02-12 (Karel Hynek): BASICPLUS: Fixed infinite loop with zero-length options -2021-02-12 (Karel Hynek): BASICPLUS: Added TCP SYN size and fixed MSS IPFIX field definition -2021-02-11 (Jiri Havranek): updated README.md -2021-02-11 (Jiri Havranek): fixed arp plugin test -2021-02-11 (Jiri Havranek): updated README.md -2021-02-11 (Jiri Havranek): updated create_plugin.sh -2021-02-11 (Karel Hynek): fixed distcheck -2021-02-11 (Jiri Havranek): added basicplus plugin exporting additional IP and TCP fields -2021-01-25 (Karel Hynek): NEW CLASS: ipfix-basiclist represent the basic list structure -2021-01-25 (Karel Hynek): PSTATS plugin: edited IPFIX export, now it uses basic list class -2021-01-25 (Karel Hynek): Added .gitignore file -2021-01-13 (Karel Hynek): PSTATS: fixed wrong packet length value when packet trimming is used -2021-01-10 (Karel Hynek): Fixed distcheck -2021-01-10 (Karel Hynek): updated pstats test-reference -2021-01-10 (Karel Hynek): Added pstats plugin option for including/excluding zero-length packets -2021-01-05 (Jiri Havranek): tests: updated tests to new timestamp precision -2021-01-05 (Jiri Havranek): pcapreader: fixed payload length computation when packet contains additional data at the end -2020-12-11 (Karel Hynek): PSTATS: changed exported packet length to payload_length -2020-12-01 (Jiri Havranek): idpcontent: fixed wrong method param -2020-12-01 (Jiri Havranek): pstats: unused code cleanup -2020-12-01 (Jiri Havranek): idpcontent: fixed packet payload content export when using flush -2020-12-01 (Jiri Havranek): pstats: fixed exported packet stats when flushing flow -2020-11-24 (Tomas Cejka): actions: test with nemea reference data -2020-11-19 (Tomas Cejka): travis: add dependencies -2020-11-19 (Tomas Cejka): travis: remove branch limit -2020-11-19 (Tomas Cejka): travis&coverity: try to update token, completed build command -2020-11-19 (lePici): Coverity: change to official example -2020-11-19 (lePici): Coverity: change secure token -2020-11-19 (lePici): Travis: delete 'master' branch in .travis.yml -2020-11-19 (lePici): Travis: delete 'travis' branch in .travis.yml -2020-11-19 (lePici): Travis: added script section in .travis.yml file -2020-11-19 (lePici): Travis: added .travis.yml file -2020-11-12 (Karel Hynek): Fixed RPM build when using libndp -2020-11-11 (Jiri Havranek): fixed compilation when libndp is used -2020-11-07 (Tomas Cejka): build: unify indentation -2020-10-22 (Jiri Havranek): Update netbiosplugin.cpp -2020-10-22 (Jiri Havranek): Update netbiosplugin.h -2020-10-19 (xsedla1o): NetBIOS: Fixed dist build error -2020-10-19 (xsedla1o): NetBIOS: Changed suffix type from bytes to uint8 -2020-10-19 (xsedla1o): NetBIOS: Review requested changes -2020-10-19 (xsedla1o): NetBIOS: Added return value to store_first_query -2020-10-19 (xsedla1o): NetBIOS: Fixed build without NEMEA -2020-10-19 (xsedla1o): NetBIOS: Whitespace changes -2020-10-19 (xsedla1o): NetBIOS: Added plugin test -2020-10-19 (xsedla1o): NetBIOS: Added stats -2020-10-19 (xsedla1o): NetBIOS: Implemented NBNS parsing -2020-10-19 (xsedla1o): NetBIOS: Changed export fields -2020-10-19 (xsedla1o): NetBIOS: Formatting -2020-10-19 (xsedla1o): NetBIOS: Filled in export base -2020-10-19 (xsedla1o): NetBIOS: Created plugin - -2020-11-01 (Jiri Havranek): improved conversion from microseconds to fraction when exporting ipfix -2020-10-30 (Jiri Havranek): increased exported timestamp precision to microseconds -2020-10-30 (Jiri Havranek): fixed payload length computation for frames shorter than 64 bytes -2020-10-23 (Karel Hynek): removed unused code -2020-10-23 (Karel Hynek): IDPContent plugin: BUGFIX! Improved condition for export IDP content. -2020-10-09 (Karel Hynek): added uncrustify config -2020-10-09 (Karel Hynek): idpcontent plugin: changed c-style cast to c++ static cast -2020-10-09 (Karel Hynek): create_plugin: fixed name inconsistency, added nemea ifndef -2020-10-09 (Karel Hynek): updated readme for IDPContent plugin unirec fields -2020-10-08 (Karel Hynek): idpcontent plugin: fix compile error -2020-10-08 (Karel Hynek): idpcontent plugin: improved coding style -2020-10-08 (Karel Hynek): idpcontent plugin: added tests -2020-10-08 (Karel Hynek): idpcontent plugin: added ipfix support -2020-10-08 (Karel Hynek): IDPContent plugin: Added export of initial data packets content -2020-10-08 (Karel Hynek): Created idpcontent plugin -2020-10-08 (Karel Hynek): create_plugin.sh: name inconsistency FIX -2020-10-05 (Tomas Cejka): build: check for libpcap and fail if missing -2020-10-05 (Lukas Hutak): systemd: introduce ipfixprobe-monitoring.target, minor fixes -2020-10-04 (Tomas Cejka): conf: fixed dnssd name in the example -2020-10-04 (Tomas Cejka): build: add distcheck setting about systemd, skip tests without NEMEA -2020-10-04 (Tomas Cejka): rpm: add systemd service -2020-09-29 (Jiri Havranek): pcapreader: added support for SLL link type - -2020-09-14 (xsedla1o): TLS Plugin: Removed total packet count from stats -2020-09-14 (xsedla1o): TLS Plugin: Updated tests -2020-09-14 (xsedla1o): TLS Plugin: Changed TLS_JA3 field type to bytes instead of string -2020-09-14 (xsedla1o): TLS Plugin: Fixed exporting only when SNI is parsed -2020-09-08 (Karel Hynek): TLS plugin: removed 443 port condition, updated coding style, removed compile warning in md5 -2020-09-08 (Karel Hynek): TLS plugin: skip GREASE values in JA3, updated tests -2020-09-04 (xsedla1o): tls: removed unused arguments -2020-09-04 (xsedla1o): tls: updated tests, removed debug prints -2020-09-04 (xsedla1o): tls: renamed export field -2020-09-03 (xsedla1o): tls: added export field for ja3 hash -2020-08-31 (xsedla1o): https: renamed to tls plugin -2020-08-31 (xsedla1o): https: refactoring -2020-08-31 (xsedla1o): https: fix build error -2020-08-31 (xsedla1o): https: add md5 hash and proper debug prints -2020-08-30 (xsedla1o): https: extract fields for ja3 fingerprint -2020-08-24 (Tomas Cejka): build: skip getopt parameters init when NEMEA is linked - -2020-08-04 (Karel Hynek): flow_meter: renamed vpndetector plugin to ovpn plugin -2020-08-03 (Tomáš Čejka): flow_meter: BUGFIX inconsistent TRILL struct for BIG_ENDIAN -2020-07-31 (xsedla1o): flow_meter: ssdp: added stats -2020-07-31 (xsedla1o): flow_meter: ssdp: Reworked parse_loc_port() -2020-07-29 (Jiri Havranek): flow_meter: added RTSP parsing plugin prototype -2020-07-29 (Jiri Havranek): flow_meter: exporting 8 bits of TCP flags -2020-07-27 (Tomas Cejka): flow_meter: MAINTENANCE deduplicate list of supported plugins -2020-07-27 (Jiri Havranek): flow_meter: http: now parsing protocol on all ports -2020-07-17 (xsedla1o): flow_meter: dns-sd: adopted code from dnsplugin -2020-07-15 (xsedla1o): flow_meter: dns-sd: created plugin files -2020-07-14 (xsedla1o): flow_meter: ssdp: implemented export functions -2020-07-14 (xsedla1o): flow_meter: created ssdp plugin files -2020-06-08 (Tomas Cejka): flow_meter: pstats: update readme - list of UniRec fields -2020-06-03 (Jiri Havranek): flow_meter: added support for trill -2020-06-03 (optical-o): flow_meter: Added support for selecting NDP DMA channel -2020-06-02 (Tomas Benes): flow_meter: Added NDP Packet receiver -2020-06-02 (Tomas Benes): flow_meter: Added nfbCInterface library -2020-05-05 (Jiri Havranek): flow_meter: added test for pstats plugin -2020-05-05 (Tomáš Čejka): flow_meter: ppi: rename fields to ipfixcol2-unirec-output -2020-05-04 (Tomáš Čejka): flow_meter: ppi: merge stats array and add directions -2020-05-04 (Jiri Havranek): flow_meter: plugins updated to work correctly with biflow related modifications, fixed tests -2020-04-30 (Jiri Havranek): flow_meter: updated pstats plugin to export stats for biflow -2020-04-27 (Karel Hynek): flow_meter: Changed numbers of IPFIX elements in pstats plugin -2020-04-26 (Jiri Havranek): flow_meter: fixed export of total byte count for IPv6 flows -2020-04-26 (Jiri Havranek): flow_meter: now exporting biflow only -2020-04-07 (Tomáš Čejka): flow_meter: bugfix: check return value of UR create template -2020-04-07 (Tomáš Čejka): flow_meter: create_plugin - updated guide -2019-04-12 (Tomas Cejka): flow_meter: update test references - MAC address representation -2018-12-23 (Tomas Cejka): flow_meter: ipfixprobe without libtrap dependency -2018-09-17 (Filip Šuster): [flow_meter] Fix exported HTTP field names (#91) From bf6f5bc7403fb7aa719aba39c87cdadd3e7abf0f Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 12:43:17 +0100 Subject: [PATCH 03/94] Remove autoconf files --- Makefile.am | 348 ------------------------ aminclude.am | 10 - configure.ac | 505 ----------------------------------- ipfixprobe.bash.in | 28 -- m4/ac_define_dir.m4 | 34 --- m4/ax_c_bigendian_cross.m4 | 122 --------- m4/ax_libtrap_check.m4 | 28 -- m4/ax_prog_doxygen.m4 | 532 ------------------------------------- m4/ax_pthread.m4 | 332 ----------------------- m4/ax_unirec_check.m4 | 80 ------ 10 files changed, 2019 deletions(-) delete mode 100644 Makefile.am delete mode 100644 aminclude.am delete mode 100644 configure.ac delete mode 100644 ipfixprobe.bash.in delete mode 100644 m4/ac_define_dir.m4 delete mode 100644 m4/ax_c_bigendian_cross.m4 delete mode 100644 m4/ax_libtrap_check.m4 delete mode 100644 m4/ax_prog_doxygen.m4 delete mode 100644 m4/ax_pthread.m4 delete mode 100644 m4/ax_unirec_check.m4 diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index c755d8d64..000000000 --- a/Makefile.am +++ /dev/null @@ -1,348 +0,0 @@ -SUBDIRS= - -if WITH_NDP -SUBDIRS+=input/nfbCInterface -endif - -SUBDIRS+=. tests init -bin_PROGRAMS=ipfixprobe ipfixprobe_stats - -DISTCHECK_CONFIGURE_FLAGS="--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)" - -ipfixprobe_LDFLAGS=-lpthread -ldl -latomic -ltelemetry -lappFs -ipfixprobe_CFLAGS=-I$(srcdir)/include/ -fPIC -DFUSE_USE_VERSION=30 -ipfixprobe_CXXFLAGS=-std=gnu++17 -Wno-write-strings -I$(srcdir)/include/ -fPIC -DFUSE_USE_VERSION=30 - -if OS_CYGWIN -ipfixprobe_CXXFLAGS+=-Wl,--export-all-symbols -else -ipfixprobe_CXXFLAGS+=-Wl,--export-dynamic -endif - -ipfixprobe_input_src=\ - input/input.cpp \ - input/benchmark.cpp \ - input/benchmark.hpp \ - input/parser.cpp \ - input/parser.hpp \ - input/headers.hpp - -# How to create loadable example.so plugin: -#pkglib_LTLIBRARIES=example.la -#example_la_CXXFLAGS=-I$(srcdir)/include/ -#example_la_SOURCES=example.cpp example.hpp -#example_la_LDFLAGS=-module -shared -avoid-version - - -if WITH_NDP -ipfixprobe_LDFLAGS+=-lnuma -lndpRI -L$(srcdir)/input/nfbCInterface/ -ipfixprobe_CXXFLAGS+=-I$(srcdir)/input/nfbCInterface/include/ -ipfixprobe_input_src+=\ - input/ndp.cpp \ - input/ndp.hpp -endif - -if WITH_RAW -ipfixprobe_input_src+=\ - input/raw.cpp \ - input/raw.hpp -endif - -if WITH_PCAP -ipfixprobe_input_src+=\ - input/pcap.cpp \ - input/pcap.hpp -endif - -if WITH_STEM -ipfixprobe_input_src+=\ - input/stem.cpp \ - input/stem.hpp -endif - -ipfixprobe_storage_src=\ - storage/fragmentationCache/ringBuffer.hpp \ - storage/fragmentationCache/timevalUtils.hpp \ - storage/fragmentationCache/fragmentationKeyData.hpp \ - storage/fragmentationCache/fragmentationTable.hpp \ - storage/fragmentationCache/fragmentationTable.cpp \ - storage/fragmentationCache/fragmentationCache.hpp \ - storage/fragmentationCache/fragmentationCache.cpp \ - storage/cache.cpp \ - storage/cache.hpp \ - storage/xxhash.c \ - storage/xxhash.h - -ipfixprobe_output_src=\ - output/ipfix.cpp \ - output/ipfix.hpp \ - output/text.cpp \ - output/text.hpp \ - output/ipfix-basiclist.cpp - -if WITH_NEMEA -ipfixprobe_output_src+=\ - output/unirec.hpp \ - output/unirec.cpp \ - fields.c \ - fields.h -endif - -ipfixprobe_process_src=\ - process/http.cpp \ - process/http.hpp \ - process/rtsp.cpp \ - process/rtsp.hpp \ - process/sip.cpp \ - process/sip.hpp \ - process/tls.cpp \ - process/tls.hpp \ - process/tls_parser.cpp \ - process/tls_parser.hpp \ - process/sha256.hpp \ - process/smtp.cpp \ - process/smtp.hpp \ - process/dns-utils.hpp \ - process/dns.cpp \ - process/dns.hpp \ - process/passivedns.cpp \ - process/passivedns.hpp \ - process/ntp.cpp \ - process/ntp.hpp \ - process/idpcontent.hpp \ - process/idpcontent.cpp \ - process/netbios.hpp \ - process/netbios.cpp \ - process/bstats.hpp \ - process/bstats.cpp \ - process/phists.cpp \ - process/phists.hpp \ - process/pstats.hpp \ - process/pstats.cpp \ - process/ovpn.hpp \ - process/ovpn.cpp \ - process/ssdp.hpp \ - process/ssdp.cpp \ - process/dnssd.hpp \ - process/dnssd.cpp \ - process/basicplus.hpp \ - process/basicplus.cpp \ - process/wg.hpp \ - process/wg.cpp \ - process/stats.cpp \ - process/stats.hpp \ - process/md5.hpp \ - process/md5.cpp \ - process/common.hpp \ - process/ssadetector.hpp \ - process/ssadetector.cpp \ - process/icmp.hpp \ - process/icmp.cpp \ - process/vlan.hpp \ - process/vlan.cpp \ - process/nettisa.hpp \ - process/nettisa.cpp \ - process/flow_hash.hpp \ - process/flow_hash.cpp \ - process/mpls.hpp \ - process/mpls.cpp \ - process/mqtt.hpp \ - process/mqtt.cpp - -if WITH_QUIC -ipfixprobe_process_src+=\ - process/quic.hpp \ - process/quic.cpp \ - process/quic_parser.cpp \ - process/quic_parser.hpp - -endif - -if WITH_FLEXPROBE -ipfixprobe_process_src+=\ - process/flexprobe-data.h \ - process/flexprobe-data-processing.cpp \ - process/flexprobe-data-processing.h \ - process/flexprobe-tcp-tracking.cpp \ - process/flexprobe-tcp-tracking.h \ - process/flexprobe-encryption-processing.cpp \ - process/flexprobe-encryption-processing.h -endif - -if WITH_OSQUERY -ipfixprobe_input_src+=\ - process/osquery.cpp\ - process/osquery.hpp -endif - -if WITH_DPDK -ipfixprobe_input_src+=\ - input/dpdk/dpdkMbuf.hpp \ - input/dpdk/dpdkMbuf.cpp \ - input/dpdk/dpdkDevice.hpp \ - input/dpdk/dpdkDevice.cpp \ - input/dpdk/dpdkCompat.hpp \ - input/dpdk/dpdkPortTelemetry.hpp \ - input/dpdk/dpdkPortTelemetry.cpp \ - input/dpdk/dpdkTelemetry.hpp \ - input/dpdk/dpdkTelemetry.cpp \ - input/dpdk.cpp \ - input/dpdk.h \ - input/dpdk-ring.cpp \ - input/dpdk-ring.h -endif - -ipfixprobe_headers_src=\ - include/ipfixprobe/plugin.hpp \ - include/ipfixprobe/input.hpp \ - include/ipfixprobe/storage.hpp \ - include/ipfixprobe/output.hpp \ - include/ipfixprobe/process.hpp \ - include/ipfixprobe/options.hpp \ - include/ipfixprobe/utils.hpp \ - include/ipfixprobe/ipfix-basiclist.hpp \ - include/ipfixprobe/flowifc.hpp \ - include/ipfixprobe/ipaddr.hpp \ - include/ipfixprobe/packet.hpp \ - include/ipfixprobe/ring.h \ - include/ipfixprobe/byte-utils.hpp \ - include/ipfixprobe/ipfix-elements.hpp \ - include/ipfixprobe/rtp.hpp \ - include/ipfixprobe/telemetry-utils.hpp \ - include/ipfixprobe/parser-stats.hpp - -ipfixprobe_src=\ - $(ipfixprobe_input_src) \ - $(ipfixprobe_storage_src) \ - $(ipfixprobe_output_src) \ - $(ipfixprobe_process_src) \ - $(ipfixprobe_headers_src) \ - pluginmgr.cpp \ - pluginmgr.hpp \ - options.cpp \ - utils.cpp \ - ring.c \ - workers.cpp \ - workers.hpp \ - stats.cpp \ - stats.hpp \ - ipfixprobe.hpp \ - ipfixprobe.cpp - -if WITH_LIBUNWIND -ipfixprobe_src+=\ - stacktrace.cpp \ - stacktrace.hpp -endif - -ipfixprobe_SOURCES=$(ipfixprobe_src) main.cpp - -ipfixprobe_stats_CXXFLAGS=-std=gnu++17 -Wno-write-strings -I$(srcdir)/include/ -ipfixprobe_stats_SOURCES=ipfixprobe_stats.cpp \ - include/ipfixprobe/options.hpp \ - include/ipfixprobe/utils.hpp \ - stats.cpp \ - stats.hpp \ - options.cpp \ - utils.cpp - -pkgdocdir=${docdir}/ipfixprobe -pkgdoc_DATA=README.md -EXTRA_DIST=README.md \ - pcaps/README.md \ - pcaps/mixed.pcap \ - pcaps/dns.pcap \ - pcaps/dnssd.pcap \ - pcaps/http.pcap \ - pcaps/rtsp.pcap \ - pcaps/tls.pcap \ - pcaps/ntp.pcap \ - pcaps/sip.pcap \ - pcaps/ssdp.pcap \ - pcaps/netbios.pcap \ - pcaps/smtp.pcap \ - pcaps/ovpn.pcap \ - pcaps/idpcontent.pcap \ - pcaps/bstats.pcap \ - pcaps/wg.pcap \ - pcaps/quic_initial-sample.pcap \ - debian/control debian/changelog debian/watch debian/copyright debian/patches debian/patches/series \ - debian/source debian/source/format debian/source/local-options debian/source/include-binaries \ - debian/rules debian/README.Debian debian/compat \ - docker/Dockerfile docker/ipfixprobe_wrapper.sh docker/process_script.sh docker/README.md - -bashcompl_DATA=ipfixprobe.bash - -if HAVE_GOOGLETEST -check_LTLIBRARIES=libipfixprobe.la -libipfixprobe_la_SOURCES=$(ipfixprobe_src) -libipfixprobe_la_LDFLAGS=$(ipfixprobe_LDFLAGS) -libipfixprobe_la_CFLAGS=$(ipfixprobe_CFLAGS) -libipfixprobe_la_CXXFLAGS=$(ipfixprobe_CXXFLAGS) - -check-local: - @if test -e googletest/googletest/Makefile; then \ - ( cd googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la ); \ - ( cd googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la ); \ - else \ - echo "missing googletest submodule, run `git submodule init && git submodule update` and reconfigure"; \ - fi; - -clean-local: - @if test -e googletest/googletest/Makefile; then \ - ( cd googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; ) \ - fi -endif - -RPMDIR = RPMBUILD - -if MAKE_RPMS -RPMFILENAME=$(PACKAGE_NAME)-$(VERSION) - -.PHONY: srpm -srpm: - rm -rf "$(RPMDIR)/SOURCES/$(RPMFILENAME)" - mkdir -p $(RPMDIR)/BUILD/ $(RPMDIR)/SRPMS/ $(RPMDIR)/RPMS/ $(RPMDIR)/SOURCES - make ${AM_MAKEFLAGS} distdir='$(RPMDIR)/SOURCES/$(RPMFILENAME)' distdir - ( cd "$(RPMDIR)/SOURCES/"; tar -z -c -f $(RPMFILENAME)-$(RELEASE).tar.gz $(RPMFILENAME); rm -rf $(RPMFILENAME); ) - $(RPMBUILD) -bs $(PACKAGE_NAME).spec --define "_topdir `pwd`/$(RPMDIR)"; - -.PHONY: rpm -rpm: srpm - $(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with pcap --with unwind; - -.PHONY: rpm-nemea -rpm-nemea: srpm - $(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with nemea --with pcap --with unwind; - -.PHONY: rpm-ndp -rpm-ndp: srpm - $(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with ndp --with unwind; -else -endif - -rpm-clean: - rm -rf $(RPMDIR) - -if WITH_NEMEA -include ./aminclude.am -else -fields.h fields.c: - touch $@ -endif - -if MAKE_DEB -.PHONY: deb-source -deb-source: - make dist && make distdir && ln -fs ipfixprobe-@VERSION@.tar.gz ipfixprobe_@VERSION@ubuntu@RELEASE@.orig.tar.gz && cd ipfixprobe-@VERSION@ && debuild -S - -.PHONY: deb -deb: - make dist && make distdir && ln -fs ipfixprobe-@VERSION@.tar.gz ipfixprobe_@VERSION@ubuntu@RELEASE@.orig.tar.gz && cd ipfixprobe-@VERSION@ && debuild -else -endif - -.PHONY: doc -doc: - doxygen - diff --git a/aminclude.am b/aminclude.am deleted file mode 100644 index d8103bed5..000000000 --- a/aminclude.am +++ /dev/null @@ -1,10 +0,0 @@ -BUILT_SOURCES = fields.h fields.c - -fields.h: - $(UNIRECPROC) -i ./ -o ./ - -fields.c: fields.h - - -CLEANFILES = fields.c fields.h - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 0ad037aac..000000000 --- a/configure.ac +++ /dev/null @@ -1,505 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT([ipfixprobe], [4.16.0], [nemea@cesnet.cz]) - -AC_CONFIG_SRCDIR([main.cpp]) -AC_CONFIG_HEADERS([config.h]) - -RELEASE=1 -AC_SUBST(RELEASE) -USERNAME=`git config --get user.name` -USERMAIL=`git config --get user.email` -AC_SUBST(USERNAME) -AC_SUBST(USERMAIL) -AM_INIT_AUTOMAKE([foreign silent-rules subdir-objects]) -AM_SILENT_RULES([yes]) -RPM_REQUIRES= -RPM_BUILDREQ= - -AC_CONFIG_MACRO_DIR([m4]) -# Must be checked before default -g -O2 is set: -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], - [Enable build with debug symbols and without optimizations.]), - [if test "$enableval" = "yes"; then - CXXFLAGS="-Wall -g -O0 $CXXFLAGS" - CFLAGS="-Wall -g -O0 $CFLAGS" - else - CXXFLAGS="-Wall -g -O3 $CXXFLAGS" - CFLAGS="-Wall -g -O3 $CFLAGS" - fi], [CXXFLAGS="-Wall -g -O3 $CXXFLAGS" - CPPFLAGS="-DNDEBUG=1 $CPPFLAGS" - CFLAGS="-Wall -g -O3"]) -AM_CONDITIONAL(DEBUG, test x"$debug" = x"true") - -AC_ARG_ENABLE([coprrpm], - AC_HELP_STRING([--enable-coprrpm], - [Enable NEMEA as a default dependency of RPM. This option simplifies copr build without parameters.]), - [if test "$enableval" = "yes"; then - COPRRPM=yes - fi], [COPRRPM=no]) -AC_SUBST(COPRRPM) - -LT_INIT() - -bashcompldir=${sysconfdir}/bash_completion.d -AC_SUBST(bashcompldir) - - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CPP -# Check for rpmbuild -AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild, [""]) -AC_CHECK_PROG(DEBUILD, debuild, debuild, [""]) - -# Checks for header files. -AC_CHECK_HEADERS([arpa/inet.h inttypes.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_HEADER_STDBOOL -AC_C_INLINE -AC_TYPE_INT32_T -AC_TYPE_INT8_T -AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T - -AX_C_BIGENDIAN_CROSS - - -AC_ARG_WITH([defaultsocketdir], - [AS_HELP_STRING([--with-defaultsocketdir=DIR], [Directory for UNIX&service IFCs [/tmp], for production set it to e.g. /var/run/ipfixprobe.])], - [], - [with_defaultsocketdir=/tmp]) - -AC_SUBST([defaultsocketdir], [$with_defaultsocketdir]) -AC_DEFINE_DIR([DEFAULTSOCKETDIR], [defaultsocketdir], [Default path to socket directory]) - -AC_CHECK_LIB(atomic, __atomic_store, [libatomic=yes], AC_MSG_ERROR([libatomic not found])) - -PKG_CHECK_MODULES([LIBLZ4], [liblz4]) -CFLAGS="$LIBLZ4_CFLAGS $CFLAGS" -CXXFLAGS="$LIBLZ4_CFLAGS $CXXFLAGS" -LIBS="$LIBLZ4_LIBS $LIBS" - -### gtest -AC_ARG_WITH([gtest], - AC_HELP_STRING([--with-gtest],[Compile ipfixprobe with gtest framework]), - [ - if test "$withval" = "yes"; then - withgtest="yes" - else - withgtest="no" - fi - ], [withgtest="no"] -) - -if test x${withgtest} = xyes; then - GTEST_HEADER="googletest/googletest/include/gtest/gtest.h" - AC_MSG_CHECKING(for googletest submodule) - AM_CONDITIONAL([HAVE_GOOGLETEST], [test -f $GTEST_HEADER]) - AS_IF([test -f googletest/googletest/include/gtest/gtest.h], - [AC_DEFINE(HAVE_GOOGLETEST, 1, [Define to 1 if the googletest submodule is available]) AC_MSG_RESULT(yes)], - [AC_MSG_ERROR([ - The googletest submodule is not present, so such tests are omitted. To prevent skipping use command: - git clone --recurse-submodules or - git clone https://github.com/google/googletest.git])] - ) -else -AM_CONDITIONAL([HAVE_GOOGLETEST], [test]) -fi - - -### openssl -AC_ARG_ENABLE([legacy-ssl], - AC_HELP_STRING([--enable-legacy-ssl],[Compile ipfixprobe on centos7.]), - [ - if test "$enableval" = "yes"; then - legacyssl="yes" - else - legacyssl="no" - fi - ], [ - legacyssl="no" - ] -) -### openssl - - -AC_ARG_WITH([quic], - AC_HELP_STRING([--without-quic],[Compile ipfixprobe without quic plugin (which have dependency on openssl-devel)]), - [ - if test "$withval" = "yes"; then - withquic="yes" - else - withquic="no" - fi - ], [withquic="yes"] -) - -if test x${withquic} = xyes; then - if test x"${legacyssl}" = xyes; then - LIBS="-l:libcrypto.so.1.1 $LIBS" - CXXFLAGS="-I/usr/include/openssl11/ $CXXFLAGS" - RPM_BUILDREQ+=" openssl11-devel" - RPM_REQUIRES+=" openssl11" - AC_CHECK_FILE(/usr/include/openssl11/openssl/kdf.h, , - AC_MSG_ERROR([openssl/kdf.h not found. Try installing at least version 1.1 of openssl-devel])) - else - RPM_REQUIRES+=" openssl" - RPM_BUILDREQ+=" openssl-devel" - AC_CHECK_LIB(crypto, EVP_PKEY_CTX_new_id, [], - [AC_MSG_ERROR([libcrypto not found. Try installing at least version 1.1 of openssl-devel])]) - fi -fi - -AM_CONDITIONAL(WITH_QUIC, test x${withquic} = xyes) -if [[ -z "$WITH_QUIC_TRUE" ]]; then - AC_DEFINE([WITH_QUIC], [1], [Define to 1 if compile with quic plugin]) -fi - -AC_ARG_WITH([quic-ch-full-tls-ext], - AC_HELP_STRING([--with-quic-ch-full-tls-ext],[Extract all QUIC TLS payloads from the first client hello.]), - [ - CPPFLAGS="$CPPFLAGS -DQUIC_CH_FULL_TLS_EXT" - ] -) - -AM_CONDITIONAL(OS_CYGWIN, test x${host_os} = xcygwin) - -AC_ARG_WITH([raw], - AC_HELP_STRING([--without-raw],[Compile ipfixprobe with raw plugin for capturing using raw sockets]), - [ - if test "$withval" = "yes"; then - if [[ -z "$OS_CYGWIN_TRUE" ]]; then - AC_MSG_ERROR(["raw plugin is not supported on cygwin"]) - fi - withraw="yes" - else - withraw="no" - fi - ], [withraw="yes"] -) - -if [[ -z "$OS_CYGWIN_TRUE" ]] && test "$withraw" = "yes"; then - AC_MSG_WARN(["raw plugin is not supported on cygwin"]) - withraw="no" -fi - -AM_CONDITIONAL(WITH_RAW, test x${withraw} = xyes) -if [[ -z "$WITH_RAW_TRUE" ]]; then - AC_CHECK_HEADERS([linux/if_packet.h net/ethernet.h net/if.h ifaddrs.h]) - AC_CHECK_TYPES([struct tpacket3_hdr],[],AC_MSG_ERROR(["TPACKET_V3 required for raw sockets plugin. Upgrade kernel to version 3.19 at least"]), [#include ]) - AC_DEFINE([WITH_RAW], [1], [Define to 1 if compile with raw plugin]) -fi - - -AC_ARG_WITH([ndp], - AC_HELP_STRING([--with-ndp],[Compile ipfixprobe with ndp plugin for capturing using netcope-common library]), - [ - if test "$withval" = "yes"; then - withndp="yes" - else - withndp="no" - fi - ], [withndp="no"] -) - -if test x${withndp} = xyes; then - AC_CHECK_HEADER(nfb/nfb.h, AC_CHECK_LIB(nfb, nfb_open, [libnfb=yes], - [AC_MSG_ERROR([libnfb not found. Try installing netcope-common])] - ), AC_MSG_ERROR([nfb/nfb.h not found. Try installing netcope-common-devel])) -fi - -AM_CONDITIONAL(WITH_NDP, test x${libnfb} = xyes && test x${withndp} = xyes) -if [[ -z "$WITH_NDP_TRUE" ]]; then - AC_DEFINE([WITH_NDP], [1], [Define to 1 if the ndp is available]) - CPPFLAGS="$CPPFLAGS -DIPXP_FLOW_CACHE_SIZE=19 -DIPXP_FLOW_LINE_SIZE=2" # 524288 cache records, 4 record per line - LIBS="-lnfb $LIBS" - RPM_REQUIRES+=" netcope-common" - RPM_BUILDREQ+=" netcope-common-devel" -fi - -AC_ARG_WITH([pcap], - AC_HELP_STRING([--with-pcap],[Compile ipfixprobe with pcap plugin for capturing using libpcap library]), - [ - if test "$withval" = "yes"; then - withpcap="yes" - else - withpcap="no" - fi - ], [withpcap="no"] -) - -if test x${withpcap} = xyes; then - AC_CHECK_HEADER(pcap.h, - AC_CHECK_LIB(pcap, pcap_open_live, [libpcap=yes], - AC_CHECK_LIB(wpcap, pcap_open_live, [libwpcap=yes], AC_MSG_ERROR([libpcap not found. Try installing libpcap]))), - AC_MSG_ERROR([pcap.h not found. Try installing libpcap-devel or libwpcap-devel])) -fi - -AM_CONDITIONAL(WITH_PCAP, test x${withpcap} && (test x${libpcap} = xyes || test x${libwpcap} = xyes)) -if [[ -z "$WITH_PCAP_TRUE" ]]; then - AC_DEFINE([WITH_PCAP], [1], [Define to 1 if the libpcap is available]) - if [[ -z "$WITH_PCAP_TRUE" ]]; then - if test x${libpcap} = xyes; then - LIBS="-lpcap $LIBS" - RPM_REQUIRES+=" libpcap" - RPM_BUILDREQ+=" libpcap-devel" - else - LIBS="-lwpcap $LIBS" - RPM_REQUIRES+=" libwpcap" - RPM_BUILDREQ+=" libwpcap-devel" - fi - fi -fi - - -AC_ARG_WITH([unwind], - AC_HELP_STRING([--with-unwind],[Compile ipfixprobe with libunwind to print stack on crash]), - [ - if test "$withval" = "yes"; then - withunwind="yes" - else - withunwind="no" - fi - ], [withunwind="no"] -) - -if test x${withunwind} = xyes; then - AC_CHECK_HEADER(libunwind.h, - AC_CHECK_LIB(unwind, unw_backtrace, [libunwind=yes], AC_MSG_ERROR([libunwind not found])), - AC_MSG_ERROR([libunwind.h not found])) - - AM_CONDITIONAL(WITH_LIBUNWIND, test x${libunwind} = xyes) - if [[ -z "$WITH_LIBUNWIND_TRUE" ]]; then - AC_DEFINE([WITH_LIBUNWIND], [1], [Define to 1 if the libunwind is available]) - LIBS="-lunwind $LIBS" - RPM_REQUIRES+=" libunwind" - RPM_BUILDREQ+=" libunwind-devel" - fi -else - AM_CONDITIONAL(WITH_LIBUNWIND, false) -fi - -AC_ARG_WITH([nemea], - AC_HELP_STRING([--with-nemea],[Compile with NEMEA framework (nemea.liberouter.org).]), - [ - if test "$withval" = "yes"; then - withnemea="yes" - AX_LIBTRAP_CHECK() - AX_UNIREC_CHECK() - else - withnemea="no" - fi - ], [withnemea="no"] -) -if test x${withnemea} = xno; then -AM_CONDITIONAL([HAVE_TRAP2MAN], [false]) -fi - -AM_CONDITIONAL(WITH_NEMEA, test x${withnemea} = xyes) - -if [[ -z "$WITH_NEMEA_TRUE" ]]; then -AC_DEFINE([WITH_NEMEA], [1], [Define to 1 if the NEMEA is available]) -RPM_REQUIRES+=" libtrap" -RPM_BUILDREQ+=" libtrap-devel unirec" -fi - -AC_ARG_WITH([osquery], - AC_HELP_STRING([--with-osquery],[Compile with osquery framework (osquery.io).]), - [ - if test "$withval" = "yes"; then - withosquery="yes" - AC_CHECK_PROG(OSQUERY, osqueryi, yes) - AS_IF([test x${OSQUERY} != xyes], [AC_MSG_ERROR([Please install osquery before configuring.])]) - else - withosquery="no" - fi - ], [withosquery="no"] -) - -AM_CONDITIONAL(WITH_OSQUERY, test x${withosquery} = xyes) - -if [[ -z "$WITH_OSQUERY_TRUE" ]]; then - AC_DEFINE([WITH_OSQUERY], [1], [Define to 1 if the osquery is available]) -fi - - -AC_ARG_WITH([dpdk], - AS_HELP_STRING([--with-dpdk],[Compile ipfixprobe with DPDK interface support.]), - [ - if test "$withval" = "yes"; then - withdpdk="yes" - else - withdpdk="no" - fi - ], - [withdpdk="no"] -) - -AM_CONDITIONAL(WITH_DPDK, test x${withdpdk} = xyes) -if [[ -z "$WITH_DPDK_TRUE" ]]; then - AC_DEFINE([WITH_DPDK], [1], [Define 1 if DPDK interface will be used]) - PKG_CHECK_MODULES([DPDK], [libdpdk]) - CFLAGS="$DPDK_CFLAGS $CFLAGS" - CXXFLAGS="$DPDK_CFLAGS $CXXFLAGS" - LIBS="$DPDK_LIBS $LIBS" -fi - -AC_ARG_WITH([flexprobe], - AC_HELP_STRING([--with-flexprobe], [Compile with support for flexprobe data processing plugins.]), - [ - if test "$withval" = "yes"; then - withflexprobe="yes" - else - withflexprobe="no" - fi - ], - [withflexprobe="no"] -) - -AM_CONDITIONAL(WITH_FLEXPROBE, test x${withflexprobe} = xyes) -if [[ -z "$WITH_FLEXPROBE_TRUE" ]]; then - AC_DEFINE([WITH_FLEXPROBE], [1], [Define to 1 to use flexprobe plugins]) -fi - -AC_ARG_WITH([stem], - AC_HELP_STRING([--with-stem], [Compile with FlexProbe StEm testing interface]), - [ - if test "$withval" = "yes"; then - withstem="yes" - else - withstem="no" - fi - ], - [withstem="no"] -) - -# Check if the telemetry library is available -AC_CHECK_LIB([telemetry], [main], - [AC_MSG_RESULT([Found telemetry library.])], - [AC_MSG_ERROR([The telemetry library is required but was not found. Try to install telemetry.])]) - -# Check if the appfs library is available -AC_CHECK_LIB([appFs], [main], - [AC_MSG_RESULT([Found appfs library.])], - [AC_MSG_ERROR([The appfs library is required but was not found. Try to install telemetry])]) - -LIBS="-lappFs -ltelemetry $LIBS" -RPM_REQUIRES+=" telemetry" -RPM_BUILDREQ+=" telemetry" - -AM_CONDITIONAL(WITH_STEM, test x${withstem} = xyes) -if [[ -z "$WITH_STEM_TRUE" ]]; then - AC_DEFINE([WITH_STEM], [1], [Define to 1 to use flexprobe testing interface]) - CFLAGS="-I/usr/local/include/Stem $CFLAGS" - CXXFLAGS="-I/usr/local/include/Stem -std=gnu++17 -g -Wno-write-strings $CXXFLAGS" - LIBS="-lstem $LIBS" -fi - - -AC_ARG_WITH([flowcachesize], - AC_HELP_STRING([--with-flowcachesize=EXPONENT],[Set default size of flow cache, accept exponent to the power of 2 number]), - [ - CPPFLAGS="$CPPFLAGS -DIPXP_FLOW_CACHE_SIZE=$withval" - ] -) - -AC_ARG_WITH([flowlinesize], - AC_HELP_STRING([--with-flowlinesize=EXPONENT],[Set default size of flow line, accept exponent to the power of 2 number]), - [ - CPPFLAGS="$CPPFLAGS -DIPXP_FLOW_LINE_SIZE=$withval" - ] -) - -AC_ARG_WITH([msects], - AC_HELP_STRING([--with-msects],[Compile ipfix plugin with miliseconds timestamp precision output instead of microsecond precision]), - [ - CPPFLAGS="$CPPFLAGS -DIPXP_TS_MSEC" - ] -) - - - - -AM_CONDITIONAL(MAKE_RPMS, test x$RPMBUILD != x) - -AM_CONDITIONAL(MAKE_DEB, test x$DEBUILD != x) - -# Checks for library functions. -AC_FUNC_ERROR_AT_LINE -AC_FUNC_STRTOD -AC_CHECK_FUNCS([gettimeofday inet_ntoa memset socket strchr strerror strncasecmp strstr strtol strtoul strtoull]) - -AC_ARG_WITH([systemdsystemunitdir], - [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])], - [], - [with_systemdsystemunitdir=auto]) - -AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ -def_systemdsystemunitdir=$(pkg-config --variable=systemdsystemunitdir systemd)]) - -AS_IF([test "x$def_systemdsystemunitdir" = "x"], [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], [with_systemdsystemunitdir=no])], -[with_systemdsystemunitdir="$def_systemdsystemunitdir"]) -#AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])], - -AS_IF([test "x$with_systemdsystemunitdir" = "xno" -o "x$with_systemdsystemunitdir" = "xauto"], [with_systemdsystemunitdir=/usr/lib/systemd/system]) - -AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) -AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) - - -if [[ -z "$HAVE_GOOGLETEST_TRUE" ]]; then -# 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 -AC_CONFIG_SUBDIRS([googletest]) -fi - -AC_CONFIG_FILES([Makefile - ipfixprobe.spec - ipfixprobe.bash - input/nfbCInterface/Makefile - init/Makefile - tests/Makefile - tests/functional/Makefile - tests/unit/Makefile]) - -#AC_CONFIG_SUBDIRS([nfbCInterface]) - -AC_OUTPUT - -echo -echo -echo "------------------------------------------------------------------------" -echo "$PACKAGE $VERSION" -echo "------------------------------------------------------------------------" -echo -echo -echo "Configuration Options Summary:" -echo -echo " ASM.(32 bit only)......: $ASM" -echo " Static binary..........: $static" -echo -echo "Documentation............: ${build_doc}" -echo -echo "UniRec processor.........: $UNIRECPROC" -echo "trap2man.sh..............: $TRAP2MAN" -echo "Compilation..............: make (or gmake)" -echo " CPPFLAGS...............: $CPPFLAGS" -echo " CFLAGS.................: $CFLAGS" -echo " CXXFLAGS...............: $CXXFLAGS" -echo " LDFLAGS................: $LDFLAGS" -echo " LIBS...................: $LIBS" -echo "Enforced NEMEA (for copr): $COPRRPM" -echo "FlexProbe Data Interface.: $withflexprobe" -echo "DPDK Interface...........: $withdpdk" -echo -echo "Installation.............: make install (as root if needed, with 'su' or 'sudo')" -echo " prefix.................: $prefix" -echo diff --git a/ipfixprobe.bash.in b/ipfixprobe.bash.in deleted file mode 100644 index edcbd012d..000000000 --- a/ipfixprobe.bash.in +++ /dev/null @@ -1,28 +0,0 @@ -# file: nemea-completion.sh -# flow_meter parameter-completion - -_flow_meter () -{ - local cur prev words cword - _init_completion || return - - case "$prev" in - -I) - COMPREPLY=( $( compgen -W "$(cat /proc/net/dev | cut -f1 -d: |tail -n +3)" -- $cur ) ) - return 0;; - -r) - COMPREPLY=( $( compgen -f -- "$cur" ) ) - return 0;; - -p) - startpart=$(echo $cur | grep , | sed 's/,[^,]*$/,/') - - COMPREPLY=( $( compgen -W "${startpart}basic ${startpart}sip ${startpart}http ${startpart}ntp ${startpart}arp ${startpart}dns" -- $cur ) ) - return 0;; - esac - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-p -c -I -r -t -s -S -m -V -v --help -h -i' -- $cur ) );; - esac - return 0 -} && complete -F _flow_meter -o filenames ./flow_meter @BINDIR@/flow_meter - diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4 deleted file mode 100644 index e15cea2c9..000000000 --- a/m4/ac_define_dir.m4 +++ /dev/null @@ -1,34 +0,0 @@ -dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) -dnl -dnl This macro sets VARNAME to the expansion of the DIR variable, -dnl taking care of fixing up ${prefix} and such. -dnl -dnl VARNAME is then offered as both an output variable and a C -dnl preprocessor symbol. -dnl -dnl Example: -dnl -dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) -dnl -dnl @category Misc -dnl @author Stepan Kasal -dnl @author Andreas Schwab -dnl @author Guido U. Draheim -dnl @author Alexandre Oliva -dnl @version 2006-10-13 -dnl @license AllPermissive - -AC_DEFUN([AC_DEFINE_DIR], [ - prefix_NONE= - exec_prefix_NONE= - test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix -dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn -dnl refers to ${prefix}. Thus we have to use `eval' twice. - eval ac_define_dir="\"[$]$2\"" - eval ac_define_dir="\"$ac_define_dir\"" - AC_SUBST($1, "$ac_define_dir") - AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) - test "$prefix_NONE" && prefix=NONE - test "$exec_prefix_NONE" && exec_prefix=NONE -]) diff --git a/m4/ax_c_bigendian_cross.m4 b/m4/ax_c_bigendian_cross.m4 deleted file mode 100644 index e6a1840d2..000000000 --- a/m4/ax_c_bigendian_cross.m4 +++ /dev/null @@ -1,122 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_c_bigendian_cross.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_C_BIGENDIAN_CROSS -# -# DESCRIPTION -# -# Check endianess even when crosscompiling (partially based on the -# original AC_C_BIGENDIAN). -# -# The implementation will create a binary, but instead of running the -# binary it will be grep'ed for some symbols that differ for different -# endianess of the binary. -# -# NOTE: The upcoming autoconf 2.53 does include the idea of this macro, -# what makes it superfluous by then. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 5 - -AU_ALIAS([AC_C_BIGENDIAN_CROSS], [AX_C_BIGENDIAN_CROSS]) -AC_DEFUN([AX_C_BIGENDIAN_CROSS], -[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, -[ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -AC_TRY_COMPILE([#include -#include ], [ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. -AC_TRY_COMPILE([#include -#include ], [ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) -if test $ac_cv_c_bigendian = unknown; then -AC_TRY_RUN([main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, -[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) -fi]) -if test $ac_cv_c_bigendian = unknown; then -AC_MSG_CHECKING(to probe for byte ordering) -[ -cat >conftest.c <&AC_FD_MSG - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG - fi - fi -AC_MSG_RESULT($ac_cv_c_bigendian) -fi -if test $ac_cv_c_bigendian = yes; then - AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) - BYTEORDER=4321 -else - BYTEORDER=1234 -fi -AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) -if test $ac_cv_c_bigendian = unknown; then - AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) -fi -]) diff --git a/m4/ax_libtrap_check.m4 b/m4/ax_libtrap_check.m4 deleted file mode 100644 index 0d3e2ec98..000000000 --- a/m4/ax_libtrap_check.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl @synopsis AX_LIBTRAP_CHECK -dnl -dnl This macro test if libtrap is installed or if it is -dnl in parent directory. It sets CFLAGS, CXXFLAGS, LDFLAGS, -dnl LIBS if libtrap is found. Otherwise, error is returned. -dnl -dnl @category InstalledPackages -dnl @author Tomas Cejka -dnl @version 2015-08-02 -dnl @license BSD - -AC_DEFUN([AX_LIBTRAP_CHECK], [ - PKG_CHECK_MODULES([libtrap], [libtrap], [HAVE_TRAPLIB="yes"]) - if test -n "$TRAPLIB"; then - CPPFLAGS="-I${TRAPINC} $CPPFLAGS" - LIBS="-L${TRAPLIB} $LIBS" - elif test "x$HAVE_TRAPLIB" = "xyes"; then - CPPFLAGS="${libtrap_CFLAGS} $CPPFLAGS" - LIBS="${libtrap_LIBS} $LIBS" - else - AC_MSG_ERROR([Libtrap was not found.]) - fi - nemeasupdir=${datarootdir}/nemea-supervisor - AC_SUBST(nemeasupdir) - AC_PATH_PROG([TRAP2MAN], [trap2man.sh], [], [/usr/bin/nemea$PATH_SEPARATOR$PATH$PATH_SEPARATOR$PWD/../nemea-framework/libtrap/tools]) - AM_CONDITIONAL([HAVE_TRAP2MAN], [test -x "$TRAP2MAN"]) -]) - diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4 deleted file mode 100644 index 44b22b00a..000000000 --- a/m4/ax_prog_doxygen.m4 +++ /dev/null @@ -1,532 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html -# =========================================================================== -# -# SYNOPSIS -# -# DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR]) -# DX_DOXYGEN_FEATURE(ON|OFF) -# DX_DOT_FEATURE(ON|OFF) -# DX_HTML_FEATURE(ON|OFF) -# DX_CHM_FEATURE(ON|OFF) -# DX_CHI_FEATURE(ON|OFF) -# DX_MAN_FEATURE(ON|OFF) -# DX_RTF_FEATURE(ON|OFF) -# DX_XML_FEATURE(ON|OFF) -# DX_PDF_FEATURE(ON|OFF) -# DX_PS_FEATURE(ON|OFF) -# -# DESCRIPTION -# -# The DX_*_FEATURE macros control the default setting for the given -# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for -# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML -# help (for MS users), 'CHI' for generating a seperate .chi file by the -# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate -# output formats. The environment variable DOXYGEN_PAPER_SIZE may be -# specified to override the default 'a4wide' paper size. -# -# By default, HTML, PDF and PS documentation is generated as this seems to -# be the most popular and portable combination. MAN pages created by -# Doxygen are usually problematic, though by picking an appropriate subset -# and doing some massaging they might be better than nothing. CHM and RTF -# are specific for MS (note that you can't generate both HTML and CHM at -# the same time). The XML is rather useless unless you apply specialized -# post-processing to it. -# -# The macros mainly control the default state of the feature. The use can -# override the default by specifying --enable or --disable. The macros -# ensure that contradictory flags are not given (e.g., -# --enable-doxygen-html and --enable-doxygen-chm, -# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each -# feature will be automatically disabled (with a warning) if the required -# programs are missing. -# -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN -# with the following parameters: a one-word name for the project for use -# as a filename base etc., an optional configuration file name (the -# default is 'Doxyfile', the same as Doxygen's default), and an optional -# output directory name (the default is 'doxygen-doc'). -# -# Automake Support -# -# The following is a template aminclude.am file for use with Automake. -# Make targets and variables values are controlled by the various -# DX_COND_* conditionals set by autoconf. -# -# The provided targets are: -# -# doxygen-doc: Generate all doxygen documentation. -# -# doxygen-run: Run doxygen, which will generate some of the -# documentation (HTML, CHM, CHI, MAN, RTF, XML) -# but will not do the post processing required -# for the rest of it (PS, PDF, and some MAN). -# -# doxygen-man: Rename some doxygen generated man pages. -# -# doxygen-ps: Generate doxygen PostScript documentation. -# -# doxygen-pdf: Generate doxygen PDF documentation. -# -# Note that by default these are not integrated into the automake targets. -# If doxygen is used to generate man pages, you can achieve this -# integration by setting man3_MANS to the list of man pages generated and -# then adding the dependency: -# -# $(man3_MANS): doxygen-doc -# -# This will cause make to run doxygen and generate all the documentation. -# -# The following variable is intended for use in Makefile.am: -# -# DX_CLEANFILES = everything to clean. -# -# Then add this variable to MOSTLYCLEANFILES. -# -# ----- begin aminclude.am ------------------------------------- -# -# ## --------------------------------- ## -# ## Format-independent Doxygen rules. ## -# ## --------------------------------- ## -# -# if DX_COND_doc -# -# ## ------------------------------- ## -# ## Rules specific for HTML output. ## -# ## ------------------------------- ## -# -# if DX_COND_html -# -# DX_CLEAN_HTML = @DX_DOCDIR@/html -# -# endif DX_COND_html -# -# ## ------------------------------ ## -# ## Rules specific for CHM output. ## -# ## ------------------------------ ## -# -# if DX_COND_chm -# -# DX_CLEAN_CHM = @DX_DOCDIR@/chm -# -# if DX_COND_chi -# -# DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi -# -# endif DX_COND_chi -# -# endif DX_COND_chm -# -# ## ------------------------------ ## -# ## Rules specific for MAN output. ## -# ## ------------------------------ ## -# -# if DX_COND_man -# -# DX_CLEAN_MAN = @DX_DOCDIR@/man -# -# endif DX_COND_man -# -# ## ------------------------------ ## -# ## Rules specific for RTF output. ## -# ## ------------------------------ ## -# -# if DX_COND_rtf -# -# DX_CLEAN_RTF = @DX_DOCDIR@/rtf -# -# endif DX_COND_rtf -# -# ## ------------------------------ ## -# ## Rules specific for XML output. ## -# ## ------------------------------ ## -# -# if DX_COND_xml -# -# DX_CLEAN_XML = @DX_DOCDIR@/xml -# -# endif DX_COND_xml -# -# ## ----------------------------- ## -# ## Rules specific for PS output. ## -# ## ----------------------------- ## -# -# if DX_COND_ps -# -# DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps -# -# DX_PS_GOAL = doxygen-ps -# -# doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps -# -# @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag -# cd @DX_DOCDIR@/latex; \ -# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ -# $(DX_LATEX) refman.tex; \ -# $(MAKEINDEX_PATH) refman.idx; \ -# $(DX_LATEX) refman.tex; \ -# countdown=5; \ -# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ -# refman.log > /dev/null 2>&1 \ -# && test $$countdown -gt 0; do \ -# $(DX_LATEX) refman.tex; \ -# countdown=`expr $$countdown - 1`; \ -# done; \ -# $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi -# -# endif DX_COND_ps -# -# ## ------------------------------ ## -# ## Rules specific for PDF output. ## -# ## ------------------------------ ## -# -# if DX_COND_pdf -# -# DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf -# -# DX_PDF_GOAL = doxygen-pdf -# -# doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf -# -# @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag -# cd @DX_DOCDIR@/latex; \ -# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ -# $(DX_PDFLATEX) refman.tex; \ -# $(DX_MAKEINDEX) refman.idx; \ -# $(DX_PDFLATEX) refman.tex; \ -# countdown=5; \ -# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ -# refman.log > /dev/null 2>&1 \ -# && test $$countdown -gt 0; do \ -# $(DX_PDFLATEX) refman.tex; \ -# countdown=`expr $$countdown - 1`; \ -# done; \ -# mv refman.pdf ../@PACKAGE@.pdf -# -# endif DX_COND_pdf -# -# ## ------------------------------------------------- ## -# ## Rules specific for LaTeX (shared for PS and PDF). ## -# ## ------------------------------------------------- ## -# -# if DX_COND_latex -# -# DX_CLEAN_LATEX = @DX_DOCDIR@/latex -# -# endif DX_COND_latex -# -# .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) -# -# .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) -# -# doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag -# -# doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) -# -# @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) -# rm -rf @DX_DOCDIR@ -# $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) -# -# DX_CLEANFILES = \ -# @DX_DOCDIR@/@PACKAGE@.tag \ -# -r \ -# $(DX_CLEAN_HTML) \ -# $(DX_CLEAN_CHM) \ -# $(DX_CLEAN_CHI) \ -# $(DX_CLEAN_MAN) \ -# $(DX_CLEAN_RTF) \ -# $(DX_CLEAN_XML) \ -# $(DX_CLEAN_PS) \ -# $(DX_CLEAN_PDF) \ -# $(DX_CLEAN_LATEX) -# -# endif DX_COND_doc -# -# ----- end aminclude.am --------------------------------------- -# -# LICENSE -# -# Copyright (c) 2009 Oren Ben-Kiki -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 12 - -## ----------## -## Defaults. ## -## ----------## - -DX_ENV="" -AC_DEFUN([DX_FEATURE_doc], ON) -AC_DEFUN([DX_FEATURE_dot], OFF) -AC_DEFUN([DX_FEATURE_man], OFF) -AC_DEFUN([DX_FEATURE_html], ON) -AC_DEFUN([DX_FEATURE_chm], OFF) -AC_DEFUN([DX_FEATURE_chi], OFF) -AC_DEFUN([DX_FEATURE_rtf], OFF) -AC_DEFUN([DX_FEATURE_xml], OFF) -AC_DEFUN([DX_FEATURE_pdf], ON) -AC_DEFUN([DX_FEATURE_ps], ON) - -## --------------- ## -## Private macros. ## -## --------------- ## - -# DX_ENV_APPEND(VARIABLE, VALUE) -# ------------------------------ -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. -AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])]) - -# DX_DIRNAME_EXPR -# --------------- -# Expand into a shell expression prints the directory part of a path. -AC_DEFUN([DX_DIRNAME_EXPR], - [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) - -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) -# ------------------------------------- -# Expands according to the M4 (static) status of the feature. -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) - -# DX_REQUIRE_PROG(VARIABLE, PROGRAM) -# ---------------------------------- -# Require the specified program to be found for the DX_CURRENT_FEATURE to work. -AC_DEFUN([DX_REQUIRE_PROG], [ -AC_PATH_TOOL([$1], [$2]) -if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then - AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) - AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) -fi -]) - -# DX_TEST_FEATURE(FEATURE) -# ------------------------ -# Expand to a shell expression testing whether the feature is active. -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) - -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) -# ------------------------------------------------- -# Verify that a required features has the right state before trying to turn on -# the DX_CURRENT_FEATURE. -AC_DEFUN([DX_CHECK_DEPEND], [ -test "$DX_FLAG_$1" = "$2" \ -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, - requires, contradicts) doxygen-DX_CURRENT_FEATURE]) -]) - -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) -# ---------------------------------------------------------- -# Turn off the DX_CURRENT_FEATURE if the required feature is off. -AC_DEFUN([DX_CLEAR_DEPEND], [ -test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) -]) - -# DX_FEATURE_ARG(FEATURE, DESCRIPTION, -# CHECK_DEPEND, CLEAR_DEPEND, -# REQUIRE, DO-IF-ON, DO-IF-OFF) -# -------------------------------------------- -# Parse the command-line option controlling a feature. CHECK_DEPEND is called -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), -# otherwise CLEAR_DEPEND is called to turn off the default state if a required -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. -AC_DEFUN([DX_ARG_ABLE], [ - AC_DEFUN([DX_CURRENT_FEATURE], [$1]) - AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) - AC_ARG_ENABLE(doxygen-$1, - [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], - [--enable-doxygen-$1]), - DX_IF_FEATURE([$1], [don't $2], [$2]))], - [ -case "$enableval" in -#( -y|Y|yes|Yes|YES) - AC_SUBST([DX_FLAG_$1], 1) - $3 -;; #( -n|N|no|No|NO) - AC_SUBST([DX_FLAG_$1], 0) -;; #( -*) - AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) -;; -esac -], [ -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) -$4 -]) -if DX_TEST_FEATURE([$1]); then - $5 - : -fi -AM_CONDITIONAL(DX_COND_$1, DX_TEST_FEATURE([$1])) -if DX_TEST_FEATURE([$1]); then - $6 - : -else - $7 - : -fi -]) - -## -------------- ## -## Public macros. ## -## -------------- ## - -# DX_XXX_FEATURE(DEFAULT_STATE) -# ----------------------------- -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) -AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])]) -AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) -AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) -AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) -AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) -AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) -AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) -AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) - -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) -# --------------------------------------------------------- -# PROJECT also serves as the base name for the documentation files. -# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". -AC_DEFUN([DX_INIT_DOXYGEN], [ - -# Files: -AC_SUBST([DX_PROJECT], [$1]) -AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])]) -AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])]) - -# Environment variables used inside doxygen.cfg: -DX_ENV_APPEND(SRCDIR, $srcdir) -DX_ENV_APPEND(PROJECT, $DX_PROJECT) -DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) - -# Doxygen itself: -DX_ARG_ABLE(doc, [generate any doxygen documentation], - [], - [], - [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) - DX_REQUIRE_PROG([DX_PERL], perl)], - [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) - -# Dot for graphics: -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_DOT], dot)], - [DX_ENV_APPEND(HAVE_DOT, YES) - DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], - [DX_ENV_APPEND(HAVE_DOT, NO)]) - -# Man pages generation: -DX_ARG_ABLE(man, [generate doxygen manual pages], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_MAN, YES)], - [DX_ENV_APPEND(GENERATE_MAN, NO)]) - -# RTF file generation: -DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_RTF, YES)], - [DX_ENV_APPEND(GENERATE_RTF, NO)]) - -# XML file generation: -DX_ARG_ABLE(xml, [generate doxygen XML documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_XML, YES)], - [DX_ENV_APPEND(GENERATE_XML, NO)]) - -# (Compressed) HTML help generation: -DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_HHC], hhc)], - [DX_ENV_APPEND(HHC_PATH, $DX_HHC) - DX_ENV_APPEND(GENERATE_HTML, YES) - DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], - [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) - -# Seperate CHI file generation. -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], - [DX_CHECK_DEPEND(chm, 1)], - [DX_CLEAR_DEPEND(chm, 1)], - [], - [DX_ENV_APPEND(GENERATE_CHI, YES)], - [DX_ENV_APPEND(GENERATE_CHI, NO)]) - -# Plain HTML pages generation: -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], - [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], - [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], - [], - [DX_ENV_APPEND(GENERATE_HTML, YES)], - [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) - -# PostScript file generation: -DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_LATEX], latex) - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) - DX_REQUIRE_PROG([DX_DVIPS], dvips) - DX_REQUIRE_PROG([DX_EGREP], egrep)]) - -# PDF file generation: -DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) - DX_REQUIRE_PROG([DX_EGREP], egrep)]) - -# LaTeX generation for PS and/or PDF: -AM_CONDITIONAL(DX_COND_latex, DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf)) -if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then - DX_ENV_APPEND(GENERATE_LATEX, YES) -else - DX_ENV_APPEND(GENERATE_LATEX, NO) -fi - -# Paper size for PS and/or PDF: -AC_ARG_VAR(DOXYGEN_PAPER_SIZE, - [a4wide (default), a4, letter, legal or executive]) -case "$DOXYGEN_PAPER_SIZE" in -#( -"") - AC_SUBST(DOXYGEN_PAPER_SIZE, "") -;; #( -a4wide|a4|letter|legal|executive) - DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) -;; #( -*) - AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) -;; -esac - -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_man=$DX_FLAG_man -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_FLAG_chm=$DX_FLAG_chm -#echo DX_FLAG_chi=$DX_FLAG_chi -#echo DX_FLAG_rtf=$DX_FLAG_rtf -#echo DX_FLAG_xml=$DX_FLAG_xml -#echo DX_FLAG_pdf=$DX_FLAG_pdf -#echo DX_FLAG_ps=$DX_FLAG_ps -#echo DX_ENV=$DX_ENV -]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 deleted file mode 100644 index d383ad5c6..000000000 --- a/m4/ax_pthread.m4 +++ /dev/null @@ -1,332 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 21 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test x"$ax_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case ${host_os} in - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" - ;; - - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" - ;; -esac - -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. - -AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], - [AC_MSG_RESULT([yes])], - [ax_pthread_extra_flags= - AC_MSG_RESULT([no])]) -CFLAGS="$save_CFLAGS" - -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - if test x"$ax_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - static void routine(void *a) { a = 0; } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $attr; return attr /* ; */])], - [attr_name=$attr; break], - []) - done - AC_MSG_RESULT([$attr_name]) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - AC_MSG_RESULT([$flag]) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then - case $host_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/m4/ax_unirec_check.m4 b/m4/ax_unirec_check.m4 deleted file mode 100644 index 29a4f4aac..000000000 --- a/m4/ax_unirec_check.m4 +++ /dev/null @@ -1,80 +0,0 @@ -dnl @synopsis AX_UNIREC_CHECK -dnl -dnl This macro test if unirec is installed or if it is -dnl in parent directory. It sets CFLAGS, CXXFLAGS, LDFLAGS, -dnl LIBS if libtrap is found. Otherwise, error is returned. -dnl This macro depends on $repobuild, if it is "true", -dnl UniRec processor will be located in parent directory, -dnl otherwise in /usr/bin/nemea. -dnl -dnl @category InstalledPackages -dnl @author Tomas Cejka -dnl @version 2015-08-02 -dnl @license BSD - -AC_DEFUN([AX_UNIREC_CHECK_INTERNAL_PARENT], [ - AC_MSG_CHECKING([for unirec in parent directory]) - # Check for unirec as a superproject. - if test -d "$srcdir/../unirec"; then - UNIRECINC='$(top_srcdir)/../' - UNIRECLIB='$(top_builddir)/../unirec/.libs/' - elif test -d "$srcdir/../../unirec"; then - UNIRECINC='$(top_srcdir)/../../' - UNIRECLIB='$(top_builddir)/../../unirec/.libs/' - elif test -d "$srcdir/nemea-framework/unirec"; then - UNIRECINC='$(top_srcdir)/nemea-framework/' - UNIRECLIB='$(top_builddir)/nemea-framework/unirec/.libs/' - elif test -d "$srcdir/../nemea-framework/unirec"; then - UNIRECINC='$(top_srcdir)/../nemea-framework/' - UNIRECLIB='$(top_builddir)/../nemea-framework/unirec/.libs/' - fi - - # AC_SUBST command line variables from UNIRECLIB and UNIRECINC. - if test -n "$UNIRECLIB"; then - AC_SUBST([UNIREC_LTLIB], ["$TRAPLIB/libtrap.la"]) - AC_SUBST([UNIREC_INCLUDE], ["-I$TRAPINC"]) - LIBS="-L$UNIRECLIB $LIBS" - CFLAGS="-I$UNIRECINC $CFLAGS" - CXXFLAGS="-I$UNIRECINC $CXXFLAGS" - AC_MSG_RESULT([yes]) - else - AC_CHECK_HEADERS(unirec/unirec.h unirec/inline.h unirec/ipaddr_cpp.h unirec/ipaddr.h unirec/links.h unirec/ur_time.h unirec/ur_values.h, - [], [AC_MSG_RESULT([no])]) - AC_CHECK_LIB([unirec], ur_create_template, [UNIRECLIB=" "]) - fi -]) - -AC_DEFUN([AX_UNIREC_CHECK], [ - # UniRec processor - if test "$repobuild" = "true"; then - AC_PATH_PROG(UNIRECPROC, ur_processor.sh, [], - [$PWD/nemea-framework/unirec$PATH_SEPARATOR$PWD/../nemea-framework/unirec$PATH_SEPARATOR$PWD/../unirec$PATH_SEPARATOR$srcdir/../nemea-framework/unirec$PATH_SEPARATOR$top_srcdir/nemea-framework/unirec$PATH_SEPARATOR$PATH$PATH_SEPARATOR/usr/bin/nemea/]) - else - AC_PATH_PROG(UNIRECPROC, ur_processor.sh, [], - [/usr/bin/nemea/$PATH_SEPARATOR$PATH]) - fi - - if test -z "$UNIRECPROC"; then - AC_MSG_ERROR([UniRec processor was not found. Add path to "ur_processor.sh" into PATH or install UniRec."]) - fi - - AC_SUBST(UNIRECPROC) - - UNIRECLIB="" - if test "$repobuild" = "true"; then - AX_UNIREC_CHECK_INTERNAL_PARENT() - else - PKG_CHECK_MODULES([unirec], [unirec], [UNIRECLIB="yes"], [ - AX_UNIREC_CHECK_INTERNAL_PARENT() - ]) - fi - if test -n "$UNIRECLIB"; then - LDFLAGS="$unirec_LDFLAGS $LDFLAGS" - LIBS="$unirec_LIBS $LIBS" - CFLAGS="$unirec_CFLAGS $CFLAGS" - CXXFLAGS="$unirec_CFLAGS $CXXFLAGS" - else - AC_MSG_ERROR([unirec was not found.]) - fi -]) - From 860671962e9a3131bf17c47fd802f8e650b26541 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 12:43:48 +0100 Subject: [PATCH 04/94] Remove ipfixprobe spec file --- ipfixprobe.spec.in | 147 --------------------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 ipfixprobe.spec.in diff --git a/ipfixprobe.spec.in b/ipfixprobe.spec.in deleted file mode 100644 index 8af17f619..000000000 --- a/ipfixprobe.spec.in +++ /dev/null @@ -1,147 +0,0 @@ -%bcond_with ndp -%bcond_with pcap -%bcond_without raw -%bcond_with nemea -%bcond_with unwind -%bcond_with is_el7 - -%if %{with ndp} -%global compile_ndp yes -%else -%global compile_ndp no -%endif - -%if %{with pcap} -%global compile_pcap yes -%else -%global compile_pcap @COPRRPM@ -%endif - -%if %{with raw} -%global compile_raw yes -%else -%global compile_raw no -%endif - -%if %{with nemea} -%global compile_nemea yes -%else -%global compile_nemea @COPRRPM@ -%endif - -%if %{with unwind} -%global compile_unwind yes -%else -%global compile_unwind @COPRRPM@ -%endif - -%if "%{dist}" == ".el7" -%global is_el7 yes -%else -%global is_el7 no -%endif - -# Hotfix to allow RPM build on fedora36+ -# There is a problem in configure autodetection when -# LDFLAGS=-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -%undefine _auto_set_build_flags - -Name: ipfixprobe -Version: @PACKAGE_VERSION@ -Release: @RELEASE@ -URL: http://nemea.liberouter.org/ -Source: https://www.liberouter.org/repo/SOURCES/%{name}-%{version}-%{release}.tar.gz -Group: Liberouter -License: BSD -Vendor: CESNET, z.s.p.o. -Packager: @USERNAME@ <@USERMAIL@> -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} -Summary: IPFIX flow exporter with various extending IPFIX elements exported by plugins. -Requires: libatomic fuse3 telemetry lz4 -BuildRequires: gcc gcc-c++ make doxygen pkgconfig libatomic telemetry lz4-devel -Provides: ipfixprobe - -%if %{with ndp} -Requires: netcope-common -BuildRequires: netcope-common -%else -Requires: libpcap -BuildRequires: libpcap-devel -%endif - -%if %{with nemea} || "@COPRRPM@" == "yes" -Requires: libtrap -BuildRequires: libtrap-devel -BuildRequires: unirec -%endif - -%if %{with unwind} || "@COPRRPM@" == "yes" -Requires: libunwind -BuildRequires: libunwind-devel -%endif - -%if "%{is_el7}" == "yes" -Requires: openssl11 -BuildRequires: openssl11-devel -%else -Requires: openssl -BuildRequires: openssl-devel -%endif - -%description -This package contains nemea flow exporter. - -%prep -%setup - -%build -./configure -q --enable-silent-rules --prefix=%{_prefix} --libdir=%{_libdir} --bindir=%{_bindir} --sysconfdir=%{_sysconfdir} --docdir=%{_docdir} --mandir=%{_mandir} --datadir=%{_datadir} --with-ndp=%{compile_ndp} --with-raw=%{compile_raw} --with-pcap=%{compile_pcap} --with-nemea=%{compile_nemea} --with-unwind=%{compile_unwind} --enable-legacy-ssl=%{is_el7}; -make clean -make -j5 - -%install -make -j5 DESTDIR=$RPM_BUILD_ROOT install - -%post -test -x %{_bindir}/ipfixprobe && setcap "CAP_NET_RAW+eip" %{_bindir}/ipfixprobe || true -ldconfig - -%if %{with ndp} -%package devel -Summary: Devel package of ipfixprobe containing header files of libndpRI interface and devel files. -Group: Liberouter -Requires: ipfixprobe = %{version}-%{release} -Provides: ipfixprobe-devel - -%description devel -This package contains header file for liburfilter. - -%endif - -%files -%attr(0755, root, nemead) %{_bindir}/ipfixprobe -%attr(0755, root, nemead) %{_bindir}/ipfixprobe_stats -%attr(0755, root, nemead) %{_bindir}/ipfixprobed -%{_sysconfdir}/bash_completion.d/ipfixprobe.bash -%{_sysconfdir}/ipfixprobe/link0.conf.example -%{_sysconfdir}/ipfixprobe/dpdk_direct.conf.example -%{_sysconfdir}/ipfixprobe/dpdk_mring.conf.example -%{_docdir}/ipfixprobe/README.md -%if %{with ndp} -%{_libdir}/libndpRI.so.0 -%{_libdir}/libndpRI.so.0.0.0 -%endif -@systemdsystemunitdir@ - -%if %{with ndp} -%files devel -%{_includedir}/ndpheader.h -%{_includedir}/ndpreader.h -%{_includedir}/ndpreader.hpp -%{_libdir}/libndpRI.a -%{_libdir}/libndpRI.la -%{_libdir}/libndpRI.so -%endif - - - From 79c50de3a2e73287cac31c5859a1dc0dba6549aa Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 13:06:13 +0100 Subject: [PATCH 05/94] .gitignore - update ignored directories --- .gitignore | 126 +++-------------------------------------------------- 1 file changed, 6 insertions(+), 120 deletions(-) diff --git a/.gitignore b/.gitignore index 4c9d4ebba..88e0a554c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,123 +1,9 @@ -# http://www.gnu.org/software/automake -Makefile.in -/ar-lib -/mdate-sh -/py-compile -/test-driver -/ylwrap -.deps/ -nfbCInterface/.deps/ -.dirstamp +# Default build directory +build/ -# http://www.gnu.org/software/autoconf +# Visual Studio files +.vscode/ -autom4te.cache -/autoscan.log -/autoscan-*.log -/aclocal.m4 -/compile -/config.guess -/config.h.in -/config.log -/config.status -/config.sub -/configure -/configure.scan -/depcomp -/install-sh -/missing -/stamp-h1 - -# https://www.gnu.org/software/libtool/ - -/ltmain.sh - -# http://www.gnu.org/software/texinfo - -/texinfo.tex - -# http://www.gnu.org/software/m4/ - -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 - -# Generated Makefile -# (meta build system like autotools, -# can automatically generate from config.status script -# (which is called by configure script)) -Makefile - -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - - -# Generated Ipfixprobe Files -config.h -.idea/ -ipfixprobe.bash -ipfixprobe.spec -libtool -fields.c -fields.h -ipfixprobe-nemea.* -ipfixprobe -ipfixprobe_stats -ipfixprobe-*.tar.gz - -# Test Outputs -tests/*/*.log -tests/*/*.trs -tests/output/ -tests/functional/output -# Unit test binaries -tests/unit/byte_utils -tests/unit/flowifc -tests/unit/options -tests/unit/unirec -tests/unit/utils - -# Mac Finder metafile -**/.DS_Store - -# vscode settings files -.vscode - -# jekyll files -docs/_site/ -docs/.sass-cache/ -docs/.jekyll-metadata/ -docs/.jekyll-cache/ \ No newline at end of file +# Clangd cache files +.clang/ From d7b8516ec68c9dce6ada82667494a0de30f324f9 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 13:09:20 +0100 Subject: [PATCH 06/94] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index abdb9fb84..8007cab94 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2022, CESNET +Copyright (c) 2025, CESNET All rights reserved. Redistribution and use in source and binary forms, with or without From 40d3670bf9bad53dbdcc1c84e8b90b6767fcbdb0 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 13:16:27 +0100 Subject: [PATCH 07/94] Create new directory structure --- ipfixprobe.cpp => src/core/ipfixprobe.cpp | 0 ipfixprobe.hpp => src/core/ipfixprobe.hpp | 0 ipfixprobe_stats.cpp => src/core/ipfixprobe_stats.cpp | 0 main.cpp => src/core/main.cpp | 0 options.cpp => src/core/options.cpp | 0 pluginmgr.cpp => src/core/pluginmgr.cpp | 0 pluginmgr.hpp => src/core/pluginmgr.hpp | 0 ring.c => src/core/ring.c | 0 stacktrace.cpp => src/core/stacktrace.cpp | 0 stacktrace.hpp => src/core/stacktrace.hpp | 0 stats.cpp => src/core/stats.cpp | 0 stats.hpp => src/core/stats.hpp | 0 utils.cpp => src/core/utils.cpp | 0 workers.cpp => src/core/workers.cpp | 0 workers.hpp => src/core/workers.hpp | 0 {input => src/plugins/input}/benchmark.cpp | 0 {input => src/plugins/input}/benchmark.hpp | 0 {input => src/plugins/input}/dpdk-ring.cpp | 0 {input => src/plugins/input}/dpdk-ring.h | 0 {input => src/plugins/input}/dpdk.cpp | 0 {input => src/plugins/input}/dpdk.h | 0 {input => src/plugins/input}/dpdk/dpdkCompat.hpp | 0 {input => src/plugins/input}/dpdk/dpdkDevice.cpp | 0 {input => src/plugins/input}/dpdk/dpdkDevice.hpp | 0 {input => src/plugins/input}/dpdk/dpdkMbuf.cpp | 0 {input => src/plugins/input}/dpdk/dpdkMbuf.hpp | 0 {input => src/plugins/input}/dpdk/dpdkPortTelemetry.cpp | 0 {input => src/plugins/input}/dpdk/dpdkPortTelemetry.hpp | 0 {input => src/plugins/input}/dpdk/dpdkTelemetry.cpp | 0 {input => src/plugins/input}/dpdk/dpdkTelemetry.hpp | 0 {input => src/plugins/input}/headers.hpp | 0 {input => src/plugins/input}/input.cpp | 0 {input => src/plugins/input}/ndp.cpp | 0 {input => src/plugins/input}/ndp.hpp | 0 {input => src/plugins/input}/nfbCInterface/Makefile.am | 0 {input => src/plugins/input}/nfbCInterface/configure.ac | 0 {input => src/plugins/input}/nfbCInterface/include/ndpheader.h | 0 {input => src/plugins/input}/nfbCInterface/include/ndpreader.h | 0 {input => src/plugins/input}/nfbCInterface/include/ndpreader.hpp | 0 {input => src/plugins/input}/nfbCInterface/ndpreader.cpp | 0 {input => src/plugins/input}/parser.cpp | 0 {input => src/plugins/input}/parser.hpp | 0 {input => src/plugins/input}/pcap.cpp | 0 {input => src/plugins/input}/pcap.hpp | 0 {input => src/plugins/input}/raw.cpp | 0 {input => src/plugins/input}/raw.hpp | 0 {input => src/plugins/input}/stem.cpp | 0 {input => src/plugins/input}/stem.hpp | 0 {output => src/plugins/output}/ipfix-basiclist.cpp | 0 {output => src/plugins/output}/ipfix.cpp | 0 {output => src/plugins/output}/ipfix.hpp | 0 {output => src/plugins/output}/text.cpp | 0 {output => src/plugins/output}/text.hpp | 0 {output => src/plugins/output}/unirec.cpp | 0 {output => src/plugins/output}/unirec.hpp | 0 {process => src/plugins/process}/basicplus.cpp | 0 {process => src/plugins/process}/basicplus.hpp | 0 {process => src/plugins/process}/bstats.cpp | 0 {process => src/plugins/process}/bstats.hpp | 0 {process => src/plugins/process}/common.hpp | 0 {process => src/plugins/process}/create_plugin.sh | 0 {process => src/plugins/process}/dns-utils.hpp | 0 {process => src/plugins/process}/dns.cpp | 0 {process => src/plugins/process}/dns.hpp | 0 {process => src/plugins/process}/dnssd.cpp | 0 {process => src/plugins/process}/dnssd.hpp | 0 {process => src/plugins/process}/flexprobe-data-processing.cpp | 0 {process => src/plugins/process}/flexprobe-data-processing.h | 0 {process => src/plugins/process}/flexprobe-data.h | 0 .../plugins/process}/flexprobe-encryption-processing.cpp | 0 .../plugins/process}/flexprobe-encryption-processing.h | 0 {process => src/plugins/process}/flexprobe-tcp-tracking.cpp | 0 {process => src/plugins/process}/flexprobe-tcp-tracking.h | 0 {process => src/plugins/process}/flow_hash.cpp | 0 {process => src/plugins/process}/flow_hash.hpp | 0 {process => src/plugins/process}/http.cpp | 0 {process => src/plugins/process}/http.hpp | 0 {process => src/plugins/process}/icmp.cpp | 0 {process => src/plugins/process}/icmp.hpp | 0 {process => src/plugins/process}/idpcontent.cpp | 0 {process => src/plugins/process}/idpcontent.hpp | 0 {process => src/plugins/process}/md5.cpp | 0 {process => src/plugins/process}/md5.hpp | 0 {process => src/plugins/process}/mpls.cpp | 0 {process => src/plugins/process}/mpls.hpp | 0 {process => src/plugins/process}/mqtt.cpp | 0 {process => src/plugins/process}/mqtt.hpp | 0 {process => src/plugins/process}/netbios.cpp | 0 {process => src/plugins/process}/netbios.hpp | 0 {process => src/plugins/process}/nettisa.cpp | 0 {process => src/plugins/process}/nettisa.hpp | 0 {process => src/plugins/process}/ntp.cpp | 0 {process => src/plugins/process}/ntp.hpp | 0 {process => src/plugins/process}/osquery.cpp | 0 {process => src/plugins/process}/osquery.hpp | 0 {process => src/plugins/process}/ovpn.cpp | 0 {process => src/plugins/process}/ovpn.hpp | 0 {process => src/plugins/process}/passivedns.cpp | 0 {process => src/plugins/process}/passivedns.hpp | 0 {process => src/plugins/process}/phists.cpp | 0 {process => src/plugins/process}/phists.hpp | 0 {process => src/plugins/process}/pstats.cpp | 0 {process => src/plugins/process}/pstats.hpp | 0 {process => src/plugins/process}/quic.cpp | 0 {process => src/plugins/process}/quic.hpp | 0 {process => src/plugins/process}/quic_parser.cpp | 0 {process => src/plugins/process}/quic_parser.hpp | 0 {process => src/plugins/process}/rtsp.cpp | 0 {process => src/plugins/process}/rtsp.hpp | 0 {process => src/plugins/process}/sha256.hpp | 0 {process => src/plugins/process}/sip.cpp | 0 {process => src/plugins/process}/sip.hpp | 0 {process => src/plugins/process}/smtp.cpp | 0 {process => src/plugins/process}/smtp.hpp | 0 {process => src/plugins/process}/ssadetector.cpp | 0 {process => src/plugins/process}/ssadetector.hpp | 0 {process => src/plugins/process}/ssdp.cpp | 0 {process => src/plugins/process}/ssdp.hpp | 0 {process => src/plugins/process}/stats.cpp | 0 {process => src/plugins/process}/stats.hpp | 0 {process => src/plugins/process}/tls.cpp | 0 {process => src/plugins/process}/tls.hpp | 0 {process => src/plugins/process}/tls_parser.cpp | 0 {process => src/plugins/process}/tls_parser.hpp | 0 {process => src/plugins/process}/vlan.cpp | 0 {process => src/plugins/process}/vlan.hpp | 0 {process => src/plugins/process}/wg.cpp | 0 {process => src/plugins/process}/wg.hpp | 0 {storage => src/plugins/storage}/cache.cpp | 0 {storage => src/plugins/storage}/cache.hpp | 0 .../plugins/storage}/fragmentationCache/fragmentationCache.cpp | 0 .../plugins/storage}/fragmentationCache/fragmentationCache.hpp | 0 .../plugins/storage}/fragmentationCache/fragmentationKeyData.hpp | 0 .../plugins/storage}/fragmentationCache/fragmentationTable.cpp | 0 .../plugins/storage}/fragmentationCache/fragmentationTable.hpp | 0 .../plugins/storage}/fragmentationCache/ringBuffer.hpp | 0 .../plugins/storage}/fragmentationCache/timevalUtils.hpp | 0 {storage => src/plugins/storage}/xxhash.c | 0 {storage => src/plugins/storage}/xxhash.h | 0 139 files changed, 0 insertions(+), 0 deletions(-) rename ipfixprobe.cpp => src/core/ipfixprobe.cpp (100%) rename ipfixprobe.hpp => src/core/ipfixprobe.hpp (100%) rename ipfixprobe_stats.cpp => src/core/ipfixprobe_stats.cpp (100%) rename main.cpp => src/core/main.cpp (100%) rename options.cpp => src/core/options.cpp (100%) rename pluginmgr.cpp => src/core/pluginmgr.cpp (100%) rename pluginmgr.hpp => src/core/pluginmgr.hpp (100%) rename ring.c => src/core/ring.c (100%) rename stacktrace.cpp => src/core/stacktrace.cpp (100%) rename stacktrace.hpp => src/core/stacktrace.hpp (100%) rename stats.cpp => src/core/stats.cpp (100%) rename stats.hpp => src/core/stats.hpp (100%) rename utils.cpp => src/core/utils.cpp (100%) rename workers.cpp => src/core/workers.cpp (100%) rename workers.hpp => src/core/workers.hpp (100%) rename {input => src/plugins/input}/benchmark.cpp (100%) rename {input => src/plugins/input}/benchmark.hpp (100%) rename {input => src/plugins/input}/dpdk-ring.cpp (100%) rename {input => src/plugins/input}/dpdk-ring.h (100%) rename {input => src/plugins/input}/dpdk.cpp (100%) rename {input => src/plugins/input}/dpdk.h (100%) rename {input => src/plugins/input}/dpdk/dpdkCompat.hpp (100%) rename {input => src/plugins/input}/dpdk/dpdkDevice.cpp (100%) rename {input => src/plugins/input}/dpdk/dpdkDevice.hpp (100%) rename {input => src/plugins/input}/dpdk/dpdkMbuf.cpp (100%) rename {input => src/plugins/input}/dpdk/dpdkMbuf.hpp (100%) rename {input => src/plugins/input}/dpdk/dpdkPortTelemetry.cpp (100%) rename {input => src/plugins/input}/dpdk/dpdkPortTelemetry.hpp (100%) rename {input => src/plugins/input}/dpdk/dpdkTelemetry.cpp (100%) rename {input => src/plugins/input}/dpdk/dpdkTelemetry.hpp (100%) rename {input => src/plugins/input}/headers.hpp (100%) rename {input => src/plugins/input}/input.cpp (100%) rename {input => src/plugins/input}/ndp.cpp (100%) rename {input => src/plugins/input}/ndp.hpp (100%) rename {input => src/plugins/input}/nfbCInterface/Makefile.am (100%) rename {input => src/plugins/input}/nfbCInterface/configure.ac (100%) rename {input => src/plugins/input}/nfbCInterface/include/ndpheader.h (100%) rename {input => src/plugins/input}/nfbCInterface/include/ndpreader.h (100%) rename {input => src/plugins/input}/nfbCInterface/include/ndpreader.hpp (100%) rename {input => src/plugins/input}/nfbCInterface/ndpreader.cpp (100%) rename {input => src/plugins/input}/parser.cpp (100%) rename {input => src/plugins/input}/parser.hpp (100%) rename {input => src/plugins/input}/pcap.cpp (100%) rename {input => src/plugins/input}/pcap.hpp (100%) rename {input => src/plugins/input}/raw.cpp (100%) rename {input => src/plugins/input}/raw.hpp (100%) rename {input => src/plugins/input}/stem.cpp (100%) rename {input => src/plugins/input}/stem.hpp (100%) rename {output => src/plugins/output}/ipfix-basiclist.cpp (100%) rename {output => src/plugins/output}/ipfix.cpp (100%) rename {output => src/plugins/output}/ipfix.hpp (100%) rename {output => src/plugins/output}/text.cpp (100%) rename {output => src/plugins/output}/text.hpp (100%) rename {output => src/plugins/output}/unirec.cpp (100%) rename {output => src/plugins/output}/unirec.hpp (100%) rename {process => src/plugins/process}/basicplus.cpp (100%) rename {process => src/plugins/process}/basicplus.hpp (100%) rename {process => src/plugins/process}/bstats.cpp (100%) rename {process => src/plugins/process}/bstats.hpp (100%) rename {process => src/plugins/process}/common.hpp (100%) rename {process => src/plugins/process}/create_plugin.sh (100%) rename {process => src/plugins/process}/dns-utils.hpp (100%) rename {process => src/plugins/process}/dns.cpp (100%) rename {process => src/plugins/process}/dns.hpp (100%) rename {process => src/plugins/process}/dnssd.cpp (100%) rename {process => src/plugins/process}/dnssd.hpp (100%) rename {process => src/plugins/process}/flexprobe-data-processing.cpp (100%) rename {process => src/plugins/process}/flexprobe-data-processing.h (100%) rename {process => src/plugins/process}/flexprobe-data.h (100%) rename {process => src/plugins/process}/flexprobe-encryption-processing.cpp (100%) rename {process => src/plugins/process}/flexprobe-encryption-processing.h (100%) rename {process => src/plugins/process}/flexprobe-tcp-tracking.cpp (100%) rename {process => src/plugins/process}/flexprobe-tcp-tracking.h (100%) rename {process => src/plugins/process}/flow_hash.cpp (100%) rename {process => src/plugins/process}/flow_hash.hpp (100%) rename {process => src/plugins/process}/http.cpp (100%) rename {process => src/plugins/process}/http.hpp (100%) rename {process => src/plugins/process}/icmp.cpp (100%) rename {process => src/plugins/process}/icmp.hpp (100%) rename {process => src/plugins/process}/idpcontent.cpp (100%) rename {process => src/plugins/process}/idpcontent.hpp (100%) rename {process => src/plugins/process}/md5.cpp (100%) rename {process => src/plugins/process}/md5.hpp (100%) rename {process => src/plugins/process}/mpls.cpp (100%) rename {process => src/plugins/process}/mpls.hpp (100%) rename {process => src/plugins/process}/mqtt.cpp (100%) rename {process => src/plugins/process}/mqtt.hpp (100%) rename {process => src/plugins/process}/netbios.cpp (100%) rename {process => src/plugins/process}/netbios.hpp (100%) rename {process => src/plugins/process}/nettisa.cpp (100%) rename {process => src/plugins/process}/nettisa.hpp (100%) rename {process => src/plugins/process}/ntp.cpp (100%) rename {process => src/plugins/process}/ntp.hpp (100%) rename {process => src/plugins/process}/osquery.cpp (100%) rename {process => src/plugins/process}/osquery.hpp (100%) rename {process => src/plugins/process}/ovpn.cpp (100%) rename {process => src/plugins/process}/ovpn.hpp (100%) rename {process => src/plugins/process}/passivedns.cpp (100%) rename {process => src/plugins/process}/passivedns.hpp (100%) rename {process => src/plugins/process}/phists.cpp (100%) rename {process => src/plugins/process}/phists.hpp (100%) rename {process => src/plugins/process}/pstats.cpp (100%) rename {process => src/plugins/process}/pstats.hpp (100%) rename {process => src/plugins/process}/quic.cpp (100%) rename {process => src/plugins/process}/quic.hpp (100%) rename {process => src/plugins/process}/quic_parser.cpp (100%) rename {process => src/plugins/process}/quic_parser.hpp (100%) rename {process => src/plugins/process}/rtsp.cpp (100%) rename {process => src/plugins/process}/rtsp.hpp (100%) rename {process => src/plugins/process}/sha256.hpp (100%) rename {process => src/plugins/process}/sip.cpp (100%) rename {process => src/plugins/process}/sip.hpp (100%) rename {process => src/plugins/process}/smtp.cpp (100%) rename {process => src/plugins/process}/smtp.hpp (100%) rename {process => src/plugins/process}/ssadetector.cpp (100%) rename {process => src/plugins/process}/ssadetector.hpp (100%) rename {process => src/plugins/process}/ssdp.cpp (100%) rename {process => src/plugins/process}/ssdp.hpp (100%) rename {process => src/plugins/process}/stats.cpp (100%) rename {process => src/plugins/process}/stats.hpp (100%) rename {process => src/plugins/process}/tls.cpp (100%) rename {process => src/plugins/process}/tls.hpp (100%) rename {process => src/plugins/process}/tls_parser.cpp (100%) rename {process => src/plugins/process}/tls_parser.hpp (100%) rename {process => src/plugins/process}/vlan.cpp (100%) rename {process => src/plugins/process}/vlan.hpp (100%) rename {process => src/plugins/process}/wg.cpp (100%) rename {process => src/plugins/process}/wg.hpp (100%) rename {storage => src/plugins/storage}/cache.cpp (100%) rename {storage => src/plugins/storage}/cache.hpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/fragmentationCache.cpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/fragmentationCache.hpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/fragmentationKeyData.hpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/fragmentationTable.cpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/fragmentationTable.hpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/ringBuffer.hpp (100%) rename {storage => src/plugins/storage}/fragmentationCache/timevalUtils.hpp (100%) rename {storage => src/plugins/storage}/xxhash.c (100%) rename {storage => src/plugins/storage}/xxhash.h (100%) diff --git a/ipfixprobe.cpp b/src/core/ipfixprobe.cpp similarity index 100% rename from ipfixprobe.cpp rename to src/core/ipfixprobe.cpp diff --git a/ipfixprobe.hpp b/src/core/ipfixprobe.hpp similarity index 100% rename from ipfixprobe.hpp rename to src/core/ipfixprobe.hpp diff --git a/ipfixprobe_stats.cpp b/src/core/ipfixprobe_stats.cpp similarity index 100% rename from ipfixprobe_stats.cpp rename to src/core/ipfixprobe_stats.cpp diff --git a/main.cpp b/src/core/main.cpp similarity index 100% rename from main.cpp rename to src/core/main.cpp diff --git a/options.cpp b/src/core/options.cpp similarity index 100% rename from options.cpp rename to src/core/options.cpp diff --git a/pluginmgr.cpp b/src/core/pluginmgr.cpp similarity index 100% rename from pluginmgr.cpp rename to src/core/pluginmgr.cpp diff --git a/pluginmgr.hpp b/src/core/pluginmgr.hpp similarity index 100% rename from pluginmgr.hpp rename to src/core/pluginmgr.hpp diff --git a/ring.c b/src/core/ring.c similarity index 100% rename from ring.c rename to src/core/ring.c diff --git a/stacktrace.cpp b/src/core/stacktrace.cpp similarity index 100% rename from stacktrace.cpp rename to src/core/stacktrace.cpp diff --git a/stacktrace.hpp b/src/core/stacktrace.hpp similarity index 100% rename from stacktrace.hpp rename to src/core/stacktrace.hpp diff --git a/stats.cpp b/src/core/stats.cpp similarity index 100% rename from stats.cpp rename to src/core/stats.cpp diff --git a/stats.hpp b/src/core/stats.hpp similarity index 100% rename from stats.hpp rename to src/core/stats.hpp diff --git a/utils.cpp b/src/core/utils.cpp similarity index 100% rename from utils.cpp rename to src/core/utils.cpp diff --git a/workers.cpp b/src/core/workers.cpp similarity index 100% rename from workers.cpp rename to src/core/workers.cpp diff --git a/workers.hpp b/src/core/workers.hpp similarity index 100% rename from workers.hpp rename to src/core/workers.hpp diff --git a/input/benchmark.cpp b/src/plugins/input/benchmark.cpp similarity index 100% rename from input/benchmark.cpp rename to src/plugins/input/benchmark.cpp diff --git a/input/benchmark.hpp b/src/plugins/input/benchmark.hpp similarity index 100% rename from input/benchmark.hpp rename to src/plugins/input/benchmark.hpp diff --git a/input/dpdk-ring.cpp b/src/plugins/input/dpdk-ring.cpp similarity index 100% rename from input/dpdk-ring.cpp rename to src/plugins/input/dpdk-ring.cpp diff --git a/input/dpdk-ring.h b/src/plugins/input/dpdk-ring.h similarity index 100% rename from input/dpdk-ring.h rename to src/plugins/input/dpdk-ring.h diff --git a/input/dpdk.cpp b/src/plugins/input/dpdk.cpp similarity index 100% rename from input/dpdk.cpp rename to src/plugins/input/dpdk.cpp diff --git a/input/dpdk.h b/src/plugins/input/dpdk.h similarity index 100% rename from input/dpdk.h rename to src/plugins/input/dpdk.h diff --git a/input/dpdk/dpdkCompat.hpp b/src/plugins/input/dpdk/dpdkCompat.hpp similarity index 100% rename from input/dpdk/dpdkCompat.hpp rename to src/plugins/input/dpdk/dpdkCompat.hpp diff --git a/input/dpdk/dpdkDevice.cpp b/src/plugins/input/dpdk/dpdkDevice.cpp similarity index 100% rename from input/dpdk/dpdkDevice.cpp rename to src/plugins/input/dpdk/dpdkDevice.cpp diff --git a/input/dpdk/dpdkDevice.hpp b/src/plugins/input/dpdk/dpdkDevice.hpp similarity index 100% rename from input/dpdk/dpdkDevice.hpp rename to src/plugins/input/dpdk/dpdkDevice.hpp diff --git a/input/dpdk/dpdkMbuf.cpp b/src/plugins/input/dpdk/dpdkMbuf.cpp similarity index 100% rename from input/dpdk/dpdkMbuf.cpp rename to src/plugins/input/dpdk/dpdkMbuf.cpp diff --git a/input/dpdk/dpdkMbuf.hpp b/src/plugins/input/dpdk/dpdkMbuf.hpp similarity index 100% rename from input/dpdk/dpdkMbuf.hpp rename to src/plugins/input/dpdk/dpdkMbuf.hpp diff --git a/input/dpdk/dpdkPortTelemetry.cpp b/src/plugins/input/dpdk/dpdkPortTelemetry.cpp similarity index 100% rename from input/dpdk/dpdkPortTelemetry.cpp rename to src/plugins/input/dpdk/dpdkPortTelemetry.cpp diff --git a/input/dpdk/dpdkPortTelemetry.hpp b/src/plugins/input/dpdk/dpdkPortTelemetry.hpp similarity index 100% rename from input/dpdk/dpdkPortTelemetry.hpp rename to src/plugins/input/dpdk/dpdkPortTelemetry.hpp diff --git a/input/dpdk/dpdkTelemetry.cpp b/src/plugins/input/dpdk/dpdkTelemetry.cpp similarity index 100% rename from input/dpdk/dpdkTelemetry.cpp rename to src/plugins/input/dpdk/dpdkTelemetry.cpp diff --git a/input/dpdk/dpdkTelemetry.hpp b/src/plugins/input/dpdk/dpdkTelemetry.hpp similarity index 100% rename from input/dpdk/dpdkTelemetry.hpp rename to src/plugins/input/dpdk/dpdkTelemetry.hpp diff --git a/input/headers.hpp b/src/plugins/input/headers.hpp similarity index 100% rename from input/headers.hpp rename to src/plugins/input/headers.hpp diff --git a/input/input.cpp b/src/plugins/input/input.cpp similarity index 100% rename from input/input.cpp rename to src/plugins/input/input.cpp diff --git a/input/ndp.cpp b/src/plugins/input/ndp.cpp similarity index 100% rename from input/ndp.cpp rename to src/plugins/input/ndp.cpp diff --git a/input/ndp.hpp b/src/plugins/input/ndp.hpp similarity index 100% rename from input/ndp.hpp rename to src/plugins/input/ndp.hpp diff --git a/input/nfbCInterface/Makefile.am b/src/plugins/input/nfbCInterface/Makefile.am similarity index 100% rename from input/nfbCInterface/Makefile.am rename to src/plugins/input/nfbCInterface/Makefile.am diff --git a/input/nfbCInterface/configure.ac b/src/plugins/input/nfbCInterface/configure.ac similarity index 100% rename from input/nfbCInterface/configure.ac rename to src/plugins/input/nfbCInterface/configure.ac diff --git a/input/nfbCInterface/include/ndpheader.h b/src/plugins/input/nfbCInterface/include/ndpheader.h similarity index 100% rename from input/nfbCInterface/include/ndpheader.h rename to src/plugins/input/nfbCInterface/include/ndpheader.h diff --git a/input/nfbCInterface/include/ndpreader.h b/src/plugins/input/nfbCInterface/include/ndpreader.h similarity index 100% rename from input/nfbCInterface/include/ndpreader.h rename to src/plugins/input/nfbCInterface/include/ndpreader.h diff --git a/input/nfbCInterface/include/ndpreader.hpp b/src/plugins/input/nfbCInterface/include/ndpreader.hpp similarity index 100% rename from input/nfbCInterface/include/ndpreader.hpp rename to src/plugins/input/nfbCInterface/include/ndpreader.hpp diff --git a/input/nfbCInterface/ndpreader.cpp b/src/plugins/input/nfbCInterface/ndpreader.cpp similarity index 100% rename from input/nfbCInterface/ndpreader.cpp rename to src/plugins/input/nfbCInterface/ndpreader.cpp diff --git a/input/parser.cpp b/src/plugins/input/parser.cpp similarity index 100% rename from input/parser.cpp rename to src/plugins/input/parser.cpp diff --git a/input/parser.hpp b/src/plugins/input/parser.hpp similarity index 100% rename from input/parser.hpp rename to src/plugins/input/parser.hpp diff --git a/input/pcap.cpp b/src/plugins/input/pcap.cpp similarity index 100% rename from input/pcap.cpp rename to src/plugins/input/pcap.cpp diff --git a/input/pcap.hpp b/src/plugins/input/pcap.hpp similarity index 100% rename from input/pcap.hpp rename to src/plugins/input/pcap.hpp diff --git a/input/raw.cpp b/src/plugins/input/raw.cpp similarity index 100% rename from input/raw.cpp rename to src/plugins/input/raw.cpp diff --git a/input/raw.hpp b/src/plugins/input/raw.hpp similarity index 100% rename from input/raw.hpp rename to src/plugins/input/raw.hpp diff --git a/input/stem.cpp b/src/plugins/input/stem.cpp similarity index 100% rename from input/stem.cpp rename to src/plugins/input/stem.cpp diff --git a/input/stem.hpp b/src/plugins/input/stem.hpp similarity index 100% rename from input/stem.hpp rename to src/plugins/input/stem.hpp diff --git a/output/ipfix-basiclist.cpp b/src/plugins/output/ipfix-basiclist.cpp similarity index 100% rename from output/ipfix-basiclist.cpp rename to src/plugins/output/ipfix-basiclist.cpp diff --git a/output/ipfix.cpp b/src/plugins/output/ipfix.cpp similarity index 100% rename from output/ipfix.cpp rename to src/plugins/output/ipfix.cpp diff --git a/output/ipfix.hpp b/src/plugins/output/ipfix.hpp similarity index 100% rename from output/ipfix.hpp rename to src/plugins/output/ipfix.hpp diff --git a/output/text.cpp b/src/plugins/output/text.cpp similarity index 100% rename from output/text.cpp rename to src/plugins/output/text.cpp diff --git a/output/text.hpp b/src/plugins/output/text.hpp similarity index 100% rename from output/text.hpp rename to src/plugins/output/text.hpp diff --git a/output/unirec.cpp b/src/plugins/output/unirec.cpp similarity index 100% rename from output/unirec.cpp rename to src/plugins/output/unirec.cpp diff --git a/output/unirec.hpp b/src/plugins/output/unirec.hpp similarity index 100% rename from output/unirec.hpp rename to src/plugins/output/unirec.hpp diff --git a/process/basicplus.cpp b/src/plugins/process/basicplus.cpp similarity index 100% rename from process/basicplus.cpp rename to src/plugins/process/basicplus.cpp diff --git a/process/basicplus.hpp b/src/plugins/process/basicplus.hpp similarity index 100% rename from process/basicplus.hpp rename to src/plugins/process/basicplus.hpp diff --git a/process/bstats.cpp b/src/plugins/process/bstats.cpp similarity index 100% rename from process/bstats.cpp rename to src/plugins/process/bstats.cpp diff --git a/process/bstats.hpp b/src/plugins/process/bstats.hpp similarity index 100% rename from process/bstats.hpp rename to src/plugins/process/bstats.hpp diff --git a/process/common.hpp b/src/plugins/process/common.hpp similarity index 100% rename from process/common.hpp rename to src/plugins/process/common.hpp diff --git a/process/create_plugin.sh b/src/plugins/process/create_plugin.sh similarity index 100% rename from process/create_plugin.sh rename to src/plugins/process/create_plugin.sh diff --git a/process/dns-utils.hpp b/src/plugins/process/dns-utils.hpp similarity index 100% rename from process/dns-utils.hpp rename to src/plugins/process/dns-utils.hpp diff --git a/process/dns.cpp b/src/plugins/process/dns.cpp similarity index 100% rename from process/dns.cpp rename to src/plugins/process/dns.cpp diff --git a/process/dns.hpp b/src/plugins/process/dns.hpp similarity index 100% rename from process/dns.hpp rename to src/plugins/process/dns.hpp diff --git a/process/dnssd.cpp b/src/plugins/process/dnssd.cpp similarity index 100% rename from process/dnssd.cpp rename to src/plugins/process/dnssd.cpp diff --git a/process/dnssd.hpp b/src/plugins/process/dnssd.hpp similarity index 100% rename from process/dnssd.hpp rename to src/plugins/process/dnssd.hpp diff --git a/process/flexprobe-data-processing.cpp b/src/plugins/process/flexprobe-data-processing.cpp similarity index 100% rename from process/flexprobe-data-processing.cpp rename to src/plugins/process/flexprobe-data-processing.cpp diff --git a/process/flexprobe-data-processing.h b/src/plugins/process/flexprobe-data-processing.h similarity index 100% rename from process/flexprobe-data-processing.h rename to src/plugins/process/flexprobe-data-processing.h diff --git a/process/flexprobe-data.h b/src/plugins/process/flexprobe-data.h similarity index 100% rename from process/flexprobe-data.h rename to src/plugins/process/flexprobe-data.h diff --git a/process/flexprobe-encryption-processing.cpp b/src/plugins/process/flexprobe-encryption-processing.cpp similarity index 100% rename from process/flexprobe-encryption-processing.cpp rename to src/plugins/process/flexprobe-encryption-processing.cpp diff --git a/process/flexprobe-encryption-processing.h b/src/plugins/process/flexprobe-encryption-processing.h similarity index 100% rename from process/flexprobe-encryption-processing.h rename to src/plugins/process/flexprobe-encryption-processing.h diff --git a/process/flexprobe-tcp-tracking.cpp b/src/plugins/process/flexprobe-tcp-tracking.cpp similarity index 100% rename from process/flexprobe-tcp-tracking.cpp rename to src/plugins/process/flexprobe-tcp-tracking.cpp diff --git a/process/flexprobe-tcp-tracking.h b/src/plugins/process/flexprobe-tcp-tracking.h similarity index 100% rename from process/flexprobe-tcp-tracking.h rename to src/plugins/process/flexprobe-tcp-tracking.h diff --git a/process/flow_hash.cpp b/src/plugins/process/flow_hash.cpp similarity index 100% rename from process/flow_hash.cpp rename to src/plugins/process/flow_hash.cpp diff --git a/process/flow_hash.hpp b/src/plugins/process/flow_hash.hpp similarity index 100% rename from process/flow_hash.hpp rename to src/plugins/process/flow_hash.hpp diff --git a/process/http.cpp b/src/plugins/process/http.cpp similarity index 100% rename from process/http.cpp rename to src/plugins/process/http.cpp diff --git a/process/http.hpp b/src/plugins/process/http.hpp similarity index 100% rename from process/http.hpp rename to src/plugins/process/http.hpp diff --git a/process/icmp.cpp b/src/plugins/process/icmp.cpp similarity index 100% rename from process/icmp.cpp rename to src/plugins/process/icmp.cpp diff --git a/process/icmp.hpp b/src/plugins/process/icmp.hpp similarity index 100% rename from process/icmp.hpp rename to src/plugins/process/icmp.hpp diff --git a/process/idpcontent.cpp b/src/plugins/process/idpcontent.cpp similarity index 100% rename from process/idpcontent.cpp rename to src/plugins/process/idpcontent.cpp diff --git a/process/idpcontent.hpp b/src/plugins/process/idpcontent.hpp similarity index 100% rename from process/idpcontent.hpp rename to src/plugins/process/idpcontent.hpp diff --git a/process/md5.cpp b/src/plugins/process/md5.cpp similarity index 100% rename from process/md5.cpp rename to src/plugins/process/md5.cpp diff --git a/process/md5.hpp b/src/plugins/process/md5.hpp similarity index 100% rename from process/md5.hpp rename to src/plugins/process/md5.hpp diff --git a/process/mpls.cpp b/src/plugins/process/mpls.cpp similarity index 100% rename from process/mpls.cpp rename to src/plugins/process/mpls.cpp diff --git a/process/mpls.hpp b/src/plugins/process/mpls.hpp similarity index 100% rename from process/mpls.hpp rename to src/plugins/process/mpls.hpp diff --git a/process/mqtt.cpp b/src/plugins/process/mqtt.cpp similarity index 100% rename from process/mqtt.cpp rename to src/plugins/process/mqtt.cpp diff --git a/process/mqtt.hpp b/src/plugins/process/mqtt.hpp similarity index 100% rename from process/mqtt.hpp rename to src/plugins/process/mqtt.hpp diff --git a/process/netbios.cpp b/src/plugins/process/netbios.cpp similarity index 100% rename from process/netbios.cpp rename to src/plugins/process/netbios.cpp diff --git a/process/netbios.hpp b/src/plugins/process/netbios.hpp similarity index 100% rename from process/netbios.hpp rename to src/plugins/process/netbios.hpp diff --git a/process/nettisa.cpp b/src/plugins/process/nettisa.cpp similarity index 100% rename from process/nettisa.cpp rename to src/plugins/process/nettisa.cpp diff --git a/process/nettisa.hpp b/src/plugins/process/nettisa.hpp similarity index 100% rename from process/nettisa.hpp rename to src/plugins/process/nettisa.hpp diff --git a/process/ntp.cpp b/src/plugins/process/ntp.cpp similarity index 100% rename from process/ntp.cpp rename to src/plugins/process/ntp.cpp diff --git a/process/ntp.hpp b/src/plugins/process/ntp.hpp similarity index 100% rename from process/ntp.hpp rename to src/plugins/process/ntp.hpp diff --git a/process/osquery.cpp b/src/plugins/process/osquery.cpp similarity index 100% rename from process/osquery.cpp rename to src/plugins/process/osquery.cpp diff --git a/process/osquery.hpp b/src/plugins/process/osquery.hpp similarity index 100% rename from process/osquery.hpp rename to src/plugins/process/osquery.hpp diff --git a/process/ovpn.cpp b/src/plugins/process/ovpn.cpp similarity index 100% rename from process/ovpn.cpp rename to src/plugins/process/ovpn.cpp diff --git a/process/ovpn.hpp b/src/plugins/process/ovpn.hpp similarity index 100% rename from process/ovpn.hpp rename to src/plugins/process/ovpn.hpp diff --git a/process/passivedns.cpp b/src/plugins/process/passivedns.cpp similarity index 100% rename from process/passivedns.cpp rename to src/plugins/process/passivedns.cpp diff --git a/process/passivedns.hpp b/src/plugins/process/passivedns.hpp similarity index 100% rename from process/passivedns.hpp rename to src/plugins/process/passivedns.hpp diff --git a/process/phists.cpp b/src/plugins/process/phists.cpp similarity index 100% rename from process/phists.cpp rename to src/plugins/process/phists.cpp diff --git a/process/phists.hpp b/src/plugins/process/phists.hpp similarity index 100% rename from process/phists.hpp rename to src/plugins/process/phists.hpp diff --git a/process/pstats.cpp b/src/plugins/process/pstats.cpp similarity index 100% rename from process/pstats.cpp rename to src/plugins/process/pstats.cpp diff --git a/process/pstats.hpp b/src/plugins/process/pstats.hpp similarity index 100% rename from process/pstats.hpp rename to src/plugins/process/pstats.hpp diff --git a/process/quic.cpp b/src/plugins/process/quic.cpp similarity index 100% rename from process/quic.cpp rename to src/plugins/process/quic.cpp diff --git a/process/quic.hpp b/src/plugins/process/quic.hpp similarity index 100% rename from process/quic.hpp rename to src/plugins/process/quic.hpp diff --git a/process/quic_parser.cpp b/src/plugins/process/quic_parser.cpp similarity index 100% rename from process/quic_parser.cpp rename to src/plugins/process/quic_parser.cpp diff --git a/process/quic_parser.hpp b/src/plugins/process/quic_parser.hpp similarity index 100% rename from process/quic_parser.hpp rename to src/plugins/process/quic_parser.hpp diff --git a/process/rtsp.cpp b/src/plugins/process/rtsp.cpp similarity index 100% rename from process/rtsp.cpp rename to src/plugins/process/rtsp.cpp diff --git a/process/rtsp.hpp b/src/plugins/process/rtsp.hpp similarity index 100% rename from process/rtsp.hpp rename to src/plugins/process/rtsp.hpp diff --git a/process/sha256.hpp b/src/plugins/process/sha256.hpp similarity index 100% rename from process/sha256.hpp rename to src/plugins/process/sha256.hpp diff --git a/process/sip.cpp b/src/plugins/process/sip.cpp similarity index 100% rename from process/sip.cpp rename to src/plugins/process/sip.cpp diff --git a/process/sip.hpp b/src/plugins/process/sip.hpp similarity index 100% rename from process/sip.hpp rename to src/plugins/process/sip.hpp diff --git a/process/smtp.cpp b/src/plugins/process/smtp.cpp similarity index 100% rename from process/smtp.cpp rename to src/plugins/process/smtp.cpp diff --git a/process/smtp.hpp b/src/plugins/process/smtp.hpp similarity index 100% rename from process/smtp.hpp rename to src/plugins/process/smtp.hpp diff --git a/process/ssadetector.cpp b/src/plugins/process/ssadetector.cpp similarity index 100% rename from process/ssadetector.cpp rename to src/plugins/process/ssadetector.cpp diff --git a/process/ssadetector.hpp b/src/plugins/process/ssadetector.hpp similarity index 100% rename from process/ssadetector.hpp rename to src/plugins/process/ssadetector.hpp diff --git a/process/ssdp.cpp b/src/plugins/process/ssdp.cpp similarity index 100% rename from process/ssdp.cpp rename to src/plugins/process/ssdp.cpp diff --git a/process/ssdp.hpp b/src/plugins/process/ssdp.hpp similarity index 100% rename from process/ssdp.hpp rename to src/plugins/process/ssdp.hpp diff --git a/process/stats.cpp b/src/plugins/process/stats.cpp similarity index 100% rename from process/stats.cpp rename to src/plugins/process/stats.cpp diff --git a/process/stats.hpp b/src/plugins/process/stats.hpp similarity index 100% rename from process/stats.hpp rename to src/plugins/process/stats.hpp diff --git a/process/tls.cpp b/src/plugins/process/tls.cpp similarity index 100% rename from process/tls.cpp rename to src/plugins/process/tls.cpp diff --git a/process/tls.hpp b/src/plugins/process/tls.hpp similarity index 100% rename from process/tls.hpp rename to src/plugins/process/tls.hpp diff --git a/process/tls_parser.cpp b/src/plugins/process/tls_parser.cpp similarity index 100% rename from process/tls_parser.cpp rename to src/plugins/process/tls_parser.cpp diff --git a/process/tls_parser.hpp b/src/plugins/process/tls_parser.hpp similarity index 100% rename from process/tls_parser.hpp rename to src/plugins/process/tls_parser.hpp diff --git a/process/vlan.cpp b/src/plugins/process/vlan.cpp similarity index 100% rename from process/vlan.cpp rename to src/plugins/process/vlan.cpp diff --git a/process/vlan.hpp b/src/plugins/process/vlan.hpp similarity index 100% rename from process/vlan.hpp rename to src/plugins/process/vlan.hpp diff --git a/process/wg.cpp b/src/plugins/process/wg.cpp similarity index 100% rename from process/wg.cpp rename to src/plugins/process/wg.cpp diff --git a/process/wg.hpp b/src/plugins/process/wg.hpp similarity index 100% rename from process/wg.hpp rename to src/plugins/process/wg.hpp diff --git a/storage/cache.cpp b/src/plugins/storage/cache.cpp similarity index 100% rename from storage/cache.cpp rename to src/plugins/storage/cache.cpp diff --git a/storage/cache.hpp b/src/plugins/storage/cache.hpp similarity index 100% rename from storage/cache.hpp rename to src/plugins/storage/cache.hpp diff --git a/storage/fragmentationCache/fragmentationCache.cpp b/src/plugins/storage/fragmentationCache/fragmentationCache.cpp similarity index 100% rename from storage/fragmentationCache/fragmentationCache.cpp rename to src/plugins/storage/fragmentationCache/fragmentationCache.cpp diff --git a/storage/fragmentationCache/fragmentationCache.hpp b/src/plugins/storage/fragmentationCache/fragmentationCache.hpp similarity index 100% rename from storage/fragmentationCache/fragmentationCache.hpp rename to src/plugins/storage/fragmentationCache/fragmentationCache.hpp diff --git a/storage/fragmentationCache/fragmentationKeyData.hpp b/src/plugins/storage/fragmentationCache/fragmentationKeyData.hpp similarity index 100% rename from storage/fragmentationCache/fragmentationKeyData.hpp rename to src/plugins/storage/fragmentationCache/fragmentationKeyData.hpp diff --git a/storage/fragmentationCache/fragmentationTable.cpp b/src/plugins/storage/fragmentationCache/fragmentationTable.cpp similarity index 100% rename from storage/fragmentationCache/fragmentationTable.cpp rename to src/plugins/storage/fragmentationCache/fragmentationTable.cpp diff --git a/storage/fragmentationCache/fragmentationTable.hpp b/src/plugins/storage/fragmentationCache/fragmentationTable.hpp similarity index 100% rename from storage/fragmentationCache/fragmentationTable.hpp rename to src/plugins/storage/fragmentationCache/fragmentationTable.hpp diff --git a/storage/fragmentationCache/ringBuffer.hpp b/src/plugins/storage/fragmentationCache/ringBuffer.hpp similarity index 100% rename from storage/fragmentationCache/ringBuffer.hpp rename to src/plugins/storage/fragmentationCache/ringBuffer.hpp diff --git a/storage/fragmentationCache/timevalUtils.hpp b/src/plugins/storage/fragmentationCache/timevalUtils.hpp similarity index 100% rename from storage/fragmentationCache/timevalUtils.hpp rename to src/plugins/storage/fragmentationCache/timevalUtils.hpp diff --git a/storage/xxhash.c b/src/plugins/storage/xxhash.c similarity index 100% rename from storage/xxhash.c rename to src/plugins/storage/xxhash.c diff --git a/storage/xxhash.h b/src/plugins/storage/xxhash.h similarity index 100% rename from storage/xxhash.h rename to src/plugins/storage/xxhash.h From 29998fe6c5742acd663a7d9929324b658464e198 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 15:20:50 +0100 Subject: [PATCH 08/94] .clang-format - update format rules --- .clang-format | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index ba68f4877..2507b44e8 100644 --- a/.clang-format +++ b/.clang-format @@ -6,6 +6,7 @@ AlwaysBreakBeforeMultilineStrings: true AlignAfterOpenBracket: AlwaysBreak AllowAllArgumentsOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false +AllowShortIfStatementsOnASingleLine: Never AllowShortFunctionsOnASingleLine: Inline AlwaysBreakTemplateDeclarations: Yes BinPackArguments: false @@ -23,6 +24,16 @@ SpaceAfterTemplateKeyword: false SpaceInEmptyBlock: false SpacesInContainerLiterals: false PointerAlignment: Left -UseTab: false -IndentWidth: 4 +TabWidth: '4' +UseTab: ForContinuationAndIndentation + +SortIncludes: true +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^"(.*)"$' + Priority: 1 + - Regex: '^<[^>]*\.(h|hpp)>$' + Priority: 3 + - Regex: '^<.*>$' + Priority: 2 ... From 0b17c87104d1cc9df68f83ebe47b83ff87e7991a Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 15:22:46 +0100 Subject: [PATCH 09/94] .clang-tidy - add clang-tidy configuration --- .clang-tidy | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..b06611ac6 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,75 @@ +--- +Checks: ' + -*, + bugprone-*, + clang-analyzer-*, + clang-diagnostic-*, + concurrency-mt-unsafe, + cppcoreguidelines-no-malloc, + misc-*, + modernize-*, + performance-*, + readability-*, + -misc-include-cleaner, + -misc-new-delete-overloads, + -misc-no-recursion, + -misc-use-anonymous-namespace, + -modernize-use-trailing-return-type, + -modernize-use-nodiscard, + -modernize-avoid-c-arrays, + -bugprone-easily-swappable-parameters, + -bugprone-multi-level-implicit-pointer-conversion, + -performance-enum-size, + -readability-avoid-nested-conditional-operator' +FormatStyle: file +WarningsAsErrors: '*' + +CheckOptions: + - key: readability-identifier-naming.ClassCase + value: 'CamelCase' + - key: readability-identifier-naming.ClassConstantCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.ClassMemberCase + value: 'camelBack' + - key: readability-identifier-naming.ClassMemberPrefix + value: 's_' + - key: readability-identifier-naming.ClassMethodCase + value: 'camelBack' + - key: readability-identifier-naming.ConstantMemberCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.EnumConstantCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.FunctionCase + value: 'camelBack' + - key: readability-identifier-naming.GlobalVariablePrefix + value: 'g_' + - key: readability-identifier-naming.GlobalConstantPrefix + value: '' + - key: readability-identifier-naming.MacroDefinitionCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.MemberCase + value: 'camelBack' + - key: readability-identifier-naming.NamespaceCase + value: 'lower_case' + - key: readability-identifier-naming.ParameterCase + value: 'camelBack' + - key: readability-identifier-naming.PrivateMemberPrefix + value: 'm_' + - key: readability-identifier-naming.ProtectedMemberPrefix + value: 'm_' + - key: readability-identifier-naming.StructCase + value: 'CamelCase' + - key: readability-identifier-naming.TypeAliasCase + value: 'CamelCase' + - key: readability-identifier-naming.TypeAliasIgnoredRegexp + value: '^.*_type$|^.*_category$|^.*reference$|^.*iterator$|^.*pointer$' + - key: readability-identifier-naming.VariableCase + value: 'camelBack' + + - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: True + - key: readability-magic-numbers.IgnorePowersOf2IntegerValues + value: True + - key: readability-magic-numbers.IgnoredIntegerValues + value: '0;1;2;3;4;255;65535;4294967295' +... From dcbfb0eb3235af1aeb157df188b5aaaae3aacaea Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:07:54 +0100 Subject: [PATCH 10/94] CMake - introduce initial build configuration --- CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++ cmake/build_type.cmake | 11 +++++++++++ cmake/dependencies.cmake | 1 + cmake/installation.cmake | 37 +++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 6 ++++++ src/buildConfig.hpp.in | 15 +++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake/build_type.cmake create mode 100644 cmake/dependencies.cmake create mode 100644 cmake/installation.cmake create mode 100644 src/CMakeLists.txt create mode 100644 src/buildConfig.hpp.in diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..85e30ac75 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.22) + +set(VERSION_MAJOR 5) +set(VERSION_MINOR 0) +set(VERSION_PATCH 0) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + +project(ipfixprobe VERSION ${VERSION} LANGUAGES CXX C) + +include(cmake/build_type.cmake) +include(cmake/installation.cmake) +include(cmake/dependencies.cmake) + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS ON) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS ON) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -ggdb3") + + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb3") + +add_subdirectory(src) diff --git a/cmake/build_type.cmake b/cmake/build_type.cmake new file mode 100644 index 000000000..235e2ce30 --- /dev/null +++ b/cmake/build_type.cmake @@ -0,0 +1,11 @@ +# Define default build type and supported options. +set(DEFAULT_BUILD_TYPE "Release") + +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS + "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.") + set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE} + CACHE STRING "build type" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake new file mode 100644 index 000000000..30748857f --- /dev/null +++ b/cmake/dependencies.cmake @@ -0,0 +1 @@ +# Project dependencies diff --git a/cmake/installation.cmake b/cmake/installation.cmake new file mode 100644 index 000000000..740ceb353 --- /dev/null +++ b/cmake/installation.cmake @@ -0,0 +1,37 @@ +# The purpose of this file is to automatically determine install directories. +# +# If no directories are defined, use GNU install directories by default. +# However, in case of RPM build, install directories are typically passed +# to CMake as definitions that overwrites the default paths. +# + +include(GNUInstallDirs) + +set(INSTALL_DIR_BIN ${CMAKE_INSTALL_FULL_BINDIR}) + +if (DEFINED LIB_INSTALL_DIR) + set(INSTALL_DIR_LIB ${LIB_INSTALL_DIR}) +else() + set(INSTALL_DIR_LIB ${CMAKE_INSTALL_FULL_LIBDIR}) +endif() + +if (DEFINED INCLUDE_INSTALL_DIR) + set(INSTALL_DIR_INCLUDE ${INCLUDE_INSTALL_DIR}) +else() + set(INSTALL_DIR_INCLUDE ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +endif() + +if (DEFINED SYSCONF_INSTALL_DIR) + set(INSTALL_DIR_SYSCONF ${SYSCONF_INSTALL_DIR}) +else() + set(INSTALL_DIR_SYSCONF ${CMAKE_INSTALL_FULL_SYSCONFDIR}) +endif() + +if (DEFINED SHARE_INSTALL_PREFIX) + set(INSTALL_DIR_SHARE ${SHARE_INSTALL_PREFIX}) +else() + set(INSTALL_DIR_SHARE ${CMAKE_INSTALL_FULL_DATAROOTDIR}) +endif() + +set(INSTALL_DIR_MAN "${INSTALL_DIR_SHARE}/man/") +set(INSTALL_DIR_DOC "${INSTALL_DIR_SHARE}/doc/${CMAKE_PROJECT_NAME}/") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..2ee4108de --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(core) + +configure_file( + ${CMAKE_SOURCE_DIR}/src/buildConfig.hpp.in + ${CMAKE_BINARY_DIR}/src/buildConfig.hpp +) diff --git a/src/buildConfig.hpp.in b/src/buildConfig.hpp.in new file mode 100644 index 000000000..a287f6559 --- /dev/null +++ b/src/buildConfig.hpp.in @@ -0,0 +1,15 @@ +/** + * @file + * @brief Build configuration + * @author Pavel Siska + * @date 2025 + * + * Copyright (c) 2025 CESNET + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#pragma once + +#define IPXP_APP_NAME "ipfixprobe" +#define IPXP_APP_VERSION "@VERSION@" From 83891be084a0b9116362a568285f27a70e548ea9 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:09:37 +0100 Subject: [PATCH 11/94] Remove #include --- include/ipfixprobe/flowifc.hpp | 1 - src/{plugins/input => core}/input.cpp | 0 src/core/ipfixprobe.cpp | 7 ++++--- src/core/ipfixprobe.hpp | 1 - src/core/ipfixprobe_stats.cpp | 3 +-- src/core/stacktrace.cpp | 5 +++-- src/core/stats.cpp | 3 +-- src/plugins/input/dpdk-ring.h | 1 - src/plugins/input/dpdk.h | 1 - src/plugins/input/parser.cpp | 1 - src/plugins/input/raw.cpp | 1 - src/plugins/input/raw.hpp | 1 - src/plugins/input/stem.cpp | 1 - src/plugins/input/stem.hpp | 1 - src/plugins/output/ipfix.cpp | 1 - src/plugins/output/text.cpp | 1 - src/plugins/output/text.hpp | 1 - src/plugins/output/unirec.cpp | 1 - src/plugins/output/unirec.hpp | 1 - src/plugins/process/http.hpp | 1 - src/plugins/process/passivedns.hpp | 1 - src/plugins/process/sip.hpp | 1 - 22 files changed, 9 insertions(+), 26 deletions(-) rename src/{plugins/input => core}/input.cpp (100%) diff --git a/include/ipfixprobe/flowifc.hpp b/include/ipfixprobe/flowifc.hpp index 2014f9a27..4d8a729eb 100644 --- a/include/ipfixprobe/flowifc.hpp +++ b/include/ipfixprobe/flowifc.hpp @@ -34,7 +34,6 @@ /* Interface between flow cache and flow exporter. */ -#include #include #include #include diff --git a/src/plugins/input/input.cpp b/src/core/input.cpp similarity index 100% rename from src/plugins/input/input.cpp rename to src/core/input.cpp diff --git a/src/core/ipfixprobe.cpp b/src/core/ipfixprobe.cpp index 1c4ce6c33..0a71b3b63 100644 --- a/src/core/ipfixprobe.cpp +++ b/src/core/ipfixprobe.cpp @@ -26,7 +26,8 @@ * */ -#include +#include "buildConfig.hpp" + #include #include #include @@ -641,14 +642,14 @@ int run(int argc, char *argv[]) if (parser.m_help) { if (parser.m_help_str.empty()) { - parser.usage(std::cout, 0, PACKAGE_NAME); + parser.usage(std::cout, 0, IPXP_APP_NAME); } else { print_help(conf, parser.m_help_str); } goto EXIT; } if (parser.m_version) { - std::cout << PACKAGE_VERSION << std::endl; + std::cout << IPXP_APP_VERSION << std::endl; goto EXIT; } if (parser.m_storage.size() > 1 || parser.m_output.size() > 1) { diff --git a/src/core/ipfixprobe.hpp b/src/core/ipfixprobe.hpp index 2ec7a7c4d..2b066f8f9 100644 --- a/src/core/ipfixprobe.hpp +++ b/src/core/ipfixprobe.hpp @@ -29,7 +29,6 @@ #ifndef IPXP_IPFIXPROBE_HPP #define IPXP_IPFIXPROBE_HPP -#include #include #include #include diff --git a/src/core/ipfixprobe_stats.cpp b/src/core/ipfixprobe_stats.cpp index 5f4db6a12..ecb5d0779 100644 --- a/src/core/ipfixprobe_stats.cpp +++ b/src/core/ipfixprobe_stats.cpp @@ -26,7 +26,6 @@ * */ -#include #include #include #include @@ -100,7 +99,7 @@ int main(int argc, char *argv[]) goto EXIT; } - path = DEFAULTSOCKETDIR "/ipfixprobe_" + std::to_string(parser.m_pid) + ".sock"; + path = "/tmp/ipfixprobe_" + std::to_string(parser.m_pid) + ".sock"; fd = connect_to_exporter(path.c_str()); if (fd == -1) { error("connecting to exporter"); diff --git a/src/core/stacktrace.cpp b/src/core/stacktrace.cpp index d655f98ce..e9dd968e1 100644 --- a/src/core/stacktrace.cpp +++ b/src/core/stacktrace.cpp @@ -26,7 +26,8 @@ * */ -#include +#include "buildConfig.hpp" + #include #include #include @@ -133,7 +134,7 @@ void st_dump(int fd, int sig) unw_getcontext(&ctx); unw_init_local(&cursor, &ctx); - st_write_str(fd, "stacktrace dump of " PACKAGE_NAME " " PACKAGE_VERSION "\n"); + st_write_str(fd, "stacktrace dump of " IPXP_APP_NAME " " IPXP_APP_VERSION "\n"); st_write_str(fd, "uid: "); st_write_num(fd, getuid()); st_write_str(fd, " pid: "); diff --git a/src/core/stats.cpp b/src/core/stats.cpp index c6b7cf148..1f641a7dc 100644 --- a/src/core/stats.cpp +++ b/src/core/stats.cpp @@ -26,7 +26,6 @@ * */ -#include #include #include @@ -144,7 +143,7 @@ int send_data(int fd, uint32_t size, void *data) std::string create_sockpath(const char *id) { - return DEFAULTSOCKETDIR "/ipfixprobe_" + std::string(id) + ".sock"; + return "/tmp/ipfixprobe_" + std::string(id) + ".sock"; } } diff --git a/src/plugins/input/dpdk-ring.h b/src/plugins/input/dpdk-ring.h index 68dd9fafa..7b7d51349 100644 --- a/src/plugins/input/dpdk-ring.h +++ b/src/plugins/input/dpdk-ring.h @@ -23,7 +23,6 @@ * software without specific prior written permission. * */ -#include #ifdef WITH_DPDK #ifndef IPXP_DPDK_RING_READER_H diff --git a/src/plugins/input/dpdk.h b/src/plugins/input/dpdk.h index d8d297520..28868a389 100644 --- a/src/plugins/input/dpdk.h +++ b/src/plugins/input/dpdk.h @@ -23,7 +23,6 @@ * software without specific prior written permission. */ -#include #ifdef WITH_DPDK diff --git a/src/plugins/input/parser.cpp b/src/plugins/input/parser.cpp index 1b6fd23a6..5ba43e6fa 100644 --- a/src/plugins/input/parser.cpp +++ b/src/plugins/input/parser.cpp @@ -26,7 +26,6 @@ * */ -#include #include #include #include diff --git a/src/plugins/input/raw.cpp b/src/plugins/input/raw.cpp index c842e5832..fd40a864a 100644 --- a/src/plugins/input/raw.cpp +++ b/src/plugins/input/raw.cpp @@ -27,7 +27,6 @@ * */ -#include #include #include #include diff --git a/src/plugins/input/raw.hpp b/src/plugins/input/raw.hpp index cd4b785f9..722abd183 100644 --- a/src/plugins/input/raw.hpp +++ b/src/plugins/input/raw.hpp @@ -29,7 +29,6 @@ #ifndef IPXP_INPUT_RAW_HPP #define IPXP_INPUT_RAW_HPP -#include #include #include diff --git a/src/plugins/input/stem.cpp b/src/plugins/input/stem.cpp index 7ae6f814b..31637ecce 100644 --- a/src/plugins/input/stem.cpp +++ b/src/plugins/input/stem.cpp @@ -26,7 +26,6 @@ * */ -#include #include #include diff --git a/src/plugins/input/stem.hpp b/src/plugins/input/stem.hpp index 8e5385315..4cfa0f091 100644 --- a/src/plugins/input/stem.hpp +++ b/src/plugins/input/stem.hpp @@ -29,7 +29,6 @@ #ifndef IPXP_INPUT_STEM_HPP #define IPXP_INPUT_STEM_HPP -#include #include #include diff --git a/src/plugins/output/ipfix.cpp b/src/plugins/output/ipfix.cpp index aefef4cdd..8321c105b 100644 --- a/src/plugins/output/ipfix.cpp +++ b/src/plugins/output/ipfix.cpp @@ -36,7 +36,6 @@ * if advised of the possibility of such damage. */ -#include #include #include #include diff --git a/src/plugins/output/text.cpp b/src/plugins/output/text.cpp index 2854309f8..164f4b03c 100644 --- a/src/plugins/output/text.cpp +++ b/src/plugins/output/text.cpp @@ -26,7 +26,6 @@ * */ -#include #include #include diff --git a/src/plugins/output/text.hpp b/src/plugins/output/text.hpp index 179246289..8e8f89f25 100644 --- a/src/plugins/output/text.hpp +++ b/src/plugins/output/text.hpp @@ -29,7 +29,6 @@ #ifndef IPXP_OUTPUT_TEXT_HPP #define IPXP_OUTPUT_TEXT_HPP -#include #include diff --git a/src/plugins/output/unirec.cpp b/src/plugins/output/unirec.cpp index 775f70678..ad802cc74 100644 --- a/src/plugins/output/unirec.cpp +++ b/src/plugins/output/unirec.cpp @@ -29,7 +29,6 @@ * */ -#include #ifdef WITH_NEMEA diff --git a/src/plugins/output/unirec.hpp b/src/plugins/output/unirec.hpp index e7ec7abb5..97dc00efa 100644 --- a/src/plugins/output/unirec.hpp +++ b/src/plugins/output/unirec.hpp @@ -32,7 +32,6 @@ #ifndef IPXP_OUTPUT_UNIREC_HPP #define IPXP_OUTPUT_UNIREC_HPP -#include #ifdef WITH_NEMEA diff --git a/src/plugins/process/http.hpp b/src/plugins/process/http.hpp index afd570d93..ff67213fc 100644 --- a/src/plugins/process/http.hpp +++ b/src/plugins/process/http.hpp @@ -30,7 +30,6 @@ #ifndef IPXP_PROCESS_HTTP_HPP #define IPXP_PROCESS_HTTP_HPP -#include #include #include #include diff --git a/src/plugins/process/passivedns.hpp b/src/plugins/process/passivedns.hpp index f9cdd5e2f..e28ec828e 100644 --- a/src/plugins/process/passivedns.hpp +++ b/src/plugins/process/passivedns.hpp @@ -29,7 +29,6 @@ #ifndef IPXP_PROCESS_PASSIVEDNS_HPP #define IPXP_PROCESS_PASSIVEDNS_HPP -#include #include #include diff --git a/src/plugins/process/sip.hpp b/src/plugins/process/sip.hpp index 7ab979121..83c03f165 100644 --- a/src/plugins/process/sip.hpp +++ b/src/plugins/process/sip.hpp @@ -28,7 +28,6 @@ #ifndef IPXP_PROCESS_SIP_HPP #define IPXP_PROCESS_SIP_HPP -#include #include #include From 38fa9765115b6d8a08a3d3a2d73089e471dab208 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:19:19 +0100 Subject: [PATCH 12/94] CMake - introduce directory for external libraries --- CMakeLists.txt | 4 +++- external/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 external/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 85e30ac75..4c9dc55ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ project(ipfixprobe VERSION ${VERSION} LANGUAGES CXX C) include(cmake/build_type.cmake) include(cmake/installation.cmake) -include(cmake/dependencies.cmake) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) @@ -32,4 +31,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb3") +include(cmake/dependencies.cmake) + +add_subdirectory(external) add_subdirectory(src) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 000000000..32497afd2 --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,4 @@ +include(FetchContent) +include(ExternalProject) + +set(FETCHCONTENT_QUIET OFF) From cb72a62ff57f30e58ae53580855b6d9f2d0da8ac Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:38:23 +0100 Subject: [PATCH 13/94] CMake - introduce telemetry library --- external/CMakeLists.txt | 2 ++ external/telemetry.cmake | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 external/telemetry.cmake diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 32497afd2..13374a676 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -2,3 +2,5 @@ include(FetchContent) include(ExternalProject) set(FETCHCONTENT_QUIET OFF) + +include(telemetry.cmake) diff --git a/external/telemetry.cmake b/external/telemetry.cmake new file mode 100644 index 000000000..5ae7321b8 --- /dev/null +++ b/external/telemetry.cmake @@ -0,0 +1,26 @@ +# Telemetry library (C++ library for telemetry data collection with Fuse integration) +# +# The Telemetry library consists of two libraries that can be added as dependency: +# +# - telemetry::telemetry (C++ library for telemetry data collection) +# - telemetry::appFs (C++ library that expose telemetry data as a Fuse filesystem) + +set(TELEMETRY_BUILD_SHARED OFF) +set(TELEMETRY_INSTALL_TARGETS OFF) +set(TELEMETRY_PACKAGE_BUILDER OFF) +set(TELEMETRY_ENABLE_TESTS OFF) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set(GIT_REPO https://github.com/CESNET/telemetry.git) + +FetchContent_Declare( + telemetry + GIT_REPOSITORY ${GIT_REPO} + GIT_TAG v1.1.0 +) + +# Make sure that subproject accepts predefined build options without warnings. +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + +FetchContent_MakeAvailable(telemetry) From fc2aa56e9b71419d802ecef614d54d9942310443 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:50:59 +0100 Subject: [PATCH 14/94] CMake - introduce dependency on libatomic --- cmake/dependencies.cmake | 4 ++++ cmake/modules/FindAtomic.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 cmake/modules/FindAtomic.cmake diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 30748857f..4fb32df21 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -1 +1,5 @@ # Project dependencies +find_package(PkgConfig REQUIRED) + +find_package(Threads REQUIRED) +find_package(Atomic REQUIRED) diff --git a/cmake/modules/FindAtomic.cmake b/cmake/modules/FindAtomic.cmake new file mode 100644 index 000000000..0f4018d65 --- /dev/null +++ b/cmake/modules/FindAtomic.cmake @@ -0,0 +1,29 @@ +# Try to find libatomic +# Once done, this will define +# +# ATOMIC_FOUND - system has libatomic +# ATOMIC_LIBRARIES - libraries needed to use libatomic +# + +find_library(ATOMIC_LIBRARY + NAMES atomic libatomic.so.1 + HINTS ${ATOMIC_ROOT} + ${CMAKE_INSTALL_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args (Atomic + REQUIRED_VARS ATOMIC_LIBRARY +) + +if (ATOMIC_FOUND AND NOT TARGET atomic::atomic) + add_library(atomic::atomic STATIC IMPORTED) + set_target_properties(atomic::atomic PROPERTIES + IMPORTED_LOCATION "${ATOMIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${ATOMIC_INCLUDE_DIR}") + target_compile_definitions(atomic::atomic INTERFACE UNWIND_FOUND) +else() + message(CRITICAL "Notice: atomic not found") + add_library(atomic::atomic INTERFACE IMPORTED) +endif() + +unset(ATOMIC_LIBRARY) From b83c324e8dc22a7a767d98b7edcc32f96ac040eb Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:51:29 +0100 Subject: [PATCH 15/94] CMake - introduce dependency on libunwind --- cmake/dependencies.cmake | 1 + cmake/modules/FindUnwind.cmake | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 cmake/modules/FindUnwind.cmake diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 4fb32df21..0759af114 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -3,3 +3,4 @@ find_package(PkgConfig REQUIRED) find_package(Threads REQUIRED) find_package(Atomic REQUIRED) +find_package(Unwind REQUIRED) diff --git a/cmake/modules/FindUnwind.cmake b/cmake/modules/FindUnwind.cmake new file mode 100644 index 000000000..073d3ed0d --- /dev/null +++ b/cmake/modules/FindUnwind.cmake @@ -0,0 +1,45 @@ +# Find unwind library +# Once done this will define +# +# UNWIND_FOUND - system has libunwind +# unwind::unwind - cmake target + +find_package(PkgConfig QUIET) +if (PKG_CONFIG_FOUND) + pkg_check_modules(PC_UNWIND QUIET libunwind) +endif() + +find_path (UNWIND_INCLUDE_DIR + NAMES unwind.h libunwind.h + HINTS ${UNWIND_ROOT} ${PC_UNWIND_INCLUDEDIR} ${PC_UNWIND_INCLUDE_DIRS} + PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} +) + +find_library (UNWIND_LIBRARY + NAMES unwind + HINTS ${UNWIND_ROOT} ${PC_UNWIND_LIBDIR} ${PC_UNWIND_LIBRARY_DIRS} + PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} +) + +mark_as_advanced (UNWIND_INCLUDE_DIR UNWIND_LIBRARY) + +include (FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set Unwind_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args (Unwind + REQUIRED_VARS UNWIND_INCLUDE_DIR UNWIND_LIBRARY +) + +if (UNWIND_FOUND AND NOT TARGET unwind::unwind) + add_library(unwind::unwind STATIC IMPORTED) + set_target_properties(unwind::unwind PROPERTIES + IMPORTED_LOCATION "${UNWIND_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${UNWIND_INCLUDE_DIR}") + target_compile_definitions(unwind::unwind INTERFACE UNWIND_FOUND) +else() + message(WARNING "Notice: UNWIND not found, no unwind support") + add_library(unwind::unwind INTERFACE IMPORTED) +endif() + +unset(UNWIND_INCLUDE_DIR) +unset(UNWIND_LIBRARY) From b75d5675aaf6d104816260813c351314a756ecbb Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 16:53:31 +0100 Subject: [PATCH 16/94] CMake - introduce CMakeLists for ipfixprobe core --- src/core/CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/core/CMakeLists.txt diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 000000000..0a9544337 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,47 @@ +add_library(ipfixprobe-core STATIC + ipfixprobe.cpp + ipfixprobe.hpp + options.cpp + pluginmgr.cpp + pluginmgr.hpp + ring.c + stacktrace.cpp + stacktrace.hpp + stats.cpp + stats.hpp + utils.cpp + workers.cpp + workers.hpp + input.cpp +) + + +target_include_directories(ipfixprobe-core PUBLIC + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/src +) + +target_compile_options(ipfixprobe-core PRIVATE -fPIC) + +set(CORE_LIB -Wl,--whole-archive ipfixprobe-core -Wl,--no-whole-archive) + +target_link_libraries(ipfixprobe-core + pthread + telemetry::telemetry + telemetry::appFs + atomic::atomic + unwind::unwind + ${CMAKE_DL_LIBS} +) + +add_executable(ipfixprobe main.cpp) +target_link_libraries(ipfixprobe ${CORE_LIB}) +target_link_options(ipfixprobe PRIVATE -Wl,--export-dynamic) + +set_target_properties( + ipfixprobe PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN YES +) + +install(TARGETS ipfixprobe DESTINATION "${INSTALL_DIR_BIN}") From c6020c853031882af06ac3b23e8ac896da1ea5bd Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 17:16:05 +0100 Subject: [PATCH 17/94] ipfixprobe - remove input benchmark plugin --- src/plugins/input/benchmark.cpp | 216 -------------------------------- src/plugins/input/benchmark.hpp | 126 ------------------- 2 files changed, 342 deletions(-) delete mode 100644 src/plugins/input/benchmark.cpp delete mode 100644 src/plugins/input/benchmark.hpp diff --git a/src/plugins/input/benchmark.cpp b/src/plugins/input/benchmark.cpp deleted file mode 100644 index 4ee9b9fdf..000000000 --- a/src/plugins/input/benchmark.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/** - * \file benchmark.cpp - * \brief Plugin for generating packets - * \author Jiri Havranek - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#include -#include -#include -#include - -#include "benchmark.hpp" -#include -#include -#include - -namespace ipxp { - -__attribute__((constructor)) static void register_this_plugin() -{ - static PluginRecord rec = PluginRecord("benchmark", [](){return new Benchmark();}); - register_plugin(&rec); -} - -Benchmark::Benchmark() - : m_generatePacketFunc(nullptr), m_flowMode(BenchmarkMode::FLOW_1), m_maxDuration(BENCHMARK_DEFAULT_DURATION), m_maxPktCnt(BENCHMARK_DEFAULT_PKT_CNT), - m_packetSizeFrom(BENCHMARK_DEFAULT_SIZE_FROM), m_packetSizeTo(BENCHMARK_DEFAULT_SIZE_TO), m_firstTs({0}), m_currentTs({0}), m_pktCnt(0) -{ -} - -Benchmark::~Benchmark() -{ - close(); -} - -void Benchmark::init(const char *params) -{ - BenchmarkOptParser parser; - try { - parser.parse(params); - } catch (ParserError &e) { - throw PluginError(e.what()); - } - - if (parser.m_mode == "1f") { - generatePacket(&m_pkt); - m_flowMode = BenchmarkMode::FLOW_1; - m_generatePacketFunc = &Benchmark::generatePacketFlow1; - } else if (parser.m_mode == "nf") { - m_flowMode = BenchmarkMode::FLOW_N; - m_generatePacketFunc = &Benchmark::generatePacketFlowN; - } else { - throw PluginError("invalid benchmark mode specified"); - } - - m_maxDuration = parser.m_duration; - m_maxPktCnt = parser.m_pkt_cnt; - m_packetSizeFrom = parser.m_pkt_size; - m_packetSizeTo = parser.m_pkt_size; - if (m_packetSizeFrom < 64) { - throw PluginError("minimal packet size is 64 bytes"); - } - - if (parser.m_seed.empty()) { - std::random_device rd; - m_rndGen = std::mt19937(rd()); - } else { - std::seed_seq seed (parser.m_seed.begin(),parser.m_seed.end()); - m_rndGen = std::mt19937(seed); - } - gettimeofday(&m_firstTs, nullptr); -} - -void Benchmark::close() -{ -} - -InputPlugin::Result Benchmark::get(PacketBlock &packets) -{ - gettimeofday(&m_currentTs, nullptr); - InputPlugin::Result res = check_constraints(); - if (res != InputPlugin::Result::PARSED) { - return res; - } - - packets.cnt = 0; - packets.bytes = 0; - for (size_t i = 0; i < packets.size; i++) { - (this->*m_generatePacketFunc)(&(packets.pkts[i])); - packets.cnt++; - packets.bytes += packets.pkts[i].packet_len_wire; - m_pktCnt++; - if (m_maxPktCnt && m_pktCnt >= m_maxPktCnt) { - break; - } - } - m_seen += packets.cnt; - m_parsed += packets.cnt; - return res; -} - -InputPlugin::Result Benchmark::check_constraints() const -{ - int tmp = m_currentTs.tv_usec - m_firstTs.tv_usec ; - uint64_t duration = m_currentTs.tv_sec - m_firstTs.tv_sec + (tmp < 0 ? -1 : 0); - - if ((m_maxPktCnt != BENCHMARK_PKT_CNT_INF && m_pktCnt >= m_maxPktCnt) || - (m_maxDuration != BENCHMARK_DURATION_INF && duration >= m_maxDuration)) { - return InputPlugin::Result::END_OF_FILE; - } - return InputPlugin::Result::PARSED; -} - -void Benchmark::swapEndpoints(Packet *pkt) -{ - std::swap(pkt->src_mac, pkt->dst_mac); - std::swap(pkt->src_ip, pkt->dst_ip); - std::swap(pkt->src_port, pkt->dst_port); -} - -void Benchmark::generatePacket(Packet *pkt) -{ - std::uniform_int_distribution distrib; - - pkt->ts = m_currentTs; - pkt->packet_len = std::uniform_int_distribution(m_packetSizeFrom, m_packetSizeTo)(m_rndGen); - pkt->packet_len_wire = pkt->packet_len; - if (distrib(m_rndGen) & 1) { - pkt->ethertype = 0x0800; - pkt->ip_version = IP::v4; - pkt->src_ip.v4 = distrib(m_rndGen); - pkt->dst_ip.v4 = distrib(m_rndGen); - } else { - pkt->ethertype = 0x86DD; - pkt->ip_version = IP::v6; - for (int i = 0; i < 4; i++) { - reinterpret_cast(pkt->src_ip.v6)[i] = distrib(m_rndGen); - reinterpret_cast(pkt->dst_ip.v6)[i] = distrib(m_rndGen); - } - } - - pkt->src_port = distrib(m_rndGen); - pkt->dst_port = distrib(m_rndGen); - if (distrib(m_rndGen) & 1) { - pkt->ip_proto = IPPROTO_TCP; - pkt->tcp_flags = 0x18; // PSH ACK - pkt->ip_payload_len = BENCHMARK_L4_SIZE_TCP; - } else { - pkt->ip_proto = IPPROTO_UDP; - pkt->tcp_flags = 0; - pkt->ip_payload_len = BENCHMARK_L4_SIZE_UDP; - } - int tmp = pkt->ip_payload_len + BENCHMARK_L2_SIZE + BENCHMARK_L3_SIZE; - - pkt->payload_len = std::uniform_int_distribution(m_packetSizeFrom - tmp, m_packetSizeTo - tmp)(m_rndGen); - pkt->ip_payload_len += pkt->payload_len; - pkt->ip_len = pkt->ip_payload_len + BENCHMARK_L3_SIZE; - pkt->packet_len = pkt->ip_len + BENCHMARK_L2_SIZE; - - pkt->packet = pkt->buffer; - pkt->payload = pkt->packet + (pkt->packet_len - pkt->payload_len); - - static_assert(BENCHMARK_L2_SIZE + BENCHMARK_L3_SIZE + - max(BENCHMARK_L4_SIZE_TCP, BENCHMARK_L4_SIZE_UDP) <= BENCHMARK_MIN_PACKET_SIZE, "minimal packet size is too low"); -} - -void Benchmark::generatePacketFlow1(Packet *pkt) -{ - int tmp = m_pkt.packet_len - m_pkt.payload_len; // Non payload size - int newPayloadLength = std::uniform_int_distribution(m_packetSizeFrom - tmp, m_packetSizeTo - tmp)(m_rndGen); - int diff = newPayloadLength - m_pkt.payload_len; - - m_pkt.payload_len += diff; - m_pkt.payload_len_wire += diff; - m_pkt.ip_payload_len += diff; - m_pkt.ip_len += diff; - m_pkt.packet_len += diff; - m_pkt.packet_len_wire += diff; - - m_pkt.ts = m_currentTs; - swapEndpoints(&m_pkt); - - m_pkt.buffer = pkt->buffer; - m_pkt.packet = m_pkt.buffer; - m_pkt.payload = m_pkt.packet + (pkt->packet_len - pkt->payload_len); - *pkt = m_pkt; -} - -void Benchmark::generatePacketFlowN(Packet *pkt) -{ - generatePacket(pkt); -} - -} diff --git a/src/plugins/input/benchmark.hpp b/src/plugins/input/benchmark.hpp deleted file mode 100644 index dee57f4d7..000000000 --- a/src/plugins/input/benchmark.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/** - * \file benchmark.hpp - * \brief Plugin for generating packets - * \author Jiri Havranek - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ -#ifndef IPXP_INPUT_BENCHMARK_HPP -#define IPXP_INPUT_BENCHMARK_HPP - -#include -#include -#include -#include - -#include -#include -#include - -namespace ipxp { - -#define BENCHMARK_L2_SIZE 14 -#define BENCHMARK_L3_SIZE 20 -#define BENCHMARK_L4_SIZE_TCP 20 -#define BENCHMARK_L4_SIZE_UDP 8 - -#define BENCHMARK_MIN_PACKET_SIZE 64 -#define BENCHMARK_PKT_CNT_INF 0 -#define BENCHMARK_FLOW_CNT_INF 0 -#define BENCHMARK_DURATION_INF 0 - -#define BENCHMARK_DEFAULT_DURATION 10 // 10s -#define BENCHMARK_DEFAULT_FLOW_CNT BENCHMARK_FLOW_CNT_INF -#define BENCHMARK_DEFAULT_PKT_CNT BENCHMARK_PKT_CNT_INF -#define BENCHMARK_DEFAULT_SIZE_FROM 512 -#define BENCHMARK_DEFAULT_SIZE_TO 512 - -class BenchmarkOptParser : public OptionsParser -{ -public: - std::string m_mode; - std::string m_seed; - uint64_t m_duration; - uint64_t m_pkt_cnt; - uint16_t m_pkt_size; - uint64_t m_link; - - BenchmarkOptParser() : OptionsParser("benchmark", "Input plugin for various benchmarking purposes"), - m_mode("1f"), m_seed(""), m_duration(0), m_pkt_cnt(0), m_pkt_size(BENCHMARK_DEFAULT_SIZE_FROM), m_link(0) - { - register_option("m", "mode", "STR", "Benchmark mode 1f (1x N-packet flow) or nf (Nx 1-packet flow)", [this](const char *arg){m_mode = arg; return true;}, OptionFlags::RequiredArgument); - register_option("S", "seed", "STR", "String seed for random generator", [this](const char *arg){m_seed = arg; return true;}, OptionFlags::RequiredArgument); - register_option("d", "duration", "TIME", "Duration in seconds", - [this](const char *arg){try {m_duration = str2num(arg);} catch(std::invalid_argument &e) {return false;} return true;}, - OptionFlags::RequiredArgument); - register_option("p", "count", "SIZE", "Packet count", - [this](const char *arg){try {m_pkt_cnt = str2num(arg);} catch(std::invalid_argument &e) {return false;} return true;}, - OptionFlags::RequiredArgument); - register_option("s", "size", "SIZE", "Packet size", - [this](const char *arg){try {m_pkt_size = str2num(arg);} catch(std::invalid_argument &e) {return false;} return true;}, - OptionFlags::RequiredArgument); - register_option("I", "id", "NUM", "Link identifier number", - [this](const char *arg){try {m_link = str2num(arg);} catch(std::invalid_argument &e) {return false;} return true;}, - OptionFlags::RequiredArgument); - } -}; - -class Benchmark : public InputPlugin -{ -public: - enum class BenchmarkMode { - FLOW_1, /* 1x N-packet flow */ - FLOW_N /* Nx 1-packet flows */ - }; - Benchmark(); - ~Benchmark(); - void init(const char *params); - void close(); - OptionsParser *get_parser() const { return new BenchmarkOptParser(); } - std::string get_name() const { return "benchmark"; } - - InputPlugin::Result get(PacketBlock &packets); - -private: - void (Benchmark::*m_generatePacketFunc)(Packet *); - BenchmarkMode m_flowMode; - uint64_t m_maxDuration; - uint64_t m_maxPktCnt; - uint16_t m_packetSizeFrom; - uint16_t m_packetSizeTo; - - std::mt19937 m_rndGen; - Packet m_pkt; - struct timeval m_firstTs; - struct timeval m_currentTs; - uint64_t m_pktCnt; - - InputPlugin::Result check_constraints() const; - void swapEndpoints(Packet *pkt); - void generatePacket(Packet *pkt); - void generatePacketFlow1(Packet *pkt); - void generatePacketFlowN(Packet *pkt); -}; - -} -#endif /* IPXP_INPUT_BENCHMARK_HPP */ From 62c1159b28669a9b4c77f0455972815328377017 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 17:16:51 +0100 Subject: [PATCH 18/94] ipfixprobe - remove input stem plugin --- src/plugins/input/stem.cpp | 185 ------------------------------------- src/plugins/input/stem.hpp | 76 --------------- 2 files changed, 261 deletions(-) delete mode 100644 src/plugins/input/stem.cpp delete mode 100644 src/plugins/input/stem.hpp diff --git a/src/plugins/input/stem.cpp b/src/plugins/input/stem.cpp deleted file mode 100644 index 31637ecce..000000000 --- a/src/plugins/input/stem.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/** - * \file stem.cpp - * \brief Plugin for reading stem specific data from hw - * \author Jiri Havranek - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#include - -#include - -#include "stem.hpp" - -namespace ipxp { - -// Read only 1 packet into packet block -constexpr size_t STEM_PACKET_BLOCK_SIZE = 1; - -__attribute__((constructor)) static void register_this_plugin() -{ - static PluginRecord rec = PluginRecord("stem", [](){return new StemPacketReader();}); - register_plugin(&rec); -} - -StemPacketReader::StemPacketReader() : m_reader(nullptr) -{ -} - -StemPacketReader::~StemPacketReader() -{ - close(); -} - -void StemPacketReader::init(const char *params) -{ - StemOptParser parser; - try { - parser.parse(params); - } catch (ParserError &e) { - throw PluginError(e.what()); - } - - if (parser.m_dev.empty()) { - throw PluginError("specify device path"); - } - - open_dev(parser.m_dev); -} - -void StemPacketReader::close() -{ - if (m_reader != nullptr) { - delete m_reader; - m_reader = nullptr; - } -} - -void StemPacketReader::open_dev(const std::string &file) -{ - try { - m_reader = new Stem::StemInterface(file); - } catch (Stem::Exceptions::Readers::ReaderSetupError &e) { - throw PluginError(e.what()); - } -} - -bool StemPacketReader::convert(Stem::StatisticsPacket &stem_pkt, Packet &pkt) -{ - Stem::StadeHardwareData hwdata = stem_pkt.hw_data(); - if (hwdata.size() > pkt.buffer_size) { - return false; - } - - pkt.ts = {hwdata.arrived_at.sec, hwdata.arrived_at.nsec / 1000}; - - memset(pkt.dst_mac, 0, sizeof(pkt.dst_mac)); - memset(pkt.src_mac, 0, sizeof(pkt.src_mac)); - pkt.ethertype = 0; - - size_t vlan_cnt = (hwdata.vlan_0 ? 1 : 0) + (hwdata.vlan_1 ? 1 : 0); - size_t ip_offset = 14 + vlan_cnt * 4; - - pkt.ip_len = hwdata.frame_len - ip_offset; // this should be done better - pkt.ip_version = hwdata.ip_version; // Get ip version - pkt.ip_ttl = 0; - pkt.ip_proto = hwdata.protocol; - pkt.ip_tos = 0; - pkt.ip_flags = 0; - if (pkt.ip_version == IP::v4) { - pkt.src_ip.v4 = *reinterpret_cast(hwdata.src_ip.data()); - pkt.dst_ip.v4 = *reinterpret_cast(hwdata.dst_ip.data()); - pkt.ip_payload_len = pkt.ip_len - 20; - } else { - memcpy(pkt.src_ip.v6, reinterpret_cast(hwdata.src_ip.data()), 16); - memcpy(pkt.dst_ip.v6, reinterpret_cast(hwdata.dst_ip.data()), 16); - pkt.ip_payload_len = pkt.ip_len - 40; - } - - pkt.src_port = ntohs(hwdata.src_port); - pkt.dst_port = ntohs(hwdata.dst_port); - pkt.tcp_flags = hwdata.l4_flags; - pkt.tcp_window = 0; - pkt.tcp_options = 0; - pkt.tcp_mss = 0; - pkt.tcp_seq = hwdata.tcp_seq; - pkt.tcp_ack = hwdata.tcp_ack; - - auto &raw_hwdata = stem_pkt.serialized(); - uint16_t datalen = raw_hwdata->size(); - if (datalen > pkt.buffer_size) { - datalen = pkt.buffer_size; - } - memcpy(pkt.buffer, raw_hwdata->data(), datalen); - - pkt.packet = pkt.buffer; - pkt.packet_len = 0; - pkt.packet_len_wire = hwdata.frame_len; - - pkt.custom = pkt.buffer; - pkt.custom_len = hwdata.size(); - - pkt.payload = pkt.buffer + hwdata.size(); - pkt.payload_len = datalen - hwdata.size(); - if (datalen < hwdata.size()) { - pkt.payload_len = 0; - } - pkt.payload_len_wire = raw_hwdata->size() - hwdata.size(); - - return true; -} - -InputPlugin::Result StemPacketReader::get(PacketBlock &packets) -{ - packets.cnt = 0; - packets.bytes = 0; - while (packets.cnt < STEM_PACKET_BLOCK_SIZE) { - try { - auto pkt = m_reader->next_packet(); - if (!pkt.has_value()) { - if (packets.cnt) { - return Result::PARSED; - } - return Result::TIMEOUT; - } else { - Stem::StatisticsPacket spkt = std::move(pkt.value()); - bool status = convert(spkt, packets.pkts[packets.cnt]); - packets.bytes += packets.pkts[packets.cnt].packet_len_wire; - - m_seen += 1; - if (!status) { - continue; - } - packets.cnt++; - m_parsed += 1; - } - } catch (Stem::Exceptions::Readers::ReadError &e) { - throw PluginError(e.what()); - } - } - - return packets.cnt ? Result::PARSED : Result::NOT_PARSED; - } - -} diff --git a/src/plugins/input/stem.hpp b/src/plugins/input/stem.hpp deleted file mode 100644 index 4cfa0f091..000000000 --- a/src/plugins/input/stem.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/** - * \file stem.hpp - * \brief Plugin for reading stem specific data from hw - * \author Jiri Havranek - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#ifndef IPXP_INPUT_STEM_HPP -#define IPXP_INPUT_STEM_HPP - - -#include -#include -#include - -#include -#include -#include -#include - -namespace ipxp { - -class StemOptParser : public OptionsParser -{ -public: - std::string m_dev; - - StemOptParser() : OptionsParser("stem", "Input plugin for reading packets using libstem"), - m_dev("") - { - register_option("d", "dev", "PATH", "Path to a device file", [this](const char *arg){m_dev = arg; return true;}, OptionFlags::RequiredArgument); - } -}; - -class StemPacketReader : public InputPlugin -{ -public: - StemPacketReader(); - ~StemPacketReader(); - - void init(const char *params); - void close(); - OptionsParser *get_parser() const { return new StemOptParser(); } - std::string get_name() const { return "stem"; } - InputPlugin::Result get(PacketBlock &packets); - -private: - Stem::StemInterface *m_reader; - - bool convert(Stem::StatisticsPacket &stem_pkt, Packet &pkt); - void open_dev(const std::string &file); -}; - -} -#endif /* IPXP_INPUT_STEM_HPP */ From 28d3c6efecdc3803e2c3b42f0f866050c11af99e Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 17:17:42 +0100 Subject: [PATCH 19/94] ipfixprobe - remove process flexprobe plugin --- .../process/flexprobe-data-processing.cpp | 42 ---- .../process/flexprobe-data-processing.h | 105 ---------- src/plugins/process/flexprobe-data.h | 152 --------------- .../flexprobe-encryption-processing.cpp | 85 --------- .../process/flexprobe-encryption-processing.h | 180 ------------------ .../process/flexprobe-tcp-tracking.cpp | 152 --------------- src/plugins/process/flexprobe-tcp-tracking.h | 112 ----------- 7 files changed, 828 deletions(-) delete mode 100644 src/plugins/process/flexprobe-data-processing.cpp delete mode 100644 src/plugins/process/flexprobe-data-processing.h delete mode 100644 src/plugins/process/flexprobe-data.h delete mode 100644 src/plugins/process/flexprobe-encryption-processing.cpp delete mode 100644 src/plugins/process/flexprobe-encryption-processing.h delete mode 100644 src/plugins/process/flexprobe-tcp-tracking.cpp delete mode 100644 src/plugins/process/flexprobe-tcp-tracking.h diff --git a/src/plugins/process/flexprobe-data-processing.cpp b/src/plugins/process/flexprobe-data-processing.cpp deleted file mode 100644 index 56e9c2c39..000000000 --- a/src/plugins/process/flexprobe-data-processing.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * \file flexprobe-data-processing.cpp - * \brief Data processing for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#include "flexprobe-data-processing.h" - -namespace ipxp { - -int FlexprobeData::REGISTERED_ID = -1; - -__attribute__((constructor)) static void register_this_plugin() -{ - static PluginRecord rec = PluginRecord("flexprobe-data", [](){return new FlexprobeDataProcessing();}); - register_plugin(&rec); - FlexprobeData::REGISTERED_ID = register_extension(); -} - -} diff --git a/src/plugins/process/flexprobe-data-processing.h b/src/plugins/process/flexprobe-data-processing.h deleted file mode 100644 index fe022bdf2..000000000 --- a/src/plugins/process/flexprobe-data-processing.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * \file flexprobe-data-processing.h - * \brief Data processing for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ -#ifndef IPFIXPROBE_FLEXPROBE_DATA_PROCESSING_H -#define IPFIXPROBE_FLEXPROBE_DATA_PROCESSING_H - -#include - -#include -#include -#include -#include -#include "flexprobe-data.h" - -namespace ipxp { - -struct FlexprobeData : public RecordExt { - static int REGISTERED_ID; - std::array frame_signature; - std::uint8_t interface_in; - - FlexprobeData() : RecordExt(REGISTERED_ID), interface_in(0) - { - frame_signature.fill(0x0); - } - - virtual int fill_ipfix(uint8_t *buffer, int size) - { - if ((sizeof(frame_signature) + sizeof(interface_in)) > size) { - return -1; - } - std::copy(frame_signature.begin(), frame_signature.end(), buffer); - *(buffer + sizeof(frame_signature)) = interface_in; - - return frame_signature.size() + sizeof(interface_in); - } - - const char **get_ipfix_tmplt() const - { - static const char *ipfix_template[] = { - IPFIX_FLEXPROBE_DATA_TEMPLATE(IPFIX_FIELD_NAMES) - nullptr - }; - return ipfix_template; - } -}; - -class FlexprobeDataProcessing : public ProcessPlugin -{ -public: - FlexprobeDataProcessing() = default; - - void init(const char *params) {} - void close() {} - RecordExt *get_ext() const { return new FlexprobeData(); } - OptionsParser *get_parser() const { return new OptionsParser("flexprobe-data", "Parse flexprobe data (Flexprobe HW only)"); } - std::string get_name() const { return "flexprobe-data"; } - FlexprobeDataProcessing *copy() override - { - return new FlexprobeDataProcessing(*this); - } - - int post_create(Flow &rec, const Packet &pkt) override - { - if (!pkt.custom) { - return 0; - } - - if (!rec.get_extension(FlexprobeData::REGISTERED_ID)) { - auto *fd = new FlexprobeData(); - auto data_view = reinterpret_cast(pkt.custom); - std::copy(data_view->frame_signature.begin(), data_view->frame_signature.end(), fd->frame_signature.begin()); - fd->interface_in = data_view->interface_in; - rec.add_extension(fd); - } - return 0; - } -}; - -} -#endif //IPFIXPROBE_FLEXPROBE_DATA_PROCESSING_H diff --git a/src/plugins/process/flexprobe-data.h b/src/plugins/process/flexprobe-data.h deleted file mode 100644 index dc7c68b80..000000000 --- a/src/plugins/process/flexprobe-data.h +++ /dev/null @@ -1,152 +0,0 @@ -/** - * \file flexprobe-data.h - * \brief Data structures for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#ifndef IPFIXPROBE_FLEXPROBE_DATA_H -#define IPFIXPROBE_FLEXPROBE_DATA_H - -#include -#include -#include - -namespace ipxp -{ - namespace Flexprobe - { - - using FrameSignature = std::array; - using ip_type = std::array; - - struct Timestamp { - using seconds_type = std::uint32_t; - using nanoseconds_type = std::uint32_t; - using DecimalTimestamp = double; - - seconds_type sec; - nanoseconds_type nsec; - - DecimalTimestamp to_decimal() const { - return static_cast(sec) + static_cast(nsec) * 1e-9f; - } - - void reset() - { - sec = 0; - nsec = 0; - } - - void to_max() - { - sec = std::numeric_limits::max(); - nsec = std::numeric_limits::max(); - } - }; - - struct MpeData - { - std::uint16_t expected_count; - std::uint16_t difference; - }; - - struct [[gnu::packed]] EncryptionData - { - std::uint8_t encr_pattern_id; - union { - struct { - std::uint8_t match_found : 1; - std::uint8_t pm_mult_pos : 1; - std::uint8_t pm_mult_pattern : 1; - std::uint8_t reserved : 5; - } items; - std::uint8_t all; - } pm_flags; - std::uint16_t pattern_offset; - MpeData mpe_8bit; - MpeData mpe_4bit; - }; - - struct DynamicPayloadHeader { - std::uint16_t dyn_type : 4; - std::uint16_t dyn_offset : 12; - std::uint16_t dyn_length; - }; - - struct [[gnu::packed]] FlexprobeData - { - std::uint32_t flow_hash; - ip_type src_ip; - ip_type dst_ip; - std::uint16_t src_port; - std::uint16_t dst_port; - std::uint8_t l4_protocol; - std::uint8_t l4_flags; - FrameSignature frame_signature; - std::uint32_t ip_version: 4; - std::uint32_t interface_in: 4; - std::uint32_t vlan_0: 12; - std::uint32_t vlan_1: 12; - Timestamp arrival_time; - std::uint16_t packet_size; - std::uint16_t payload_size; - std::uint32_t tcp_sequence_no; - std::uint32_t tcp_acknowledge_no; - EncryptionData encr_data; - std::uint16_t dyn_item_count; - std::uint16_t dyn_payload_length; - - [[nodiscard]] - size_t static_size() const - { - return sizeof(flow_hash) - + src_ip.size() - + dst_ip.size() - + sizeof(src_port) - + sizeof(dst_port) - + sizeof(l4_protocol) - + sizeof(l4_flags) - + frame_signature.size() - + sizeof(std::uint32_t) // ip_version + interface_in + vlan_0 + vlan_1 - + sizeof(arrival_time) - + sizeof(packet_size) - + sizeof(payload_size) - + sizeof(tcp_sequence_no) - + sizeof(tcp_acknowledge_no) - + sizeof(encr_data) - + sizeof(dyn_item_count) - + sizeof(dyn_payload_length); - } - - [[nodiscard]] - size_t size() const - { - return static_size() + (dyn_item_count * sizeof(DynamicPayloadHeader)); - } - }; - } -} - -#endif //IPFIXPROBE_FLEXPROBE_DATA_H diff --git a/src/plugins/process/flexprobe-encryption-processing.cpp b/src/plugins/process/flexprobe-encryption-processing.cpp deleted file mode 100644 index 78410f3c1..000000000 --- a/src/plugins/process/flexprobe-encryption-processing.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/** - * \file flexprobe-encryption-processing.cpp - * \brief Traffic feature processing for encryption analysis for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#include "flexprobe-encryption-processing.h" -#include "flexprobe-data.h" - -namespace ipxp { - -int FlexprobeEncryptionData::REGISTERED_ID = -1; - -__attribute__((constructor)) static void register_this_plugin() -{ - static PluginRecord rec = PluginRecord("flexprobe-encrypt", [](){return new FlexprobeEncryptionProcessing();}); - register_plugin(&rec); - FlexprobeEncryptionData::REGISTERED_ID = register_extension(); -} - -int FlexprobeEncryptionProcessing::post_create(Flow& rec, const Packet& pkt) -{ - if (!rec.get_extension(FlexprobeEncryptionData::REGISTERED_ID)) { - auto ext = new FlexprobeEncryptionData(); - rec.add_extension(ext); - } - - return 0; -} - -int FlexprobeEncryptionProcessing::post_update(Flow& rec, const Packet& pkt) -{ - if (!pkt.custom) { - return 0; - } - - // convert timestamp to decimal - auto data_view = reinterpret_cast(pkt.custom); - - auto arrival = data_view->arrival_time.to_decimal(); - Flexprobe::Timestamp::DecimalTimestamp flow_end = static_cast(rec.time_last.tv_sec) + static_cast(rec.time_last.tv_usec) * 1e-6f; - auto encr_data = dynamic_cast(rec.get_extension(FlexprobeEncryptionData::REGISTERED_ID)); - auto total_packets = rec.src_packets + rec.dst_packets; - - encr_data->time_interpacket.update(arrival - flow_end, total_packets); - encr_data->payload_size.update(data_view->payload_size, total_packets); - - if (data_view->payload_size >= 256) { - encr_data->mpe8_valid_count += 1; - //TODO: update value - encr_data->mpe_8bit.update(1, encr_data->mpe8_valid_count); - } - - if (data_view->payload_size >= 16) { - encr_data->mpe4_valid_count += 1; - //TODO: update value - encr_data->mpe_4bit.update(1, encr_data->mpe4_valid_count); - } - - return 0; -} - -} diff --git a/src/plugins/process/flexprobe-encryption-processing.h b/src/plugins/process/flexprobe-encryption-processing.h deleted file mode 100644 index 056e932de..000000000 --- a/src/plugins/process/flexprobe-encryption-processing.h +++ /dev/null @@ -1,180 +0,0 @@ -/** - * \file flexprobe-encryption-processing.h - * \brief Traffic feature processing for encryption analysis for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#ifndef IPFIXPROBE_FLEXPROBE_ENCRYPTION_PROCESSING_H -#define IPFIXPROBE_FLEXPROBE_ENCRYPTION_PROCESSING_H - -#include -#include - -#include -#include -#include -#include - -#include "flexprobe-data.h" - -namespace ipxp { - -template class RtStats -{ -protected: - // helper variables for variance calculation -// T prev_average_; - T delta_sq_sum_; - - T mean_; - T variance_; - T deviation_; - - T minimum_; - T maximum_; - -public: - T mean() const { - return mean_; - } - - T variance() const { - return variance_; - } - - T deviation() const { - return deviation_; - } - - T minimum() const { - return minimum_; - } - - T maximum() const { - return maximum_; - } - -protected: - // running average - T running_average_(T next_value, std::uint64_t packets) - { -// prev_average_ = mean_; - auto p_delta = next_value - mean_; - mean_ = packets ? (next_value + static_cast((packets - 1)) * mean_) / static_cast(packets) : T(); - auto delta = next_value - mean_; - delta_sq_sum_ += p_delta * delta; - return mean_; - } - - // running variance calculated using Welford's algorithm - T running_variance_(std::uint64_t packets) - { - return (variance_ = packets ? delta_sq_sum_ / static_cast(packets) : T()), variance_; - } - - // running deviation - T comp_deviation_() - { - return deviation_ = std::sqrt(variance_), deviation_; - } - - T comp_minimum_(T next_val) { - return minimum_ = std::min(minimum_, next_val), minimum_; - } - - T comp_maximum_(T next_val) { - return maximum_ = std::max(maximum_, next_val), maximum_; - } - -public: - explicit RtStats(T init_min = std::numeric_limits::max(), T init_max = std::numeric_limits::min()) - : delta_sq_sum_(0), - mean_(0), - variance_(0), - deviation_(0), - minimum_(init_min), - maximum_(init_max) - {} - - void update(T next_val, const size_t count) - { - running_average_(next_val, count); - running_variance_(count); - comp_deviation_(); - comp_minimum_(next_val); - comp_maximum_(next_val); - } -}; - -struct FlexprobeEncryptionData : public RecordExt { - static int REGISTERED_ID; - - std::uint64_t mpe8_valid_count; - std::uint64_t mpe4_valid_count; - RtStats time_interpacket; - RtStats payload_size; - RtStats mpe_8bit; - RtStats mpe_4bit; - - FlexprobeEncryptionData() : RecordExt(REGISTERED_ID), mpe8_valid_count(), mpe4_valid_count() {} - - virtual int fill_ipfix(uint8_t *buffer, int size) - { - // TODO: fill fields in correct order - return 0; - } - - const char **get_ipfix_tmplt() const - { - static const char *ipfix_template[] = { - IPFIX_FLEXPROBE_ENCR_TEMPLATE(IPFIX_FIELD_NAMES) - nullptr - }; - return ipfix_template; - } -}; - -class FlexprobeEncryptionProcessing : public ProcessPlugin -{ -public: - FlexprobeEncryptionProcessing() = default; - - void init(const char *params) {} // TODO - void close() {} // TODO - RecordExt *get_ext() const { return new FlexprobeEncryptionData(); } - OptionsParser *get_parser() const { return new OptionsParser("flexprobe-encrypt", "Parse flexprobe data"); } - std::string get_name() const { return "flexprobe-encrypt"; } - FlexprobeEncryptionProcessing *copy() override - { - return new FlexprobeEncryptionProcessing(*this); - } - - int post_create(Flow &rec, const Packet &pkt) override; - - int post_update(Flow& rec, const Packet& pkt) override; -}; - -} -#endif //IPFIXPROBE_FLEXPROBE_ENCRYPTION_PROCESSING_H diff --git a/src/plugins/process/flexprobe-tcp-tracking.cpp b/src/plugins/process/flexprobe-tcp-tracking.cpp deleted file mode 100644 index 1c4596339..000000000 --- a/src/plugins/process/flexprobe-tcp-tracking.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/** - * \file flexprobe-tcp-tracking.cpp - * \brief TCP tracking for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ - -#include "flexprobe-tcp-tracking.h" -#include "flexprobe-data.h" - -namespace ipxp -{ - int TcpTrackingData::REGISTERED_ID = -1; - - __attribute__((constructor)) static void register_this_plugin() - { - static PluginRecord rec = PluginRecord("flexprobe-tcp", []() - { return new FlexprobeTcpTracking(); }); - register_plugin(&rec); - TcpTrackingData::REGISTERED_ID = register_extension(); - } - - std::uint32_t - FlexprobeTcpTracking::advance_expected_seq_(std::uint32_t current_seq, std::uint16_t payload_len, bool syn, - bool fin) - { - return current_seq + payload_len + (syn ? 1 : 0) + (fin ? 1 : 0); - } - - FlowState FlexprobeTcpTracking::check_(TcpTrackingData& td, std::uint32_t tcp_seq, unsigned direction) - { - FlowState fs = FlowState::OK; - - if (td.expected_seq[direction] > tcp_seq) { - if (td.tracker_state[direction] != TrackerState::INLINE) { - fs = FlowState::PACKET_LOSS; - } - td.tracker_state[direction] = TrackerState::AHEAD; - } else if (td.expected_seq[direction] < tcp_seq) { - if (td.tracker_state[direction] != TrackerState::INLINE) { - fs = FlowState::PACKET_LOSS; - } - td.tracker_state[direction] = TrackerState::BEHIND; - } else { - if (td.tracker_state[direction] == TrackerState::BEHIND) { - fs = FlowState::PACKET_LOSS; - } - - td.tracker_state[direction] = TrackerState::INLINE; - } - - return direction == 0 ? fs : FlowState::OK; - } - - int FlexprobeTcpTracking::post_create(Flow& rec, const Packet& pkt) - { - if (!pkt.custom) { - return 0; - } - - if (pkt.ip_proto != 0x6) { // track only TCP - return 0; - } - - auto data_view = reinterpret_cast(pkt.custom); - - if (!rec.get_extension(TcpTrackingData::REGISTERED_ID)) { - auto *td = new TcpTrackingData(); - - auto direction = pkt.source_pkt ? 0 : 1; - - td->expected_seq[direction] = advance_expected_seq_(pkt.tcp_seq, - data_view->payload_size, - pkt.tcp_flags & 0x2, - pkt.tcp_flags & 0x1); - direction = direction == 0 ? 1 : 0; - td->expected_seq[direction] = pkt.tcp_ack; // TODO: add to HW - rec.add_extension(td); - } - - return 0; - } - - int FlexprobeTcpTracking::post_update(Flow& rec, const Packet& pkt) - { - if (!pkt.custom) { - return 0; - } - - if (pkt.ip_proto != 0x6) { // track only TCP - return 0; - } - - auto data_view = reinterpret_cast(pkt.custom); - - auto tcp_data = dynamic_cast(rec.get_extension(TcpTrackingData::REGISTERED_ID)); - auto next_tcp = pkt.tcp_seq; - auto direction = pkt.source_pkt ? 0 : 1; - - //skip check if SYN and ACK present and dst -> src at 0) - if ((pkt.tcp_flags & 0x12) && tcp_data->expected_seq[direction] == 0) { - tcp_data->expected_seq[direction] = advance_expected_seq_(next_tcp, - data_view->payload_size, - pkt.tcp_flags & 0x2, - pkt.tcp_flags & 0x1); - return 0; - } - auto check_result = check_(*tcp_data, next_tcp, direction); - if (check_result == FlowState::PACKET_LOSS) { - tcp_data->result = TcpResult::INCOMPLETE; - } - - switch (tcp_data->tracker_state[direction]) { - case TrackerState::INLINE: - tcp_data->expected_seq[direction] = advance_expected_seq_( - tcp_data->expected_seq[direction], - data_view->payload_size, - pkt.tcp_flags & 0x2, - pkt.tcp_flags & 0x1); - break; - case TrackerState::BEHIND: - tcp_data->expected_seq[direction] = next_tcp; - break; - default: - break; - } - - return 0; - } - -} diff --git a/src/plugins/process/flexprobe-tcp-tracking.h b/src/plugins/process/flexprobe-tcp-tracking.h deleted file mode 100644 index 2bac1e1c6..000000000 --- a/src/plugins/process/flexprobe-tcp-tracking.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * \file flexprobe-tcp-tracking.h - * \brief TCP tracking for Flexprobe -- HW accelerated network probe - * \author Roman Vrana - * \date 2021 - */ -/* - * Copyright (C) 2021 CESNET - * - * LICENSE TERMS - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of the Company nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * - * - */ -#ifndef IPFIXPROBE_FLEXPROBE_TCP_TRACKING_H -#define IPFIXPROBE_FLEXPROBE_TCP_TRACKING_H - -#include -#include -#include -#include - -namespace ipxp { - -enum class TrackerState { - BEHIND, - INLINE, - AHEAD -}; - -enum class FlowState { - OK, - PACKET_LOSS -}; - -enum class TcpResult { - OK, - INCOMPLETE -}; - -struct TcpTrackingData : public RecordExt { - static int REGISTERED_ID; - - TrackerState tracker_state[2]; - TcpResult result; - std::uint32_t expected_seq[2]; - - TcpTrackingData() - : RecordExt(REGISTERED_ID), - tracker_state{TrackerState::INLINE, TrackerState::INLINE}, - result(TcpResult::OK), - expected_seq{0, 0} - {} - - virtual int fill_ipfix(uint8_t *buffer, int size) - { - if (sizeof(std::uint8_t) > size) { - return -1; - } - *buffer = std::underlying_type::type(result); - return sizeof(std::uint8_t); - } - - const char **get_ipfix_tmplt() const - { - static const char *ipfix_template[] = { - IPFIX_FLEXPROBE_TCP_TEMPLATE(IPFIX_FIELD_NAMES) - nullptr - }; - return ipfix_template; - } -}; - -class FlexprobeTcpTracking : public ProcessPlugin -{ -private: - FlowState check_(TcpTrackingData& td, std::uint32_t tcp_seq, unsigned direction); - - std::uint32_t advance_expected_seq_(std::uint32_t current_seq, std::uint16_t payload_len, bool syn, bool fin); -public: - FlexprobeTcpTracking() = default; - - void init(const char *params) {} // TODO - void close() {} // TODO - RecordExt *get_ext() const { return new TcpTrackingData(); } - OptionsParser *get_parser() const { return new OptionsParser("flexprobe-tcp", "Track TCP Sequence numbers using flexprobe format (Flexprobe HW only)"); } - std::string get_name() const { return "flexprobe-tcp"; } - FlexprobeTcpTracking *copy() override - { - return new FlexprobeTcpTracking(*this); - } - - int post_create(Flow &rec, const Packet &pkt) override; - - int post_update(Flow &rec, const Packet &pkt) override; -}; - -} -#endif //IPFIXPROBE_FLEXPROBE_TCP_TRACKING_H From 4a65d48416cb95c38b152ee7c8d5ebc727657c5a Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 17:36:35 +0100 Subject: [PATCH 20/94] ipfixprobe - introduce pluginFactory --- .../pluginFactory/pluginFactory.hpp | 170 ++++++++++++++++++ .../pluginFactory/pluginGenerator.hpp | 75 ++++++++ .../pluginFactory/pluginManifest.hpp | 63 +++++++ .../pluginFactory/pluginRegistrar.hpp | 99 ++++++++++ 4 files changed, 407 insertions(+) create mode 100644 include/ipfixprobe/pluginFactory/pluginFactory.hpp create mode 100644 include/ipfixprobe/pluginFactory/pluginGenerator.hpp create mode 100644 include/ipfixprobe/pluginFactory/pluginManifest.hpp create mode 100644 include/ipfixprobe/pluginFactory/pluginRegistrar.hpp diff --git a/include/ipfixprobe/pluginFactory/pluginFactory.hpp b/include/ipfixprobe/pluginFactory/pluginFactory.hpp new file mode 100644 index 000000000..e92a18a47 --- /dev/null +++ b/include/ipfixprobe/pluginFactory/pluginFactory.hpp @@ -0,0 +1,170 @@ +/** + * @file + * @author Pavel Siska + * + * @brief This file contains the definition of the `PluginFactory` class. The class is responsible + * for registering plugins and creating instances of those plugins via generator functions. It + * provides support for various types of object creation, including unique pointers, shared + * pointers and in-place construction. + * + * @copyright Copyright (c) 2025 CESNET, z.s.p.o. + */ + +#pragma once + +#include "pluginGenerator.hpp" +#include "pluginManifest.hpp" + +#include +#include +#include +#include +#include + +namespace ipxp { + +/** + * @brief Templated class `PluginFactory` is responsible for managing and creating plugin instances. + * + * The `PluginFactory` class provides a singleton-based interface for registering plugins + * and generating their instances. It supports creating unique and shared pointers, as well as + * objects constructed at pre-allocated memory. Each plugin is identified by a `PluginManifest`. + * + * @tparam Base The base class type that all plugins must inherit from. + * @tparam Args The types of arguments that will be passed to the plugin constructors. + */ +template +class PluginFactory { +public: + /** + * @brief Retrieves the singleton instance of `PluginFactory`. + * + * @return A reference to the singleton `PluginFactory` instance. + */ + static PluginFactory& getInstance() + { + static PluginFactory instance; + return instance; + } + + /** + * @brief Registers a plugin with the factory. + * + * This function registers a plugin by associating its manifest with its generator functions. + * The function enforces that the `Derived` type must inherit from the `Base` class. + * + * @tparam Derived The plugin type (class) that inherits from the `Base` class. + * @param manifest The manifest containing metadata about the plugin. + * + * @throw std::logic_error If `Derived` is not derived from `Base`. + */ + template + void registerPlugin(const PluginManifest& manifest) + { + static_assert(std::is_base_of::value, "Derived must be a subclass of Base"); + + m_registeredPlugins[manifest] = createGenerators(); + } + + /** + * @brief Retrieves a list of all registered plugins. + * + * @return A vector of `PluginManifest` objects representing the registered plugins. + */ + [[nodiscard]] std::vector getRegisteredPlugins() + { + std::vector registeredPlugins; + registeredPlugins.reserve(m_registeredPlugins.size()); + + for (const auto& [pluginManifest, _] : m_registeredPlugins) { + registeredPlugins.push_back(pluginManifest); + } + return registeredPlugins; + } + + /** + * @brief Creates a unique pointer to a plugin instance. + * + * @param key The key identifying the plugin (from the manifest). + * @param args The arguments passed to the plugin constructor. + * @return A unique pointer to the plugin instance. + * @throws std::runtime_error If the plugin identified by the key is not registered. + * @throws Any exception from the plugin constructor. + */ + [[nodiscard]] std::unique_ptr createUnique(std::string_view key, Args... args) const + { + const auto& generators = getGenerators(key); + return generators.uniqueGenerator(std::forward(args)...); + } + + /** + * @brief Creates a shared pointer to a plugin instance. + * + * @param key The key identifying the plugin (from the manifest). + * @param args The arguments passed to the plugin constructor. + * @return A shared pointer to the plugin instance. + * @throws std::runtime_error If the plugin identified by the key is not registered. + * @throws Any exception from the plugin constructor. + */ + [[nodiscard]] std::shared_ptr createShared(std::string_view key, Args... args) const + { + const auto& generators = getGenerators(key); + return generators.sharedGenerator(std::forward(args)...); + } + + /** + * @brief Constructs a plugin instance at a pre-allocated memory location. + * + * @param key The key identifying the plugin (from the manifest). + * @param ptr The pre-allocated memory where the instance will be constructed. + * @param args The arguments passed to the plugin constructor. + * @return A pointer to the constructed plugin instance. + * @throws std::runtime_error If the plugin identified by the key is not registered. + * @throws Any exception from the plugin constructor. + */ + [[nodiscard]] Base* constructAt(std::string_view key, void* ptr, Args... args) const + { + const auto& generators = getGenerators(key); + return generators.constructAtGenerator(ptr, std::forward(args)...); + } + +private: + PluginFactory() = default; + + using Generators = BaseGenerators; + + Generators getGenerators(std::string_view key) const + { + const auto iter = m_registeredPlugins.find(key); + if (iter == m_registeredPlugins.end()) { + throw std::runtime_error( + "PluginFactory::getGenerators() has failed. Plugin: '" + std::string(key) + + "' is not registered."); + } + + return iter->second; + } + + struct PluginManifestComparator { + using is_transparent = void; + + bool operator()(const PluginManifest& lhs, const PluginManifest& rhs) const + { + return lhs.name < rhs.name; + } + + bool operator()(const PluginManifest& lhs, std::string_view rhs) const + { + return lhs.name < rhs; + } + + bool operator()(std::string_view lhs, const PluginManifest& rhs) const + { + return lhs < rhs.name; + } + }; + + std::map m_registeredPlugins; +}; + +} // namespace ipxp \ No newline at end of file diff --git a/include/ipfixprobe/pluginFactory/pluginGenerator.hpp b/include/ipfixprobe/pluginFactory/pluginGenerator.hpp new file mode 100644 index 000000000..bc051f669 --- /dev/null +++ b/include/ipfixprobe/pluginFactory/pluginGenerator.hpp @@ -0,0 +1,75 @@ +/** + * @file + * @author Pavel Siska + * + * @brief This file contains the definition of the `BaseGenerators` struct and the + * `createGenerators` function. The `BaseGenerators` struct provides generator functions for + * creating instances of derived classes from a base class. This includes support for unique + * pointers, shared pointers and constructing at pre-allocated memory. + * + * @copyright Copyright (c) 2025 CESNET, z.s.p.o. + */ + +#pragma once + +#include +#include +#include + +namespace ipxp { + +/** + * @brief Templated struct `BaseGenerators` provides generator functions for creating instances of + * derived classes from a base class. + * + * @tparam Base The base class type. + * @tparam Args The types of arguments for the generator functions (constructor of the derived + * class). + */ +template +struct BaseGenerators { + std::function(Args...)> + uniqueGenerator; ///< Generator for unique pointer. + std::function(Args...)> + sharedGenerator; ///< Generator for shared pointer. + std::function + constructAtGenerator; ///< Generator for constructing at pre-allocated memory. +}; + +/** + * @brief Creates a set of generator functions for constructing instances of a derived class. + * + * This function generates a `BaseGenerators` instance containing three callable functions + * that create instances of the specified derived type. The generators provide: + * - A factory function returning `std::unique_ptr`. + * - A factory function returning `std::shared_ptr`. + * - A function for in-place construction using `std::construct_at`. + * + * The function ensures at compile-time that `Derived` is a subclass of `Base`. If `Derived` + * is not nothrow-constructible with `Args...`, the generator functions will not be marked + * as `noexcept`, meaning they can throw exceptions if the constructor of `Derived` fails. + * + * @tparam Base The base class type. + * @tparam Derived The derived class type (must inherit from `Base`). + * @tparam Args The types of arguments used to construct `Derived`. + * @return A `BaseGenerators` instance containing generator functions for creating `Derived` + * objects. + */ +template +static BaseGenerators createGenerators() noexcept +{ + static_assert(std::is_base_of_v, "Derived must be a subclass of Base"); + + return { + [](Args... args) noexcept(std::is_nothrow_constructible_v) { + return std::make_unique(std::forward(args)...); + }, + [](Args... args) noexcept(std::is_nothrow_constructible_v) { + return std::make_shared(std::forward(args)...); + }, + [](void* ptr, Args... args) noexcept(std::is_nothrow_constructible_v) { + return std::construct_at(static_cast(ptr), std::forward(args)...); + }}; +} + +} // namespace ipxp \ No newline at end of file diff --git a/include/ipfixprobe/pluginFactory/pluginManifest.hpp b/include/ipfixprobe/pluginFactory/pluginManifest.hpp new file mode 100644 index 000000000..a67180e86 --- /dev/null +++ b/include/ipfixprobe/pluginFactory/pluginManifest.hpp @@ -0,0 +1,63 @@ +/** + * @file + * @author Pavel Siska + * @brief Definition of the PluginManifest struct and related utilities. + * + * This file contains the definition of the PluginManifest struct, which represents + * metadata and functionalities associated with a plugin. It also defines a custom comparator for + * PluginManifest instances. + * + * @copyright Copyright (c) 2025 CESNET, z.s.p.o. + */ + +#pragma once + +#include +#include + +namespace ipxp { + +/** + * @brief Struct representing the metadata and functionalities associated with a plugin. + * + * The PluginManifest struct encapsulates important details about a plugin, such as its + * name, description, version, and the required API version. This metadata is used to + * identify and manage plugins within the system. + */ +struct PluginManifest { + std::string name; ///< Name of the plugin. + std::string description; ///< Description of the plugin. + std::string pluginVersion; ///< Version of the plugin. + std::string apiVersion; ///< Required API version. + std::function usage; ///< Function pointer to the plugin's usage. +}; + +/** + * @brief Custom less-than comparator for PluginManifest instances. + * + * This operator allows for sorting PluginManifest instances based on their name. + * + * @param lhs Left-hand side PluginManifest instance. + * @param rhs Right-hand side PluginManifest instance. + * @return True if the name of lhs is lexicographically less than the name of rhs, false otherwise. + */ +inline bool operator<(const PluginManifest& lhs, const PluginManifest& rhs) +{ + return lhs.name < rhs.name; +} + +/** + * @brief Custom equality operator for PluginManifest instances. + * + * This operator allows for comparison between two PluginManifest instances based on their name. + * + * @param lhs Left-hand side PluginManifest instance. + * @param rhs Right-hand side PluginManifest instance. + * @return True if the names of both instances are equal, false otherwise. + */ +inline bool operator==(const PluginManifest& lhs, const PluginManifest& rhs) +{ + return lhs.name == rhs.name; +} + +} // namespace ipxp \ No newline at end of file diff --git a/include/ipfixprobe/pluginFactory/pluginRegistrar.hpp b/include/ipfixprobe/pluginFactory/pluginRegistrar.hpp new file mode 100644 index 000000000..9f767c95c --- /dev/null +++ b/include/ipfixprobe/pluginFactory/pluginRegistrar.hpp @@ -0,0 +1,99 @@ +/** + * @file + * @author Pavel Siska + * + * @brief This file contains the definition of the `PluginRegistrar` struct. + * The struct is responsible for automatically registering a plugin with the `Factory`. + * It ensures that the `Derived` type is properly registered with the factory under + * the provided manifest. + * + * The `PluginRegistrar` template can be used to simplify the process of + * plugin registration. By specifying the `Derived` type and the corresponding + * `Factory`, this struct allows for easy integration of plugins into the + * factory system at runtime. + * + * @copyright Copyright (c) 2025 CESNET, z.s.p.o. + */ + +#pragma once + +#include "pluginFactory.hpp" +#include "pluginManifest.hpp" + +#include +#include + +namespace ipxp { + +/** + * @brief Templated struct `PluginRegistrar` is responsible for automatically registering + * a plugin with the specified `Factory` during construction. + * + * This struct registers a plugin with the factory at runtime. It allows for the specification of a + * `Derived` type, which must be registered under the provided `PluginManifest`. This facilitates + * the registration process, ensuring that the `Derived` class is integrated into the plugin system + * seamlessly. + * + * @tparam Derived The derived class type being registered. + * @tparam Factory The factory type responsible for managing plugins. + * + * @code + * //// basePlugin.hpp + * + * // Example of a base plugin class definition + * class BasePlugin { + * public: + * virtual void doSomething() = 0; // Pure virtual function + * }; + * + * // forward declaration of the factory type + * template + * class PluginFactory; + * + * // define the factory type + * // std::string is the type of the constructor parameter + * using BasePluginFactory = PluginFactory; + * + * //// plugin.hpp + * #include "basePlugin.hpp" + * + * class DerivedPlugin : public BasePlugin { + * public: + * // Constructor requiring a string parameter + * DerivedPlugin(const std::string& params) { + * // Initialize plugin with provided parameters + * } + * + * void doSomething() override { + * // Implementation of the plugin's functionality + * } + * }; + * + * //// plugin.cpp + * + * #include "plugin.hpp" + * #include "pluginFactoryRegistration.hpp" + * + * // Registering the plugin with the factory + * // This ensures that the required constructor exists + * static const PluginRegistrar + * derivedRegistrator(pluginManifest); + * @endcode + */ +template +struct PluginRegistrar { + /** + * @brief Constructor that automatically registers the `Derived` class with the factory. + * + * This constructor registers the `Derived` class plugin with the specified factory, + * using the provided manifest. + * + * @param manifest The manifest containing metadata about the plugin. + */ + explicit PluginRegistrar(const PluginManifest& manifest) + { + Factory::getInstance().template registerPlugin(manifest); + } +}; + +} // namespace ipxp \ No newline at end of file From 4bb1a30081c326e86a9a1b800b90ef1d3564efe0 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 17:52:38 +0100 Subject: [PATCH 21/94] Makefile - introduce initial Makefile --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..7a8526b92 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +ifeq ($(CMAKE),) +CMAKE := cmake +endif + +.PHONY: all +all: build/Makefile + @$(MAKE) --no-print-directory -C build + +%: build/Makefile + @$(MAKE) --no-print-directory -C build $@ + +build/Makefile: | build + @cd build && $(CMAKE) $(CMAKE_ARGS) .. + +build: + @mkdir -p $@ From 57a4823d06af6584e460f755ab6fb02dac011c52 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 18:00:11 +0100 Subject: [PATCH 22/94] Makefile - introduce format and tidy target --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Makefile b/Makefile index 7a8526b92..3cd4e6feb 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,22 @@ ifeq ($(CMAKE),) CMAKE := cmake endif +ifeq ($(CLANG_FORMAT),) +CLANG_FORMAT := clang-format +endif + +ifeq ($(RUN_CLANG_TIDY),) +RUN_CLANG_TIDY := run-clang-tidy +endif + + +SRC_DIR = "$(shell pwd)/src" +INC_DIR = "$(shell pwd)/include" + +SOURCE_DIR = "$(SRC_DIR)" "$(INC_DIR)" +SOURCE_REGEX = '.*\.\(cpp\|hpp\|c\|h\)' + + .PHONY: all all: build/Makefile @$(MAKE) --no-print-directory -C build @@ -14,3 +30,19 @@ build/Makefile: | build build: @mkdir -p $@ + +.PHONY: format +format: + @find $(SOURCE_DIR) -type f -regex $(SOURCE_REGEX) -print0 | xargs -0 $(CLANG_FORMAT) --dry-run --Werror + +.PHONY: format-fix +format-fix: + @find $(SOURCE_DIR) -type f -regex $(SOURCE_REGEX) -print0 | xargs -0 $(CLANG_FORMAT) -i + +.PHONY: tidy +tidy: all + $(RUN_CLANG_TIDY) -p build -quiet -j $(shell nproc) -header-filter=$(SOURCE_DIR) $(SOURCE_DIR) + +.PHONY: tidy-fix +tidy-fix: all + $(RUN_CLANG_TIDY) -p build -quiet -fix -j $(shell nproc) -header-filter=$(SOURCE_DIR) $(SOURCE_DIR) From b9434fcf870a1a4182d3b84683946e59f874e110 Mon Sep 17 00:00:00 2001 From: Pavel Siska Date: Mon, 3 Mar 2025 18:03:46 +0100 Subject: [PATCH 23/94] Reformat whole repository using clang-format --- include/ipfixprobe/byte-utils.hpp | 8 +- include/ipfixprobe/flowifc.hpp | 389 +- include/ipfixprobe/input.hpp | 56 +- include/ipfixprobe/ipaddr.hpp | 11 +- include/ipfixprobe/ipfix-basiclist.hpp | 45 +- include/ipfixprobe/ipfix-elements.hpp | 1071 ++- include/ipfixprobe/options.hpp | 88 +- include/ipfixprobe/output.hpp | 50 +- include/ipfixprobe/packet.hpp | 211 +- include/ipfixprobe/parser-stats.hpp | 20 +- include/ipfixprobe/plugin.hpp | 89 +- include/ipfixprobe/process.hpp | 112 +- include/ipfixprobe/ring.h | 25 +- include/ipfixprobe/rtp.hpp | 50 +- include/ipfixprobe/storage.hpp | 288 +- include/ipfixprobe/telemetry-utils.hpp | 20 +- include/ipfixprobe/utils.hpp | 179 +- src/core/input.cpp | 45 +- src/core/ipfixprobe.cpp | 1283 ++-- src/core/ipfixprobe.hpp | 511 +- src/core/ipfixprobe_stats.cpp | 309 +- src/core/main.cpp | 14 +- src/core/options.cpp | 338 +- src/core/pluginmgr.cpp | 184 +- src/core/pluginmgr.hpp | 52 +- src/core/ring.c | 676 +- src/core/stacktrace.cpp | 261 +- src/core/stacktrace.hpp | 2 +- src/core/stats.cpp | 203 +- src/core/stats.hpp | 52 +- src/core/utils.cpp | 138 +- src/core/workers.cpp | 372 +- src/core/workers.hpp | 63 +- src/plugins/input/dpdk-ring.cpp | 348 +- src/plugins/input/dpdk-ring.h | 224 +- src/plugins/input/dpdk.cpp | 345 +- src/plugins/input/dpdk.h | 385 +- src/plugins/input/dpdk/dpdkCompat.hpp | 80 +- src/plugins/input/dpdk/dpdkDevice.cpp | 14 +- src/plugins/input/dpdk/dpdkDevice.hpp | 13 +- src/plugins/input/dpdk/dpdkMbuf.hpp | 56 +- src/plugins/input/dpdk/dpdkPortTelemetry.cpp | 411 +- src/plugins/input/dpdk/dpdkPortTelemetry.hpp | 24 +- src/plugins/input/dpdk/dpdkTelemetry.cpp | 274 +- src/plugins/input/dpdk/dpdkTelemetry.hpp | 22 +- src/plugins/input/headers.hpp | 376 +- src/plugins/input/ndp.cpp | 135 +- src/plugins/input/ndp.hpp | 90 +- .../input/nfbCInterface/include/ndpheader.h | 14 +- .../input/nfbCInterface/include/ndpreader.h | 24 +- .../input/nfbCInterface/include/ndpreader.hpp | 65 +- src/plugins/input/nfbCInterface/ndpreader.cpp | 379 +- src/plugins/input/parser.cpp | 1204 ++-- src/plugins/input/parser.hpp | 25 +- src/plugins/input/pcap.cpp | 403 +- src/plugins/input/pcap.hpp | 148 +- src/plugins/input/raw.cpp | 566 +- src/plugins/input/raw.hpp | 170 +- src/plugins/output/ipfix-basiclist.cpp | 125 +- src/plugins/output/ipfix.cpp | 2320 +++--- src/plugins/output/ipfix.hpp | 717 +- src/plugins/output/text.cpp | 205 +- src/plugins/output/text.hpp | 77 +- src/plugins/output/unirec.cpp | 685 +- src/plugins/output/unirec.hpp | 363 +- src/plugins/process/basicplus.cpp | 89 +- src/plugins/process/basicplus.hpp | 250 +- src/plugins/process/bstats.cpp | 189 +- src/plugins/process/bstats.hpp | 422 +- src/plugins/process/common.hpp | 39 +- src/plugins/process/dns-utils.hpp | 214 +- src/plugins/process/dns.cpp | 1047 +-- src/plugins/process/dns.hpp | 289 +- src/plugins/process/dnssd.cpp | 1019 +-- src/plugins/process/dnssd.hpp | 460 +- src/plugins/process/flow_hash.cpp | 43 +- src/plugins/process/flow_hash.hpp | 118 +- src/plugins/process/http.hpp | 356 +- src/plugins/process/icmp.cpp | 40 +- src/plugins/process/icmp.hpp | 106 +- src/plugins/process/idpcontent.cpp | 75 +- src/plugins/process/idpcontent.hpp | 189 +- src/plugins/process/md5.cpp | 374 +- src/plugins/process/md5.hpp | 73 +- src/plugins/process/mpls.cpp | 33 +- src/plugins/process/mpls.hpp | 122 +- src/plugins/process/mqtt.cpp | 250 +- src/plugins/process/mqtt.hpp | 270 +- src/plugins/process/netbios.cpp | 152 +- src/plugins/process/netbios.hpp | 149 +- src/plugins/process/nettisa.cpp | 145 +- src/plugins/process/nettisa.hpp | 274 +- src/plugins/process/ntp.cpp | 670 +- src/plugins/process/ntp.hpp | 360 +- src/plugins/process/osquery.cpp | 915 +-- src/plugins/process/osquery.hpp | 884 +-- src/plugins/process/ovpn.cpp | 367 +- src/plugins/process/ovpn.hpp | 204 +- src/plugins/process/passivedns.cpp | 718 +- src/plugins/process/passivedns.hpp | 241 +- src/plugins/process/phists.cpp | 159 +- src/plugins/process/phists.hpp | 337 +- src/plugins/process/pstats.cpp | 194 +- src/plugins/process/pstats.hpp | 342 +- src/plugins/process/quic.cpp | 874 +-- src/plugins/process/quic.hpp | 720 +- src/plugins/process/quic_parser.cpp | 2352 +++--- src/plugins/process/quic_parser.hpp | 453 +- src/plugins/process/rtsp.cpp | 730 +- src/plugins/process/rtsp.hpp | 317 +- src/plugins/process/sha256.hpp | 226 +- src/plugins/process/sip.cpp | 1013 +-- src/plugins/process/sip.hpp | 589 +- src/plugins/process/smtp.cpp | 632 +- src/plugins/process/smtp.hpp | 383 +- src/plugins/process/ssadetector.cpp | 321 +- src/plugins/process/ssadetector.hpp | 205 +- src/plugins/process/ssdp.cpp | 356 +- src/plugins/process/ssdp.hpp | 280 +- src/plugins/process/stats.cpp | 136 +- src/plugins/process/stats.hpp | 98 +- src/plugins/process/tls.cpp | 541 +- src/plugins/process/tls.hpp | 320 +- src/plugins/process/tls_parser.cpp | 798 ++- src/plugins/process/tls_parser.hpp | 489 +- src/plugins/process/vlan.cpp | 27 +- src/plugins/process/vlan.hpp | 114 +- src/plugins/process/wg.cpp | 314 +- src/plugins/process/wg.hpp | 196 +- src/plugins/storage/cache.cpp | 990 +-- src/plugins/storage/cache.hpp | 414 +- .../fragmentationCache/fragmentationCache.cpp | 92 +- .../fragmentationCache/fragmentationCache.hpp | 123 +- .../fragmentationKeyData.hpp | 123 +- .../fragmentationCache/fragmentationTable.cpp | 30 +- .../fragmentationCache/fragmentationTable.hpp | 41 +- .../storage/fragmentationCache/ringBuffer.hpp | 556 +- .../fragmentationCache/timevalUtils.hpp | 24 +- src/plugins/storage/xxhash.c | 5 +- src/plugins/storage/xxhash.h | 6320 +++++++++-------- 140 files changed, 26188 insertions(+), 24694 deletions(-) diff --git a/include/ipfixprobe/byte-utils.hpp b/include/ipfixprobe/byte-utils.hpp index 34c3a94dc..61153927a 100644 --- a/include/ipfixprobe/byte-utils.hpp +++ b/include/ipfixprobe/byte-utils.hpp @@ -45,14 +45,14 @@ namespace ipxp { #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN static inline uint64_t swap_uint64(uint64_t value) { - return value; + return value; } #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN static inline uint64_t swap_uint64(uint64_t value) { - value = ((value << 8) & 0xFF00FF00FF00FF00ULL) | ((value >> 8) & 0x00FF00FF00FF00FFULL); - value = ((value << 16) & 0xFFFF0000FFFF0000ULL) | ((value >> 16) & 0x0000FFFF0000FFFFULL); - return (value << 32) | (value >> 32); + value = ((value << 8) & 0xFF00FF00FF00FF00ULL) | ((value >> 8) & 0x00FF00FF00FF00FFULL); + value = ((value << 16) & 0xFFFF0000FFFF0000ULL) | ((value >> 16) & 0x0000FFFF0000FFFFULL); + return (value << 32) | (value >> 32); } #else #error "Please fix " diff --git a/include/ipfixprobe/flowifc.hpp b/include/ipfixprobe/flowifc.hpp index 4d8a729eb..5033b1ae3 100644 --- a/include/ipfixprobe/flowifc.hpp +++ b/include/ipfixprobe/flowifc.hpp @@ -39,16 +39,19 @@ #include #ifdef WITH_NEMEA -#include #include "fields.h" + +#include #else #define UR_FIELDS(...) #endif -#include #include "ipaddr.hpp" + #include +#include + namespace ipxp { #define BASIC_PLUGIN_NAME "basic" @@ -60,215 +63,211 @@ int get_extension_cnt(); * \brief Flow record extension base struct. */ struct RecordExt { - RecordExt *m_next; /**< Pointer to next extension */ - int m_ext_id; /**< Identifier of extension. */ + RecordExt* m_next; /**< Pointer to next extension */ + int m_ext_id; /**< Identifier of extension. */ - /** - * \brief Constructor. - * \param [in] id ID of extension. - */ - RecordExt(int id) : m_next(nullptr), m_ext_id(id) - { - } + /** + * \brief Constructor. + * \param [in] id ID of extension. + */ + RecordExt(int id) + : m_next(nullptr) + , m_ext_id(id) + { + } #ifdef WITH_NEMEA - /** - * \brief Fill unirec record with stored extension data. - * \param [in] tmplt Unirec template. - * \param [out] record Pointer to the unirec record. - */ - virtual void fill_unirec(ur_template_t *tmplt, void *record) - { - } - - /** - * \brief Get unirec template string. - * \return Unirec template string. - */ - virtual const char *get_unirec_tmplt() const - { - return ""; - } + /** + * \brief Fill unirec record with stored extension data. + * \param [in] tmplt Unirec template. + * \param [out] record Pointer to the unirec record. + */ + virtual void fill_unirec(ur_template_t* tmplt, void* record) + { + (void) tmplt; + (void) record; + } + + /** + * \brief Get unirec template string. + * \return Unirec template string. + */ + virtual const char* get_unirec_tmplt() const { return ""; } #endif - /** - * \brief Fill IPFIX record with stored extension data. - * \param [out] buffer IPFIX template record buffer. - * \param [in] size IPFIX template record buffer size. - * \return Number of bytes written to buffer or -1 if data cannot be written. - */ - virtual int fill_ipfix(uint8_t *buffer, int size) - { - return 0; - } - - /** - * \brief Get ipfix string fields. - * \return Return ipfix fields array. - */ - virtual const char **get_ipfix_tmplt() const - { - return nullptr; - } - - /** - * \brief Get text representation of exported elements - * \return Return fields converted to text - */ - virtual std::string get_text() const - { - return ""; - } - - /** - * \brief Add extension at the end of linked list. - * \param [in] ext Extension to add. - */ - void add_extension(RecordExt *ext) - { - RecordExt **tmp = &m_next; - while (*tmp) { - tmp = &(*tmp)->m_next; - } - *tmp = ext; - } - - /** - * \brief Virtual destructor. - */ - virtual ~RecordExt() - { - if (m_next != nullptr) { - delete m_next; - } - } + /** + * \brief Fill IPFIX record with stored extension data. + * \param [out] buffer IPFIX template record buffer. + * \param [in] size IPFIX template record buffer size. + * \return Number of bytes written to buffer or -1 if data cannot be written. + */ + virtual int fill_ipfix(uint8_t* buffer, int size) + { + (void) buffer; + (void) size; + + return 0; + } + + /** + * \brief Get ipfix string fields. + * \return Return ipfix fields array. + */ + virtual const char** get_ipfix_tmplt() const { return nullptr; } + + /** + * \brief Get text representation of exported elements + * \return Return fields converted to text + */ + virtual std::string get_text() const { return ""; } + + /** + * \brief Add extension at the end of linked list. + * \param [in] ext Extension to add. + */ + void add_extension(RecordExt* ext) + { + RecordExt** tmp = &m_next; + while (*tmp) { + tmp = &(*tmp)->m_next; + } + *tmp = ext; + } + + /** + * \brief Virtual destructor. + */ + virtual ~RecordExt() + { + if (m_next != nullptr) { + delete m_next; + } + } }; struct Record { - RecordExt *m_exts; /**< Extension headers. */ - - /** - * \brief Add new extension header. - * \param [in] ext Pointer to the extension header. - */ - void add_extension(RecordExt* ext) - { - if (m_exts == nullptr) { - m_exts = ext; - } else { - RecordExt *ext_ptr = m_exts; - while (ext_ptr->m_next != nullptr) { - ext_ptr = ext_ptr->m_next; - } - ext_ptr->m_next = ext; - } - } - - /** - * \brief Get given extension. - * \param [in] id Type of extension. - * \return Pointer to the requested extension or nullptr if extension is not present. - */ - RecordExt *get_extension(int id) const - { - RecordExt *ext = m_exts; - while (ext != nullptr) { - if (ext->m_ext_id == id) { - return ext; - } - ext = ext->m_next; - } - return nullptr; - } - /** - * \brief Remove given extension. - * \param [in] id Type of extension. - * \return True when successfully removed - */ - bool remove_extension(int id) - { - RecordExt *ext = m_exts; - RecordExt *prev_ext = nullptr; - - while (ext != nullptr) { - if (ext->m_ext_id == id) { - if (prev_ext == nullptr) { // at beginning - m_exts = ext->m_next; - } else if (ext->m_next == nullptr) { // at end - prev_ext->m_next = nullptr; - } else { // in middle - prev_ext->m_next = ext->m_next; - } - ext->m_next = nullptr; - delete ext; - return true; - } - prev_ext = ext; - ext = ext->m_next; - } - return false; - } - - /** - * \brief Remove extension headers. - */ - void remove_extensions() - { - if (m_exts != nullptr) { - delete m_exts; - m_exts = nullptr; - } - } - - /** - * \brief Constructor. - */ - Record() : m_exts(nullptr) - { - } - - /** - * \brief Destructor. - */ - virtual ~Record() - { - remove_extensions(); - } + RecordExt* m_exts; /**< Extension headers. */ + + /** + * \brief Add new extension header. + * \param [in] ext Pointer to the extension header. + */ + void add_extension(RecordExt* ext) + { + if (m_exts == nullptr) { + m_exts = ext; + } else { + RecordExt* ext_ptr = m_exts; + while (ext_ptr->m_next != nullptr) { + ext_ptr = ext_ptr->m_next; + } + ext_ptr->m_next = ext; + } + } + + /** + * \brief Get given extension. + * \param [in] id Type of extension. + * \return Pointer to the requested extension or nullptr if extension is not present. + */ + RecordExt* get_extension(int id) const + { + RecordExt* ext = m_exts; + while (ext != nullptr) { + if (ext->m_ext_id == id) { + return ext; + } + ext = ext->m_next; + } + return nullptr; + } + /** + * \brief Remove given extension. + * \param [in] id Type of extension. + * \return True when successfully removed + */ + bool remove_extension(int id) + { + RecordExt* ext = m_exts; + RecordExt* prev_ext = nullptr; + + while (ext != nullptr) { + if (ext->m_ext_id == id) { + if (prev_ext == nullptr) { // at beginning + m_exts = ext->m_next; + } else if (ext->m_next == nullptr) { // at end + prev_ext->m_next = nullptr; + } else { // in middle + prev_ext->m_next = ext->m_next; + } + ext->m_next = nullptr; + delete ext; + return true; + } + prev_ext = ext; + ext = ext->m_next; + } + return false; + } + + /** + * \brief Remove extension headers. + */ + void remove_extensions() + { + if (m_exts != nullptr) { + delete m_exts; + m_exts = nullptr; + } + } + + /** + * \brief Constructor. + */ + Record() + : m_exts(nullptr) + { + } + + /** + * \brief Destructor. + */ + virtual ~Record() { remove_extensions(); } }; #define FLOW_END_INACTIVE 0x01 -#define FLOW_END_ACTIVE 0x02 -#define FLOW_END_EOF 0x03 -#define FLOW_END_FORCED 0x04 -#define FLOW_END_NO_RES 0x05 +#define FLOW_END_ACTIVE 0x02 +#define FLOW_END_EOF 0x03 +#define FLOW_END_FORCED 0x04 +#define FLOW_END_NO_RES 0x05 /** * \brief Flow record struct constaining basic flow record data and extension headers. */ struct Flow : public Record { - uint64_t flow_hash; - - struct timeval time_first; - struct timeval time_last; - uint64_t src_bytes; - uint64_t dst_bytes; - uint32_t src_packets; - uint32_t dst_packets; - uint8_t src_tcp_flags; - uint8_t dst_tcp_flags; - - uint8_t ip_version; - - uint8_t ip_proto; - uint16_t src_port; - uint16_t dst_port; - ipaddr_t src_ip; - ipaddr_t dst_ip; - - uint8_t src_mac[6]; - uint8_t dst_mac[6]; - uint8_t end_reason; + uint64_t flow_hash; + + struct timeval time_first; + struct timeval time_last; + uint64_t src_bytes; + uint64_t dst_bytes; + uint32_t src_packets; + uint32_t dst_packets; + uint8_t src_tcp_flags; + uint8_t dst_tcp_flags; + + uint8_t ip_version; + + uint8_t ip_proto; + uint16_t src_port; + uint16_t dst_port; + ipaddr_t src_ip; + ipaddr_t dst_ip; + + uint8_t src_mac[6]; + uint8_t dst_mac[6]; + uint8_t end_reason; }; -} +} // namespace ipxp #endif /* IPXP_FLOWIFC_HPP */ diff --git a/include/ipfixprobe/input.hpp b/include/ipfixprobe/input.hpp index aa5c09359..0ff4bca9b 100644 --- a/include/ipfixprobe/input.hpp +++ b/include/ipfixprobe/input.hpp @@ -30,54 +30,50 @@ #ifndef IPXP_INPUT_HPP #define IPXP_INPUT_HPP -#include -#include -#include - -#include "telemetry-utils.hpp" -#include "plugin.hpp" #include "packet.hpp" #include "parser-stats.hpp" +#include "plugin.hpp" +#include "telemetry-utils.hpp" + +#include +#include + +#include namespace ipxp { /** * \brief Base class for packet receivers. */ -class InputPlugin : public TelemetryUtils, public Plugin -{ +class InputPlugin + : public TelemetryUtils + , public Plugin { public: - enum class Result { - TIMEOUT = 0, - PARSED, - NOT_PARSED, - END_OF_FILE, - ERROR - }; + enum class Result { TIMEOUT = 0, PARSED, NOT_PARSED, END_OF_FILE, ERROR }; - uint64_t m_seen; - uint64_t m_parsed; - uint64_t m_dropped; + uint64_t m_seen; + uint64_t m_parsed; + uint64_t m_dropped; - InputPlugin(); - virtual ~InputPlugin() {} + InputPlugin(); + virtual ~InputPlugin() {} - virtual Result get(PacketBlock &packets) = 0; + virtual Result get(PacketBlock& packets) = 0; - void set_telemetry_dirs( - std::shared_ptr plugin_dir, - std::shared_ptr queues_dir); + void set_telemetry_dirs( + std::shared_ptr plugin_dir, + std::shared_ptr queues_dir); protected: - virtual void configure_telemetry_dirs( - std::shared_ptr plugin_dir, - std::shared_ptr queues_dir) {}; + virtual void configure_telemetry_dirs( + std::shared_ptr plugin_dir, + std::shared_ptr queues_dir) {}; - ParserStats m_parser_stats; + ParserStats m_parser_stats; private: - void create_parser_stats_telemetry(std::shared_ptr queues_dir); + void create_parser_stats_telemetry(std::shared_ptr queues_dir); }; -} +} // namespace ipxp #endif /* IPXP_INPUT_TEMPLATE_HPP */ diff --git a/include/ipfixprobe/ipaddr.hpp b/include/ipfixprobe/ipaddr.hpp index 8e11e1b94..b80f9c5f7 100644 --- a/include/ipfixprobe/ipaddr.hpp +++ b/include/ipfixprobe/ipaddr.hpp @@ -31,18 +31,15 @@ namespace ipxp { -enum IP : uint8_t { - v4 = 4, - v6 = 6 -}; +enum IP : uint8_t { v4 = 4, v6 = 6 }; /** * \brief Store IPv4 or IPv6 address. */ typedef union ipaddr_u { - uint8_t v6[16]; /**< IPv6 address. */ - uint32_t v4; /**< IPv4 address */ + uint8_t v6[16]; /**< IPv6 address. */ + uint32_t v4; /**< IPv4 address */ } ipaddr_t; -} +} // namespace ipxp #endif /* IPXP_IPADDR_HPP */ diff --git a/include/ipfixprobe/ipfix-basiclist.hpp b/include/ipfixprobe/ipfix-basiclist.hpp index 59c343bb4..b9fa1d97e 100644 --- a/include/ipfixprobe/ipfix-basiclist.hpp +++ b/include/ipfixprobe/ipfix-basiclist.hpp @@ -29,41 +29,42 @@ #ifndef IPFIXBASICLIST #define IPFIXBASICLIST -#include -#include #include + +#include #include +#include namespace ipxp { struct IpfixBasicList { public: - static const uint8_t IpfixBasicListRecordHdrSize = 12; - static const uint8_t IpfixBasicListHdrSize = 9; - static const uint8_t flag = 255; // Maximum size see rfc631; - static const uint8_t hdrSemantic = 3; - - enum ePEMNumber { - CesnetPEM = 8057, - }; + static const uint8_t IpfixBasicListRecordHdrSize = 12; + static const uint8_t IpfixBasicListHdrSize = 9; + static const uint8_t flag = 255; // Maximum size see rfc631; + static const uint8_t hdrSemantic = 3; - ePEMNumber hdrEnterpriseNum; + enum ePEMNumber { + CesnetPEM = 8057, + }; + ePEMNumber hdrEnterpriseNum; - static uint64_t Tv2Ts(timeval input); + static uint64_t Tv2Ts(timeval input); - int32_t HeaderSize(); - int32_t FillBuffer(uint8_t *buffer, uint16_t *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, int16_t *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, uint32_t *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, int32_t *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, struct timeval *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, uint8_t *values, uint16_t len, uint16_t fieldID); - int32_t FillBuffer(uint8_t *buffer, int8_t *values, uint16_t len, uint16_t fieldID); + int32_t HeaderSize(); + int32_t FillBuffer(uint8_t* buffer, uint16_t* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, int16_t* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, uint32_t* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, int32_t* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, struct timeval* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, uint8_t* values, uint16_t len, uint16_t fieldID); + int32_t FillBuffer(uint8_t* buffer, int8_t* values, uint16_t len, uint16_t fieldID); private: - int32_t FillBufferHdr(uint8_t *buffer, uint16_t length, uint16_t elementLength, uint16_t fieldID); + int32_t + FillBufferHdr(uint8_t* buffer, uint16_t length, uint16_t elementLength, uint16_t fieldID); }; -} +} // namespace ipxp #endif // ifndef IPFIXBASICLIST diff --git a/include/ipfixprobe/ipfix-elements.hpp b/include/ipfixprobe/ipfix-elements.hpp index d9f894bcf..72e31620d 100644 --- a/include/ipfixprobe/ipfix-elements.hpp +++ b/include/ipfixprobe/ipfix-elements.hpp @@ -43,7 +43,6 @@ namespace ipxp { * 4. Source memory pointer (to copy value from) */ - /** * Difference between NTP and UNIX epoch in number of seconds. */ @@ -57,7 +56,8 @@ namespace ipxp { /** * Create 64 bit NTP timestamp which consist of 32 bit seconds part and 32 bit fraction part. */ -#define MK_NTP_TS(ts) (((uint64_t) (ts.tv_sec + EPOCH_DIFF) << 32) | (uint64_t) NTP_USEC_TO_FRAC(ts.tv_usec)) +#define MK_NTP_TS(ts) \ + (((uint64_t) (ts.tv_sec + EPOCH_DIFF) << 32) | (uint64_t) NTP_USEC_TO_FRAC(ts.tv_usec)) /** * Convert FIELD to its "attributes", i.e. BYTES(FIELD) used in the source code produces @@ -67,243 +67,250 @@ namespace ipxp { #define FIELD(EN, ID, LEN, SRC) EN, ID, LEN, SRC /* The list of known IPFIX elements: */ -#define BYTES(F) F(0, 1, 8, &flow.src_bytes) -#define BYTES_REV(F) F(29305, 1, 8, &flow.dst_bytes) -#define PACKETS(F) F(0, 2, 8, (temp = (uint64_t) flow.src_packets, &temp)) -#define PACKETS_REV(F) F(29305, 2, 8, (temp = (uint64_t) flow.dst_packets, &temp)) -#define FLOW_START_MSEC(F) F(0, 152, 8, (temp = ((uint64_t) flow.time_first.tv_sec) * 1000 + (flow.time_first.tv_usec / 1000), &temp)) -#define FLOW_END_MSEC(F) F(0, 153, 8, (temp = ((uint64_t) flow.time_last.tv_sec) * 1000 + (flow.time_last.tv_usec / 1000), &temp)) -#define FLOW_START_USEC(F) F(0, 154, 8, (temp = MK_NTP_TS(flow.time_first), &temp)) -#define FLOW_END_USEC(F) F(0, 155, 8, (temp = MK_NTP_TS(flow.time_last), &temp)) -#define OBSERVATION_MSEC(F) F(0, 323, 8, nullptr) -#define INPUT_INTERFACE(F) F(0, 10, 4, &this->dir_bit_field) -#define OUTPUT_INTERFACE(F) F(0, 14, 2, nullptr) -#define FLOW_END_REASON(F) F(0, 136, 1, &flow.end_reason) -#define FLOW_ID(F) F(0, 148, 8, &flow.flow_hash) - -#define ETHERTYPE(F) F(0, 256, 2, nullptr) - -#define VLAN_ID(F) F(0, 58, 2, nullptr) - -#define L2_SRC_MAC(F) F(0, 56, 6, flow.src_mac) -#define L2_DST_MAC(F) F(0, 80, 6, flow.dst_mac) - -#define L3_PROTO(F) F(0, 60, 1, &flow.ip_version) -#define L3_IPV4_ADDR_SRC(F) F(0, 8, 4, &flow.src_ip.v4) -#define L3_IPV4_ADDR_DST(F) F(0, 12, 4, &flow.dst_ip.v4) -#define L3_IPV4_TOS(F) F(0, 5, 1, nullptr) -#define L3_IPV6_ADDR_SRC(F) F(0, 27, 16, &flow.src_ip.v6) -#define L3_IPV6_ADDR_DST(F) F(0, 28, 16, &flow.dst_ip.v6) -#define L3_IPV4_IDENTIFICATION(F) F(0, 54, 2, nullptr) -#define L3_IPV4_FRAGMENT(F) F(0, 88, 2, nullptr) -#define L3_IPV4_TTL(F) F(0, 192, 1, nullptr) -#define L3_IPV6_TTL(F) F(0, 192, 1, nullptr) -#define L3_TTL(F) F(0, 192, 1, nullptr) -#define L3_TTL_REV(F) F(29305, 192, 1, nullptr) -#define L3_FLAGS(F) F(0, 197, 1, nullptr) -#define L3_FLAGS_REV(F) F(29305, 197, 1, nullptr) - -#define L4_PROTO(F) F(0, 4, 1, &flow.ip_proto) -#define L4_TCP_FLAGS(F) F(0, 6, 1, &flow.src_tcp_flags) -#define L4_TCP_FLAGS_REV(F) F(29305, 6, 1, &flow.dst_tcp_flags) -#define L4_PORT_SRC(F) F(0, 7, 2, &flow.src_port) -#define L4_PORT_DST(F) F(0, 11, 2, &flow.dst_port) -#define L4_ICMP_TYPE_CODE(F) F(0, 32, 2, nullptr) -#define L4_TCP_WIN(F) F(0, 186, 2, nullptr) -#define L4_TCP_WIN_REV(F) F(29305, 186, 2, nullptr) -#define L4_TCP_OPTIONS(F) F(0, 209, 8, nullptr) -#define L4_TCP_OPTIONS_REV(F) F(29305, 209, 8, nullptr) - - -#define L4_TCP_MSS(F) F(8057, 900, 4, nullptr) -#define L4_TCP_MSS_REV(F) F(8057, 901, 4, nullptr) -#define L4_TCP_SYN_SIZE(F) F(8057, 902, 2, nullptr) - -#define HTTP_DOMAIN(F) F(39499, 1, -1, nullptr) -#define HTTP_REFERER(F) F(39499, 3, -1, nullptr) -#define HTTP_URI(F) F(39499, 2, -1, nullptr) -#define HTTP_CONTENT_TYPE(F) F(39499, 10, -1, nullptr) -#define HTTP_STATUS(F) F(39499, 12, 2, nullptr) -#define HTTP_USERAGENT(F) F(39499, 20, -1, nullptr) -#define HTTP_METHOD(F) F(8057, 200, -1, nullptr) -#define HTTP_SERVER(F) F(8057, 201, -1, nullptr) -#define HTTP_SET_COOKIE_NAMES(F) F(8057, 202, -1, nullptr) - -#define RTSP_METHOD(F) F(16982, 600, -1, nullptr) -#define RTSP_USERAGENT(F) F(16982, 601, -1, nullptr) -#define RTSP_URI(F) F(16982, 602, -1, nullptr) -#define RTSP_STATUS(F) F(16982, 603, 2, nullptr) -#define RTSP_CONTENT_TYPE(F) F(16982, 604, -1, nullptr) -#define RTSP_SERVER(F) F(16982, 605, -1, nullptr) - -#define DNS_RCODE(F) F(8057, 1, 1, nullptr) -#define DNS_NAME(F) F(8057, 2, -1, nullptr) -#define DNS_QTYPE(F) F(8057, 3, 2, nullptr) -#define DNS_CLASS(F) F(8057, 4, 2, nullptr) -#define DNS_RR_TTL(F) F(8057, 5, 4, nullptr) -#define DNS_RLENGTH(F) F(8057, 6, 2, nullptr) -#define DNS_RDATA(F) F(8057, 7, -1, nullptr) -#define DNS_PSIZE(F) F(8057, 8, 2, nullptr) -#define DNS_DO(F) F(8057, 9, 1, nullptr) -#define DNS_ID(F) F(8057, 10, 2, nullptr) -#define DNS_ATYPE(F) F(8057, 11, 2, nullptr) -#define DNS_ANSWERS(F) F(8057, 14, 2, nullptr) - -#define SIP_MSG_TYPE(F) F(8057, 100, 2, nullptr) -#define SIP_STATUS_CODE(F) F(8057, 101, 2, nullptr) -#define SIP_CALL_ID(F) F(8057, 102, -1, nullptr) -#define SIP_CALLING_PARTY(F) F(8057, 103, -1, nullptr) -#define SIP_CALLED_PARTY(F) F(8057, 104, -1, nullptr) -#define SIP_VIA(F) F(8057, 105, -1, nullptr) -#define SIP_USER_AGENT(F) F(8057, 106, -1, nullptr) -#define SIP_REQUEST_URI(F) F(8057, 107, -1, nullptr) -#define SIP_CSEQ(F) F(8057, 108, -1, nullptr) - -#define NTP_LEAP(F) F(8057, 18, 1, nullptr) -#define NTP_VERSION(F) F(8057, 19, 1, nullptr) -#define NTP_MODE(F) F(8057, 20, 1, nullptr) -#define NTP_STRATUM(F) F(8057, 21, 1, nullptr) -#define NTP_POLL(F) F(8057, 22, 1, nullptr) -#define NTP_PRECISION(F) F(8057, 23, 1, nullptr) -#define NTP_DELAY(F) F(8057, 24, 4, nullptr) -#define NTP_DISPERSION(F) F(8057, 25, 4, nullptr) -#define NTP_REF_ID(F) F(8057, 26, -1, nullptr) -#define NTP_REF(F) F(8057, 27, -1, nullptr) -#define NTP_ORIG(F) F(8057, 28, -1, nullptr) -#define NTP_RECV(F) F(8057, 29, -1, nullptr) -#define NTP_SENT(F) F(8057, 30, -1, nullptr) - -#define ARP_HA_FORMAT(F) F(8057, 31, 2, nullptr) -#define ARP_PA_FORMAT(F) F(8057, 32, 2, nullptr) -#define ARP_OPCODE(F) F(8057, 33, 2, nullptr) -#define ARP_SRC_HA(F) F(8057, 34, -1, nullptr) -#define ARP_SRC_PA(F) F(8057, 35, -1, nullptr) -#define ARP_DST_HA(F) F(8057, 36, -1, nullptr) -#define ARP_DST_PA(F) F(8057, 37, -1, nullptr) - -#define TLS_SNI(F) F(8057, 808, -1, nullptr) -#define TLS_VERSION(F) F(39499, 333, 2, nullptr) -#define TLS_ALPN(F) F(39499, 337, -1, nullptr) -#define TLS_JA3(F) F(39499, 357, -1, nullptr) -#define TLS_JA4(F) F(39499, 358, -1, nullptr) -#define TLS_EXT_TYPE(F) F(0, 291, -1, nullptr) -#define TLS_EXT_LEN(F) F(0, 291, -1, nullptr) - -#define SMTP_COMMANDS(F) F(8057, 810, 4, nullptr) -#define SMTP_MAIL_COUNT(F) F(8057, 811, 4, nullptr) -#define SMTP_RCPT_COUNT(F) F(8057, 812, 4, nullptr) -#define SMTP_SENDER(F) F(8057, 813, -1, nullptr) -#define SMTP_RECIPIENT(F) F(8057, 814, -1, nullptr) -#define SMTP_STATUS_CODES(F) F(8057, 815, 4, nullptr) -#define SMTP_CODE_2XX_COUNT(F) F(8057, 816, 4, nullptr) -#define SMTP_CODE_3XX_COUNT(F) F(8057, 817, 4, nullptr) -#define SMTP_CODE_4XX_COUNT(F) F(8057, 818, 4, nullptr) -#define SMTP_CODE_5XX_COUNT(F) F(8057, 819, 4, nullptr) -#define SMTP_DOMAIN(F) F(8057, 820, -1, nullptr) - -#define SSDP_LOCATION_PORT(F) F(8057, 821, 2, nullptr) -#define SSDP_SERVER(F) F(8057, 822, -1, nullptr) -#define SSDP_USER_AGENT(F) F(8057, 823, -1, nullptr) -#define SSDP_NT(F) F(8057, 824, -1, nullptr) -#define SSDP_ST(F) F(8057, 825, -1, nullptr) - -#define DNSSD_QUERIES(F) F(8057, 826, -1, nullptr) -#define DNSSD_RESPONSES(F) F(8057, 827, -1, nullptr) - -#define OVPN_CONF_LEVEL(F) F(8057, 828, 1, nullptr) -#define SSA_CONF_LEVEL(F) F(8057, 903, 1, nullptr) - -#define NB_NAME(F) F(8057, 831, -1, nullptr) -#define NB_SUFFIX(F) F(8057, 832, 1, nullptr) - - -#define IDP_CONTENT(F) F(8057, 850, -1, nullptr) -#define IDP_CONTENT_REV(F) F(8057, 851, -1, nullptr) - -#define STATS_PCKT_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1013 (uint16*) -#define STATS_PCKT_TIMESTAMPS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1014 (time*) -#define STATS_PCKT_TCPFLGS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1015 (uint8*) -#define STATS_PCKT_DIRECTIONS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1016 (int8*) - -#define SBI_BRST_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1050 (uint16*) -#define SBI_BRST_BYTES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1051 (uint16*) -#define SBI_BRST_TIME_START(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1052 (time*) -#define SBI_BRST_TIME_STOP(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1053 (time*) -#define DBI_BRST_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1054 (uint16*) -#define DBI_BRST_BYTES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1055 (uint16*) -#define DBI_BRST_TIME_START(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1056 (time*) -#define DBI_BRST_TIME_STOP(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1057 (time*) - -#define D_PHISTS_IPT(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1063 (uint32*) -#define D_PHISTS_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1062 (uint32*) -#define S_PHISTS_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1060 (uint32*) -#define S_PHISTS_IPT(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1061 (uint32*) - -#define QUIC_SNI(F) F(8057, 890, -1, nullptr) -#define QUIC_USER_AGENT(F) F(8057, 891, -1, nullptr) -#define QUIC_VERSION(F) F(8057, 892, 4, nullptr) -#define QUIC_CLIENT_VERSION(F) F(8057, 893, 4, nullptr) -#define QUIC_TOKEN_LENGTH(F) F(8057, 894, 8, nullptr) -#define QUIC_OCCID(F) F(8057, 895, -1, nullptr) -#define QUIC_OSCID(F) F(8057, 896, -1, nullptr) -#define QUIC_SCID(F) F(8057, 897, -1, nullptr) -#define QUIC_RETRY_SCID(F) F(8057, 898, -1, nullptr) -#define QUIC_MULTIPLEXED(F) F(8057, 899, 1, nullptr) -#define QUIC_ZERO_RTT(F) F(8057, 889, 1, nullptr) -#define QUIC_SERVER_PORT(F) F(8057, 887, 2, nullptr) -#define QUIC_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id888 (uint16*) -#define QUIC_CH_PARSED(F) F(8057, 886, 1, nullptr) -#define QUIC_TLS_EXT_TYPE(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id885 (uint16*) -#define QUIC_TLS_EXT_LEN(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id884 (uint16*) -#define QUIC_TLS_EXT(F) F(8057, 883, -1, nullptr) - - -#define OSQUERY_PROGRAM_NAME(F) F(8057, 852, -1, nullptr) -#define OSQUERY_USERNAME(F) F(8057, 853, -1, nullptr) -#define OSQUERY_OS_NAME(F) F(8057, 854, -1, nullptr) -#define OSQUERY_OS_MAJOR(F) F(8057, 855, 2, nullptr) -#define OSQUERY_OS_MINOR(F) F(8057, 856, 2, nullptr) -#define OSQUERY_OS_BUILD(F) F(8057, 857, -1, nullptr) -#define OSQUERY_OS_PLATFORM(F) F(8057, 858, -1, nullptr) -#define OSQUERY_OS_PLATFORM_LIKE(F) F(8057, 859, -1, nullptr) -#define OSQUERY_OS_ARCH(F) F(8057, 860, -1, nullptr) -#define OSQUERY_KERNEL_VERSION(F) F(8057, 861, -1, nullptr) -#define OSQUERY_SYSTEM_HOSTNAME(F) F(8057, 862, -1, nullptr) +#define BYTES(F) F(0, 1, 8, &flow.src_bytes) +#define BYTES_REV(F) F(29305, 1, 8, &flow.dst_bytes) +#define PACKETS(F) F(0, 2, 8, (temp = (uint64_t) flow.src_packets, &temp)) +#define PACKETS_REV(F) F(29305, 2, 8, (temp = (uint64_t) flow.dst_packets, &temp)) +#define FLOW_START_MSEC(F) \ + F(0, \ + 152, \ + 8, \ + (temp = ((uint64_t) flow.time_first.tv_sec) * 1000 + (flow.time_first.tv_usec / 1000), \ + &temp)) +#define FLOW_END_MSEC(F) \ + F(0, \ + 153, \ + 8, \ + (temp = ((uint64_t) flow.time_last.tv_sec) * 1000 + (flow.time_last.tv_usec / 1000), &temp)) +#define FLOW_START_USEC(F) F(0, 154, 8, (temp = MK_NTP_TS(flow.time_first), &temp)) +#define FLOW_END_USEC(F) F(0, 155, 8, (temp = MK_NTP_TS(flow.time_last), &temp)) +#define OBSERVATION_MSEC(F) F(0, 323, 8, nullptr) +#define INPUT_INTERFACE(F) F(0, 10, 4, &this->dir_bit_field) +#define OUTPUT_INTERFACE(F) F(0, 14, 2, nullptr) +#define FLOW_END_REASON(F) F(0, 136, 1, &flow.end_reason) +#define FLOW_ID(F) F(0, 148, 8, &flow.flow_hash) + +#define ETHERTYPE(F) F(0, 256, 2, nullptr) + +#define VLAN_ID(F) F(0, 58, 2, nullptr) + +#define L2_SRC_MAC(F) F(0, 56, 6, flow.src_mac) +#define L2_DST_MAC(F) F(0, 80, 6, flow.dst_mac) + +#define L3_PROTO(F) F(0, 60, 1, &flow.ip_version) +#define L3_IPV4_ADDR_SRC(F) F(0, 8, 4, &flow.src_ip.v4) +#define L3_IPV4_ADDR_DST(F) F(0, 12, 4, &flow.dst_ip.v4) +#define L3_IPV4_TOS(F) F(0, 5, 1, nullptr) +#define L3_IPV6_ADDR_SRC(F) F(0, 27, 16, &flow.src_ip.v6) +#define L3_IPV6_ADDR_DST(F) F(0, 28, 16, &flow.dst_ip.v6) +#define L3_IPV4_IDENTIFICATION(F) F(0, 54, 2, nullptr) +#define L3_IPV4_FRAGMENT(F) F(0, 88, 2, nullptr) +#define L3_IPV4_TTL(F) F(0, 192, 1, nullptr) +#define L3_IPV6_TTL(F) F(0, 192, 1, nullptr) +#define L3_TTL(F) F(0, 192, 1, nullptr) +#define L3_TTL_REV(F) F(29305, 192, 1, nullptr) +#define L3_FLAGS(F) F(0, 197, 1, nullptr) +#define L3_FLAGS_REV(F) F(29305, 197, 1, nullptr) + +#define L4_PROTO(F) F(0, 4, 1, &flow.ip_proto) +#define L4_TCP_FLAGS(F) F(0, 6, 1, &flow.src_tcp_flags) +#define L4_TCP_FLAGS_REV(F) F(29305, 6, 1, &flow.dst_tcp_flags) +#define L4_PORT_SRC(F) F(0, 7, 2, &flow.src_port) +#define L4_PORT_DST(F) F(0, 11, 2, &flow.dst_port) +#define L4_ICMP_TYPE_CODE(F) F(0, 32, 2, nullptr) +#define L4_TCP_WIN(F) F(0, 186, 2, nullptr) +#define L4_TCP_WIN_REV(F) F(29305, 186, 2, nullptr) +#define L4_TCP_OPTIONS(F) F(0, 209, 8, nullptr) +#define L4_TCP_OPTIONS_REV(F) F(29305, 209, 8, nullptr) + +#define L4_TCP_MSS(F) F(8057, 900, 4, nullptr) +#define L4_TCP_MSS_REV(F) F(8057, 901, 4, nullptr) +#define L4_TCP_SYN_SIZE(F) F(8057, 902, 2, nullptr) + +#define HTTP_DOMAIN(F) F(39499, 1, -1, nullptr) +#define HTTP_REFERER(F) F(39499, 3, -1, nullptr) +#define HTTP_URI(F) F(39499, 2, -1, nullptr) +#define HTTP_CONTENT_TYPE(F) F(39499, 10, -1, nullptr) +#define HTTP_STATUS(F) F(39499, 12, 2, nullptr) +#define HTTP_USERAGENT(F) F(39499, 20, -1, nullptr) +#define HTTP_METHOD(F) F(8057, 200, -1, nullptr) +#define HTTP_SERVER(F) F(8057, 201, -1, nullptr) +#define HTTP_SET_COOKIE_NAMES(F) F(8057, 202, -1, nullptr) + +#define RTSP_METHOD(F) F(16982, 600, -1, nullptr) +#define RTSP_USERAGENT(F) F(16982, 601, -1, nullptr) +#define RTSP_URI(F) F(16982, 602, -1, nullptr) +#define RTSP_STATUS(F) F(16982, 603, 2, nullptr) +#define RTSP_CONTENT_TYPE(F) F(16982, 604, -1, nullptr) +#define RTSP_SERVER(F) F(16982, 605, -1, nullptr) + +#define DNS_RCODE(F) F(8057, 1, 1, nullptr) +#define DNS_NAME(F) F(8057, 2, -1, nullptr) +#define DNS_QTYPE(F) F(8057, 3, 2, nullptr) +#define DNS_CLASS(F) F(8057, 4, 2, nullptr) +#define DNS_RR_TTL(F) F(8057, 5, 4, nullptr) +#define DNS_RLENGTH(F) F(8057, 6, 2, nullptr) +#define DNS_RDATA(F) F(8057, 7, -1, nullptr) +#define DNS_PSIZE(F) F(8057, 8, 2, nullptr) +#define DNS_DO(F) F(8057, 9, 1, nullptr) +#define DNS_ID(F) F(8057, 10, 2, nullptr) +#define DNS_ATYPE(F) F(8057, 11, 2, nullptr) +#define DNS_ANSWERS(F) F(8057, 14, 2, nullptr) + +#define SIP_MSG_TYPE(F) F(8057, 100, 2, nullptr) +#define SIP_STATUS_CODE(F) F(8057, 101, 2, nullptr) +#define SIP_CALL_ID(F) F(8057, 102, -1, nullptr) +#define SIP_CALLING_PARTY(F) F(8057, 103, -1, nullptr) +#define SIP_CALLED_PARTY(F) F(8057, 104, -1, nullptr) +#define SIP_VIA(F) F(8057, 105, -1, nullptr) +#define SIP_USER_AGENT(F) F(8057, 106, -1, nullptr) +#define SIP_REQUEST_URI(F) F(8057, 107, -1, nullptr) +#define SIP_CSEQ(F) F(8057, 108, -1, nullptr) + +#define NTP_LEAP(F) F(8057, 18, 1, nullptr) +#define NTP_VERSION(F) F(8057, 19, 1, nullptr) +#define NTP_MODE(F) F(8057, 20, 1, nullptr) +#define NTP_STRATUM(F) F(8057, 21, 1, nullptr) +#define NTP_POLL(F) F(8057, 22, 1, nullptr) +#define NTP_PRECISION(F) F(8057, 23, 1, nullptr) +#define NTP_DELAY(F) F(8057, 24, 4, nullptr) +#define NTP_DISPERSION(F) F(8057, 25, 4, nullptr) +#define NTP_REF_ID(F) F(8057, 26, -1, nullptr) +#define NTP_REF(F) F(8057, 27, -1, nullptr) +#define NTP_ORIG(F) F(8057, 28, -1, nullptr) +#define NTP_RECV(F) F(8057, 29, -1, nullptr) +#define NTP_SENT(F) F(8057, 30, -1, nullptr) + +#define ARP_HA_FORMAT(F) F(8057, 31, 2, nullptr) +#define ARP_PA_FORMAT(F) F(8057, 32, 2, nullptr) +#define ARP_OPCODE(F) F(8057, 33, 2, nullptr) +#define ARP_SRC_HA(F) F(8057, 34, -1, nullptr) +#define ARP_SRC_PA(F) F(8057, 35, -1, nullptr) +#define ARP_DST_HA(F) F(8057, 36, -1, nullptr) +#define ARP_DST_PA(F) F(8057, 37, -1, nullptr) + +#define TLS_SNI(F) F(8057, 808, -1, nullptr) +#define TLS_VERSION(F) F(39499, 333, 2, nullptr) +#define TLS_ALPN(F) F(39499, 337, -1, nullptr) +#define TLS_JA3(F) F(39499, 357, -1, nullptr) +#define TLS_JA4(F) F(39499, 358, -1, nullptr) +#define TLS_EXT_TYPE(F) F(0, 291, -1, nullptr) +#define TLS_EXT_LEN(F) F(0, 291, -1, nullptr) + +#define SMTP_COMMANDS(F) F(8057, 810, 4, nullptr) +#define SMTP_MAIL_COUNT(F) F(8057, 811, 4, nullptr) +#define SMTP_RCPT_COUNT(F) F(8057, 812, 4, nullptr) +#define SMTP_SENDER(F) F(8057, 813, -1, nullptr) +#define SMTP_RECIPIENT(F) F(8057, 814, -1, nullptr) +#define SMTP_STATUS_CODES(F) F(8057, 815, 4, nullptr) +#define SMTP_CODE_2XX_COUNT(F) F(8057, 816, 4, nullptr) +#define SMTP_CODE_3XX_COUNT(F) F(8057, 817, 4, nullptr) +#define SMTP_CODE_4XX_COUNT(F) F(8057, 818, 4, nullptr) +#define SMTP_CODE_5XX_COUNT(F) F(8057, 819, 4, nullptr) +#define SMTP_DOMAIN(F) F(8057, 820, -1, nullptr) + +#define SSDP_LOCATION_PORT(F) F(8057, 821, 2, nullptr) +#define SSDP_SERVER(F) F(8057, 822, -1, nullptr) +#define SSDP_USER_AGENT(F) F(8057, 823, -1, nullptr) +#define SSDP_NT(F) F(8057, 824, -1, nullptr) +#define SSDP_ST(F) F(8057, 825, -1, nullptr) + +#define DNSSD_QUERIES(F) F(8057, 826, -1, nullptr) +#define DNSSD_RESPONSES(F) F(8057, 827, -1, nullptr) + +#define OVPN_CONF_LEVEL(F) F(8057, 828, 1, nullptr) +#define SSA_CONF_LEVEL(F) F(8057, 903, 1, nullptr) + +#define NB_NAME(F) F(8057, 831, -1, nullptr) +#define NB_SUFFIX(F) F(8057, 832, 1, nullptr) + +#define IDP_CONTENT(F) F(8057, 850, -1, nullptr) +#define IDP_CONTENT_REV(F) F(8057, 851, -1, nullptr) + +#define STATS_PCKT_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1013 (uint16*) +#define STATS_PCKT_TIMESTAMPS(F) \ + F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1014 (time*) +#define STATS_PCKT_TCPFLGS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1015 (uint8*) +#define STATS_PCKT_DIRECTIONS(F) \ + F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1016 (int8*) + +#define SBI_BRST_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1050 (uint16*) +#define SBI_BRST_BYTES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1051 (uint16*) +#define SBI_BRST_TIME_START(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1052 (time*) +#define SBI_BRST_TIME_STOP(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1053 (time*) +#define DBI_BRST_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1054 (uint16*) +#define DBI_BRST_BYTES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1055 (uint16*) +#define DBI_BRST_TIME_START(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1056 (time*) +#define DBI_BRST_TIME_STOP(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1057 (time*) + +#define D_PHISTS_IPT(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1063 (uint32*) +#define D_PHISTS_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1062 (uint32*) +#define S_PHISTS_SIZES(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1060 (uint32*) +#define S_PHISTS_IPT(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id1061 (uint32*) + +#define QUIC_SNI(F) F(8057, 890, -1, nullptr) +#define QUIC_USER_AGENT(F) F(8057, 891, -1, nullptr) +#define QUIC_VERSION(F) F(8057, 892, 4, nullptr) +#define QUIC_CLIENT_VERSION(F) F(8057, 893, 4, nullptr) +#define QUIC_TOKEN_LENGTH(F) F(8057, 894, 8, nullptr) +#define QUIC_OCCID(F) F(8057, 895, -1, nullptr) +#define QUIC_OSCID(F) F(8057, 896, -1, nullptr) +#define QUIC_SCID(F) F(8057, 897, -1, nullptr) +#define QUIC_RETRY_SCID(F) F(8057, 898, -1, nullptr) +#define QUIC_MULTIPLEXED(F) F(8057, 899, 1, nullptr) +#define QUIC_ZERO_RTT(F) F(8057, 889, 1, nullptr) +#define QUIC_SERVER_PORT(F) F(8057, 887, 2, nullptr) +#define QUIC_PACKETS(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id888 (uint16*) +#define QUIC_CH_PARSED(F) F(8057, 886, 1, nullptr) +#define QUIC_TLS_EXT_TYPE(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id885 (uint16*) +#define QUIC_TLS_EXT_LEN(F) F(0, 291, -1, nullptr) // BASIC LIST -- FIELD IS e8057id884 (uint16*) +#define QUIC_TLS_EXT(F) F(8057, 883, -1, nullptr) + +#define OSQUERY_PROGRAM_NAME(F) F(8057, 852, -1, nullptr) +#define OSQUERY_USERNAME(F) F(8057, 853, -1, nullptr) +#define OSQUERY_OS_NAME(F) F(8057, 854, -1, nullptr) +#define OSQUERY_OS_MAJOR(F) F(8057, 855, 2, nullptr) +#define OSQUERY_OS_MINOR(F) F(8057, 856, 2, nullptr) +#define OSQUERY_OS_BUILD(F) F(8057, 857, -1, nullptr) +#define OSQUERY_OS_PLATFORM(F) F(8057, 858, -1, nullptr) +#define OSQUERY_OS_PLATFORM_LIKE(F) F(8057, 859, -1, nullptr) +#define OSQUERY_OS_ARCH(F) F(8057, 860, -1, nullptr) +#define OSQUERY_KERNEL_VERSION(F) F(8057, 861, -1, nullptr) +#define OSQUERY_SYSTEM_HOSTNAME(F) F(8057, 862, -1, nullptr) #ifdef WITH_FLEXPROBE -#define FX_FRAME_SIGNATURE(F) F(5715, 1010, 18, nullptr) -#define FX_INPUT_INTERFACE(F) F(5715, 1015, 1, nullptr) -#define FX_TCP_TRACKING(F) F(5715, 1020, 1, nullptr) +#define FX_FRAME_SIGNATURE(F) F(5715, 1010, 18, nullptr) +#define FX_INPUT_INTERFACE(F) F(5715, 1015, 1, nullptr) +#define FX_TCP_TRACKING(F) F(5715, 1020, 1, nullptr) #endif -#define WG_CONF_LEVEL(F) F(8057, 1100, 1, nullptr) -#define WG_SRC_PEER(F) F(8057, 1101, 4, nullptr) -#define WG_DST_PEER(F) F(8057, 1102, 4, nullptr) - -#define NTS_MEAN(F) F(8057, 1020, 4, nullptr) -#define NTS_MIN(F) F(8057, 1021, 2, nullptr) -#define NTS_MAX(F) F(8057, 1022, 2, nullptr) -#define NTS_STDEV(F) F(8057, 1023, 4, nullptr) -#define NTS_KURTOSIS(F) F(8057, 1024, 4, nullptr) -#define NTS_ROOT_MEAN_SQUARE(F) F(8057, 1025, 4, nullptr) -#define NTS_AVERAGE_DISPERSION(F) F(8057, 1026, 4, nullptr) -#define NTS_MEAN_SCALED_TIME(F) F(8057, 1027, 4, nullptr) -#define NTS_MEAN_DIFFTIMES(F) F(8057, 1028, 4, nullptr) -#define NTS_MIN_DIFFTIMES(F) F(8057, 1029, 4, nullptr) -#define NTS_MAX_DIFFTIMES(F) F(8057, 1030, 4, nullptr) -#define NTS_TIME_DISTRIBUTION(F) F(8057, 1031, 4, nullptr) -#define NTS_SWITCHING_RATIO(F) F(8057, 1032, 4, nullptr) - -#define MQTT_TYPE_CUMULATIVE(F) F(8057, 1033, 2, nullptr) -#define MQTT_VERSION(F) F(8057, 1034, 1, nullptr) -#define MQTT_CONNECTION_FLAGS(F) F(8057, 1035, 1, nullptr) -#define MQTT_KEEP_ALIVE(F) F(8057, 1036, 2, nullptr) -#define MQTT_LAST_RETURN_CODE(F) F(8057, 1037, 1, nullptr) -#define MQTT_PUBLISH_FLAGS(F) F(8057, 1038, 1, nullptr) -#define MQTT_TOPICS(F) F(8057, 1039, -1, nullptr) - -#define MPLS_TOP_LABEL_STACK_SECTION F(0, 70, -1, nullptr) - +#define WG_CONF_LEVEL(F) F(8057, 1100, 1, nullptr) +#define WG_SRC_PEER(F) F(8057, 1101, 4, nullptr) +#define WG_DST_PEER(F) F(8057, 1102, 4, nullptr) + +#define NTS_MEAN(F) F(8057, 1020, 4, nullptr) +#define NTS_MIN(F) F(8057, 1021, 2, nullptr) +#define NTS_MAX(F) F(8057, 1022, 2, nullptr) +#define NTS_STDEV(F) F(8057, 1023, 4, nullptr) +#define NTS_KURTOSIS(F) F(8057, 1024, 4, nullptr) +#define NTS_ROOT_MEAN_SQUARE(F) F(8057, 1025, 4, nullptr) +#define NTS_AVERAGE_DISPERSION(F) F(8057, 1026, 4, nullptr) +#define NTS_MEAN_SCALED_TIME(F) F(8057, 1027, 4, nullptr) +#define NTS_MEAN_DIFFTIMES(F) F(8057, 1028, 4, nullptr) +#define NTS_MIN_DIFFTIMES(F) F(8057, 1029, 4, nullptr) +#define NTS_MAX_DIFFTIMES(F) F(8057, 1030, 4, nullptr) +#define NTS_TIME_DISTRIBUTION(F) F(8057, 1031, 4, nullptr) +#define NTS_SWITCHING_RATIO(F) F(8057, 1032, 4, nullptr) + +#define MQTT_TYPE_CUMULATIVE(F) F(8057, 1033, 2, nullptr) +#define MQTT_VERSION(F) F(8057, 1034, 1, nullptr) +#define MQTT_CONNECTION_FLAGS(F) F(8057, 1035, 1, nullptr) +#define MQTT_KEEP_ALIVE(F) F(8057, 1036, 2, nullptr) +#define MQTT_LAST_RETURN_CODE(F) F(8057, 1037, 1, nullptr) +#define MQTT_PUBLISH_FLAGS(F) F(8057, 1038, 1, nullptr) +#define MQTT_TOPICS(F) F(8057, 1039, -1, nullptr) + +#define MPLS_TOP_LABEL_STACK_SECTION F(0, 70, -1, nullptr) /** * IPFIX Templates - list of elements @@ -317,278 +324,270 @@ namespace ipxp { */ #ifdef IPXP_TS_MSEC -#define FLOW_START FLOW_START_MSEC -#define FLOW_END FLOW_END_MSEC +#define FLOW_START FLOW_START_MSEC +#define FLOW_END FLOW_END_MSEC #else -#define FLOW_START FLOW_START_USEC -#define FLOW_END FLOW_END_USEC +#define FLOW_START FLOW_START_USEC +#define FLOW_END FLOW_END_USEC #endif - -#define BASIC_TMPLT_V4(F) \ - F(FLOW_END_REASON) \ - F(BYTES) \ - F(BYTES_REV) \ - F(PACKETS) \ - F(PACKETS_REV) \ - F(FLOW_START) \ - F(FLOW_END) \ - F(L3_PROTO) \ - F(L4_PROTO) \ - F(L4_TCP_FLAGS) \ - F(L4_TCP_FLAGS_REV) \ - F(L4_PORT_SRC) \ - F(L4_PORT_DST) \ - F(INPUT_INTERFACE) \ - F(L3_IPV4_ADDR_SRC) \ - F(L3_IPV4_ADDR_DST) \ - F(L2_SRC_MAC) \ - F(L2_DST_MAC) - -#define BASIC_TMPLT_V6(F) \ - F(FLOW_END_REASON) \ - F(BYTES) \ - F(BYTES_REV) \ - F(PACKETS) \ - F(PACKETS_REV) \ - F(FLOW_START) \ - F(FLOW_END) \ - F(L3_PROTO) \ - F(L4_PROTO) \ - F(L4_TCP_FLAGS) \ - F(L4_TCP_FLAGS_REV) \ - F(L4_PORT_SRC) \ - F(L4_PORT_DST) \ - F(INPUT_INTERFACE) \ - F(L3_IPV6_ADDR_SRC) \ - F(L3_IPV6_ADDR_DST) \ - F(L2_SRC_MAC) \ - F(L2_DST_MAC) - -#define IPFIX_HTTP_TEMPLATE(F) \ - F(HTTP_USERAGENT) \ - F(HTTP_METHOD) \ - F(HTTP_DOMAIN) \ - F(HTTP_REFERER) \ - F(HTTP_URI) \ - F(HTTP_CONTENT_TYPE) \ - F(HTTP_SERVER) \ - F(HTTP_SET_COOKIE_NAMES) \ - F(HTTP_STATUS) - -#define IPFIX_RTSP_TEMPLATE(F) \ - F(RTSP_METHOD) \ - F(RTSP_USERAGENT) \ - F(RTSP_URI) \ - F(RTSP_STATUS)\ - F(RTSP_SERVER) \ - F(RTSP_CONTENT_TYPE) - -#define IPFIX_TLS_TEMPLATE(F) \ - F(TLS_VERSION) \ - F(TLS_SNI) \ - F(TLS_ALPN) \ - F(TLS_JA3) \ - F(TLS_JA4) \ - F(TLS_EXT_TYPE) \ - F(TLS_EXT_LEN) - -#define IPFIX_NTP_TEMPLATE(F) \ - F(NTP_LEAP) \ - F(NTP_VERSION) \ - F(NTP_MODE) \ - F(NTP_STRATUM) \ - F(NTP_POLL) \ - F(NTP_PRECISION) \ - F(NTP_DELAY) \ - F(NTP_DISPERSION) \ - F(NTP_REF_ID) \ - F(NTP_REF) \ - F(NTP_ORIG) \ - F(NTP_RECV) \ - F(NTP_SENT) - -#define IPFIX_DNS_TEMPLATE(F) \ - F(DNS_ANSWERS) \ - F(DNS_RCODE) \ - F(DNS_QTYPE) \ - F(DNS_CLASS) \ - F(DNS_RR_TTL) \ - F(DNS_RLENGTH) \ - F(DNS_PSIZE) \ - F(DNS_DO) \ - F(DNS_ID) \ - F(DNS_NAME) \ - F(DNS_RDATA) - -#define IPFIX_PASSIVEDNS_TEMPLATE(F) \ - F(DNS_ID) \ - F(DNS_RR_TTL) \ - F(DNS_ATYPE) \ - F(DNS_RDATA) \ - F(DNS_NAME) - -#define IPFIX_SMTP_TEMPLATE(F) \ - F(SMTP_COMMANDS) \ - F(SMTP_MAIL_COUNT) \ - F(SMTP_RCPT_COUNT) \ - F(SMTP_STATUS_CODES) \ - F(SMTP_CODE_2XX_COUNT) \ - F(SMTP_CODE_3XX_COUNT) \ - F(SMTP_CODE_4XX_COUNT) \ - F(SMTP_CODE_5XX_COUNT) \ - F(SMTP_DOMAIN) \ - F(SMTP_SENDER) \ - F(SMTP_RECIPIENT) - -#define IPFIX_SIP_TEMPLATE(F) \ - F(SIP_MSG_TYPE) \ - F(SIP_STATUS_CODE) \ - F(SIP_CSEQ) \ - F(SIP_CALLING_PARTY) \ - F(SIP_CALLED_PARTY) \ - F(SIP_CALL_ID) \ - F(SIP_USER_AGENT) \ - F(SIP_REQUEST_URI) \ - F(SIP_VIA) - -#define IPFIX_MQTT_TEMPLATE(F) \ - F(MQTT_TYPE_CUMULATIVE) \ - F(MQTT_VERSION) \ - F(MQTT_CONNECTION_FLAGS) \ - F(MQTT_KEEP_ALIVE) \ - F(MQTT_LAST_RETURN_CODE) \ - F(MQTT_PUBLISH_FLAGS) \ - F(MQTT_TOPICS) - -#define IPFIX_PSTATS_TEMPLATE(F) \ - F(STATS_PCKT_SIZES) \ - F(STATS_PCKT_TIMESTAMPS) \ - F(STATS_PCKT_TCPFLGS) \ - F(STATS_PCKT_DIRECTIONS) - -#define IPFIX_OVPN_TEMPLATE(F) \ - F(OVPN_CONF_LEVEL) - -#define IPFIX_SSADETECTOR_TEMPLATE(F) \ - F(SSA_CONF_LEVEL) - -#define IPFIX_SSDP_TEMPLATE(F) \ - F(SSDP_LOCATION_PORT) \ - F(SSDP_NT) \ - F(SSDP_USER_AGENT)\ - F(SSDP_ST) \ - F(SSDP_SERVER) - -#define IPFIX_DNSSD_TEMPLATE(F) \ - F(DNSSD_QUERIES) \ - F(DNSSD_RESPONSES) - -#define IPFIX_IDPCONTENT_TEMPLATE(F) \ - F(IDP_CONTENT) \ - F(IDP_CONTENT_REV) - -#define IPFIX_BSTATS_TEMPLATE(F) \ - F(SBI_BRST_PACKETS) \ - F(SBI_BRST_BYTES) \ - F(SBI_BRST_TIME_START) \ - F(SBI_BRST_TIME_STOP) \ - F(DBI_BRST_PACKETS) \ - F(DBI_BRST_BYTES) \ - F(DBI_BRST_TIME_START) \ - F(DBI_BRST_TIME_STOP) - -#define IPFIX_NETBIOS_TEMPLATE(F) \ - F(NB_SUFFIX) \ - F(NB_NAME) - -#define IPFIX_NETBIOS_TEMPLATE(F) \ - F(NB_SUFFIX) \ - F(NB_NAME) - -#define IPFIX_BASICPLUS_TEMPLATE(F) \ - F(L3_TTL) \ - F(L3_TTL_REV) \ - F(L3_FLAGS) \ - F(L3_FLAGS_REV) \ - F(L4_TCP_WIN) \ - F(L4_TCP_WIN_REV) \ - F(L4_TCP_OPTIONS) \ - F(L4_TCP_OPTIONS_REV) \ - F(L4_TCP_MSS) \ - F(L4_TCP_MSS_REV) \ - F(L4_TCP_SYN_SIZE) - -#define IPFIX_PHISTS_TEMPLATE(F) \ - F(S_PHISTS_SIZES) \ - F(S_PHISTS_IPT) \ - F(D_PHISTS_SIZES) \ - F(D_PHISTS_IPT) - -#define IPFIX_WG_TEMPLATE(F) \ - F(WG_CONF_LEVEL) \ - F(WG_SRC_PEER) \ - F(WG_DST_PEER) - -#define IPFIX_QUIC_TEMPLATE(F) \ - F(QUIC_SNI) \ - F(QUIC_USER_AGENT) \ - F(QUIC_VERSION) \ - F(QUIC_CLIENT_VERSION) \ - F(QUIC_TOKEN_LENGTH) \ - F(QUIC_OCCID) \ - F(QUIC_OSCID) \ - F(QUIC_SCID) \ - F(QUIC_RETRY_SCID) \ - F(QUIC_MULTIPLEXED) \ - F(QUIC_ZERO_RTT) \ - F(QUIC_SERVER_PORT) \ - F(QUIC_PACKETS) \ - F(QUIC_CH_PARSED) \ - F(QUIC_TLS_EXT_TYPE) \ - F(QUIC_TLS_EXT_LEN) \ - F(QUIC_TLS_EXT) - -#define IPFIX_OSQUERY_TEMPLATE(F) \ - F(OSQUERY_PROGRAM_NAME) \ - F(OSQUERY_USERNAME) \ - F(OSQUERY_OS_NAME) \ - F(OSQUERY_OS_MAJOR) \ - F(OSQUERY_OS_MINOR) \ - F(OSQUERY_OS_BUILD) \ - F(OSQUERY_OS_PLATFORM) \ - F(OSQUERY_OS_PLATFORM_LIKE) \ - F(OSQUERY_OS_ARCH) \ - F(OSQUERY_KERNEL_VERSION) \ - F(OSQUERY_SYSTEM_HOSTNAME) - -#define IPFIX_ICMP_TEMPLATE(F) \ - F(L4_ICMP_TYPE_CODE) - -#define IPFIX_VLAN_TEMPLATE(F) \ - F(VLAN_ID) - -#define IPFIX_NETTISA_TEMPLATE(F) \ - F(NTS_MEAN) \ - F(NTS_MIN) \ - F(NTS_MAX) \ - F(NTS_STDEV) \ - F(NTS_KURTOSIS) \ - F(NTS_ROOT_MEAN_SQUARE) \ - F(NTS_AVERAGE_DISPERSION) \ - F(NTS_MEAN_SCALED_TIME) \ - F(NTS_MEAN_DIFFTIMES) \ - F(NTS_MIN_DIFFTIMES) \ - F(NTS_MAX_DIFFTIMES) \ - F(NTS_TIME_DISTRIBUTION) \ - F(NTS_SWITCHING_RATIO) - - -#define IPFIX_FLOW_HASH_TEMPLATE(F) \ - F(FLOW_ID) - -#define IPFIX_MPLS_TEMPLATE(F) \ - F(MPLS_TOP_LABEL_STACK_SECTION) +#define BASIC_TMPLT_V4(F) \ + F(FLOW_END_REASON) \ + F(BYTES) \ + F(BYTES_REV) \ + F(PACKETS) \ + F(PACKETS_REV) \ + F(FLOW_START) \ + F(FLOW_END) \ + F(L3_PROTO) \ + F(L4_PROTO) \ + F(L4_TCP_FLAGS) \ + F(L4_TCP_FLAGS_REV) \ + F(L4_PORT_SRC) \ + F(L4_PORT_DST) \ + F(INPUT_INTERFACE) \ + F(L3_IPV4_ADDR_SRC) \ + F(L3_IPV4_ADDR_DST) \ + F(L2_SRC_MAC) \ + F(L2_DST_MAC) + +#define BASIC_TMPLT_V6(F) \ + F(FLOW_END_REASON) \ + F(BYTES) \ + F(BYTES_REV) \ + F(PACKETS) \ + F(PACKETS_REV) \ + F(FLOW_START) \ + F(FLOW_END) \ + F(L3_PROTO) \ + F(L4_PROTO) \ + F(L4_TCP_FLAGS) \ + F(L4_TCP_FLAGS_REV) \ + F(L4_PORT_SRC) \ + F(L4_PORT_DST) \ + F(INPUT_INTERFACE) \ + F(L3_IPV6_ADDR_SRC) \ + F(L3_IPV6_ADDR_DST) \ + F(L2_SRC_MAC) \ + F(L2_DST_MAC) + +#define IPFIX_HTTP_TEMPLATE(F) \ + F(HTTP_USERAGENT) \ + F(HTTP_METHOD) \ + F(HTTP_DOMAIN) \ + F(HTTP_REFERER) \ + F(HTTP_URI) \ + F(HTTP_CONTENT_TYPE) \ + F(HTTP_SERVER) \ + F(HTTP_SET_COOKIE_NAMES) \ + F(HTTP_STATUS) + +#define IPFIX_RTSP_TEMPLATE(F) \ + F(RTSP_METHOD) \ + F(RTSP_USERAGENT) \ + F(RTSP_URI) \ + F(RTSP_STATUS) \ + F(RTSP_SERVER) \ + F(RTSP_CONTENT_TYPE) + +#define IPFIX_TLS_TEMPLATE(F) \ + F(TLS_VERSION) \ + F(TLS_SNI) \ + F(TLS_ALPN) \ + F(TLS_JA3) \ + F(TLS_JA4) \ + F(TLS_EXT_TYPE) \ + F(TLS_EXT_LEN) + +#define IPFIX_NTP_TEMPLATE(F) \ + F(NTP_LEAP) \ + F(NTP_VERSION) \ + F(NTP_MODE) \ + F(NTP_STRATUM) \ + F(NTP_POLL) \ + F(NTP_PRECISION) \ + F(NTP_DELAY) \ + F(NTP_DISPERSION) \ + F(NTP_REF_ID) \ + F(NTP_REF) \ + F(NTP_ORIG) \ + F(NTP_RECV) \ + F(NTP_SENT) + +#define IPFIX_DNS_TEMPLATE(F) \ + F(DNS_ANSWERS) \ + F(DNS_RCODE) \ + F(DNS_QTYPE) \ + F(DNS_CLASS) \ + F(DNS_RR_TTL) \ + F(DNS_RLENGTH) \ + F(DNS_PSIZE) \ + F(DNS_DO) \ + F(DNS_ID) \ + F(DNS_NAME) \ + F(DNS_RDATA) + +#define IPFIX_PASSIVEDNS_TEMPLATE(F) \ + F(DNS_ID) \ + F(DNS_RR_TTL) \ + F(DNS_ATYPE) \ + F(DNS_RDATA) \ + F(DNS_NAME) + +#define IPFIX_SMTP_TEMPLATE(F) \ + F(SMTP_COMMANDS) \ + F(SMTP_MAIL_COUNT) \ + F(SMTP_RCPT_COUNT) \ + F(SMTP_STATUS_CODES) \ + F(SMTP_CODE_2XX_COUNT) \ + F(SMTP_CODE_3XX_COUNT) \ + F(SMTP_CODE_4XX_COUNT) \ + F(SMTP_CODE_5XX_COUNT) \ + F(SMTP_DOMAIN) \ + F(SMTP_SENDER) \ + F(SMTP_RECIPIENT) + +#define IPFIX_SIP_TEMPLATE(F) \ + F(SIP_MSG_TYPE) \ + F(SIP_STATUS_CODE) \ + F(SIP_CSEQ) \ + F(SIP_CALLING_PARTY) \ + F(SIP_CALLED_PARTY) \ + F(SIP_CALL_ID) \ + F(SIP_USER_AGENT) \ + F(SIP_REQUEST_URI) \ + F(SIP_VIA) + +#define IPFIX_MQTT_TEMPLATE(F) \ + F(MQTT_TYPE_CUMULATIVE) \ + F(MQTT_VERSION) \ + F(MQTT_CONNECTION_FLAGS) \ + F(MQTT_KEEP_ALIVE) \ + F(MQTT_LAST_RETURN_CODE) \ + F(MQTT_PUBLISH_FLAGS) \ + F(MQTT_TOPICS) + +#define IPFIX_PSTATS_TEMPLATE(F) \ + F(STATS_PCKT_SIZES) \ + F(STATS_PCKT_TIMESTAMPS) \ + F(STATS_PCKT_TCPFLGS) \ + F(STATS_PCKT_DIRECTIONS) + +#define IPFIX_OVPN_TEMPLATE(F) F(OVPN_CONF_LEVEL) + +#define IPFIX_SSADETECTOR_TEMPLATE(F) F(SSA_CONF_LEVEL) + +#define IPFIX_SSDP_TEMPLATE(F) \ + F(SSDP_LOCATION_PORT) \ + F(SSDP_NT) \ + F(SSDP_USER_AGENT) \ + F(SSDP_ST) \ + F(SSDP_SERVER) + +#define IPFIX_DNSSD_TEMPLATE(F) \ + F(DNSSD_QUERIES) \ + F(DNSSD_RESPONSES) + +#define IPFIX_IDPCONTENT_TEMPLATE(F) \ + F(IDP_CONTENT) \ + F(IDP_CONTENT_REV) + +#define IPFIX_BSTATS_TEMPLATE(F) \ + F(SBI_BRST_PACKETS) \ + F(SBI_BRST_BYTES) \ + F(SBI_BRST_TIME_START) \ + F(SBI_BRST_TIME_STOP) \ + F(DBI_BRST_PACKETS) \ + F(DBI_BRST_BYTES) \ + F(DBI_BRST_TIME_START) \ + F(DBI_BRST_TIME_STOP) + +#define IPFIX_NETBIOS_TEMPLATE(F) \ + F(NB_SUFFIX) \ + F(NB_NAME) + +#define IPFIX_NETBIOS_TEMPLATE(F) \ + F(NB_SUFFIX) \ + F(NB_NAME) + +#define IPFIX_BASICPLUS_TEMPLATE(F) \ + F(L3_TTL) \ + F(L3_TTL_REV) \ + F(L3_FLAGS) \ + F(L3_FLAGS_REV) \ + F(L4_TCP_WIN) \ + F(L4_TCP_WIN_REV) \ + F(L4_TCP_OPTIONS) \ + F(L4_TCP_OPTIONS_REV) \ + F(L4_TCP_MSS) \ + F(L4_TCP_MSS_REV) \ + F(L4_TCP_SYN_SIZE) + +#define IPFIX_PHISTS_TEMPLATE(F) \ + F(S_PHISTS_SIZES) \ + F(S_PHISTS_IPT) \ + F(D_PHISTS_SIZES) \ + F(D_PHISTS_IPT) + +#define IPFIX_WG_TEMPLATE(F) \ + F(WG_CONF_LEVEL) \ + F(WG_SRC_PEER) \ + F(WG_DST_PEER) + +#define IPFIX_QUIC_TEMPLATE(F) \ + F(QUIC_SNI) \ + F(QUIC_USER_AGENT) \ + F(QUIC_VERSION) \ + F(QUIC_CLIENT_VERSION) \ + F(QUIC_TOKEN_LENGTH) \ + F(QUIC_OCCID) \ + F(QUIC_OSCID) \ + F(QUIC_SCID) \ + F(QUIC_RETRY_SCID) \ + F(QUIC_MULTIPLEXED) \ + F(QUIC_ZERO_RTT) \ + F(QUIC_SERVER_PORT) \ + F(QUIC_PACKETS) \ + F(QUIC_CH_PARSED) \ + F(QUIC_TLS_EXT_TYPE) \ + F(QUIC_TLS_EXT_LEN) \ + F(QUIC_TLS_EXT) + +#define IPFIX_OSQUERY_TEMPLATE(F) \ + F(OSQUERY_PROGRAM_NAME) \ + F(OSQUERY_USERNAME) \ + F(OSQUERY_OS_NAME) \ + F(OSQUERY_OS_MAJOR) \ + F(OSQUERY_OS_MINOR) \ + F(OSQUERY_OS_BUILD) \ + F(OSQUERY_OS_PLATFORM) \ + F(OSQUERY_OS_PLATFORM_LIKE) \ + F(OSQUERY_OS_ARCH) \ + F(OSQUERY_KERNEL_VERSION) \ + F(OSQUERY_SYSTEM_HOSTNAME) + +#define IPFIX_ICMP_TEMPLATE(F) F(L4_ICMP_TYPE_CODE) + +#define IPFIX_VLAN_TEMPLATE(F) F(VLAN_ID) + +#define IPFIX_NETTISA_TEMPLATE(F) \ + F(NTS_MEAN) \ + F(NTS_MIN) \ + F(NTS_MAX) \ + F(NTS_STDEV) \ + F(NTS_KURTOSIS) \ + F(NTS_ROOT_MEAN_SQUARE) \ + F(NTS_AVERAGE_DISPERSION) \ + F(NTS_MEAN_SCALED_TIME) \ + F(NTS_MEAN_DIFFTIMES) \ + F(NTS_MIN_DIFFTIMES) \ + F(NTS_MAX_DIFFTIMES) \ + F(NTS_TIME_DISTRIBUTION) \ + F(NTS_SWITCHING_RATIO) + +#define IPFIX_FLOW_HASH_TEMPLATE(F) F(FLOW_ID) + +#define IPFIX_MPLS_TEMPLATE(F) F(MPLS_TOP_LABEL_STACK_SECTION) #ifdef WITH_FLEXPROBE #define IPFIX_FLEXPROBE_DATA_TEMPLATE(F) F(FX_FRAME_SIGNATURE) F(FX_INPUT_INTERFACE) @@ -606,37 +605,37 @@ namespace ipxp { * This macro is define in order to use all elements of all defined * templates at once. */ -#define IPFIX_ENABLED_TEMPLATES(F) \ - BASIC_TMPLT_V4(F) \ - BASIC_TMPLT_V6(F) \ - IPFIX_HTTP_TEMPLATE(F) \ - IPFIX_RTSP_TEMPLATE(F) \ - IPFIX_TLS_TEMPLATE(F) \ - IPFIX_NTP_TEMPLATE(F) \ - IPFIX_SIP_TEMPLATE(F) \ - IPFIX_DNS_TEMPLATE(F) \ - IPFIX_PASSIVEDNS_TEMPLATE(F) \ - IPFIX_PSTATS_TEMPLATE(F) \ - IPFIX_OVPN_TEMPLATE(F) \ - IPFIX_SMTP_TEMPLATE(F) \ - IPFIX_SSDP_TEMPLATE(F) \ - IPFIX_DNSSD_TEMPLATE(F) \ - IPFIX_IDPCONTENT_TEMPLATE(F) \ - IPFIX_NETBIOS_TEMPLATE(F) \ - IPFIX_BASICPLUS_TEMPLATE(F) \ - IPFIX_BSTATS_TEMPLATE(F) \ - IPFIX_PHISTS_TEMPLATE(F) \ - IPFIX_WG_TEMPLATE(F) \ - IPFIX_QUIC_TEMPLATE(F) \ - IPFIX_OSQUERY_TEMPLATE(F) \ - IPFIX_FLEXPROBE_DATA_TEMPLATE(F) \ - IPFIX_FLEXPROBE_TCP_TEMPLATE(F) \ - IPFIX_FLEXPROBE_ENCR_TEMPLATE(F) \ - IPFIX_SSADETECTOR_TEMPLATE(F) \ - IPFIX_ICMP_TEMPLATE(F) \ - IPFIX_VLAN_TEMPLATE(F) \ - IPFIX_NETTISA_TEMPLATE(F) \ - IPFIX_FLOW_HASH_TEMPLATE(F) +#define IPFIX_ENABLED_TEMPLATES(F) \ + BASIC_TMPLT_V4(F) \ + BASIC_TMPLT_V6(F) \ + IPFIX_HTTP_TEMPLATE(F) \ + IPFIX_RTSP_TEMPLATE(F) \ + IPFIX_TLS_TEMPLATE(F) \ + IPFIX_NTP_TEMPLATE(F) \ + IPFIX_SIP_TEMPLATE(F) \ + IPFIX_DNS_TEMPLATE(F) \ + IPFIX_PASSIVEDNS_TEMPLATE(F) \ + IPFIX_PSTATS_TEMPLATE(F) \ + IPFIX_OVPN_TEMPLATE(F) \ + IPFIX_SMTP_TEMPLATE(F) \ + IPFIX_SSDP_TEMPLATE(F) \ + IPFIX_DNSSD_TEMPLATE(F) \ + IPFIX_IDPCONTENT_TEMPLATE(F) \ + IPFIX_NETBIOS_TEMPLATE(F) \ + IPFIX_BASICPLUS_TEMPLATE(F) \ + IPFIX_BSTATS_TEMPLATE(F) \ + IPFIX_PHISTS_TEMPLATE(F) \ + IPFIX_WG_TEMPLATE(F) \ + IPFIX_QUIC_TEMPLATE(F) \ + IPFIX_OSQUERY_TEMPLATE(F) \ + IPFIX_FLEXPROBE_DATA_TEMPLATE(F) \ + IPFIX_FLEXPROBE_TCP_TEMPLATE(F) \ + IPFIX_FLEXPROBE_ENCR_TEMPLATE(F) \ + IPFIX_SSADETECTOR_TEMPLATE(F) \ + IPFIX_ICMP_TEMPLATE(F) \ + IPFIX_VLAN_TEMPLATE(F) \ + IPFIX_NETTISA_TEMPLATE(F) \ + IPFIX_FLOW_HASH_TEMPLATE(F) /** * Helper macro, convert FIELD into its name as a C literal. @@ -646,5 +645,5 @@ namespace ipxp { */ #define IPFIX_FIELD_NAMES(F) #F, -} +} // namespace ipxp #endif /* IPXP_IPFIX_ELEMENTS_HPP */ diff --git a/include/ipfixprobe/options.hpp b/include/ipfixprobe/options.hpp index 06223e1f9..0431a2d70 100644 --- a/include/ipfixprobe/options.hpp +++ b/include/ipfixprobe/options.hpp @@ -29,63 +29,65 @@ #ifndef IPXP_OPTIONS_HPP #define IPXP_OPTIONS_HPP -#include -#include +#include #include +#include +#include #include #include -#include -#include +#include namespace ipxp { -class OptionsParser -{ +class OptionsParser { public: - static const char DELIM = ';'; - typedef std::function OptionParserFunc; - enum OptionFlags : uint32_t { - RequiredArgument = 1, - OptionalArgument = 2, - NoArgument = 4 - }; + static const char DELIM = ';'; + typedef std::function OptionParserFunc; + enum OptionFlags : uint32_t { RequiredArgument = 1, OptionalArgument = 2, NoArgument = 4 }; - OptionsParser(); - OptionsParser(const std::string &name, const std::string &info); - ~OptionsParser(); - OptionsParser(OptionsParser &p) = delete; - OptionsParser(OptionsParser &&p) = delete; - void operator=(OptionsParser &p) = delete; - void operator=(OptionsParser &&p) = delete; - void parse(const char *args) const; - void parse(int argc, const char **argv) const; - void usage(std::ostream &os, int indentation = 0, std::string mod_name = "") const; + OptionsParser(); + OptionsParser(const std::string& name, const std::string& info); + ~OptionsParser(); + OptionsParser(OptionsParser& p) = delete; + OptionsParser(OptionsParser&& p) = delete; + void operator=(OptionsParser& p) = delete; + void operator=(OptionsParser&& p) = delete; + void parse(const char* args) const; + void parse(int argc, const char** argv) const; + void usage(std::ostream& os, int indentation = 0, std::string mod_name = "") const; protected: - std::string m_name; - std::string m_info; - char m_delim; - struct Option { - std::string m_short; - std::string m_long; - std::string m_hint; - std::string m_description; - OptionParserFunc m_parser; - OptionFlags m_flags; - }; - std::vector