aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hdfsdata.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-hdfsdata.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-hdfsdata.c')
-rw-r--r--epan/dissectors/packet-hdfsdata.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/epan/dissectors/packet-hdfsdata.c b/epan/dissectors/packet-hdfsdata.c
index f0d72d9689..a3f0ba7958 100644
--- a/epan/dissectors/packet-hdfsdata.c
+++ b/epan/dissectors/packet-hdfsdata.c
@@ -400,8 +400,8 @@ get_hdfsdata_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
}
/* This method dissects fully reassembled messages */
-static void
-dissect_hdfsdata_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hdfsdata_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
@@ -487,10 +487,12 @@ dissect_hdfsdata_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+
+ return tvb_length(tvb);
}
-static void
-dissect_hdfsdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hdfsdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
int frame_header_len = 0;
@@ -522,7 +524,8 @@ dissect_hdfsdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
frame_header_len = WRITE_REQ_HEAD_LEN;
}
- tcp_dissect_pdus(tvb, pinfo, tree, need_reassemble, frame_header_len, get_hdfsdata_message_len, dissect_hdfsdata_message);
+ tcp_dissect_pdus(tvb, pinfo, tree, need_reassemble, frame_header_len, get_hdfsdata_message_len, dissect_hdfsdata_message, data);
+ return tvb_length(tvb);
}
/* registers the protcol with the given names */
@@ -791,7 +794,7 @@ proto_register_hdfsdata(void)
10,
&tcp_port);
- hdfsdata_handle = register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
+ hdfsdata_handle = new_register_dissector("hdfsdata", dissect_hdfsdata, proto_hdfsdata);
}
/* registers handoff */