aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ajp13.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-ajp13.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-ajp13.c')
-rw-r--r--epan/dissectors/packet-ajp13.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c
index e1f2be9a1e..99ccbaede3 100644
--- a/epan/dissectors/packet-ajp13.c
+++ b/epan/dissectors/packet-ajp13.c
@@ -748,8 +748,8 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo,
/* main dissector function. wireshark calls it for segments in both
* directions.
*/
-static void
-dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint16 mag;
/* guint16 len; */
@@ -829,6 +829,8 @@ dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
display_rsp(tvb, pinfo, ajp13_tree, cd);
}
+
+ return tvb_length(tvb);
}
@@ -851,8 +853,8 @@ get_ajp13_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
/* Code to actually dissect the packets.
*/
-static void
-dissect_ajp13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ajp13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
/* Set up structures needed to add the protocol subtree and manage it
*/
@@ -860,7 +862,9 @@ dissect_ajp13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
TRUE, /* desegment or not */
4, /* magic + length */
get_ajp13_pdu_len, /* use first 4, calc data len */
- dissect_ajp13_tcp_pdu); /* the naive dissector */
+ dissect_ajp13_tcp_pdu, data); /* the naive dissector */
+
+ return tvb_length(tvb);
}
@@ -1118,6 +1122,6 @@ void
proto_reg_handoff_ajp13(void)
{
dissector_handle_t ajp13_handle;
- ajp13_handle = create_dissector_handle(dissect_ajp13, proto_ajp13);
+ ajp13_handle = new_create_dissector_handle(dissect_ajp13, proto_ajp13);
dissector_add_uint("tcp.port", 8009, ajp13_handle);
}