Added RiskInfo string

This commit is contained in:
Luca Deri
2022-05-30 00:32:32 +02:00
parent a9d7cc4841
commit f25deeccb1
22 changed files with 376 additions and 162 deletions
+2 -1
View File
@@ -147,7 +147,8 @@ extern "C" {
const u_int8_t ** l4ptr, u_int16_t * l4len,
u_int8_t * nxt_hdr);
void ndpi_set_risk(struct ndpi_detection_module_struct *ndpi_str,
struct ndpi_flow_struct *flow, ndpi_risk_enum r);
struct ndpi_flow_struct *flow, ndpi_risk_enum r,
char *risk_message);
int ndpi_isset_risk(struct ndpi_detection_module_struct *ndpi_str,
struct ndpi_flow_struct *flow, ndpi_risk_enum r);
int ndpi_is_printable_string(char * const str, size_t len);
+4 -1
View File
@@ -169,6 +169,7 @@ typedef struct node_t {
/* NDPI_MASK_SIZE */
typedef u_int32_t ndpi_ndpi_mask;
#define MAX_NUM_RISK_INFOS 8
/* NDPI_PROTO_BITMASK_STRUCT */
#ifdef NDPI_CFFI_PREPROCESSING
@@ -1197,7 +1198,9 @@ struct ndpi_flow_struct {
u_int8_t risk_checked:1, ip_risk_mask_evaluated:1, host_risk_mask_evaluated:1, tree_risk_checked:1, _notused:4;
ndpi_risk risk_mask; /* Stores the flow risk mask for flow peers */
ndpi_risk risk; /* Issues found with this flow [bitmask of ndpi_risk] */
char *risk_infos[MAX_NUM_RISK_INFOS]; /* String that contains information about the risks found */
u_int8_t num_risk_infos;
/*
This structure below will not not stay inside the protos
structure below as HTTP is used by many subprotocols