aboutsummaryrefslogtreecommitdiff
path: root/nDPId.c
Commit message (Collapse)AuthorAge
* Reworked IPv4 address and netmask retrieval.add/apple-bsd-portToni Uhlig2023-11-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed invalid use of `SIOCAIFADDR` for `ioctl()`.Toni Uhlig2023-11-06
| | | | | | * `SIOCGIFALIAS` is the desired one Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* FreeBSD / Apple portToni Uhlig2023-11-06
| | | | 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>
* nDPId: Reduced flow-updates for TCP flows to 1/4 of the timeout value.Toni Uhlig2022-09-19
| | | | | | | | | | | | * nDPId: Fixed broken validation tests. * nDPId: Removed TICK_RESOLUTION, not required anymore. * c-collectd: Improved total layer4 payload calculation/update handling. * c-collectd: Updated RRD Graph script according to total layer4 payload changes. * py-flow-info.py: Fixed several bugs and syntax errors. * Python scripts: Added dirname(argv[0]) as search path for nDPIsrvd.py. * nDPIsrvd&nDPId-test: Fixed missing EPOLLERR check. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added layer4 payload length bins.Toni Uhlig2022-09-19
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Provide thread sync via locking on architectures that do not support ↵Toni Uhlig2022-09-17
| | | | | | Compare&Swap. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed last pkt time.lns2022-09-14
| | | | Signed-off-by: lns <matzeton@googlemail.com>
* New flow event: 'analysis'.Toni Uhlig2022-09-13
| | | | | | | | | * The goal was to provide a separate event for extracted feature that are not required and only useful for a few (e.g. someone who wants do ML). * Increased network buffer size to 32kB (8192 * 4). * Switched timestamp precision from ms to us for *ALL* timestamps. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: Removed thread_id nonsense as it does not provide any useful ↵Toni Uhlig2022-09-10
| | | | | | | | information and is not portable at all, not even on Linux systems .. * nDPId: Removed blocking I/O warning, which causes logspams.. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* include fixToni Uhlig2022-09-10
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed compilation warnings on linux32 platforms.Toni Uhlig2022-09-10
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Do not use pthread_t as numeric value. Some systems define pthread_t as struct *Toni Uhlig2022-09-10
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Bump libnDPI to 37f918322c0a489b5143a987c8f1a44a6f78a6f3 and updated flow ↵Toni Uhlig2022-09-06
| | | | | | | | | json schema file. * export env vars AR / CMAKE_C_COMPILER_AR and RANLIB / CMAKE_C_COMPILER_RANLIB while building libnDPI * nDPId check API version during startup (macro vs. function call) and print a warning if they are different Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: Fixed fcntl() issue; invalid fcntl() set after a blocking-write.lns2022-08-29
| | | | | | | * nDPId: imrpvoed collector socket error messages on connect/write/etc failures * reverted `netcat` parts of the README Signed-off-by: lns <matzeton@googlemail.com>
* nDPId: improved error messages if UNIX/UDP endpoint refuses ↵lns2022-08-27
| | | | | | connections/datagrams Signed-off-by: lns <matzeton@googlemail.com>
* nDPId: support for custom UDP endpointsToni Uhlig2022-08-27
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: improved error messages if UNIX/UDP endpoint refuses ↵lns2022-08-27
| | | | | | connections/datagrams Signed-off-by: lns <matzeton@googlemail.com>
* nDPId: support for custom UDP endpointsToni Uhlig2022-08-27
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Split `*_l4_payload_len' into `*_src_l4_payload_len' and `*_dst_l4_payload_len'.Toni Uhlig2022-08-15
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Split `flow_packets_processed' into `flow_src_packets_processed' and ↵lns2022-08-15
| | | | | | | | | `flow_dst_packets_processed'. * no use for `flow_avg_l4_payload_len' -> removed * test/run_tests.sh does not fail if git-worktree's are used Signed-off-by: lns <matzeton@googlemail.com>
* Do not SIGSEGV if a subopt has no value.lns2022-08-08
| | | | Signed-off-by: lns <matzeton@googlemail.com>
* Replaced outdated nDPI version info with the correct one.Toni Uhlig2022-07-14
| | | | | | * add CI job to verify the lowest known-to-work-libnDPI-version Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 8f6a006e36eef0ae386f7e663d3ebecfad6a2dc9Toni Uhlig2022-07-01
| | | | | | | * try to use same wording wherever possible e.g. renamed workflow->total_l4_data_len to workflow->total_l4_payload_len Signed-off-by: Toni Uhlig <matzeton@googlemail.com>