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-etch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'epan/dissectors/packet-etch.c') diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c index 226422eb54..2588475ee2 100644 --- a/epan/dissectors/packet-etch.c +++ b/epan/dissectors/packet-etch.c @@ -716,8 +716,8 @@ get_column_info(tvbuff_t *tvb) /* * main dissector function for an etch message */ -static void -dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* We've a full PDU: 8 bytes + pdu_packetlen bytes */ wmem_strbuf_t *colInfo = NULL; @@ -758,6 +758,7 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) read_struct(&offset, tvb, etch_tree, 0); } + return tvb_length(tvb); } /* @@ -775,7 +776,7 @@ get_etch_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) * main dissector function for the etch protocol */ static int -dissect_etch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_etch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { if (tvb_length(tvb) < 4) { /* Too small for an etch packet. */ @@ -788,7 +789,7 @@ dissect_etch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ } tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 8, get_etch_message_len, - dissect_etch_message); + dissect_etch_message, data); if (gbl_pdu_counter > 0) { col_set_writable(pinfo->cinfo, TRUE); -- cgit v1.2.3