diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2025-01-06 16:53:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-06 16:53:29 +0100 |
commit | bf830b4236132b1100fb9c4863a737fb53eb669f (patch) | |
tree | 553dcba7218a50c247baa182d8c294fbc297e198 /src/include | |
parent | c3d19be26f8a437fbfc3fbae14d13c260cbe77d7 (diff) |
Add the ability to enable/disable every specific flow risks (#2653)
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_main.h | 6 | ||||
-rw-r--r-- | src/include/ndpi_private.h | 2 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/include/ndpi_main.h b/src/include/ndpi_main.h index e96d96b91..6bbeb320c 100644 --- a/src/include/ndpi_main.h +++ b/src/include/ndpi_main.h @@ -93,8 +93,8 @@ extern "C" { ndpi_protocol_category_t protoCategory, ndpi_port_range *tcpDefPorts, ndpi_port_range *udpDefPorts); - void ndpi_set_risk(struct ndpi_flow_struct *flow, ndpi_risk_enum r, - char *risk_message); + void ndpi_set_risk(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow, + ndpi_risk_enum r, char *risk_message); void ndpi_unset_risk(struct ndpi_flow_struct *flow, ndpi_risk_enum r); int ndpi_isset_risk(struct ndpi_flow_struct *flow, ndpi_risk_enum r); int ndpi_is_printable_buffer(u_int8_t const * const buf, size_t len); @@ -108,7 +108,7 @@ extern "C" { #define NDPI_ENTROPY_ENCRYPTED_OR_RANDOM(entropy) (entropy >= 7.312f) float ndpi_entropy(u_int8_t const * const buf, size_t len); char *ndpi_entropy2str(float entropy, char *buf, size_t len); - void ndpi_entropy2risk(struct ndpi_flow_struct *flow); + void ndpi_entropy2risk(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow); #ifdef __cplusplus } diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h index 43ffe5fc8..3491efcf8 100644 --- a/src/include/ndpi_private.h +++ b/src/include/ndpi_private.h @@ -292,6 +292,8 @@ struct ndpi_detection_module_config_struct { NDPI_PROTOCOL_BITMASK ip_list_bitmask; NDPI_PROTOCOL_BITMASK monitoring; + NDPI_PROTOCOL_BITMASK flowrisk_bitmask; + int flow_risk_lists_enabled; int risk_anonymous_subscriber_list_icloudprivaterelay_enabled; int risk_anonymous_subscriber_list_protonvpn_enabled; diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 9800f26e4..9e4f61296 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -97,7 +97,7 @@ typedef enum { NOTE When the typedef below is modified don't forget to update - nDPI/wireshark/ndpi.lua - - ndpi_risk2str, ndpi_risk2code, ndpi_code2risk (in ndpi_utils.c) + - ndpi_risk2str, ndpi_risk2code, ndpi_code2risk, ndpi_risk_shortnames (in ndpi_utils.c) - doc/flow_risks.rst - ndpi_known_risks (ndpi_main.c) @@ -175,6 +175,9 @@ typedef enum { typedef u_int64_t ndpi_risk; /* (**) */ +/*Used mainly by configuration */ +extern const char *ndpi_risk_shortnames[NDPI_MAX_RISK]; + typedef enum { NDPI_PARAM_HOSTNAME /* char* */, NDPI_PARAM_ISSUER_DN /* char* */, |