diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-08-18 07:59:33 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-08-18 07:59:33 +0000 |
commit | 66370dc127a98398cbbdea550a3a970ca4077730 (patch) | |
tree | a7cfb0f20b07b68a9b4a6e6f7b8e3e2214a878d1 /packet-gnutella.c | |
parent | 71aaaa181964133e0d9eee15a5ec67882c5e9d43 (diff) | |
download | wireshark-66370dc127a98398cbbdea550a3a970ca4077730.tar.gz wireshark-66370dc127a98398cbbdea550a3a970ca4077730.tar.bz2 wireshark-66370dc127a98398cbbdea550a3a970ca4077730.zip |
All dissectors must put their protocol tree items under a top-level item
for the protocol; otherwise, the protocol statistics code doesn't work
(and often trips across assertions). Put the "Gnutella Upload /
Download Stream" item underneath a Gnutell protocol item, rather than
putting it at the top level.
svn path=/trunk/; revision=3847
Diffstat (limited to 'packet-gnutella.c')
-rw-r--r-- | packet-gnutella.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/packet-gnutella.c b/packet-gnutella.c index 8f67f2eddb..7557563be2 100644 --- a/packet-gnutella.c +++ b/packet-gnutella.c @@ -2,7 +2,7 @@ * Routines for gnutella dissection * Copyright 2001, B. Johannessen <bob@havoq.com> * - * $Id: packet-gnutella.c,v 1.2 2001/06/18 02:17:46 guy Exp $ + * $Id: packet-gnutella.c,v 1.3 2001/08/18 07:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -446,13 +446,21 @@ static void dissect_gnutella(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree } if (tree) { + ti = proto_tree_add_item(tree, + proto_gnutella, + tvb, + 0, + tvb_length(tvb), + FALSE); + gnutella_tree = proto_item_add_subtree(ti, ett_gnutella); + offset = 0; size = tvb_get_letohl( tvb, offset + GNUTELLA_HEADER_SIZE_OFFSET); if(size > GNUTELLA_MAX_SNAP_SIZE) { - proto_tree_add_item(tree, + proto_tree_add_item(gnutella_tree, hf_gnutella_stream, tvb, offset, @@ -461,14 +469,6 @@ static void dissect_gnutella(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree return; } - ti = proto_tree_add_item(tree, - proto_gnutella, - tvb, - 0, - tvb_length(tvb), - FALSE); - gnutella_tree = proto_item_add_subtree(ti, ett_gnutella); - while(snap_len - offset >= GNUTELLA_HEADER_LENGTH) { payload_descriptor = tvb_get_guint8( tvb, @@ -818,4 +818,3 @@ void proto_reg_handoff_gnutella(void) { dissect_gnutella, proto_gnutella); } - |