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 /asn1/ilp | |
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 'asn1/ilp')
-rw-r--r-- | asn1/ilp/ilp.cnf | 2 | ||||
-rw-r--r-- | asn1/ilp/packet-ilp-template.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/asn1/ilp/ilp.cnf b/asn1/ilp/ilp.cnf index d76b27e882..a27c5561c6 100644 --- a/asn1/ilp/ilp.cnf +++ b/asn1/ilp/ilp.cnf @@ -8,7 +8,7 @@ PER UNALIGNED #.END -#.PDU +#.PDU_NEW ILP-PDU #.END diff --git a/asn1/ilp/packet-ilp-template.c b/asn1/ilp/packet-ilp-template.c index a6c94e1340..c334e1f834 100644 --- a/asn1/ilp/packet-ilp-template.c +++ b/asn1/ilp/packet-ilp-template.c @@ -79,11 +79,12 @@ get_ilp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return tvb_get_ntohs(tvb,offset); } -static void -dissect_ilp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ilp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, ilp_desegment, ILP_HEADER_SIZE, - get_ilp_pdu_len, dissect_ILP_PDU_PDU); + get_ilp_pdu_len, dissect_ILP_PDU_PDU, data); + return tvb_length(tvb); } void proto_reg_handoff_ilp(void); @@ -108,7 +109,7 @@ void proto_register_ilp(void) { /* Register protocol */ proto_ilp = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("ilp", dissect_ilp_tcp, proto_ilp); + new_register_dissector("ilp", dissect_ilp_tcp, proto_ilp); /* Register fields and subtrees */ proto_register_field_array(proto_ilp, hf, array_length(hf)); |