Commit graph

173 commits

Author SHA1 Message Date
Vitaly Lavrov
a6f5031574 Merge commit 'ca9d819151' into flow_info-4 2026-11-20 12:35:21 +03:00
netcons
eda68ccc93
Ambiguous data in GitHub domain lists (#3293)
GitHub downloaded lists are converted by ipaddr2list.py, which strips leading "*."
If "*.domain" and "domain" exists in these lists.
It causes "domain" to exist in multiple converted lists.
2026-10-23 13:21:59 +02:00
Vitaly Lavrov
094c9014a4 Merge commit 'eb8024ea92' into flow_info-4 2026-10-07 10:18:05 +03:00
Vitaly Lavrov
cab81ce615 Merge commit '7d1edd831c' into flow_info-4 2026-10-05 14:07:49 +03:00
Vitaly Lavrov
5fa42a1942 Merge commit 'dedf61e9cc' into flow_info-4 2026-10-02 15:32:03 +03:00
Ivan Nardi
c8443f9747 Temporary workaround since mining list is no more directly available 2026-09-15 08:51:14 +02:00
Luca Deri
d7c97ba097 Improved dual-license wording 2026-08-25 16:58:08 +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
Vitaly Lavrov
734cff685b Merge branch 'github.dev' into flow_info-4 2026-07-13 14:44:55 +03:00
Ivan Kapranov
54c3192279
fix urls for downloading google crawlers (#3191) 2026-07-07 19:17:21 +02:00
Vitaly Lavrov
a24240213c Merge branch 'github.dev' into flow_info-4
Some checks failed
CIFuzz / Fuzzing (address) (push) Has been cancelled
CIFuzz / Fuzzing (memory) (push) Has been cancelled
CIFuzz / Fuzzing (undefined) (push) Has been cancelled
+Fix after merge
2026-05-27 14:37:54 +03:00
Ivan Nardi
70b7d941cf
build: improve cross-compilation support and tests (#3185)
Cross-compilation: add s390x script, fix libtool cross-tools warning

- utils/cross-compile-test-s390x.sh: new script mirroring the aarch64
  one but targeting IBM s390x; full mode installs s390x multiarch libs,
  builds examples+tests and runs the full test suite via QEMU binfmt_misc.
- utils/cross-compile-test.sh (aarch64): add pkgconf to COMMON_PKGS,
  remove stale src/include/ndpi_config.h before VPATH build,
  add full binfmt_misc test-suite section matching the s390x script.
- .github/workflows/build_crosscompilation.yml: add s390x CI job alongside
  the existing aarch64 job; both use the respective scripts in full mode.
- configure.ac: pre-set FILECMD and MANIFEST_TOOL via AC_PATH_PROG before
  LT_INIT so libtool's AC_CHECK_TOOL finds them already resolved and does
  not search for ${host}-file / ${host}-mt, eliminating the spurious
  "using cross tools not prefixed with host triplet" autoconf warning.
- cross-compilation scripts: add --tests mode, keep ndpiReader -H in --full

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 21:22:54 +02:00
Ivan Nardi
6dcb262236
configure: fix cross-compilation best practices (#3183)
- Move Darwin clang/clang++ preference (`: ${CC:=clang}`) before
  AC_PROG_CC so the hint actually takes effect; previously it ran after
  CC was already chosen.
- Remove global AC_LANG_WERROR; it caused false-negative feature checks
  with strict cross-compilers.
- Add cross-compilation warning block (fires when build != host) that
  alerts the user when PKG_CONFIG_SYSROOT_DIR / PKG_CONFIG_LIBDIR are
  unset and when build-host paths (Homebrew, DPDK, PCAP_HOME+PF_RING)
  may not apply to the target.
- Guard Homebrew include/lib injection with `test "$cross_compiling" != yes`
  so it is skipped when cross-compiling from a macOS host.
- Make pfring_config execution conditional on the binary being present
  and executable (guards against absent or target-arch binary).
- Save and restore PKG_CONFIG_PATH around the custom libpcap pkg-config
  lookup to prevent it leaking into subsequent checks; also quote
  $PKG_CONFIG in the shell interpolation.
- Quote previously unquoted variables in test expressions: $OS_TYPE,
  $HOMEBREW_DIR, $HOME/DPDK, $PCAP_HOME.
- Replace BSD-only `date -r FILE` with `stat -c`/`stat -f` fallback
  chain that works on both GNU/Linux and macOS.
- Move AC_CANONICAL_HOST before PKG_PROG_PKG_CONFIG so the source-level
ordering matches the required expansion order (PKG_PROG_PKG_CONFIG uses
AC_PATH_TOOL which requires AC_CANONICAL_HOST).
- Remove AC_PROG_CPP_WERROR: it makes all AC_CHECK_HEADERS calls use
-Werror on the preprocessor, which can produce false negatives when
cross-compiling with a stricter cross-compiler. Same rationale as the
earlier removal of AC_LANG_WERROR.

Also add utils/cross-compile-test.sh: a self-contained script that
exercises the cross-compilation path on Ubuntu x86-64 targeting
AArch64 (aarch64-linux-gnu).  Supports a fast --library-only mode and
a --full mode that installs arm64 multiarch dev libraries, configures
with PKG_CONFIG_SYSROOT_DIR, builds examples and unit tests, and runs
ndpiReader -H under QEMU user-mode emulation to verify the resulting
binary executes correctly on the build host.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 10:22:06 +02:00
Ivan Nardi
24d88cf784
CI: rework jobs (#3180) 2026-05-11 18:11:33 +02:00
Vitaly Lavrov
e5d3178c64 Merge commit '68c7159a72' into flow_info-4 2026-05-07 10:17:25 +03:00
Ivan Nardi
307643d4ee
Remove Whatsapp IPs list: Meta doesn't provide it anymore (#3153) 2026-04-16 13:32:27 +02:00
Vitaly Lavrov
4928347756 Merge commit '15bac7a892' into flow_info-4 2026-03-20 11:06:51 +03:00
Vitaly Lavrov
c4e6a75800 Merge commit 'ac4cc91cea' into flow_info-4 2026-03-20 11:01:23 +03:00
Ivan Nardi
c89fe74812
utils: follow redirect when using curl (#3117) 2026-02-17 09:59:35 +01:00
Ivan Kapranov
ac4cc91cea
GitHub: (sub-)classification improvement (#3108)
Add specific protocol ids for Copilot, GitHub Actions and GitHub Packages.

There is some overlapping between the addresses in the Github list and in the Azure one.
Not sure about the best action here: add a (temporary?) workaround to avoid collisions.

Close #2976

---------

Co-authored-by: Ivan Nardi <nardi.ivan@gmail.com>
2026-02-08 21:08:02 +01:00
Vitaly Lavrov
07b76c4d26 Merge commit '1ffc582e76' into flow_info-4 2026-02-06 12:32:00 +03:00
Vitaly Lavrov
19e85f2eff The ndpi_network_list_compile tool has been moved to the utils/ folder. 2026-01-14 11:30:56 +03:00
Luca Deri
37ca034697 (C) update 2026-01-01 10:31:40 +01:00
Luca Deri
8aaff75ede
Fixes protocol inconsistencies (#3069)
* Added code to address inconsistencies
* Added check for discarding dig errors
* Temporarily disabled whatsapp script: an update is required. See https://developers.facebook.com/docs/whatsapp/on-premises/sunset
2025-12-31 20:54:35 +01:00
Vitaly Lavrov
3dedede44b Merge commit '0a97483835' into flow_info-4 2025-12-09 13:09:34 +03:00
Vitaly Lavrov
4aee91fd7a Merge commit 'd76007054c' into flow_info-4 2025-12-09 12:47:45 +03:00
Vitaly Lavrov
acdd82f4c4 Merge commit 'e22a434709' into flow_info-4 2025-12-08 15:05:45 +03: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
Vitaly Lavrov
427e9e2799 Merge commit '6ab338928c' into flow_info-4 2025-11-27 15:47:14 +03:00
Ivan Nardi
b2357c29c3
Build system: Standardize and improve clean/distclean targets (#3039)
This commit improves the nDPI build system by standardizing cleanup
targets, improving portability, and ensuring complete removal of
generated files during `make distclean`.

Changes:

1. Standardize clean targets (replace /bin/rm with portable $(RM))

2. Add distclean-local targets for complete cleanup

3. Add missing clean/distclean targets

4. Remove obsolete commented-out curl detection code

5. fuzz/Makefile.am: Fix out-of-tree build compatibility by replacing hardcoded
   relative paths (../example/fuzz_*.o) with proper $(top_builddir) variables.
   Add distclean-local target.
2025-11-24 18:42:03 +01:00
Ivan Nardi
19ee4f6c33
Build system: minor fixes about flag compilation and example dependencies (#3038)
- always use `-Wextra` compilation flag; it was already used in CI
- always compile `ndpiSimpleIntegration` when building examples
- don't mess with optimization flags: `CFLAGS` default value is "-g -O2"
  and the user can change it

Try to test -O1,2,3,s flags in CI.

Fix some warnings.
2025-11-21 15:51:29 +01:00
Vitaly Lavrov
218f84587a Merge commit 'bc6dc56d8f' into flow_info-4 2025-11-20 12:16:54 +03:00
Ivan Nardi
e22a434709
Rework API to set custom memory allocator functions (#3023)
Full accounting of memory used by the library.

Change `ndpi_realloc()` prototype to be compatible with standard
`realloc()`.
Be compatible with croaring allocation logic.

Note that aligned allocations are used only by croaring code.
Note that flow allocations are used only by the application, not by the
library.

API changes:
* remove `set_ndpi_malloc()` and `set_ndpi_free()`; use
  `ndpi_set_memory_alloction_functions()` instead
2025-11-09 13:11:55 +01:00
Ivan Nardi
6ab338928c
Add support for out-of-tree builds (#2993)
Initial work to support out-of-tree builds
```
./autogen.sh
mkdir build
cd build
../configure
make
make check
```
IMPORTANT: `autogen.sh` doesn't call `configure` automatically anymore!!

You have to do: `./autogen.sh && ./configure --$OPTIONS`.
A little bit annoying but the pattern `autogen && configure && make` is
very common on Linux.

Known issues:
* `make doc` doesn't work in out-of-tree builds, yet
* Windows/MinGW/DPDK (out-of-tree) builds have not been tested, so it is unlikely they work

See: #2992
2025-11-03 11:58:59 +01:00
Luca Deri
6001c9f34c Akamai IP address download 2025-10-18 12:25:16 +02:00
Luca Deri
d69446893d Added NDPI_MISMATCHING_PROTOCOL_WITH_IP flow risk
Fixed host protocol matching
Added NDPI_PROTOCOL_AKAMAI protocol
2025-10-17 23:48:44 +02:00
Vitaly Lavrov
71e8488d35 Merge commit 'b99d942d89' into flow_info-4 2025-10-17 13:44:05 +03:00
Vitaly Lavrov
acc3d16c59 Merge commit 'c9dfc946ff' into flow_info-4 2025-10-17 13:38:58 +03:00
Ivan Nardi
17879f40dc
Automatically update the ip list of ChatGPT bots (#2977) 2025-10-02 20:18:09 +02:00
Ivan Nardi
113170cca4
New protocols for Amazon/AWS sub-classification (#2975)
Add:
* Cognito
* API Gateway
* Kinesis
* EC2
* EMR
* S3
* Cloudfront
* DynamoDB

Keep `NDPI_PROTOCOL_AMAZON_AWS` for generic AWS traffic
2025-10-02 11:48:25 +02:00
Luca Deri
3358fb5516 Code cleanup 2025-09-27 23:01:54 +02:00
Vitaly Lavrov
f4deca6b3e Merge commit '1c1535738f' into flow_info-4 2025-09-24 11:15:22 +03:00
Vitaly Lavrov
1478cecfc7 Merge commit '7152c5c289' into flow_info-4 2025-09-24 11:05:48 +03:00
Luca Deri
d20f4bb1c0 Added utility to print content of rank files 2025-09-12 11:27:53 +02:00
Ivan Nardi
30cd98f978
croaring: update to 4.3.6 (from 3.0.0) (#2934)
Old compilers (example: gcc < 7, mingw or VS older than 2022) don't
work with latest croaring versions; note that we had this issue even
before this change...

We somehow try to autodect if we can use latest version (TODO: we can do
better!): otherwise we fallback to legacy code.
The user can force that via `--enable-old-croaring` option: that's the
option to use if you get any errors on `roaring.c` filw while compiling.

Remove `-AC_COMPILE_IFELSE` check which does nothing and provides
misleading output!

On CI, we always use legacy version on Windows (if we use VisualStudio)
and with Mingw compiler.

Please, note that before the recent code adding
`NDPI_UNRESOLVED_HOSTNAME` support, the croaring code, even if present
in the repository, was NEVER used!!
2025-09-02 15:50:03 +02:00
Vitaly Lavrov
3c9bcebc88 Merge commit '2279a011c8' into flow_info-5 2025-08-19 11:12:12 +03:00
Vitaly Lavrov
b506bd09d5 Merge commit '79f0cbd32a' into flow_info-5 2025-08-19 10:31:08 +03:00
Vitaly Lavrov
517e9bad48 Merge commit '81ca06b0c7' into flow_info-5 2025-08-19 10:24:44 +03:00
Ivan Nardi
1dd6d4c30c
MS domain lists: avoid duplicates (#2928)
Update all MS domains lists.

Close #2927
2025-08-02 19:11:40 +02:00
Vitaly Lavrov
933d39679f Merge commit '38fe9859b3' into flow_info-5 2025-07-29 15:40:15 +03:00