diff options
author | Luca Deri <deri@ntop.org> | 2020-11-30 22:01:49 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-11-30 22:01:49 +0100 |
commit | eb689b2069ebd9d78e376e812af5163ad61fd7ad (patch) | |
tree | e16b8e15240a729923d87a4ad8995a5e8e96492f /src/include | |
parent | b77a4276f9c9273b9abefb76e4c5409265fe747c (diff) |
nDPI rules (work in progress) implementation
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_api.h.in | 4 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h.in b/src/include/ndpi_api.h.in index fbc9414a4..c0f0042de 100644 --- a/src/include/ndpi_api.h.in +++ b/src/include/ndpi_api.h.in @@ -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 diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 70fab3f75..31043b685 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -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__ */ |