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-drda.c | |
parent | c9b2ee3768abb730b49fc4fc779e77578a1c4971 (diff) | |
download | wireshark-8081cf1d90397cbbb4404f9720595e1537ed5e14.tar.gz |
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-drda.c')
-rw-r--r-- | epan/dissectors/packet-drda.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c index 9d666345e6..0f29ff9207 100644 --- a/epan/dissectors/packet-drda.c +++ b/epan/dissectors/packet-drda.c @@ -671,8 +671,8 @@ drda_init(void) iPreviousFrameNumber = 0; } -static void -dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; @@ -788,6 +788,8 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += iLength; } } + + return tvb_length(tvb); } static guint @@ -800,15 +802,16 @@ get_drda_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return 0; } -static void -dissect_drda_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_drda_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - tcp_dissect_pdus(tvb, pinfo, tree, drda_desegment, 10, get_drda_pdu_len, dissect_drda); + tcp_dissect_pdus(tvb, pinfo, tree, drda_desegment, 10, get_drda_pdu_len, dissect_drda, data); + return tvb_length(tvb); } static gboolean -dissect_drda_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_drda_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { conversation_t * conversation; if (tvb_length(tvb) >= 10) @@ -824,7 +827,7 @@ dissect_drda_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat conversation_set_dissector(conversation, drda_tcp_handle); /* Dissect the packet */ - dissect_drda(tvb, pinfo, tree); + dissect_drda(tvb, pinfo, tree, data); return TRUE; } } @@ -957,5 +960,5 @@ void proto_reg_handoff_drda(void) { heur_dissector_add("tcp", dissect_drda_heur, proto_drda); - drda_tcp_handle = create_dissector_handle(dissect_drda_tcp, proto_drda); + drda_tcp_handle = new_create_dissector_handle(dissect_drda_tcp, proto_drda); } |