summaryrefslogtreecommitdiff
path: root/nDPId.c
Commit message (Collapse)AuthorAge
* Read and parse configuration files. Fixes #41. (#42)1.7rc1Toni2024-10-16
| | | | | | | | | | | Read and parse configuration files. Fixes #41. * supports nDPId / nDPIsrvd via command line parameter `-f` * nDPId: read general/tuning and libnDPI settings * support for settings risk domains libnDPI option via config file or via `-R` (Fixes #45, thanks to @UnveilTech) * added some documentation in the config file * adjusted Systemd and Debian packaging to make use of config files Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added some static assertion based sanity checks.Toni Uhlig2024-09-11
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Save hostname after detection finished for later use within analyse/end/idle ↵Toni Uhlig2024-09-11
| | | | | | flow events. Fixes #39. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Add PF_RING support. (#38)Toni2024-08-19
|
* Added global (heap) memory stats for daemon status events.Toni Uhlig2024-06-19
| | | | | | | | * added new CMake option `ENABLE_MEMORY_STATUS` to restore the old behavior (and increase performance) * splitted `ENABLE_MEMORY_PROFILING` into `ENABLE_MEMORY_STATUS` and `ENABLE_MEMORY_PROFILING` Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 9185c2ccc402d3368fc28ac90ab281b4f951719eToni Uhlig2024-04-04
| | | | | | * incorporated API changes from 41eef9246c6a3055e3876e3dd7aeaadecb4b76c0 Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Read Ipv6 address and netmask using `getifaddrs()` instead of reading ↵Toni Uhlig2024-02-07
| | | | | | | | `/proc/net/if_inet6`. * fixes a compatibility issue with Mac OSX Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Removed API version macro check as it's inconsistent on different platforms.Toni Uhlig2024-02-06
| | | | | | * set min required nDPI version to 4.9.0 Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 4543385d107fcc5a7e8632e35d9a60bcc40cb4f4Toni Uhlig2024-02-06
| | | | | | * incorporated API changes from nDPI Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed an event issue.Toni Uhlig2023-12-14
| | | | | | | | | * a "detection-update" event was thrown even if nothing changed * in some cases "not-detected" events were spammed if detection not completed * tell `libnDPI` how many packets per flow we want to dissect * `nDPId-test` validates total active flows in the right way Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Replaced ambiguous naming of "JSON string" to more accurate "JSON message". #2Toni Uhlig2023-12-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Replaced ambiguous naming of "JSON string" to more accurate "JSON message".Toni Uhlig2023-12-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved zlib compression ratio.Toni Uhlig2023-12-01
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Warn about unused return values that are quite important.Toni Uhlig2023-12-01
| | | | | | | * CI: ArchLinux build should now instrument `-Werror` * CI: Increased OpenWrt build verbosity Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed SonarCloud complaints.Toni Uhlig2023-11-20
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed clang-tidy warnings.Toni Uhlig2023-11-13
| | | | | | * fixed/improved c-captured logging Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to b08c787fe267053afdea82701071f3878c09244bToni Uhlig2023-11-09
| | | | | | | * fix ndpi data anylsis struct min/max issue * py-flow-info cosmetics in printing some information Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Forcefully reset `NDPI_UNIDIRECTIONAL_TRAFFIC` if classification was done ↵Toni Uhlig2023-11-08
| | | | | | after the first packet. Nonsense. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed missing deflate during flow event json serializing.1.6rc3Toni Uhlig2023-11-08
| | | | | | * caused by recently added serializing some nDPI data even packet processing is still ongoing Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Reset `Unidirectional Traffc` risk if packets from both directions processed.1.6rc2Toni Uhlig2023-11-08
| | | | | | | * Fixed risk hash value calculation, which was only done lower 32 bits. * Reduced default reader threads count to two if cross compiling. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed more SonarCloud complaints.Toni Uhlig2023-11-07
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed some SonarCloud complaints.Toni Uhlig2023-11-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Apple/BSD port (#30)Toni2023-11-06
| | | | | | | | * Add MacOS to Github CI builds. * Fixed libnDPI-4.8 CI build. * Fixed missing include for `struct sockaddr*`. * Reworked IPv4 address and netmask retrieval. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Event I/O abstraction layer. (#28)Toni2023-11-06
| | | | | | | | | | | * Finalize Event I/O abstraction layer. * Fix possible fd leakage, Gitlab-CI build and error logging. * Fixed possible uninitialized signalfd variable. * Fixed possible memory leak. * Fixed some SonarCloud complaints. * Fixed nDPId-test nDPIsrvd-arpa-mockup stuck indefinitely. * Add nDPId / nDPIsrvd command line option to use poll() on Linux instead of the default epoll(). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fix issues detected by SonarCloud.Toni Uhlig2023-10-05
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Serialize nDPId / libnDPI versions within daemon events.Toni Uhlig2023-09-10
| | | | | | * changed nDPI version hints / requirements Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 1f693c3f5a5dcd9d69dffb610b9a81bd33f95382Toni Uhlig2023-08-27
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed invalid base64 encoding in some rare cases.Toni Uhlig2023-08-24
| | | | | | * nDPId-test may also verify the correct encoding/decoding Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Tiny improvments.Toni Uhlig2023-08-02
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 2b230e28e0612e8654ad617534deb9aaaabd51b7Toni Uhlig2023-07-23
| | | | | | | * fixes loading of gambling lists which increased nDPId's memory usage *a lot* * nDPId: handle EINTR correctly Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: `-v' give information about libnDPI linkageToni Uhlig2023-07-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: `-v' prints also information about dependeciesToni Uhlig2023-07-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* `get-and-build-libndpi.sh` uses GMake MAKEFLAGS for sub-make (required for ↵Toni Uhlig2023-07-16
| | | | | | | | e.g. jobserver) * fixed invalid CMake `test -r ...` Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Required libnDPI version increases (>=4.8.0) due to an API change.lns2023-05-31
| | | | | | * fix CI issues Signed-off-by: lns <matzeton@googlemail.com>
* bump libnDPI to 04f5c5196e790db8b8cc39e42c8645fb7f3dd141lns2023-05-30
| | | | | | * added custom nDPI logging callback Signed-off-by: lns <matzeton@googlemail.com>
* Fixed integer overflow for tcp timeout (>INT_MAX).lns2023-05-26
| | | | Signed-off-by: lns <matzeton@googlemail.com>
* Moved `datalink` json key/value from error to packet events and renamed it ↵Toni Uhlig2023-04-21
| | | | | | to `pkt_datalink`. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPid: Fixed base64encode bug which lead to invalid base64 strings.Toni Uhlig2023-01-09
| | | | | | | | * py-semantic-validation: Decode base64 raw packet data as well * nDPIsrvd.py: Added PACKETS_PLEN_MAX * nDPIsrvd.py: Improved JSON parse error/exception handling Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Limit the size of base64 serialized raw packet data (8192 bytes per packet).Toni Uhlig2022-12-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId-test: Reworked I/O handling to prevent some endless loop scenarios. ↵Toni Uhlig2022-12-02
| | | | | | | | Fixed a race condition in the memory wrapper as well. * nDPId: Instead of sending too long JSON strings, log an error and some parts. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Unified nDPId/nDPIsrvd command line argument storage.Toni Uhlig2022-11-21
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved the point of time when to append the raw packet base64 data to the ↵Toni Uhlig2022-11-15
| | | | | | | | | serializer. * nDPId-test: Increased the max-packets-per-flow-to-send from 3 to 5. This is quite useful for TCP as the first 3 packets are usually part of the three-way-handshake. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Provide workaround for change user/group.Toni Uhlig2022-11-13
| | | | | | | | * nDPId/nDPIsrvd/c-examples: Parameter parsing needs to be improved if `strdup()` in combination with static strings is used. * Other non-critical fixes. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: Fixed base64 encoding issue.Toni Uhlig2022-11-13
| | | | | | | | | | | | * The issue can result in an error message like: `Base64 encoding failed with: Buffer too small.` and also in too big JSON strings generated by nDPId which nDPIsrvd does not like as it's length is greater than `NETWORK_BUFFER_MAX_SIZE`. * nDPId will now obey `NETWORK_BUFFER_MAX_SIZE` while trying to base64 encode raw packet data. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Experimental systemd support.Toni Uhlig2022-11-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: Added error event threshold to prevent event spamming which may be ↵Toni Uhlig2022-10-17
| | | | | | abused. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved py-machine-learning example.Toni Uhlig2022-10-09
| | | | | | | | | * c-analysed: fixed quoting bug * nDPId: fixed invalid iat storing/serialisation * nDPId: free data analysis after event was sent Signed-off-by: Toni Uhlig <matzeton@googlemail.com> Signed-off-by: lns <matzeton@googlemail.com>
* Added nDPIsrvd-analysed to generate CSV files from analyse events.Toni Uhlig2022-09-30
| | | | | | | * nDPIsrvd.h: iterate over JSON arrays * nDPId: calculate l3 payload packet entropies for analysis Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Refactored client distributor C API.Toni Uhlig2022-09-25
| | | | | | | | | | | * Still not perfect, but the code before was not even able to deal with JSON arrays. Use common "speaking" function names for all functions in nDPIsrvd.h * Provide a more or less generic and easy extendable JSON walk function. * Modified C examples to align with the changed C API. * c-collectd: Reduced lot's of code duplication by providing mapping tables. * nDPId: IAT array requires one slot less (first packet has always an IAT of 0). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved flown analyse event:Toni Uhlig2022-09-22
| | | | | | | | * store packet directions * merged direction based IATs * merged direction based PKTLENs Signed-off-by: Toni Uhlig <matzeton@googlemail.com>