aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-slsk.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-slsk.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-slsk.c')
-rw-r--r--epan/dissectors/packet-slsk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index 2fb7cbf887..4cc5201cae 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -301,7 +301,7 @@ static guint get_slsk_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
/* Code to actually dissect the packets */
-static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
@@ -2381,14 +2381,14 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
expert_add_info(pinfo, ti_len, &ei_slsk_unknown_data);
}
-
+ return tvb_length(tvb);
}
-static void dissect_slsk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_slsk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
- tcp_dissect_pdus(tvb, pinfo, tree, slsk_desegment, 4, get_slsk_pdu_len, dissect_slsk_pdu);
-
+ tcp_dissect_pdus(tvb, pinfo, tree, slsk_desegment, 4, get_slsk_pdu_len, dissect_slsk_pdu, data);
+ return tvb_length(tvb);
}
@@ -2630,7 +2630,7 @@ proto_reg_handoff_slsk(void)
{
dissector_handle_t slsk_handle;
- slsk_handle = create_dissector_handle(dissect_slsk, proto_slsk);
+ slsk_handle = new_create_dissector_handle(dissect_slsk, proto_slsk);
dissector_add_uint("tcp.port", TCP_PORT_SLSK_1, slsk_handle);
dissector_add_uint("tcp.port", TCP_PORT_SLSK_2, slsk_handle);
dissector_add_uint("tcp.port", TCP_PORT_SLSK_3, slsk_handle);