Added ability to define an unlimited number of custom rules IP:port for the same IP (it used tobe limited to 2)

This commit is contained in:
Luca Deri
2023-03-13 21:57:14 +01:00
parent ebfc1fe827
commit 3585e2d201
4 changed files with 154 additions and 108 deletions
+16 -10
View File
@@ -66,20 +66,26 @@
#define UV16_MAX_USER_VALUES 2
struct patricia_uv16 {
u_int16_t user_value, additional_user_value;
};
struct patricia_uv16_list {
struct patricia_uv16 value;
struct patricia_uv16_list *next;
};
struct patricia_uv32 {
u_int32_t user_value, additional_user_value;
};
/* pointer to user data (ex. route flap info) */
union ndpi_patricia_node_value_t {
/* User-defined values */
union {
struct {
u_int16_t user_value, additional_user_value;
} uv16[UV16_MAX_USER_VALUES];
struct {
u_int32_t user_value, additional_user_value;
} uv32;
u_int64_t uv64;
struct patricia_uv16 uv16[UV16_MAX_USER_VALUES];
struct patricia_uv32 uv32;
u_int64_t uv64;
void *user_data;
} u;
};
+9 -9
View File
@@ -1,7 +1,7 @@
/*
* ndpi_typedefs.h
*
* Copyright (C) 2011-22 - ntop.org
* Copyright (C) 2011-23 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
@@ -1156,18 +1156,18 @@ struct ndpi_detection_module_struct {
risky_domain_automa, tls_cert_subject_automa,
host_risk_mask_automa, common_alpns_automa;
/* IMPORTANT: please, whenever you add a new automa:
* update ndpi_finalize_initialization()
* update automa_type above
*/
* update ndpi_finalize_initialization()
* update automa_type above
*/
ndpi_str_hash *malicious_ja3_hashmap, *malicious_sha1_hashmap;
ndpi_list *trusted_issuer_dn;
void *ip_risk_mask_ptree;
void *ip_risk_ptree;
/* IP-based protocol detection */
void *protocols_ptree;
/* Patricia trees */
ndpi_patricia_tree_t *ip_risk_mask_ptree;
ndpi_patricia_tree_t *ip_risk_ptree;
ndpi_patricia_tree_t *protocols_ptree; /* IP-based protocol detection */
/* *** If you add a new Patricia tree, please update ptree_type above! *** */