aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ndpi_api.h27
-rw-r--r--src/include/ndpi_protocol_ids.h2
-rw-r--r--src/include/ndpi_typedefs.h18
3 files changed, 24 insertions, 23 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index 34b1fed67..194afa7d6 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -383,13 +383,12 @@ extern "C" {
* @return the ID of the matched subprotocol
*
*/
- int ndpi_match_host_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow,
- char *string_to_match,
- u_int string_to_match_len,
- ndpi_protocol_match_result *ret_match,
- u_int16_t master_protocol_id);
-
+ u_int16_t ndpi_match_host_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ char *string_to_match,
+ u_int string_to_match_len,
+ ndpi_protocol_match_result *ret_match,
+ u_int16_t master_protocol_id);
/**
* Check if the string content passed match with a protocol
@@ -403,12 +402,12 @@ extern "C" {
* @return the ID of the matched subprotocol
*
*/
- int ndpi_match_content_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow,
- char *string_to_match,
- u_int string_to_match_len,
- ndpi_protocol_match_result *ret_match,
- u_int16_t master_protocol_id);
+ u_int16_t ndpi_match_content_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ char *string_to_match,
+ u_int string_to_match_len,
+ ndpi_protocol_match_result *ret_match,
+ u_int16_t master_protocol_id);
/**
* Exclude protocol from search
*
@@ -755,7 +754,7 @@ extern "C" {
u_int32_t daddr,
ndpi_protocol *ret);
int ndpi_match_custom_category(struct ndpi_detection_module_struct *ndpi_struct,
- char *name, unsigned long *id);
+ char *name, unsigned long *id);
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
ndpi_protocol *ret);
diff --git a/src/include/ndpi_protocol_ids.h b/src/include/ndpi_protocol_ids.h
index 812360e20..874c50e14 100644
--- a/src/include/ndpi_protocol_ids.h
+++ b/src/include/ndpi_protocol_ids.h
@@ -171,7 +171,7 @@ typedef enum {
NDPI_PROTOCOL_LASTFM = 134,
NDPI_PROTOCOL_WAZE = 135,
NDPI_PROTOCOL_YOUTUBE_UPLOAD = 136, /* Upload files to youtube */
- NDPI_PROTOCOL_GENERIC = 137, /* Generic protocol used for category matching */
+ NDPI_PROTOCOL_FREE_137 = 137, /* Free */
NDPI_PROTOCOL_CHECKMK = 138,
NDPI_PROTOCOL_AJP = 139, /* Leonn Paiva <leonn.paiva@gmail.com> */
NDPI_PROTOCOL_APPLE = 140,
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index ccc4faec7..3e71c2ab2 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -919,11 +919,10 @@ typedef enum {
} ndpi_protocol_category_t;
typedef enum {
- ndpi_pref_http_dont_dissect_response = 0,
- ndpi_pref_dns_dont_dissect_response,
- ndpi_pref_direction_detect_disable,
- ndpi_pref_disable_metadata_export,
- ndpi_pref_enable_category_substring_match
+ ndpi_pref_http_dont_dissect_response = 0,
+ ndpi_pref_dns_dont_dissect_response,
+ ndpi_pref_direction_detect_disable,
+ ndpi_pref_disable_metadata_export,
} ndpi_detection_preference;
/* ntop extensions */
@@ -1048,7 +1047,6 @@ struct ndpi_detection_module_struct {
#else
ndpi_automa hostnames, hostnames_shadow;
#endif
- void *hostnames_hash;
void *ipAddresses, *ipAddresses_shadow; /* Patricia */
u_int8_t categories_loaded;
} custom_categories;
@@ -1102,8 +1100,7 @@ struct ndpi_detection_module_struct {
u_int8_t http_dont_dissect_response:1, dns_dont_dissect_response:1,
direction_detect_disable:1, /* disable internal detection of packet direction */
- disable_metadata_export:1, /* No metadata is exported */
- enable_category_substring_match:1 /* Default is perfect match */
+ disable_metadata_export:1 /* No metadata is exported */
;
void *hyperscan; /* Intel Hyperscan */
@@ -1338,6 +1335,11 @@ typedef struct {
} ndpi_protocol_match;
typedef struct {
+ char *string_to_match, *hyperscan_string_to_match;
+ ndpi_protocol_category_t protocol_category;
+} ndpi_category_match;
+
+typedef struct {
u_int32_t network;
u_int8_t cidr;
u_int8_t value;