Commit graph

8 commits

Author SHA1 Message Date
Luca Deri
61337dad12
Reworked code to split flow definition in core and metadata 2026-09-05 15:48:02 +02:00
Ivan Nardi
f290b81018
Build: compiler-driven header dependency tracking; fix --with-ndpi-pro (#3239)
The hand-written Makefiles compiled objects with a rule of the form
"%.o: %.c $(HEADERS)" where $(HEADERS) was a hand-maintained list. That list
missed transitive headers, third_party/include/*.h, the generated *.c.inc
files, and the ndpi-pro/nDPI-custom protocol snippets that tls.c #includes, so
editing any of those did not trigger a rebuild.

Replace it with automatic dependency tracking: compile with -MMD -MP so the
compiler writes an exact .d fragment per object, and read those back with
-include $(wildcard *.d). -MP emits phony targets for each header so a removed
header does not break the build. The explicit $(HEADERS) list is dropped
(kept only the generated-header ordering for the first compile); .d files are
removed by "make clean" and ignored via *.d in .gitignore.

Applied to src/lib, src/lib/plugins, example, tests/unit and tests/dga; the
automake-generated Makefiles already do this.

Also fix a typo that made --with-ndpi-pro a no-op: the AS_IF tested
${with_npri_pro} instead of ${with_ndpi_pro}, so CUSTOM_NDPI /
-DCUSTOM_NDPI_PROTOCOLS was never set.
2026-08-29 14:54:11 +02:00
Ivan Nardi
1f2606902c
License: non-commercial vs commercial applications (#3220)
* WIP

* Fix compilation of fuzzing

* Fix fuzzing compilation

* Cleaned up old quic contributed code (#3222)

Recode commits 713cdd0, 26df140

* QUIC: refactoring

* WIP

* WIP

* Revert "QUIC: refactoring"

This reverts commit 50afd07f28.

* QUIC: refactoring original Wireshark code (#3224)

* Added ability to specify in protocol definition, when a (partial) protocol
can change. This can be queries using a new APi call
named ndpi_can_partial_proto_classification_change()

* TLS: minor changes and remove same stale comments

* Fix out-of-bounds read of TLS certificate dates (#3225)

notBefore and notAfter are u_int32_t, but ndpi_tls2json() passed their
address to ndpi_gmtime_r() as a time_t *. Wherever time_t is 8 bytes this
reads 4 bytes past the field, picking up the adjacent member, so the value
handed to gmtime_r() is notBefore | (notAfter << 32) on little-endian.

gmtime_r() then fails on that out-of-range value and returns NULL, leaving
before/after NULL, so the "notbefore" and "notafter" fields are silently
dropped from the JSON output. On architectures that require aligned access
the 8-byte load traps instead of merely being wrong.

Convert to a real time_t instead of casting the address. The temporaries
are named not_before/not_after because notBefore/notAfter are already
char[32] buffers in the same function.

* WIP

* fuzz: fix compilation

---------

Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
Co-authored-by: Luca Deri <deri@ntop.org>
Co-authored-by: shalseth <33956011+shalseth@users.noreply.github.com>
2026-08-22 17:57:28 +02:00
Luca Deri
082bf536cb Added ability to specify in protocol definition, when a (partial) protocol
can change. This can be queries using a new APi call
named ndpi_can_partial_proto_classification_change()
2026-08-17 12:10:16 +02:00
Ivan Nardi
d4ea2be1b7
build: plugins: fix missing header dependencies causing stale rebuilds (#3132) 2026-03-08 20:08:56 +01:00
Ivan Nardi
36b79954d9
Rename register_dissector() into ndpi_register_dissector() (#3093)
Try to avoid collisions with similar Wireshark function: see #3063.
Note that this function is now used by plugins, so it is somehow part
of the public API anyway.

Close #3063
2026-01-18 12:48:50 +01:00
Luca Deri
37ca034697 (C) update 2026-01-01 10:31:40 +01:00
Luca Deri
3f2f1f8ce4
Added ability to define protocol dissectors in shared libraries (#3047)
* Added ability to define protocol dissectors in shred libraries and load them at runtime

---------

Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2025-12-04 15:26:15 +01:00