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.
* 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>
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>
- 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>
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>
- 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.
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
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
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!!