summaryrefslogtreecommitdiff
path: root/nDPIsrvd.c
Commit message (Collapse)AuthorAge
* 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>
* nDPIsrvd: Fixed memory leak caused be not clearing buffer cache after a ↵Toni Uhlig2022-01-26
| | | | | | | | client disconnected. * README.md: Fixed a typ0 and added a meh image from examples/py-flow-dashboard/flow-dash.py 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>
* 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>
* nDPId-test: Set max buffer size for remote descriptors useful to test ↵Toni Uhlig2021-11-04
| | | | | | caching/buffering. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Fixed anther bug, introduced during refactoring -_-Toni Uhlig2021-09-15
| | | | | | nDPId-test: Collect information about JSON string length's. 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>
* Improved nDPIsrvd buffer bloat handling using caching.Toni Uhlig2021-08-04
| | | | | | | * still allow blocking mode (with send timeout) * improved daemon start/stop test script 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>
* Build system cleanup / cosmetics.1.4Toni Uhlig2021-06-07
| | | | | | * libnDPI submodule update Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Unified IO buffer mgmt.Toni Uhlig2021-06-07
| | | | | | | * c-collectd gives the user control over collectd-exec instance name * added missing collectd type `flow_l4_icmp_count` Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* travis-ci build CMake projectToni Uhlig2021-04-15
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId-test: added JSON distribution + JSON parsing (Multithreaded design ↵Toni Uhlig2021-04-09
| | | | | | | | | | | | | | re-using most of nDPId/nDPIsrvd core) * improved Makefile.old install targets * splitted nDPIsrvd_parse into nDPIsrvd_parse_line and nDPIsrvd_parse_all for the sake of readability * minor Python script improvments (check for nDPIsrvd.py on multiple locations, may be superseeded by setuptools in the future) * some paths needs to be absolute (chdir() during daemonize) and therefor additional checks introduced * test run script checks and fails if certain files are are missing (PCAP file <=> result output file) * removed not very useful "internal format error" JSON serialization if a BUG for same exists * fixed invalid l4 type statistics counters for nDPIsrvd-collectd Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added nDPId-test as all-in-one JSON dumper.Toni Uhlig2021-03-24
| | | | | | | | | * fixed invalid flow event schema type * added run_tests.sh to generate/diff JSON dumps * renamed lot's of vars/fns in nDPId.c/nDPIsrvd.c, so nDPId-test.c can include "*.c" * improved CMake dependency checks Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Reduced code duplication. Preps for nDPId-test.Toni Uhlig2021-03-23
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd collectd-exec overhaul.Toni Uhlig2021-03-15
| | | | | | | * Install targets updated. * Removed nDPIsrvd.h token validation function (done automatically by token_get). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd refactoringToni Uhlig2021-03-05
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Finalized examples/c-captured to dump packet bytes to PCAP for further analysis.Toni Uhlig2021-02-24
| | | | | | * Fixed memory holes in nDPId structs. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Extended nDPIsrvd.h with address parsing.Toni Uhlig2021-02-23
| | | | | | | | | * nDPId supports looading of custom nDPI protocol/category files * extended JSON schemas according to nDPI / nDPId JSON serializing * removed memory holes in nDPId * extended examples/c-captured Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed braindead failure - Increase of NETWORK_BUFFER_MAX_SIZE > 9999 means ↵Toni Uhlig2021-01-27
| | | | | | | | | to also increase NETWORK_BUFFER_LENGTH_DIGITS to 5. * Fixed ARM32 xcompile warnings; Other GCC versions, other uint64_t's.. * Replaced ridiculous nDPIsrvd_JSON_BYTES with NETWORK_BUFFER_LENGTH_DIGITS. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Distributor clients which are too slow can cause buffer bloat.Toni Uhlig2020-12-19
| | | | | | | | | Switching back to blocking mode works as a quick fix but is not sufficient. See comments. * nDPId prints more accurate error messages if command line argument validation failed Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Let travis use pcap files from nDPI to produce some JSON output. (disabled, ↵Toni Uhlig2020-12-01
| | | | | | | | | | | needs further testing..) * Added pcap diff script * Added \n to JSON string end (useful for debugging and readability) * Use first host/server name character for hash calculation as well * Removed error'ing EPOLLHUP handling in nDPIsrvd (connection closing will be detected via read()) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId/nDPIsrvd: change_user_group does now chown/chmod collector/distributor ↵Toni Uhlig2020-10-07
| | | | | | socket paths Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Added very important warning and use UDS now by default.Toni Uhlig2020-09-29
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Improved UDS related code parts.Toni Uhlig2020-09-29
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Use of an anonymous enum for collector/distributor socket types ↵Toni Uhlig2020-09-07
| | | | | | fits best. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Change user/group, allow listening on UNIX socket for incoming ↵Toni Uhlig2020-09-05
| | | | | | distributor connections Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: add command line option for distributor listen host/portToni Uhlig2020-08-18
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: log ip:port for distributor connection failsToni Uhlig2020-08-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* minor improvments regarding flow guessing on flow end/idle and other not ↵Toni Uhlig2020-08-16
| | | | | | worth to mention Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* error handling enhancementsToni Uhlig2020-08-15
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: fixed another two bugs; one related to EPOLLIN event for fd with ↵Toni Uhlig2020-08-15
| | | | | | shutdown reading end, one if write() did not write all bytes Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* several fixes and improvmentsToni Uhlig2020-08-14
| | | | | | | | - set errno to 0 if it is checked right after a libc call - ignore SIGPIPE as we want to avoid signal handling where possible - fixed another issue in nDPIsrvd/c-json-stdout which caused buffering errors Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* minor improvmentsToni Uhlig2020-08-14
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: fixed broken bufferingToni Uhlig2020-08-14
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* improved nDPIsrvd buffering if write returned EAGAINToni Uhlig2020-08-12
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* do not disconnect a distributor client if write returned EAGAIN (still not ↵Toni Uhlig2020-08-09
| | | | | | perfect) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd sighandler and cmd opt parserToni Uhlig2020-08-06
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* introduced NETWORK_BUFFER_MAX_SIZE to replace BUFSIZ as this might change ↵Toni Uhlig2020-08-04
| | | | | | depending on the arch/libc used Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* fixed buffering issue, improved logging verbosityToni Uhlig2020-08-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* clang-formatToni Uhlig2020-08-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: collect, buffer and distribute JSON stringsToni Uhlig2020-08-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* merged some pre-processor macros which are used in multiple executablesToni Uhlig2020-08-04
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* forwarding data from collector(client,source,UNIX-sock) to ↵Toni Uhlig2020-08-03
| | | | | | distributor(client,sink,TCP-sock) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* remote connection tracking/ event-handling for collector(UNIX) and ↵Toni Uhlig2020-08-03
| | | | | | distributor(TCP) connections Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: getting events from epoll and accepting new connectionsToni Uhlig2020-07-19
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: UNIX/INET socket creationToni Uhlig2020-07-19
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>