aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
committerLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
commit1076455c01bfcfa51b24ff8d681e65fd00047dbd (patch)
tree1ffe59c0ae57a55499cece7a2131431bdcf6eea2 /src/include
parent2d486aeed8e6450cc8034d6244848297bdefc31e (diff)
Added ndpi_set_detection_preferences() APi call
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ndpi_api.h10
-rw-r--r--src/include/ndpi_typedefs.h16
2 files changed, 19 insertions, 7 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index bdb351df4..c2c129ec0 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -35,7 +35,7 @@ extern "C" {
sure that datastructures and in sync across versions
*/
#define NDPI_API_VERSION 1
-
+
#define SIZEOF_ID_STRUCT ( sizeof(struct ndpi_id_struct) )
#define SIZEOF_FLOW_STRUCT ( sizeof(struct ndpi_flow_struct) )
@@ -748,7 +748,7 @@ extern "C" {
*
*/
int ndpi_match_string(void *_automa, char *string_to_match);
-
+
void ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
char *ip_address_and_mask, ndpi_protocol_category_t category);
int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_struct,
@@ -756,7 +756,11 @@ extern "C" {
int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct);
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
- ndpi_protocol *ret);
+ ndpi_protocol *ret);
+ int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod,
+ ndpi_detection_preference pref,
+ int value);
+
/**
* Add a string to match to an automata
*
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 869a198f7..83fad2930 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -797,6 +797,13 @@ typedef enum {
*/
} ndpi_protocol_category_t;
+typedef enum {
+ ndpi_pref_http_dont_dissect_response = 0,
+ ndpi_pref_dns_dissect_response,
+ ndpi_pref_direction_detect_disable,
+ ndpi_pref_disable_metadata_export
+} ndpi_detection_preference;
+
/* ntop extensions */
typedef struct ndpi_proto_defaults {
char *protoName;
@@ -952,8 +959,10 @@ struct ndpi_detection_module_struct {
ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
u_int8_t http_dont_dissect_response:1, dns_dissect_response:1,
- direction_detect_disable:1; /* disable internal detection of packet direction */
-
+ direction_detect_disable:1, /* disable internal detection of packet direction */
+ disable_metadata_export:1 /* No metadata is exported */
+ ;
+
void *hyperscan; /* Intel Hyperscan */
};
@@ -989,8 +998,7 @@ struct ndpi_flow_struct {
} l4;
/*
- Pointer to src or dst
- that identifies the
+ Pointer to src or dst that identifies the
server of this connection
*/
struct ndpi_id_struct *server_id;