config: move debug/log configuration to the new API

This commit is contained in:
Nardi Ivan
2024-01-18 10:21:24 +01:00
committed by Ivan Nardi
parent c704be1a20
commit 6c85f10cd5
18 changed files with 106 additions and 104 deletions
+2 -6
View File
@@ -11,8 +11,6 @@
struct ndpi_workflow_prefs *prefs = NULL;
struct ndpi_workflow *workflow = NULL;
int nDPI_LogLevel = 0;
char *_debug_protocols = NULL;
u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
u_int8_t enable_protocol_guess = 1, enable_payload_analyzer = 0;
u_int8_t enable_flow_stats = 1;
@@ -36,7 +34,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
int r;
char errbuf[PCAP_ERRBUF_SIZE];
NDPI_PROTOCOL_BITMASK all;
NDPI_PROTOCOL_BITMASK debug_bitmask;
u_int i;
FILE *fd;
@@ -57,9 +54,8 @@ 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_BITMASK_SET_ALL(debug_bitmask);
ndpi_set_log_level(workflow->ndpi_struct, 4);
ndpi_set_debug_bitmask(workflow->ndpi_struct, debug_bitmask);
ndpi_set_config(workflow->ndpi_struct, NULL, "log.level", "3");
ndpi_set_config(workflow->ndpi_struct, "all", "log.enable", "1");
ndpi_load_protocols_file(workflow->ndpi_struct, "protos.txt");
ndpi_load_categories_file(workflow->ndpi_struct, "categories.txt", NULL);