From 03fd155ae38b0b3b57f18a25e80abb68b169e326 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:56:44 +0100 Subject: IPv6: add support for custom categories (#2126) --- src/include/ndpi_api.h | 7 +++++++ src/include/ndpi_typedefs.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src/include') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 35fbde85c..ee77b537a 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -810,6 +810,7 @@ extern "C" { * -1 else */ int ndpi_load_categories_file(struct ndpi_detection_module_struct *ndpi_str, const char* path, void *user_data); + int ndpi_load_categories_file2(struct ndpi_detection_module_struct *ndpi_str, FILE *fd, void *user_data); /** * Loads a file (separated by ) of domain names associated with the specified category @@ -1028,11 +1029,17 @@ extern "C" { int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct); void* ndpi_find_ipv4_category_userdata(struct ndpi_detection_module_struct *ndpi_str, u_int32_t saddr); + void* ndpi_find_ipv6_category_userdata(struct ndpi_detection_module_struct *ndpi_str, + struct in6_addr *saddr); int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int32_t saddr, u_int32_t daddr, ndpi_protocol *ret); + int ndpi_fill_ip6_protocol_category(struct ndpi_detection_module_struct *ndpi_str, + struct ndpi_flow_struct *flow, + struct in6_addr *saddr, struct in6_addr *daddr, + ndpi_protocol *ret); int ndpi_match_custom_category(struct ndpi_detection_module_struct *ndpi_struct, char *name, u_int name_len, ndpi_protocol_category_t *id); void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct, diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 257023080..365638aa3 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1327,6 +1327,7 @@ struct ndpi_detection_module_struct { ndpi_domain_classify *sc_hostnames, *sc_hostnames_shadow; #endif void *ipAddresses, *ipAddresses_shadow; /* Patricia */ + void *ipAddresses6, *ipAddresses6_shadow; /* Patricia IPv6*/ u_int8_t categories_loaded; } custom_categories; -- cgit v1.2.3