summaryrefslogtreecommitdiff
path: root/nDPId.c
Commit message (Collapse)AuthorAge
...
* 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>
* bump libnDPI to 0b3f8ed849cdf9971224c49a3958f0904a2bbbb5lns2022-06-06
| | | | | | * README/nDPId: fixed typ0 Signed-off-by: lns <matzeton@googlemail.com>
* Small fixes.lns2022-04-26
| | | | Signed-off-by: lns <matzeton@googlemail.com>
* nDPId: Merged nDPId_flow_(info|finished) into nDPId_flowlns2022-04-24
| | | | | | | * nDPIsrvd: Fixed buffer allocation error due to missing memset() on disconnect * nDPIsrvd: Removed unused struct members Signed-off-by: lns <matzeton@googlemail.com>
* Added proper DLT_RAW dissection for IPv4 and IPv6.lns2022-04-24
| | | | | | | | | | * nDPId: Improved TCP timeout handling if FIN/RST seen which caused Midstream TCP flows when there shouldn't be any. * nDPIsrvd: Unified remote descriptor resource cleanup on disconnects/shutdown. * nDPIsrvd: Added additional error messages for remote descriptors. * py-flow-info: Better daemon status message printing. Signed-off-by: lns <matzeton@googlemail.com>
* bump libnDPI to bb12837ca75efc2691ecb18fd5f56e2d097ef26bToni Uhlig2022-03-24
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Executing ./tests/run_tests.sh w/o zLib should not result in diff's anymore.Toni Uhlig2022-03-24
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Reworked nDPIsrvd.h C-API.Toni Uhlig2022-03-21
| | | | | | | | | | | | * nDPIsrvd.h: Provide nDPId thread storage. * nDPIsrvd.py: Fixed instance cleanup bug. * nDPIsrvd.h: Support for instance/thread user data and cleanup callback. * nDPIsrvd.h: Most recent flow time stored in thread ht instead of instance ht. * nDPId: Moved flow logger out the memory profilier into SIGUSR1 signal handling. * nDPId: Added signal fd to be usable within epoll's event handling (live-capture only!) * nDPId: Added information about ZLib compressions to daemon status/shutdown events. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Renamed basic event to error event for the sake of the logic.Toni Uhlig2022-03-13
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Disconnect nDPIsrvd clients immediately instead waiting for a failed write().Toni Uhlig2022-03-13
| | | | | | | | | * nDPIsrvd: Collector/Distributor logging improved * nDPIsrvd: Command line option for max remote descriptors * nDPId: Stop spamming nDPIsrvd Collector with the same events over and over again * nDPId: Refactored some variable names and events Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed build error regarding missing LINKTYPE_* define's.Toni Uhlig2022-03-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added daemon event: DAEMON_EVENT_STATUS (periodically send's daemon statistics.)Toni Uhlig2022-03-06
| | | | | | | | | | * Improved distributor timeout handling (per-thread). * flow-info.py / flow-dash.py: Distinguish between flow risk severities. * nDPId: Skip tag switch datalink packet dissection / processing. * nDPId: Fixed incorrect value for current active flows. * Improved JSON schema's. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Serialize flow risk score / confidence.Toni Uhlig2022-02-27
| | | | | | | * bump libnDPI to 8b062295cc76a60e3905c054ce37bd17669464d1 * removed ndpi_id_struct's Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved py-flow-info to provide more optional information about received ↵Toni Uhlig2022-02-05
| | | | | | | | | | timestamps. * py-flow-dashboard: Added color mapping for PieCharts/Graph that make more sense * nDPId: Renamed `flow_type' to a more precisely `flow_state' * nDPId: Changed the default setting to process only as much packets as libnDPI does Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added additional (minimalistic) detection information to flow updates.Toni Uhlig2022-02-04
| | | | | | | | | | | | | This will only affect flows with the state `FT_FINISHED' (detection done). * nDPIsrvd.py: force use of JSON schema Draft 7 validator * flow-dash.py: gather/use total processed layer4 payload size * flow-info.py: added additional event filter * flow-info.py: prettified flow events printing whose detection is in progress * py-semantic-validation.py: added validation checks for FT_FINISHED * updated flow event JSON schema Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added logging interface used by nDPId, nDPIsrvd and nDPId-test.Toni Uhlig2022-02-03
| | | | | | | | | * fixed GitLab pipeline * nDPId: added static assert (just for a test) * nDPId: memory profiling for total bytes compressed * nDPId-test: enable zLib compression if configured with ENABLE_ZLIB Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Process additional layer 3 protocols.Toni Uhlig2022-01-31
| | | | | | | | | * bump libnDPI to c53c82d4823b5a8f856d1375155ac5112b68e8af * run_tests.sh: improved execution from non-git directories e.g. via `make dist` * updated JSON schema to be more restrictive * nDPId: splitted generic get_ip_from_sockaddr into IPv4/IPv6 to prevent compiler warnings on some platforms Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId: Added some error messages when workflow init fails.Toni Uhlig2022-01-26
| | | | | | | * Fixed invalid array subscript typ0 (caused some trouble..) * bump libnDPI to 2cd0479204301c50c6149706fcd4df3058b2a8cc Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved Plotly/Dash example. It is now somehow informative.Toni Uhlig2022-01-25
| | | | | | | * TCP timeout after FIN/RST: switched back to the value from a35fc1d5ea8570609cc0c8cf6edadc81f8f5bb76 * py-flow-info: reset 'guessed' flag after detection/detection-update received Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Major nDPId extension. Sorry for the huge commit.Toni Uhlig2022-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - nDPId: fixed invalid IP4/IP6 tuple compare - nDPIsrvd: fixed caching issue (finally) - added tiny c example (can be used to check flow manager sanity) - c-captured: use flow_last_seen timestamp from `struct nDPIsrvd_flow` - README.md update: added example JSON sequence - nDPId: added new flow event `update` necessary for correct timeout handling (and other future use-cases) - nDPIsrvd.h and nDPIsrvd.py: switched to an instance (consists of an alias/source tuple) based flow manager - every flow related event **must** now serialize `alias`, `source`, `flow_id`, `flow_last_seen` and `flow_idle_time` to make the timeout handling and verification process work correctly - nDPIsrvd.h: ability to profile any dynamic memory (de-)allocation - nDPIsrvd.py: removed PcapPacket class (unused) - py-flow-dashboard and py-flow-multiprocess: fixed race condition - py-flow-info: print statusbar with probably useful information - nDPId/nDPIsrvd.h: switched from packet-flow only timestamps (`pkt_*sec`) to a generic flow event timestamp `ts_msec` - nDPId-test: added additional checks - nDPId: increased ICMP flow timeout - nDPId: using event based i/o if capturing packets from a device - nDPIsrvd: fixed memory leak on shutdown if remote descriptors were still connected Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Use blocking I/O to prevent data loss if nDPIsrvd too slow.Toni Uhlig2021-11-16
| | | | | | * Fixed MemoryProfiler stack overflow. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* MemoryProfiling: Advanced flow usage logging.Toni Uhlig2021-11-13
| | | | | | | | * nDPId-test: disable #include <syslog.h> if NO_MAIN macro defined * nDPId-test: mock syslog flags and functions * gitlab-ci: force -Werror Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Additional semantic validation tests.Toni Uhlig2021-11-02
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed invalid "flow_last_seen" timestamp for the first packet.Toni Uhlig2021-10-08
| | | | | | | | | | * After the first packet was processed, "flow_last_seen" was still 0. This behaviour is invalid as the first packet may contain l4 payload data e.g. for UDP and it also breaks nDPId json consistency "flow_first_seen" > 0, but "flow_last_seen" == 0. * JSON schema: set minimum timestamp value for Epoch timestamps to 24710 for flow_*_seen and 1 for pcap packet ts. Those values are dependant on some manipulated pcap's in libnDPI/tests/pcap. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed some typ0's and reduced ICMP timeout to 10s.Toni Uhlig2021-09-16
| | | | | | | * nDPId: Renamed some of the misleading terms, still TODO for nDPIsrvd * CMake improvments Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* fixed Warnings / build error / cosmeticsToni Uhlig2021-09-14
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved and Fixed another buffering issue caused by removing an outgoing fd ↵Toni Uhlig2021-08-05
| | | | | | too early from epoll queue (EPOLLOUT). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Enable memory profiling for nDPId-test.Toni Uhlig2021-06-18
| | | | | | * print a summary Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added zLib compression parameters to control compression conditions.Toni Uhlig2021-06-16
| | | | | | | | * more structs are now "compressable" * fixed missing DAEMON_RECONNECT event * improved memory profiler Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Support for zLib flow memory compression. Experimental.Toni Uhlig2021-06-14
| | | | | | | Please use this feature only for testing purposes. It will change or be removed in the future. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Git tag/commit version printing for nDPId/nDPIsrvd. Reduces confusion.Toni Uhlig2021-06-08
| | | | | | * disabled subshell spawn for run_tests.sh, common pitfall while using counters Signed-off-by: Toni Uhlig <matzeton@googlemail.com>