aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-srvloc.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-srvloc.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-srvloc.c')
-rw-r--r--epan/dissectors/packet-srvloc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c
index 624a046922..f8addd577b 100644
--- a/epan/dissectors/packet-srvloc.c
+++ b/epan/dissectors/packet-srvloc.c
@@ -1412,8 +1412,8 @@ get_srvloc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
return tvb_get_ntohs(tvb, offset + 2);
}
-static void
-dissect_srvloc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_srvloc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *srvloc_tree = NULL;
proto_item *ti;
@@ -1427,10 +1427,11 @@ dissect_srvloc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
srvloc_tree = proto_item_add_subtree(ti, ett_srvloc);
}
dissect_srvloc(tvb, pinfo, srvloc_tree, NULL);
+ return tvb_length(tvb);
}
-static void
-dissect_srvloc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_srvloc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
/*
* XXX - in SLPv1, the fixed length need only be 4, as the length
@@ -1441,7 +1442,8 @@ dissect_srvloc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* and we can't handle a length < 4 anyway.
*/
tcp_dissect_pdus(tvb, pinfo, tree, srvloc_desegment, 5, get_srvloc_pdu_len,
- dissect_srvloc_pdu);
+ dissect_srvloc_pdu, data);
+ return tvb_length(tvb);
}
/* Register protocol with Wireshark. */
@@ -1915,7 +1917,7 @@ proto_reg_handoff_srvloc(void)
dissector_handle_t srvloc_handle, srvloc_tcp_handle;
srvloc_handle = new_create_dissector_handle(dissect_srvloc, proto_srvloc);
dissector_add_uint("udp.port", UDP_PORT_SRVLOC, srvloc_handle);
- srvloc_tcp_handle = create_dissector_handle(dissect_srvloc_tcp,
+ srvloc_tcp_handle = new_create_dissector_handle(dissect_srvloc_tcp,
proto_srvloc);
dissector_add_uint("tcp.port", TCP_PORT_SRVLOC, srvloc_tcp_handle);
}