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-tns.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-tns.c')
-rw-r--r-- | epan/dissectors/packet-tns.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c index fb006d8bcf..ba2958c54a 100644 --- a/epan/dissectors/packet-tns.c +++ b/epan/dissectors/packet-tns.c @@ -192,7 +192,7 @@ static const value_string tns_control_cmds[] = { void proto_reg_handoff_tns(void); static guint get_tns_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset); -static void dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +static int dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_); static void dissect_tns_service_options(tvbuff_t *tvb, int offset, proto_tree *sopt_tree) @@ -841,7 +841,7 @@ get_tns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) } static int -dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint8 type; @@ -860,12 +860,12 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) } tcp_dissect_pdus(tvb, pinfo, tree, tns_desegment, 2, - get_tns_pdu_len, dissect_tns_pdu); + get_tns_pdu_len, dissect_tns_pdu, data); return tvb_length(tvb); } -static void -dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *tns_tree = NULL, *ti; proto_item *hidden_item; @@ -971,6 +971,8 @@ dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tns_tree); break; } + + return tvb_length(tvb); } void proto_register_tns(void) |