diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
commit | 283ce59938ad2be252a6232e40a958e177a40e1a (patch) | |
tree | b451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-q931.c | |
parent | aa553f63ecc7b9e310a05b743502c50f6dffb800 (diff) | |
download | wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.gz wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.bz2 wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.zip |
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-q931.c')
-rw-r--r-- | packet-q931.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-q931.c b/packet-q931.c index 547c7361a8..f0ce81fe2a 100644 --- a/packet-q931.c +++ b/packet-q931.c @@ -2,7 +2,7 @@ * Routines for Q.931 frame disassembly * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-q931.c,v 1.15 2000/05/29 08:57:38 guy Exp $ + * $Id: packet-q931.c,v 1.16 2000/05/31 05:07:31 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -2074,21 +2074,21 @@ dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_q931, tvb, offset, - END_OF_FRAME, NULL); + tvb_length(tvb), FALSE); q931_tree = proto_item_add_subtree(ti, ett_q931); - proto_tree_add_item(q931_tree, hf_q931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); + proto_tree_add_uint(q931_tree, hf_q931_discriminator, tvb, offset, 1, tvb_get_guint8(tvb, offset)); } offset += 1; call_ref_len = tvb_get_guint8(tvb, offset) & 0xF; /* XXX - do as a bit field? */ if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_call_ref_len, tvb, offset, 1, call_ref_len); + proto_tree_add_uint(q931_tree, hf_q931_call_ref_len, tvb, offset, 1, call_ref_len); offset += 1; if (call_ref_len != 0) { /* XXX - split this into flag and value */ tvb_memcpy(tvb, call_ref, offset, call_ref_len); if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_call_ref, tvb, offset, call_ref_len, call_ref); + proto_tree_add_bytes(q931_tree, hf_q931_call_ref, tvb, offset, call_ref_len, call_ref); offset += call_ref_len; } message_type = tvb_get_guint8(tvb, offset); @@ -2098,7 +2098,7 @@ dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Unknown message type (0x%02X)")); } if (q931_tree != NULL) - proto_tree_add_item(q931_tree, hf_q931_message_type, tvb, offset, 1, message_type); + proto_tree_add_uint(q931_tree, hf_q931_message_type, tvb, offset, 1, message_type); offset += 1; /* |