From 8081cf1d90397cbbb4404f9720595e1537ed5e14 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 9 Nov 2013 17:46:28 +0000 Subject: Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198 --- epan/dissectors/packet-aim.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'epan/dissectors/packet-aim.c') diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index 6aaf764636..b808dce634 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -1407,8 +1407,8 @@ get_aim_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return plen + 6; } -static void -dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* Header fields */ unsigned char hdr_channel; /* channel ID */ @@ -1469,11 +1469,12 @@ dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } + return tvb_length(tvb); } /* Code to actually dissect the packets */ static int -dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { /* check, if this is really an AIM packet, they start with 0x2a */ /* XXX - I've seen some stuff starting with 0x5a followed by 0x2a */ @@ -1490,7 +1491,7 @@ dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) } tcp_dissect_pdus(tvb, pinfo, tree, aim_desegment, 6, get_aim_pdu_len, - dissect_aim_pdu); + dissect_aim_pdu, data); return tvb_length(tvb); } -- cgit v1.2.3