Commit graph

25 commits

Author SHA1 Message Date
Ivan Nardi
dd8be1fcb1
Fix some warnings reported by CODESonar (#2227)
Remove some unreached/duplicated code.

Add error checking for `atoi()` calls.

About `isdigit()` and similar functions. The warning reported is:
```
Negative Character Value help
isdigit() is invoked here with an argument of signed type char, but only
has defined behavior for int arguments that are either representable
as unsigned char or equal to the value of macro EOF(-1).
Casting the argument to unsigned char will avoid the undefined behavior.
In a number of libc implementations, isdigit() is implemented using lookup
tables (arrays): passing in a negative value can result in a read underrun.
```
Switching to our macros fix that.
Add a check to `check_symbols.sh` to avoid using the original functions
from libc.
2024-01-12 13:30:43 +01:00
Luca Deri
1366518bff Implements ndpi_pearson_correlation for measuring how correlated are two series 2023-12-27 22:42:37 +01:00
Toni
ef3adb9830
Added printf/fprintf replacement for some internal modules. (#1974)
* logging is instead redirected to `ndpi_debug_printf`

Signed-off-by: lns <matzeton@googlemail.com>
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2023-09-26 23:10:57 +02:00
Ivan Nardi
cc4461f424
fuzz: extend coverage (#2073) 2023-08-20 15:18:19 +02:00
Toni
4e284b5e40
Set _DEFAULT_SOURCE and _GNU_SOURCE globally. (#2010)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2023-06-12 19:53:57 +02:00
Ivan Nardi
40b6d5a2e1
fuzz: extend fuzzers coverage (#1952) 2023-04-25 16:37:28 +02:00
Ivan Nardi
22821241e2
Fix some errors found by oss-fuzz (#1834) 2022-12-20 22:50:18 +01:00
Luca Deri
3bb6bf628d Removed gettimeofday as win files has located in windows/src/ 2022-10-14 19:01:41 +02:00
Luca Deri
e4dcec560e Windows changes 2022-10-06 11:58:16 +02:00
Toni
66a8010ef7
Fix ndpi_timeval_to_milliseconds/microseconds for platforms with tv_usec is an unsigned int. (#1762)
* implicit conversion to an 32 bit unsigned int leads to an overflow

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2022-10-02 12:48:24 +02:00
Toni
b7c1030804
Fix broken ndpi_timeval_to_(milli|micro)seconds (>UINT_MAX). (#1720)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2022-09-04 19:19:05 +02:00
Toni Uhlig
c3df3a12aa Fixed msys2 build warnings and re-activated CI Mingw64 build.
* Removed Visual Studio leftovers. Maintaining an autotools project with VS integration requires some additional overhead.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Signed-off-by: lns <matzeton@googlemail.com>
2022-04-14 19:17:48 +02:00
Toni
8d0c7b1fae
Fixed Mingw64 build, SonerCloud-CI and more. (#1273)
* Added ARM build and unit test run for SonarCloud-CI.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

* Fixed Mingw64 build.

 * adapted to SonarCloud-CI workflow
 * removed broken and incomplete Windows example (tested on VS2017/VS2019)
 * removed unnecessary include (e.g. pthread.h for the library which does not make use of it)

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2021-08-18 11:34:16 +02:00
Toni Uhlig
4c776501a6
Fixed shlib xcompile for x86_64-w64-mingw32
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2020-09-08 19:52:46 +02:00
Adrian Zgorzałek
8f74d5733d OpenBSD: Introduce pkt_timeval to deal with (bpf_)_timeval
Some BSD APIs called in example/ return `struct bpf_timeval`, where nDPI
APIs expect `struct timeval`. These two structs, besides having
a different name, share the exact same set of fields.
2020-08-09 14:30:12 +01:00
Luca Deri
5a40f9b7fd Minor fixes 2020-01-21 20:52:42 +01:00
Luca Deri
14e5adc7c2 Win fixes 2019-12-14 15:05:47 +01:00
Luca Deri
c247a9d191 Code cleanup 2019-10-02 23:25:05 +02:00
Luca Deri
4fd7e5734a Manual merge of pull #769 2019-10-02 23:01:29 +02:00
Ravi Kerur
77edf1f680 Fix crash due to recent code changes when using hyperscan and mining_hosts.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-10-02 09:32:39 -07:00
Ravi Kerur
e8d501158e Restore protocol extraction to original method.
Add microseconds to time series if milliseconds returns 0.

Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-21 10:38:04 -07:00
Luca
2acffb4163 Initial work towards traffic classification 2019-08-27 12:56:15 +02:00
Luca Deri
5c6c64ed1d Warnign fix 2019-07-24 14:16:38 +02:00
Luca Deri
d398b0aba6 Simplified makefile
Fixed warning
2019-07-23 22:45:31 +02:00
Ravi Kerur
a262f8dd29 Add SPLT and BD classification to the lib.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 10:00:34 -07:00