config: follow-up (#2268)

Some changes in the parameters names.
Add a fuzzer to fuzz the configuration file format.
Add the infrastructure to configuratin callbacks.
Add an helper to map LRU cache indexes to names.
This commit is contained in:
Ivan Nardi
2024-01-20 16:14:41 +01:00
committed by GitHub
parent 8651ce9811
commit 42d23cff6a
62 changed files with 264 additions and 118 deletions
+4 -4
View File
@@ -55,7 +55,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
workflow = ndpi_workflow_init(prefs, NULL /* pcap handler will be set later */, 0, ndpi_serialization_format_json);
ndpi_set_config(workflow->ndpi_struct, NULL, "log.level", "3");
ndpi_set_config(workflow->ndpi_struct, "all", "log.enable", "1");
ndpi_set_config(workflow->ndpi_struct, "all", "log", "1");
ndpi_load_protocols_file(workflow->ndpi_struct, "protos.txt");
ndpi_load_categories_file(workflow->ndpi_struct, "categories.txt", NULL);
@@ -67,9 +67,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
NDPI_BITMASK_SET_ALL(all);
ndpi_set_protocol_detection_bitmask2(workflow->ndpi_struct, &all);
ndpi_set_config(workflow->ndpi_struct, NULL, "flow.track_payload.enable", "1");
ndpi_set_config(workflow->ndpi_struct, NULL, "tcp_ack_payload_heuristic.enable", "1");
ndpi_set_config(workflow->ndpi_struct, "tls", "application_blocks_tracking.enable", "1");
ndpi_set_config(workflow->ndpi_struct, NULL, "flow.track_payload", "1");
ndpi_set_config(workflow->ndpi_struct, NULL, "tcp_ack_payload_heuristic", "1");
ndpi_set_config(workflow->ndpi_struct, "tls", "application_blocks_tracking", "1");
memset(workflow->stats.protocol_counter, 0,
sizeof(workflow->stats.protocol_counter));