aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-07-02 07:29:03 +0000
committerGuy Harris <guy@alum.mit.edu>2001-07-02 07:29:03 +0000
commit0395944bf6fdc498c413d735b822aa0d670a2f3a (patch)
tree4032370e93bb1a4b94187f7eb5546b9479ab2786 /packet-dns.c
parentc6266ee4d98abdba9871b8da4715b322b41edcc8 (diff)
For DNS-over-TCP, put the length indicator into the tree for the DNS
request/response. svn path=/trunk/; revision=3633
Diffstat (limited to 'packet-dns.c')
-rw-r--r--packet-dns.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/packet-dns.c b/packet-dns.c
index fd8c726f29..80202d622d 100644
--- a/packet-dns.c
+++ b/packet-dns.c
@@ -1,7 +1,7 @@
/* packet-dns.c
* Routines for DNS packet disassembly
*
- * $Id: packet-dns.c,v 1.69 2001/07/02 07:11:38 guy Exp $
+ * $Id: packet-dns.c,v 1.70 2001/07/02 07:29:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -41,6 +41,7 @@
#include "packet-dns.h"
static int proto_dns = -1;
+static int hf_dns_length = -1;
static int hf_dns_response = -1;
static int hf_dns_query = -1;
static int hf_dns_flags = -1;
@@ -1799,7 +1800,7 @@ dissect_answer_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
static void
dissect_dns_common(tvbuff_t *tvb, int offset, int cap_len, packet_info *pinfo,
- proto_tree *tree)
+ proto_tree *tree, gboolean is_tcp)
{
int dns_data_offset;
frame_data *fd;
@@ -1858,6 +1859,11 @@ dissect_dns_common(tvbuff_t *tvb, int offset, int cap_len, packet_info *pinfo,
dns_tree = proto_item_add_subtree(ti, ett_dns);
+ if (is_tcp) {
+ /* Put the length indication into the tree. */
+ proto_tree_add_uint(dns_tree, hf_dns_length, tvb, offset - 2, 2, cap_len);
+ }
+
if (flags & F_RESPONSE)
proto_tree_add_boolean_hidden(dns_tree, hf_dns_response, tvb, offset, 4, 1);
else
@@ -1985,7 +1991,7 @@ dissect_dns_common(tvbuff_t *tvb, int offset, int cap_len, packet_info *pinfo,
static void
dissect_dns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_dns_common(tvb, 0, tvb_length(tvb), pinfo, tree);
+ dissect_dns_common(tvb, 0, tvb_length(tvb), pinfo, tree, FALSE);
}
static void
@@ -2009,7 +2015,7 @@ dissect_dns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Yes - dissect it.
*/
- dissect_dns_common(tvb, offset, plen, pinfo, tree);
+ dissect_dns_common(tvb, offset, plen, pinfo, tree, TRUE);
}
}
@@ -2017,6 +2023,10 @@ void
proto_register_dns(void)
{
static hf_register_info hf[] = {
+ { &hf_dns_length,
+ { "Length", "dns.length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Length of DNS-over-TCP request or response", HFILL }},
{ &hf_dns_response,
{ "Response", "dns.response",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,