diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-10-14 18:05:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 18:05:35 +0200 |
commit | 521d0ca7a0196889f5452a2e725f8e01ddf79efb (patch) | |
tree | 06b76aa973aa8cf380c064750c4b9a052af82e29 /fuzz/fuzz_config.cpp | |
parent | 44d0d9454c5db4e7863ed0b83c94de08eb19e132 (diff) |
Add monitoring capability (#2588)
Allow nDPI to process the entire flows and not only the first N packets.
Usefull when the application is interested in some metadata spanning the
entire life of the session.
As initial step, only STUN flows can be put in monitoring.
See `doc/monitoring.md` for further details.
This feature is disabled by default.
Close #2583
Diffstat (limited to 'fuzz/fuzz_config.cpp')
-rw-r--r-- | fuzz/fuzz_config.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fuzz/fuzz_config.cpp b/fuzz/fuzz_config.cpp index 69ca93489..37f340bcd 100644 --- a/fuzz/fuzz_config.cpp +++ b/fuzz/fuzz_config.cpp @@ -295,6 +295,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ndpi_get_config(ndpi_info_mod, cfg_proto, "ip_list.load", cfg_value, sizeof(cfg_value)); } if(fuzzed_data.ConsumeBool()) { + pid = fuzzed_data.ConsumeIntegralInRange<u_int16_t>(0, NDPI_MAX_SUPPORTED_PROTOCOLS + 1); /* + 1 to trigger invalid pid */ + value = fuzzed_data.ConsumeIntegralInRange(0, 1 + 1); + snprintf(cfg_value, sizeof(cfg_value), "%d", value); + snprintf(cfg_proto, sizeof(cfg_proto), "%d", pid); + ndpi_set_config(ndpi_info_mod, cfg_proto, "monitoring", cfg_value); + } + if(fuzzed_data.ConsumeBool()) { value = fuzzed_data.ConsumeIntegralInRange(0, 255 + 1); snprintf(cfg_value, sizeof(cfg_value), "%d", value); ndpi_set_config(ndpi_info_mod, NULL, "packets_limit_per_flow", cfg_value); |