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-starteam.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-starteam.c')
-rw-r--r-- | epan/dissectors/packet-starteam.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/epan/dissectors/packet-starteam.c b/epan/dissectors/packet-starteam.c index c23e8ea1cc..a6251bb083 100644 --- a/epan/dissectors/packet-starteam.c +++ b/epan/dissectors/packet-starteam.c @@ -483,8 +483,8 @@ starteam_init(void) iPreviousFrameNumber = -1; } -static void -dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset = 0; @@ -573,6 +573,8 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } } + + return tvb_length(tvb); } static guint @@ -589,15 +591,16 @@ get_starteam_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return iPDULength; } -static void -dissect_starteam_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_starteam_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - tcp_dissect_pdus(tvb, pinfo, tree, starteam_desegment, 8, get_starteam_pdu_len, dissect_starteam); + tcp_dissect_pdus(tvb, pinfo, tree, starteam_desegment, 8, get_starteam_pdu_len, dissect_starteam, data); + return tvb_length(tvb); } static gboolean -dissect_starteam_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_starteam_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { if(tvb_length(tvb) >= 32){ gint iOffsetLengths = -1; @@ -619,7 +622,7 @@ dissect_starteam_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void conversation_set_dissector(conversation, starteam_tcp_handle); /* Dissect the packet */ - dissect_starteam(tvb, pinfo, tree); + dissect_starteam(tvb, pinfo, tree, data); return TRUE; } } @@ -709,5 +712,5 @@ void proto_reg_handoff_starteam(void) { heur_dissector_add("tcp", dissect_starteam_heur, proto_starteam); - starteam_tcp_handle = create_dissector_handle(dissect_starteam_tcp, proto_starteam); + starteam_tcp_handle = new_create_dissector_handle(dissect_starteam_tcp, proto_starteam); } |