diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
commit | 8081cf1d90397cbbb4404f9720595e1537ed5e14 (patch) | |
tree | 353220f46e08be1f0020603538f501b65bea8f3b /epan/dissectors/packet-aim.c | |
parent | c9b2ee3768abb730b49fc4fc779e77578a1c4971 (diff) |
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
Diffstat (limited to 'epan/dissectors/packet-aim.c')
-rw-r--r-- | epan/dissectors/packet-aim.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); } |