diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
commit | 8081cf1d90397cbbb4404f9720595e1537ed5e14 (patch) | |
tree | 353220f46e08be1f0020603538f501b65bea8f3b /epan/dissectors/packet-turnchannel.c | |
parent | c9b2ee3768abb730b49fc4fc779e77578a1c4971 (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-turnchannel.c')
-rw-r--r-- | epan/dissectors/packet-turnchannel.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/epan/dissectors/packet-turnchannel.c b/epan/dissectors/packet-turnchannel.c index 187151b6c2..2fa4c0f19c 100644 --- a/epan/dissectors/packet-turnchannel.c +++ b/epan/dissectors/packet-turnchannel.c @@ -119,25 +119,18 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo, return tvb_length(tvb); } - -static void -dissect_turnchannel_message_no_return(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - dissect_turnchannel_message(tvb, pinfo, tree, NULL); -} - - static guint get_turnchannel_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { return (guint)tvb_get_ntohs(tvb, offset+2) + TURNCHANNEL_HDR_LEN; } -static void -dissect_turnchannel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_turnchannel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, TURNCHANNEL_HDR_LEN, - get_turnchannel_message_len, dissect_turnchannel_message_no_return); + get_turnchannel_message_len, dissect_turnchannel_message, data); + return tvb_length(tvb); } @@ -210,7 +203,7 @@ proto_reg_handoff_turnchannel(void) dissector_handle_t turnchannel_tcp_handle; dissector_handle_t turnchannel_udp_handle; - turnchannel_tcp_handle = create_dissector_handle(dissect_turnchannel_tcp, proto_turnchannel); + turnchannel_tcp_handle = new_create_dissector_handle(dissect_turnchannel_tcp, proto_turnchannel); turnchannel_udp_handle = find_dissector("turnchannel"); /* Used for "Decode As" in case STUN negotiation isn't captured */ |