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-icep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'epan/dissectors/packet-icep.c') diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c index bd65d3a1b0..7c2dd8f85d 100644 --- a/epan/dissectors/packet-icep.c +++ b/epan/dissectors/packet-icep.c @@ -921,7 +921,7 @@ static guint get_icep_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return tvb_get_letohl(tvb, offset + 10); } -static void dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* p. 611, chapter 23.3.1: * @@ -1021,10 +1021,11 @@ static void dissect_icep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree expert_add_info_format(pinfo, msg_item, &ei_icep_message_type, "Unknown Message Type: 0x%02x", tvb_get_guint8(tvb, 8)); break; } + return tvb_length(tvb); } /* entry point */ -static gboolean dissect_icep_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +static gboolean dissect_icep_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { DBG0("triggered\n"); @@ -1036,12 +1037,12 @@ static gboolean dissect_icep_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree * /* start dissecting */ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, ICEP_HEADER_SIZE, - get_icep_pdu_len, dissect_icep_pdu); + get_icep_pdu_len, dissect_icep_pdu, data); return TRUE; } -static gboolean dissect_icep_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +static gboolean dissect_icep_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { DBG0("triggered\n"); @@ -1051,7 +1052,7 @@ static gboolean dissect_icep_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree * } /* start dissecting */ - dissect_icep_pdu(tvb, pinfo, tree); + dissect_icep_pdu(tvb, pinfo, tree, data); return TRUE; } -- cgit v1.2.3