aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_api.h19
-rw-r--r--src/lib/ndpi_main.c8
2 files changed, 27 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index e52993243..d4e940bde 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -78,6 +78,25 @@ extern "C" {
*/
u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void);
+
+ /**
+ * Get the size of the flow struct
+ *
+ * @return the size of the flow struct
+ *
+ */
+ u_int32_t ndpi_detection_get_sizeof_ndpi_flow_tcp_struct(void);
+
+
+ /**
+ * Get the size of the flow struct
+ *
+ * @return the size of the flow struct
+ *
+ */
+ u_int32_t ndpi_detection_get_sizeof_ndpi_flow_udp_struct(void);
+
+
/**
* nDPI personal allocation and free functions
**/
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index af6811b25..21491c5e7 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -165,6 +165,14 @@ u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void) { return(sizeof(struct
/* *********************************************************************************** */
+u_int32_t ndpi_detection_get_sizeof_ndpi_flow_tcp_struct(void) { return(sizeof(struct ndpi_flow_tcp_struct)); }
+
+/* *********************************************************************************** */
+
+u_int32_t ndpi_detection_get_sizeof_ndpi_flow_udp_struct(void) { return(sizeof(struct ndpi_flow_udp_struct)); }
+
+/* *********************************************************************************** */
+
char * ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_str, u_int id) {
return((id >= ndpi_str->ndpi_num_supported_protocols) ? NULL : ndpi_str->proto_defaults[id].protoName);
}