aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eth.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-09 23:01:28 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-13 17:44:24 +0000
commit01f7356f85d33567a25e722e6488addd72ff64d4 (patch)
tree2d8623b57706cc924f76293f0f5b6ce8d83124ab /epan/dissectors/packet-eth.c
parentb776707af540d7431e815818e21ea1efac326d9f (diff)
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 <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r--epan/dissectors/packet-eth.c21
1 files changed, 12 insertions, 9 deletions
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);