From fcff6d5abb168c3318c019fc140ce1e809b40d2b Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 30 Jan 2025 21:48:53 +0100 Subject: Exported DNS transactionId --- src/include/ndpi_typedefs.h | 2 +- src/lib/protocols/dns.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index ad09dfcaa..398cdb8c3 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1393,7 +1393,7 @@ struct ndpi_flow_struct { struct { u_int8_t num_queries, num_answers, reply_code, num_rsp_addr; u_int8_t is_query:1, pad:7; - u_int16_t query_type, query_class, rsp_type, edns0_udp_payload_size; + u_int16_t transaction_id, query_type, query_class, rsp_type, edns0_udp_payload_size; u_int8_t is_rsp_addr_ipv6[MAX_NUM_DNS_RSP_ADDRESSES]; ndpi_ip_addr_t rsp_addr[MAX_NUM_DNS_RSP_ADDRESSES]; /* The first num_rsp_addr address in a DNS response packet (A and AAAA) */ u_int32_t rsp_addr_ttl[MAX_NUM_DNS_RSP_ADDRESSES]; diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c index bd55f19e7..d78a8e808 100644 --- a/src/lib/protocols/dns.c +++ b/src/lib/protocols/dns.c @@ -283,7 +283,7 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct, memcpy(dns_header, (struct ndpi_dns_packet_header*)&packet->payload[x], sizeof(struct ndpi_dns_packet_header)); - dns_header->tr_id = ntohs(dns_header->tr_id); + flow->protos.dns.transaction_id = dns_header->tr_id = ntohs(dns_header->tr_id); dns_header->flags = ntohs(dns_header->flags); dns_header->num_queries = ntohs(dns_header->num_queries); dns_header->num_answers = ntohs(dns_header->num_answers); -- cgit v1.2.3