aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_utils.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-07-22 01:35:57 +0200
committerLuca Deri <deri@ntop.org>2021-07-22 01:35:57 +0200
commitb01b60a2b523b98f2801c4752213b9468f63cad5 (patch)
tree7b134b1896e0d69be4514f828f8c294b98040cf6 /src/lib/ndpi_utils.c
parentfc9901292d617f1ecd38f37d063d5f046978c1aa (diff)
Implementation of flow risk eception (work in progress)
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r--src/lib/ndpi_utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 87b2b3e8a..ab546403e 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -2050,3 +2050,18 @@ float ndpi_calculate_entropy(u_int8_t const * const buf, size_t len)
entropy *= -1.0f;
return entropy;
}
+
+/* ******************************************* */
+
+char* ndpi_get_flow_name(struct ndpi_flow_struct *flow) {
+ if(!flow) goto no_flow_info;
+
+ if(flow->host_server_name[0] != '\0')
+ return((char*)flow->host_server_name);
+
+ if(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[0] != '\0')
+ return(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name);
+
+ no_flow_info:
+ return((char*)"");
+}