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-ndps.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-ndps.c')
-rw-r--r-- | epan/dissectors/packet-ndps.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c index 0c580b61a8..e2a4b5aacc 100644 --- a/epan/dissectors/packet-ndps.c +++ b/epan/dissectors/packet-ndps.c @@ -4295,21 +4295,21 @@ get_ndps_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) return tvb_get_ntohs(tvb, offset +2) + 4; } -static void -dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - proto_tree *ndps_tree = NULL; + proto_tree *ndps_tree; proto_item *ti; col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDPS"); col_clear(pinfo->cinfo, COL_INFO); - if (tree) { - ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, ENC_NA); - ndps_tree = proto_item_add_subtree(ti, ett_ndps); - } + ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, ENC_NA); + ndps_tree = proto_item_add_subtree(ti, ett_ndps); + dissect_ndps(tvb, pinfo, ndps_tree); + return tvb_length(tvb); } /* @@ -4470,10 +4470,11 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, spx_info *spx_i } } -static void -dissect_ndps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ndps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - tcp_dissect_pdus(tvb, pinfo, tree, ndps_desegment, 4, get_ndps_pdu_len, dissect_ndps_pdu); + tcp_dissect_pdus(tvb, pinfo, tree, ndps_desegment, 4, get_ndps_pdu_len, dissect_ndps_pdu, data); + return tvb_length(tvb); } @@ -9801,7 +9802,7 @@ proto_reg_handoff_ndps(void) dissector_handle_t ndps_handle, ndps_tcp_handle; ndps_handle = new_create_dissector_handle(dissect_ndps_ipx, proto_ndps); - ndps_tcp_handle = create_dissector_handle(dissect_ndps_tcp, proto_ndps); + ndps_tcp_handle = new_create_dissector_handle(dissect_ndps_tcp, proto_ndps); dissector_add_uint("spx.socket", SPX_SOCKET_PA, ndps_handle); dissector_add_uint("spx.socket", SPX_SOCKET_BROKER, ndps_handle); |