aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
commit283ce59938ad2be252a6232e40a958e177a40e1a (patch)
treeb451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-dns.c
parentaa553f63ecc7b9e310a05b743502c50f6dffb800 (diff)
Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031
Diffstat (limited to 'packet-dns.c')
-rw-r--r--packet-dns.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/packet-dns.c b/packet-dns.c
index c8e0dac521..ff0d4cbd1d 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.44 2000/05/11 08:15:05 gram Exp $
+ * $Id: packet-dns.c,v 1.45 2000/05/31 05:07:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1573,11 +1573,11 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
dns_tree = proto_item_add_subtree(ti, ett_dns);
if (flags & F_RESPONSE)
- proto_tree_add_item_hidden(dns_tree, hf_dns_response, NullTVB, offset, 4, 1);
+ proto_tree_add_boolean_hidden(dns_tree, hf_dns_response, NullTVB, offset, 4, 1);
else
- proto_tree_add_item_hidden(dns_tree, hf_dns_query, NullTVB, offset, 4, 1);
+ proto_tree_add_boolean_hidden(dns_tree, hf_dns_query, NullTVB, offset, 4, 1);
- proto_tree_add_item(dns_tree, hf_dns_transaction_id, NullTVB,
+ proto_tree_add_uint(dns_tree, hf_dns_transaction_id, NullTVB,
offset + DNS_ID, 2, id);
strcpy(buf, val_to_str(flags & F_OPCODE, opcode_vals, "Unknown operation"));
@@ -1640,13 +1640,13 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
decode_enumerated_bitfield(flags, F_RCODE,
2*8, rcode_vals, "%s"));
}
- proto_tree_add_item(dns_tree, hf_dns_count_questions, NullTVB,
+ proto_tree_add_uint(dns_tree, hf_dns_count_questions, NullTVB,
offset + DNS_QUEST, 2, quest);
- proto_tree_add_item(dns_tree, hf_dns_count_answers, NullTVB,
+ proto_tree_add_uint(dns_tree, hf_dns_count_answers, NullTVB,
offset + DNS_ANS, 2, ans);
- proto_tree_add_item(dns_tree, hf_dns_count_auth_rr, NullTVB,
+ proto_tree_add_uint(dns_tree, hf_dns_count_auth_rr, NullTVB,
offset + DNS_AUTH, 2, auth);
- proto_tree_add_item(dns_tree, hf_dns_count_add_rr, NullTVB,
+ proto_tree_add_uint(dns_tree, hf_dns_count_add_rr, NullTVB,
offset + DNS_ADD, 2, add);
}