nDPI rules (work in progress) implementation

This commit is contained in:
Luca Deri
2020-11-30 22:01:49 +01:00
parent b77a4276f9
commit eb689b2069
5 changed files with 287 additions and 0 deletions
+4
View File
@@ -1426,6 +1426,10 @@ extern "C" {
struct ndpi_bin *centroids);
u_int32_t ndpi_quick_16_byte_hash(u_int8_t *in_16_bytes_long);
/* ******************************* */
ndpi_rules* ndpi_parse_rules(struct ndpi_detection_module_struct *ndpi_str, char *path);
#ifdef __cplusplus
}
#endif
+27
View File
@@ -1553,4 +1553,31 @@ struct ndpi_bin {
} u;
};
/* **************************** */
typedef struct {
ndpi_ip_addr_t ip;
u_int8_t cidr;
u_int8_t ip_v6:1, _notused:7;
u_int16_t l4_port;
} ndpi_rule_peer;
typedef enum {
rule_pass,
rule_drop
} ndpi_rule_action;
typedef struct {
u_int16_t id;
char *description;
u_int8_t l4_proto;
ndpi_rule_action action;
ndpi_rule_peer client, server; /* Network byte order */
u_int16_t l7_proto;
} ndpi_rule;
typedef struct {
u_int32_t num_rules;
} ndpi_rules;
#endif /* __NDPI_TYPEDEFS_H__ */