aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-02-04 22:16:54 +0100
committerLuca Deri <deri@ntop.org>2020-02-04 22:16:54 +0100
commit0703ab5ac558857319c2ed4a1673444006f915f8 (patch)
treeabbd21aba8176a5791129c803c84b87210e47235 /example/reader_util.c
parent3e99b736358ca11c3ba3723a1282ffd3bfc760bd (diff)
Improved DNS response decoding
The first decoded address is now reported by ndpiReader
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 2236f79d3..cf8261e05 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -966,6 +966,13 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
if(n == 0) flow->bittorent_hash[0] = '\0';
}
+ /* DNS */
+ else if(is_ndpi_proto(flow, NDPI_PROTOCOL_DNS)) {
+ if(flow->ndpi_flow->protos.dns.rsp_type == 0x1)
+ inet_ntop(AF_INET, &flow->ndpi_flow->protos.dns.rsp_addr.ipv4, flow->info, sizeof(flow->info));
+ else
+ inet_ntop(AF_INET6, &flow->ndpi_flow->protos.dns.rsp_addr.ipv6, flow->info, sizeof(flow->info));
+ }
/* MDNS */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_MDNS)) {
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.mdns.answer);