aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-03-23 19:05:32 +0100
committerLuca Deri <deri@ntop.org>2018-03-23 19:05:32 +0100
commit462da90a21d7a73fe9122b759c6b40bebfefc6e8 (patch)
tree2ab125db5f231bb74d50b83df0ab4dbf979ac73e
parenta2acd092634d1cfc04e89c874d584a16ae54f3ea (diff)
Added API calls
ndpi_network_ptree_match ndpi_check_flow_func ndpi_config.h is now installed with "make install"
-rw-r--r--libndpi.sym4
-rw-r--r--src/include/ndpi_api.h15
-rw-r--r--src/lib/Makefile.am13
-rw-r--r--src/lib/ndpi_main.c9
4 files changed, 31 insertions, 10 deletions
diff --git a/libndpi.sym b/libndpi.sym
index 9c6643db4..07442982c 100644
--- a/libndpi.sym
+++ b/libndpi.sym
@@ -61,4 +61,6 @@ ndpi_category_get_name
ndpi_is_custom_category
ndpi_is_subprotocol_informative
ndpi_set_proto_category
-ndpi_get_api_version \ No newline at end of file
+ndpi_get_api_version
+ndpi_network_ptree_match
+ndpi_check_flow_func \ No newline at end of file
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index 230885d6d..7ac5b3ef8 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -282,6 +282,21 @@ extern "C" {
/**
+ * API call that is called internally by ndpi_detection_process_packet or by apps
+ * that want to avoid calling ndpi_detection_process_packet as they have already
+ * parsed the packet and thus want to avoid this.
+ *
+ *
+ * @par ndpi_struct = the detection module
+ * @par flow = the flow given for the detection module
+ * @par ndpi_selection_bitmask = the protocol selected bitmask
+ *
+ */
+ void ndpi_check_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ NDPI_SELECTION_BITMASK_PROTOCOL_SIZE *ndpi_selection_packet);
+
+ /**
* Query the pointer to the layer 4 packet
*
* @par l3 = pointer to the layer 3 data
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index ec8f4e03f..fd7df2c7f 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -6,13 +6,14 @@ libndpi_la_LDFLAGS = -version-info 1:0:0 -export-symbols $(top_srcdir)/libndpi.s
libndpi_la_includedir = $(includedir)/libndpi-@VERSION@/libndpi
-libndpi_la_include_HEADERS = ../include/ndpi_api.h \
- ../include/ndpi_define.h \
- ../include/ndpi_main.h \
- ../include/ndpi_includes.h \
+libndpi_la_include_HEADERS = ../include/ndpi_api.h \
+ ../include/ndpi_define.h \
+ ../include/ndpi_main.h \
+ ../include/ndpi_includes.h \
+ ../include/ndpi_config.h \
../include/ndpi_protocol_ids.h \
- ../include/ndpi_protocols.h \
- ../include/ndpi_typedefs.h \
+ ../include/ndpi_protocols.h \
+ ../include/ndpi_typedefs.h \
third_party/include/libcache.h
libndpi_la_SOURCES = ndpi_content_match.c.inc \
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index afb0f39e7..430f25781 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -3582,7 +3582,10 @@ void check_ndpi_tcp_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
}
}
-void check_ndpi_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
+
+/* ********************************************************************************* */
+
+void ndpi_check_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
NDPI_SELECTION_BITMASK_PROTOCOL_SIZE *ndpi_selection_packet) {
if(flow->packet.tcp != NULL)
@@ -3837,11 +3840,11 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct
if(flow->guessed_host_protocol_id >= (NDPI_MAX_SUPPORTED_PROTOCOLS-1)) {
/* This is a custom protocol and it has priority over everything else */
ret.master_protocol = NDPI_PROTOCOL_UNKNOWN, ret.app_protocol = flow->guessed_host_protocol_id;
- check_ndpi_flow_func(ndpi_struct, flow, &ndpi_selection_packet);
+ ndpi_check_flow_func(ndpi_struct, flow, &ndpi_selection_packet);
return(ret);
}
- check_ndpi_flow_func(ndpi_struct, flow, &ndpi_selection_packet);
+ ndpi_check_flow_func(ndpi_struct, flow, &ndpi_selection_packet);
a = flow->packet.detected_protocol_stack[0];
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, a) == 0)