From dcfea6a06ddf7adeafc8613efe74310251201789 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 24 Nov 2015 21:59:51 -0500 Subject: create_dissector_handle -> new_create_dissector_handle This finalizes the transformation for dissectors. Change-Id: Ie5986b72bb69a6e8779ca3f5e20a80357c9e6fea Reviewed-on: https://code.wireshark.org/review/12122 Petri-Dish: Michael Mann Reviewed-by: Michael Mann --- epan/dissectors/packet-mpls.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'epan/dissectors/packet-mpls.c') diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 8960abde42..5180a7cad4 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -245,15 +245,15 @@ decode_mpls_label(tvbuff_t *tvb, int offset, /* * FF: PW Associated Channel Header dissection as per RFC 4385. */ -static void -dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; guint channel_type; if (tvb_reported_length_remaining(tvb, 0) < 4) { proto_tree_add_expert(tree, pinfo, &ei_mpls_pw_ach_error_processing_message, tvb, 0, -1); - return; + return tvb_captured_length(tvb); } channel_type = tvb_get_ntohs(tvb, 2); @@ -297,6 +297,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) XXX - Perhaps a new dissector function that combines both is preferred.*/ dissect_bfd_mep(next_tvb, tree, 0); } + return tvb_captured_length(tvb); } gboolean @@ -325,18 +326,18 @@ dissect_try_cw_first_nibble( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree /* * FF: Generic/Preferred PW MPLS Control Word dissection as per RFC 4385. */ -static void -dissect_pw_mcw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_pw_mcw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; if (tvb_reported_length_remaining(tvb, 0) < 4) { proto_tree_add_expert(tree, pinfo, &ei_mpls_pw_mcw_error_processing_message, tvb, 0, -1); - return; + return tvb_captured_length(tvb); } if ( dissect_try_cw_first_nibble( tvb, pinfo, tree )) - return; + return tvb_captured_length(tvb); if (tree) { proto_tree *mpls_pw_mcw_tree; @@ -355,6 +356,7 @@ dissect_pw_mcw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } next_tvb = tvb_new_subset_remaining(tvb, 4); call_dissector(dissector_data, next_tvb, pinfo, tree); + return tvb_captured_length(tvb); } static int @@ -647,7 +649,7 @@ proto_reg_handoff_mpls(void) dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_MPLS, mpls_handle); dissector_add_uint("udp.port", UDP_PORT_MPLS_OVER_UDP, mpls_handle); - mpls_pwcw_handle = create_dissector_handle( dissect_pw_mcw, proto_pw_mcw ); + mpls_pwcw_handle = new_create_dissector_handle( dissect_pw_mcw, proto_pw_mcw ); dissector_add_uint( "mpls.label", MPLS_LABEL_INVALID, mpls_pwcw_handle ); dissector_data = find_dissector("data"); @@ -655,7 +657,7 @@ proto_reg_handoff_mpls(void) dissector_ip = find_dissector("ip"); dissector_pw_eth_heuristic = find_dissector("pw_eth_heuristic"); - dissector_pw_ach = create_dissector_handle(dissect_pw_ach, proto_pw_ach ); + dissector_pw_ach = new_create_dissector_handle(dissect_pw_ach, proto_pw_ach ); } /* * Editor modelines -- cgit v1.2.3