aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-etch.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-09 17:46:28 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-09 17:46:28 +0000
commit8081cf1d90397cbbb4404f9720595e1537ed5e14 (patch)
tree353220f46e08be1f0020603538f501b65bea8f3b /epan/dissectors/packet-etch.c
parentc9b2ee3768abb730b49fc4fc779e77578a1c4971 (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-etch.c')
-rw-r--r--epan/dissectors/packet-etch.c9
1 files changed, 5 insertions, 4 deletions
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);