-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IPv6: add support for custom categories (#2126)
- Loading branch information
Showing
15 changed files
with
266 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Format: name\tcategory_id | ||
internetbadguys.com 100 | ||
144.139.247.220 100 | ||
172.30.69.0/24 100 | ||
[2001:1670:8:40a6:a08e:332b:aa69:18dc] 100 | ||
[2001:db8:1::1]/127 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Format: name\tcategory_id | ||
internetbadguys.com 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
144.139.247.220 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
144.139.247.220/24 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[3ffe:507:0:1:200:86ff:fe05:80da] 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[3ffe:507:0:1:200:86ff:fe05:80da]/64 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "ndpi_api.h" | ||
#include "fuzz_common_code.h" | ||
|
||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
struct ndpi_detection_module_struct *ndpi_struct; | ||
FILE *fd; | ||
/* Try to be fast */ | ||
ndpi_init_prefs prefs = ndpi_dont_load_tor_list | | ||
ndpi_dont_load_azure_list | | ||
ndpi_dont_load_whatsapp_list | | ||
ndpi_dont_load_amazon_aws_list | | ||
ndpi_dont_load_ethereum_list | | ||
ndpi_dont_load_zoom_list | | ||
ndpi_dont_load_cloudflare_list | | ||
ndpi_dont_load_microsoft_list | | ||
ndpi_dont_load_google_list | | ||
ndpi_dont_load_google_cloud_list | | ||
ndpi_dont_load_asn_lists | | ||
ndpi_dont_init_risk_ptree | | ||
ndpi_dont_load_cachefly_list | | ||
ndpi_dont_load_protonvpn_list | | ||
ndpi_dont_load_mullvad_list; | ||
NDPI_PROTOCOL_BITMASK all; | ||
NDPI_PROTOCOL_BITMASK debug_bitmask; | ||
|
||
/* To allow memory allocation failures */ | ||
fuzz_set_alloc_callbacks_and_seed(size); | ||
|
||
ndpi_struct = ndpi_init_detection_module(prefs); | ||
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); | ||
|
||
fd = buffer_to_file(data, size); | ||
ndpi_load_categories_file2(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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.