mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-30 16:09:43 +00:00
config: move debug/log configuration to the new API
This commit is contained in:
parent
c704be1a20
commit
6c85f10cd5
18 changed files with 106 additions and 104 deletions
|
|
@ -6,7 +6,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
struct ndpi_detection_module_struct *ndpi_struct;
|
||||
FILE *fd;
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
NDPI_PROTOCOL_BITMASK debug_bitmask;
|
||||
|
||||
/* To allow memory allocation failures */
|
||||
fuzz_set_alloc_callbacks_and_seed(size);
|
||||
|
|
@ -15,17 +14,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all);
|
||||
|
||||
NDPI_BITMASK_SET_ALL(debug_bitmask);
|
||||
ndpi_set_log_level(ndpi_struct, 4);
|
||||
ndpi_set_debug_bitmask(ndpi_struct, debug_bitmask);
|
||||
ndpi_set_config(ndpi_struct, NULL, "log.level", "3");
|
||||
ndpi_set_config(ndpi_struct, "all", "log.enable", "1");
|
||||
|
||||
fd = buffer_to_file(data, size);
|
||||
load_categories_file_fd(ndpi_struct, fd, NULL);
|
||||
if(fd)
|
||||
fclose(fd);
|
||||
|
||||
/* We don't really need to call ndpi_finalize_initialization */
|
||||
|
||||
ndpi_exit_detection_module(ndpi_struct);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue