Implement nDPI patricia tree API

This commit is contained in:
emanuele-f
2019-10-15 01:22:17 +02:00
parent cbe20d3740
commit 6b044335cd
4 changed files with 130 additions and 5 deletions
+6
View File
@@ -837,6 +837,12 @@ extern "C" {
char *outbuf, u_int outbuf_len);
char* ndpi_ssl_version2str(u_int16_t version, u_int8_t *unknown_tls_version);
/* ptree (trie) API */
ndpi_ptree_t* ndpi_ptree_create();
int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, u_int8_t bits, uint user_data);
int ndpi_ptree_match_addr(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, uint *user_data);
void ndpi_ptree_destroy(ndpi_ptree_t *tree);
/* Serializer */
int ndpi_init_serializer_ll(ndpi_serializer *serializer, ndpi_serialization_format fmt,
u_int32_t buffer_size);
+1
View File
@@ -114,6 +114,7 @@ extern "C" {
extern int ndpi_parse_ip_string(const char *ip_str, ndpi_ip_addr_t *parsed_ip);
extern char *ndpi_get_ip_string(const ndpi_ip_addr_t * ip, char *buf, u_int buf_len);
extern u_int8_t ndpi_is_ipv6(const ndpi_ip_addr_t *ip);
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
+4
View File
@@ -1438,4 +1438,8 @@ struct ndpi_analyze_struct {
#define MAX_SERIES_LEN 512
#define MIN_SERIES_LEN 8
/* **************************************** */
typedef struct ndpi_ptree ndpi_ptree_t;
#endif /* __NDPI_TYPEDEFS_H__ */