From afc4d9e34d61a45c5daeffcdcc187bc0b105ef3e Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 15 Oct 2024 22:25:48 +0200 Subject: Added -L for loading domain suffixes Exported domainanme in JSON file (-K JSON) --- src/lib/ndpi_utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index 26efd20a2..bfe1e5274 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -1267,11 +1267,12 @@ int ndpi_dpi2json(struct ndpi_detection_module_struct *ndpi_struct, ndpi_serialize_proto(ndpi_struct, serializer, flow->risk, flow->confidence, l7_protocol); host_server_name = ndpi_get_flow_info(flow, &l7_protocol); - if (host_server_name != NULL) - { + + if (host_server_name != NULL) { ndpi_serialize_string_string(serializer, "hostname", host_server_name); + ndpi_serialize_string_string(serializer, "domainame", ndpi_get_host_domain(ndpi_struct, host_server_name)); } - + switch(l7_protocol.proto.master_protocol ? l7_protocol.proto.master_protocol : l7_protocol.proto.app_protocol) { case NDPI_PROTOCOL_IP_ICMP: if(flow->entropy > 0.0f) { -- cgit v1.2.3