aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-opsi.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-opsi.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-opsi.c')
-rw-r--r--epan/dissectors/packet-opsi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-opsi.c b/epan/dissectors/packet-opsi.c
index d7c2e21fb7..dfe82b6a32 100644
--- a/epan/dissectors/packet-opsi.c
+++ b/epan/dissectors/packet-opsi.c
@@ -554,8 +554,8 @@ dissect_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *opsi_tree, int
}
}
-static void
-dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti;
proto_tree *opsi_tree;
@@ -581,15 +581,17 @@ dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
dissect_attributes(tvb, pinfo, opsi_tree, HEADER_LENGTH, MIN(((int)tvb_reported_length(tvb)-HEADER_LENGTH), (tvb_get_ntohs(tvb, PACKET_LENGTH_OFFSET)-HEADER_LENGTH)));
+ return tvb_length(tvb);
}
-static void
-dissect_opsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_opsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
/* We should mimimally grab the header */
tcp_dissect_pdus(tvb, pinfo, tree, opsi_desegment, HEADER_LENGTH, get_opsi_pdu_len,
- dissect_opsi_pdu);
+ dissect_opsi_pdu, data);
+ return tvb_length(tvb);
}
@@ -884,6 +886,6 @@ void
proto_reg_handoff_opsi(void)
{
dissector_handle_t opsi_handle;
- opsi_handle = create_dissector_handle(dissect_opsi, proto_opsi);
+ opsi_handle = new_create_dissector_handle(dissect_opsi, proto_opsi);
dissector_add_uint("tcp.port", TCP_PORT_OPSI, opsi_handle);
}