From 01f7356f85d33567a25e722e6488addd72ff64d4 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Mon, 9 Nov 2015 23:01:28 -0500 Subject: register_dissector -> new_register_dissector Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I3d5e576b796556ef070bb36d8b55da0b175dcba8 Reviewed-on: https://code.wireshark.org/review/11805 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-eth.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'epan/dissectors/packet-eth.c') diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 04e689fe8a..b5d45e95ef 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -799,8 +799,8 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, /* Called for the Ethernet Wiretap encapsulation type; pass the FCS length reported to us, or, if the "assume_fcs" preference is set, pass 4. */ -static void -dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *fh_tree; @@ -827,21 +827,24 @@ dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { dissect_eth_common(tvb, pinfo, tree, eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len); } + return tvb_captured_length(tvb); } /* Called by other dissectors This one's for encapsulated Ethernet packets that don't include an FCS. */ -static void -dissect_eth_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_eth_common(tvb, pinfo, tree, 0); + return tvb_captured_length(tvb); } /* ...and this one's for encapsulated packets that do. */ -static void -dissect_eth_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_eth_common(tvb, pinfo, tree, 4); + return tvb_captured_length(tvb); } void @@ -1007,9 +1010,9 @@ proto_register_eth(void) "Set the condition that must be true for the CCSDS dissector to be called", &ccsds_heuristic_bit); - register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth); - register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth); - register_dissector("eth", dissect_eth_maybefcs, proto_eth); + new_register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth); + new_register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth); + new_register_dissector("eth", dissect_eth_maybefcs, proto_eth); eth_tap = register_tap("eth"); register_conversation_table(proto_eth, TRUE, eth_conversation_packet, eth_hostlist_packet); -- cgit v1.2.3