Reworked flow risk implementation

This commit is contained in:
Luca Deri
2021-07-23 17:27:15 +02:00
parent 4ffe1eb3c0
commit 61fc5be202
52 changed files with 1792 additions and 1744 deletions
+2 -1
View File
@@ -151,7 +151,8 @@ extern "C" {
int ndpi_handle_ipv6_extension_headers(struct ndpi_detection_module_struct *ndpi_str,
const u_int8_t ** l4ptr, u_int16_t * l4len,
u_int8_t * nxt_hdr);
void ndpi_set_risk(struct ndpi_flow_struct *flow, ndpi_risk_enum r);
void ndpi_set_risk(struct ndpi_detection_module_struct *ndpi_str,
struct ndpi_flow_struct *flow, ndpi_risk_enum r);
int ndpi_is_printable_string(char const * const str, size_t len);
float ndpi_calculate_entropy(u_int8_t const * const buf, size_t len);
#ifdef __cplusplus
+2 -1
View File
@@ -1301,7 +1301,8 @@ struct ndpi_flow_struct {
/* HTTP host or DNS query */
u_char host_server_name[240];
u_int8_t initial_binary_bytes[8], initial_binary_bytes_len;
u_int8_t risk_checked;
u_int8_t risk_checked:1, ip_risk_mask_evaluated:1, _notused:6;
ndpi_risk host_risk_mask; /* Stores the flow risk mask for flow peers */
ndpi_risk risk; /* Issues found with this flow [bitmask of ndpi_risk] */
/*