aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eth.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-11-24 09:13:52 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-11-24 09:13:52 +0000
commit3b59563a091cb47e33522fb46c873eb4ba660a54 (patch)
tree8a078ef2bb27f034ded036ea017e2b910df7de81 /epan/dissectors/packet-eth.c
parent21f7a209dcaa60bb0fc8d2e9383bdeba5f91b9f3 (diff)
Export two versions of the Ethereal dissector, for use with encapsulated
Ethernet frames, one for encapsulated frames that include an FCS and one for encapsulated frames that don't include an FCS. Use the appropriate versions. In the ISL dissector, do the same sort of processing we do in the Ethernet dissector to figure out whether the frame has a trailer or not and whether it has an FCS or not. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12593 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r--epan/dissectors/packet-eth.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c
index e89df34539..be00065114 100644
--- a/epan/dissectors/packet-eth.c
+++ b/epan/dissectors/packet-eth.c
@@ -54,7 +54,6 @@ static int hf_eth_trailer = -1;
static gint ett_ieee8023 = -1;
static gint ett_ether2 = -1;
-static dissector_handle_t isl_handle;
static dissector_handle_t fw1_handle;
static heur_dissector_list_t heur_subdissector_list;
@@ -213,7 +212,7 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvb_get_guint8(tvb, 2) == 0x0C &&
tvb_get_guint8(tvb, 3) == 0x00 &&
tvb_get_guint8(tvb, 4) == 0x00 ) {
- call_dissector(isl_handle, tvb, pinfo, tree);
+ dissect_isl(tvb, pinfo, tree, fcs_len);
goto end_of_eth;
}
}
@@ -396,14 +395,21 @@ dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_eth_common(tvb, pinfo, tree, pinfo->pseudo_header->eth.fcs_len);
}
-/* Called by other dissectors - for now, we assume Ethernet encapsulated
- inside other protocols doesn't include the FCS. */
+/* Called by other dissectors This one's for encapsulated Ethernet
+ packets that don't include an FCS. */
static void
-dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+dissect_eth_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
dissect_eth_common(tvb, pinfo, tree, 0);
}
+/* ...and this one's for encapsulated packets that do. */
+static void
+dissect_eth_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_eth_common(tvb, pinfo, tree, 4);
+}
+
void
proto_register_eth(void)
{
@@ -454,27 +460,27 @@ proto_register_eth(void)
"Whether packets should be interpreted as coming from CheckPoint FireWall-1 monitor file if they look as if they do",
&eth_interpret_as_fw1_monitor);
- register_dissector("eth", dissect_eth, proto_eth);
+ register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth);
+ register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth);
eth_tap = register_tap("eth");
}
void
proto_reg_handoff_eth(void)
{
- dissector_handle_t eth_handle, eth_maybefcs_handle;
+ dissector_handle_t eth_maybefcs_handle, eth_withoutfcs_handle;
/*
- * Get a handle for the ISL dissector.
+ * Get a handle for the Firewall-1 dissector.
*/
- isl_handle = find_dissector("isl");
fw1_handle = find_dissector("fw1");
eth_maybefcs_handle = create_dissector_handle(dissect_eth_maybefcs,
proto_eth);
dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, eth_maybefcs_handle);
- eth_handle = find_dissector("eth");
- dissector_add("ethertype", ETHERTYPE_ETHBRIDGE, eth_handle);
- dissector_add("chdlctype", ETHERTYPE_ETHBRIDGE, eth_handle);
- dissector_add("gre.proto", ETHERTYPE_ETHBRIDGE, eth_handle);
+ eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
+ dissector_add("ethertype", ETHERTYPE_ETHBRIDGE, eth_withoutfcs_handle);
+ dissector_add("chdlctype", ETHERTYPE_ETHBRIDGE, eth_withoutfcs_handle);
+ dissector_add("gre.proto", ETHERTYPE_ETHBRIDGE, eth_withoutfcs_handle);
}