mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-30 07:59:49 +00:00
New API to enable/disable protocols; remove ndpi_set_protocol_detection_bitmask2() (#2853)
The main goal is not to have the bitmask depending on the total number of protocols anymore: `NDPI_INTERNAL_PROTOCOL_BITMASK` depends only on internal protocols, i.e. on `NDPI_MAX_INTERNAL_PROTOCOLS`, i.e. custom-defined protocols are not counted. See #2136 Keep the old data structure `NDPI_PROTOCOL_BITMASK` with the old semantic. Since we need to change the API (and all the application code...) anyway, simplify the API: by default all the protocols are enabled. If you need otherwise, please use `ndpi_init_detection_module_ext()` instead of `ndpi_init_detection_module()` (you can find an example in the `ndpiReader` code). To update the application code you likely only need to remove these 3 lines from your code: ``` - NDPI_PROTOCOL_BITMASK all; - NDPI_BITMASK_SET_ALL(all); - ndpi_set_protocol_detection_bitmask2(ndpi_str, &all); ``` Removed an unused field and struct definition.
This commit is contained in:
parent
40fe26b2f1
commit
70a72f1638
27 changed files with 138 additions and 211 deletions
|
|
@ -5,14 +5,11 @@
|
|||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
struct ndpi_detection_module_struct *ndpi_struct;
|
||||
FILE *fd;
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
|
||||
/* To allow memory allocation failures */
|
||||
fuzz_set_alloc_callbacks_and_seed(size);
|
||||
|
||||
ndpi_struct = ndpi_init_detection_module(NULL);
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all);
|
||||
|
||||
ndpi_set_config(ndpi_struct, NULL, "log.level", "3");
|
||||
ndpi_set_config(ndpi_struct, "all", "log", "1");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue