diff options
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-ascend.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-atm.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-cosine.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-eth.c | 32 | ||||
-rw-r--r-- | epan/dissectors/packet-etherip.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fr.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-isl.c | 166 | ||||
-rw-r--r-- | epan/dissectors/packet-isl.h | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-llc.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-lwapp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-sflow.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-wfleet-hdlc.c | 6 |
14 files changed, 184 insertions, 99 deletions
diff --git a/epan/dissectors/packet-ascend.c b/epan/dissectors/packet-ascend.c index 1c3caa7f8d..a1274b2e4d 100644 --- a/epan/dissectors/packet-ascend.c +++ b/epan/dissectors/packet-ascend.c @@ -45,7 +45,7 @@ static const value_string encaps_vals[] = { {ASCEND_PFX_WDD, "Ethernet" }, {0, NULL } }; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t ppp_hdlc_handle; static void @@ -108,7 +108,7 @@ dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(ppp_hdlc_handle, tvb, pinfo, tree); break; case ASCEND_PFX_WDD: - call_dissector(eth_handle, tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, tvb, pinfo, tree); break; default: break; @@ -161,7 +161,7 @@ proto_reg_handoff_ascend(void) /* * Get handles for the Ethernet and PPP-in-HDLC-like-framing dissectors. */ - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); ppp_hdlc_handle = find_dissector("ppp_hdlc"); ascend_handle = create_dissector_handle(dissect_ascend, proto_ascend); diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 5bf4de3dff..820643c62e 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -59,7 +59,7 @@ static gint ett_aal1 = -1; static gint ett_aal3_4 = -1; static gint ett_oamaal = -1; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t tr_handle; static dissector_handle_t llc_handle; static dissector_handle_t sscop_handle; @@ -668,7 +668,7 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Dissect as Ethernet */ next_tvb_le_client = tvb_new_subset(tvb, 2, -1, -1); - call_dissector(eth_handle, next_tvb_le_client, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb_le_client, pinfo, tree); break; case TRAF_ST_LANE_802_5: @@ -1622,7 +1622,7 @@ proto_reg_handoff_atm(void) * Get handles for the Ethernet, Token Ring, LLC, SSCOP, LANE, * and ILMI dissectors. */ - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); tr_handle = find_dissector("tr"); llc_handle = find_dissector("llc"); sscop_handle = find_dissector("sscop"); diff --git a/epan/dissectors/packet-cosine.c b/epan/dissectors/packet-cosine.c index 2c8fa84666..8679904379 100644 --- a/epan/dissectors/packet-cosine.c +++ b/epan/dissectors/packet-cosine.c @@ -46,7 +46,7 @@ static int hf_err = -1; static gint ett_raw = -1; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t ppp_hdlc_handle; static dissector_handle_t llc_handle; static dissector_handle_t chdlc_handle; @@ -112,7 +112,7 @@ dissect_cosine(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (pseudo_header->cosine.encap) { case COSINE_ENCAP_ETH: - call_dissector(eth_handle, tvb_new_subset(tvb, 0, -1, -1), + call_dissector(eth_withoutfcs_handle, tvb_new_subset(tvb, 0, -1, -1), pinfo, tree); break; case COSINE_ENCAP_ATM: @@ -181,7 +181,7 @@ proto_reg_handoff_cosine(void) /* * Get handles for dissectors. */ - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); ppp_hdlc_handle = find_dissector("ppp_hdlc"); llc_handle = find_dissector("llc"); chdlc_handle = find_dissector("chdlc"); 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", ð_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); } diff --git a/epan/dissectors/packet-etherip.c b/epan/dissectors/packet-etherip.c index b24e2e89dd..9d75436be3 100644 --- a/epan/dissectors/packet-etherip.c +++ b/epan/dissectors/packet-etherip.c @@ -37,7 +37,7 @@ static int hf_etherip_ver = -1; static gint ett_etherip = -1; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; #ifndef offsetof #define offsetof(type, member) ((size_t)(&((type *)0)->member)) @@ -92,7 +92,7 @@ dissect_etherip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Set the tvbuff for the payload after the header */ next_tvb = tvb_new_subset(tvb, sizeof(etheriph), -1, -1); - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } void @@ -120,7 +120,7 @@ proto_reg_handoff_etherip(void) { dissector_handle_t etherip_handle; - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); etherip_handle = find_dissector("etherip"); dissector_add("ip.proto", IP_PROTO_ETHERIP, etherip_handle); } diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c index a8c8f0eec6..3868faa886 100644 --- a/epan/dissectors/packet-fr.c +++ b/epan/dissectors/packet-fr.c @@ -109,7 +109,7 @@ static gint hf_fr_pid = -1; static gint hf_fr_snaptype = -1; static gint hf_fr_chdlctype = -1; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withfcs_handle; static dissector_handle_t gprs_ns_handle; static dissector_handle_t data_handle; @@ -435,7 +435,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case RAW_ETHER: next_tvb = tvb_new_subset(tvb, offset, -1, -1); if (address != 0) - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withfcs_handle, next_tvb, pinfo, tree); else dissect_lapf(next_tvb, pinfo, tree); break; @@ -716,6 +716,14 @@ void proto_register_fr(void) register_dissector("fr", dissect_fr, proto_fr); frencap_module = prefs_register_protocol(proto_fr, NULL); + /* + * XXX - this should really be per-circuit - I've seen at least one + * capture where different DLCIs have different encapsulations - but + * we don't yet have any support for per-circuit encapsulations. + * + * Even with that, though, we might want a default encapsulation, + * so that people dealing with GPRS can make gprs-ns the default. + */ prefs_register_enum_preference(frencap_module, "encap", "Encapsulation", "Encapsulation", &fr_encap, fr_encap_options, FALSE); @@ -732,7 +740,7 @@ void proto_reg_handoff_fr(void) fr_phdr_handle = create_dissector_handle(dissect_fr_phdr, proto_fr); dissector_add("wtap_encap", WTAP_ENCAP_FRELAY_WITH_PHDR, fr_phdr_handle); - eth_handle = find_dissector("eth"); + eth_withfcs_handle = find_dissector("eth_withfcs"); gprs_ns_handle = find_dissector("gprs_ns"); data_handle = find_dissector("data"); diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index a42ca3e8dc..7dde6091ad 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -504,7 +504,7 @@ static const fragment_items frag_items = { static dissector_handle_t llc_handle; static dissector_handle_t ipx_handle; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t data_handle; /* ************************************************************************* */ @@ -2492,7 +2492,7 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, break; case ENCAP_ETHERNET: - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); break; case ENCAP_IPX: @@ -3226,7 +3226,7 @@ proto_reg_handoff_ieee80211(void) */ llc_handle = find_dissector("llc"); ipx_handle = find_dissector("ipx"); - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); data_handle = find_dissector("data"); ieee80211_handle = find_dissector("wlan"); diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c index 2c455d72c0..c1544dc611 100644 --- a/epan/dissectors/packet-isl.c +++ b/epan/dissectors/packet-isl.c @@ -31,6 +31,7 @@ #include "packet-isl.h" #include "packet-eth.h" #include "packet-tr.h" +#include "packet-frame.h" #include "etypes.h" /* @@ -67,6 +68,7 @@ static int hf_isl_dst_route_descriptor = -1; static int hf_isl_src_route_descriptor = -1; static int hf_isl_fcs_not_incl = -1; static int hf_isl_esize = -1; +static int hf_isl_trailer = -1; static gint ett_isl = -1; @@ -77,7 +79,7 @@ static gint ett_isl = -1; #define TYPE_FDDI 0x2 #define TYPE_ATM 0x3 -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withfcs_handle; static dissector_handle_t tr_handle; static dissector_handle_t data_handle; @@ -137,16 +139,18 @@ static const true_false_string explorer_tfs = { "Data frame" }; -static void -dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +void +dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) { - proto_tree *fh_tree = NULL; + proto_tree *volatile fh_tree = NULL; proto_item *ti; guint8 type; - guint16 length; - gint crc_offset; + volatile guint16 length; gint captured_length; - tvbuff_t *next_tvb; + tvbuff_t *volatile payload_tvb; + tvbuff_t *volatile next_tvb; + tvbuff_t *volatile trailer_tvb; + const char *saved_proto; if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISL"); @@ -178,38 +182,65 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item_hidden(fh_tree, hf_isl_addr, tvb, 6, 6, FALSE); } length = tvb_get_ntohs(tvb, 12); - if (tree) { + if (tree) proto_tree_add_uint(fh_tree, hf_isl_len, tvb, 12, 2, length); + if (length != 0) { + /* The length field was set; it's like an 802.3 length field, so + treat it similarly, by constructing a tvbuff containing only + the data specified by the length field. */ + + TRY { + payload_tvb = tvb_new_subset(tvb, 14, length, length); + trailer_tvb = tvb_new_subset(tvb, 14 + length, -1, -1); + } + CATCH2(BoundsError, ReportedBoundsError) { + /* Either: + + the packet doesn't have "length" bytes worth of + captured data left in it - or it may not even have + "length" bytes worth of data in it, period - + so the "tvb_new_subset()" creating "payload_tvb" + threw an exception + + or + + the packet has exactly "length" bytes worth of + captured data left in it, so the "tvb_new_subset()" + creating "trailer_tvb" threw an exception. + + In either case, this means that all the data in the frame + is within the length value, so we give all the data to the + next protocol and have no trailer. */ + payload_tvb = tvb_new_subset(tvb, 14, -1, length); + trailer_tvb = NULL; + } + ENDTRY; + } else { + /* The length field is 0; make it the length remaining in the packet + after the first 14 bytes. */ + length = tvb_reported_length_remaining(tvb, 14); + payload_tvb = tvb_new_subset(tvb, 14, -1, -1); + trailer_tvb = NULL; + } + + if (tree) { /* This part looks sort of like a SNAP-encapsulated LLC header... */ - proto_tree_add_text(fh_tree, tvb, 14, 1, "DSAP: 0x%X", tvb_get_guint8(tvb, 14)); - proto_tree_add_text(fh_tree, tvb, 15, 1, "SSAP: 0x%X", tvb_get_guint8(tvb, 15)); - proto_tree_add_text(fh_tree, tvb, 16, 1, "Control: 0x%X", tvb_get_guint8(tvb, 16)); + proto_tree_add_text(fh_tree, payload_tvb, 0, 1, "DSAP: 0x%X", tvb_get_guint8(tvb, 14)); + proto_tree_add_text(fh_tree, payload_tvb, 1, 1, "SSAP: 0x%X", tvb_get_guint8(tvb, 15)); + proto_tree_add_text(fh_tree, payload_tvb, 2, 1, "Control: 0x%X", tvb_get_guint8(tvb, 16)); /* ...but this is the manufacturer's ID portion of the source address field (which is, admittedly, an OUI). */ - proto_tree_add_item(fh_tree, hf_isl_hsa, tvb, 17, 3, FALSE); + proto_tree_add_item(fh_tree, hf_isl_hsa, payload_tvb, 3, 3, FALSE); } if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "VLAN ID: 0x%04X", tvb_get_ntohs(tvb, 20) >> 1); if (tree) { - proto_tree_add_item(fh_tree, hf_isl_vlan_id, tvb, 20, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_bpdu, tvb, 20, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_index, tvb, 22, 2, FALSE); - - /* Now for the encapsulated frame's CRC, which is at the *end* of the - packet; "length" is the length of the frame, not including the - first 14 bytes of the frame, but including the encapsulated - frame's CRC, which is 4 bytes long, so the offset of the - encapsulated CRC is "length + 14 - 4". - - We check for the CRC and display it only if we have that data, - rather than throwing an exception before we've dissected any - of the rest of the frame. */ - crc_offset = length + 14 - 4; - if (tvb_bytes_exist(tvb, crc_offset, 4)) - proto_tree_add_item(fh_tree, hf_isl_crc, tvb, crc_offset, 4, FALSE); + proto_tree_add_item(fh_tree, hf_isl_vlan_id, payload_tvb, 6, 2, FALSE); + proto_tree_add_item(fh_tree, hf_isl_bpdu, payload_tvb, 6, 2, FALSE); + proto_tree_add_item(fh_tree, hf_isl_index, payload_tvb, 8, 2, FALSE); } switch (type) { @@ -217,46 +248,73 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case TYPE_ETHER: /* The length of the encapsulated frame is the length from the header, minus 12 bytes for the part of the ISL header that - follows the length and 4 bytes for the encapsulated frame - CRC. */ - if (length >= 12+4) { + follows the length. */ + if (length >= 12) { /* Well, we at least had that much data in the frame. Try dissecting what's left as an Ethernet frame. */ - length -= 12+4; + length -= 12; /* Trim the captured length. */ - captured_length = tvb_length_remaining(tvb, ISL_HEADER_SIZE); - if (captured_length > 4) { - /* Subtract the encapsulated frame CRC. */ - captured_length -= 4; + captured_length = tvb_length_remaining(payload_tvb, 12); + + /* Make sure it's not bigger than the actual length. */ + if (captured_length > length) + captured_length = length; - /* Make sure it's not bigger than the actual length. */ - if (captured_length > length) - captured_length = length; + next_tvb = tvb_new_subset(payload_tvb, 12, captured_length, length); - next_tvb = tvb_new_subset(tvb, ISL_HEADER_SIZE, captured_length, length); + /* Dissect the payload as an Etherner frame. - call_dissector(eth_handle, next_tvb, pinfo, tree); + Catch BoundsError and ReportedBoundsError, so that if the + reported length of "next_tvb" was reduced by some dissector + before an exception was thrown, we can still put in an item + for the trailer. */ + saved_proto = pinfo->current_proto; + TRY { + /* Frames encapsulated in ISL include an FCS. */ + call_dissector(eth_withfcs_handle, next_tvb, pinfo, tree); + } + CATCH(BoundsError) { + /* Somebody threw BoundsError, which means that dissecting the payload + found that the packet was cut off by a snapshot length before the + end of the payload. The trailer comes after the payload, so *all* + of the trailer is cut off - don't bother adding the trailer, just + rethrow the exception so it gets reported. */ + RETHROW; + } + CATCH_ALL { + /* Well, somebody threw an exception other than BoundsError. + Show the exception, and then drive on to show the trailer, + restoring the protocol value that was in effect before we + called the subdissector. */ + show_exception(next_tvb, pinfo, tree, EXCEPT_CODE); + pinfo->current_proto = saved_proto; } + ENDTRY; + + /* Now add the Ethernet trailer and FCS. + XXX - do this only if we're encapsulated in Ethernet? */ + add_ethernet_trailer(fh_tree, hf_isl_trailer, tvb, trailer_tvb, fcs_len); } break; case TYPE_TR: if (tree) { - proto_tree_add_item(fh_tree, hf_isl_src_vlan_id, tvb, 24, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_explorer, tvb, 24, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_dst_route_descriptor, tvb, 26, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_src_route_descriptor, tvb, 28, 2, FALSE); - proto_tree_add_item(fh_tree, hf_isl_fcs_not_incl, tvb, 30, 1, FALSE); - proto_tree_add_item(fh_tree, hf_isl_esize, tvb, 30, 1, FALSE); + proto_tree_add_item(fh_tree, hf_isl_src_vlan_id, payload_tvb, 10, 2, FALSE); + proto_tree_add_item(fh_tree, hf_isl_explorer, payload_tvb, 10, 2, FALSE); + proto_tree_add_item(fh_tree, hf_isl_dst_route_descriptor, payload_tvb, 12, 2, FALSE); + proto_tree_add_item(fh_tree, hf_isl_src_route_descriptor, payload_tvb, 14, 2, FALSE); + /* This doesn't appear to be present in at least one capture I've seen. */ + proto_tree_add_item(fh_tree, hf_isl_fcs_not_incl, payload_tvb, 16, 1, FALSE); + proto_tree_add_item(fh_tree, hf_isl_esize, payload_tvb, 16, 1, FALSE); } - next_tvb = tvb_new_subset(tvb, 31, -1, -1); + next_tvb = tvb_new_subset(payload_tvb, 17, -1, -1); call_dissector(tr_handle, next_tvb, pinfo, tree); break; default: - next_tvb = tvb_new_subset(tvb, ISL_HEADER_SIZE, -1, -1); - call_dissector(data_handle,next_tvb, pinfo, tree); + next_tvb = tvb_new_subset(payload_tvb, 12, -1, -1); + call_dissector(data_handle, next_tvb, pinfo, tree); break; } } @@ -321,6 +379,10 @@ proto_register_isl(void) { &hf_isl_esize, { "Esize", "isl.esize", FT_UINT8, BASE_DEC, NULL, 0x3F, "Frame size for frames less than 64 bytes", HFILL }}, + { &hf_isl_trailer, + { "Trailer", "isl.trailer", FT_BYTES, BASE_NONE, NULL, 0x0, + "Ethernet Trailer or Checksum", HFILL }}, + }; static gint *ett[] = { &ett_isl, @@ -329,8 +391,6 @@ proto_register_isl(void) proto_isl = proto_register_protocol("Cisco ISL", "ISL", "isl"); proto_register_field_array(proto_isl, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - - register_dissector("isl", dissect_isl, proto_isl); } void @@ -339,7 +399,7 @@ proto_reg_handoff_isl(void) /* * Get handles for the Ethernet and Token Ring dissectors. */ - eth_handle = find_dissector("eth"); + eth_withfcs_handle = find_dissector("eth_withfcs"); tr_handle = find_dissector("tr"); data_handle = find_dissector("data"); } diff --git a/epan/dissectors/packet-isl.h b/epan/dissectors/packet-isl.h index d26417c9f0..c926480ea5 100644 --- a/epan/dissectors/packet-isl.h +++ b/epan/dissectors/packet-isl.h @@ -26,4 +26,7 @@ void capture_isl(const guchar *, int, int, packet_counts *); +void dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + int fcs_len); + #endif diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index 0d60f70b3c..8150a101c3 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -80,7 +80,8 @@ static dissector_table_t subdissector_table; static dissector_table_t xid_subdissector_table; static dissector_handle_t bpdu_handle; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; +static dissector_handle_t eth_withfcs_handle; static dissector_handle_t fddi_handle; static dissector_handle_t tr_handle; static dissector_handle_t data_handle; @@ -512,10 +513,16 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, switch (etype) { case BPID_ETH_WITH_FCS: + next_tvb = tvb_new_subset(tvb, offset+5+bridge_pad, + -1, -1); + call_dissector(eth_withfcs_handle, next_tvb, pinfo, + tree); + break; + case BPID_ETH_WITHOUT_FCS: next_tvb = tvb_new_subset(tvb, offset+5+bridge_pad, -1, -1); - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); break; case BPID_802_5_WITH_FCS: @@ -720,7 +727,8 @@ proto_reg_handoff_llc(void) * dissectors. */ bpdu_handle = find_dissector("bpdu"); - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); + eth_withfcs_handle = find_dissector("eth_withfcs"); fddi_handle = find_dissector("fddi"); tr_handle = find_dissector("tr"); data_handle = find_dissector("data"); diff --git a/epan/dissectors/packet-lwapp.c b/epan/dissectors/packet-lwapp.c index f2d87cd933..cdba063454 100644 --- a/epan/dissectors/packet-lwapp.c +++ b/epan/dissectors/packet-lwapp.c @@ -74,7 +74,7 @@ static gint hf_lwapp_control_type = -1; static gint hf_lwapp_control_seq_no = -1; static gint hf_lwapp_control_length = -1; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t wlan_handle; static dissector_handle_t wlan_bsfc_handle; static dissector_handle_t data_handle; @@ -331,7 +331,7 @@ static void dissect_lwapp_l3(tvbuff_t *tvb, packet_info *pinfo, /* Dissect as Ethernet */ next_client = tvb_new_subset(tvb, 0, -1, -1); - call_dissector(eth_handle, next_client, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_client, pinfo, tree); return; } /* dissect_lwapp_l3*/ @@ -543,7 +543,7 @@ proto_reg_handoff_lwapp(void) /* * Get handles for the Ethernet and wireless dissectors. */ - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); wlan_handle = find_dissector("wlan"); wlan_bsfc_handle = find_dissector("wlan_bsfc"); data_handle = find_dissector("data"); diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index e88aef39ae..bacb9634db 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -120,7 +120,7 @@ static hf_register_info mplsf_info[] = { static dissector_handle_t ipv4_handle; static dissector_handle_t ipv6_handle; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t data_handle; static dissector_table_t ppp_subdissector_table; @@ -252,7 +252,7 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else if (ipvers == 1) { dissect_mpls_control(next_tvb, pinfo, tree); } else { - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } } @@ -280,7 +280,7 @@ proto_reg_handoff_mpls(void) */ ipv4_handle = find_dissector("ip"); ipv6_handle = find_dissector("ipv6"); - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); data_handle = find_dissector("data"); ppp_subdissector_table = find_dissector_table("ppp.protocol"); diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 9177a7be74..a144219b42 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -307,7 +307,7 @@ static gint ett_sflow_extended_data = -1; static gint ett_sflow_sampled_header = -1; /* dissectors for other protocols */ -static dissector_handle_t eth_handle; +static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t tr_handle; static dissector_handle_t fddi_handle; static dissector_handle_t fr_handle; @@ -375,7 +375,7 @@ dissect_sflow_sampled_header(tvbuff_t *tvb, packet_info *pinfo, TRY { switch (header_proto) { case SFLOW_HEADER_ETHERNET: - call_dissector(eth_handle, next_tvb, pinfo, sflow_header_tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, sflow_header_tree); break; case SFLOW_HEADER_TOKENRING: call_dissector(tr_handle, next_tvb, pinfo, sflow_header_tree); @@ -1050,7 +1050,7 @@ proto_reg_handoff_sflow(void) { dissector_handle_t sflow_handle; - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); tr_handle = find_dissector("tr"); fddi_handle = find_dissector("fddi"); fr_handle = find_dissector("fr"); diff --git a/epan/dissectors/packet-wfleet-hdlc.c b/epan/dissectors/packet-wfleet-hdlc.c index ecc8665c67..51f6712375 100644 --- a/epan/dissectors/packet-wfleet-hdlc.c +++ b/epan/dissectors/packet-wfleet-hdlc.c @@ -40,7 +40,7 @@ static int hf_wfleet_hdlc_cmd = -1; static gint ett_wfleet_hdlc = -1; -dissector_handle_t eth_handle; +dissector_handle_t eth_withoutfcs_handle; static const value_string wfleet_hdlc_cmd_vals[] = { { 0x03, "Un-numbered I frame"}, @@ -84,7 +84,7 @@ dissect_wfleet_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) next_tvb = tvb_new_subset(tvb, 2, -1, -1); - call_dissector(eth_handle, next_tvb, pinfo, tree); + call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } @@ -123,5 +123,5 @@ proto_reg_handoff_wfleet_hdlc(void) * Find the eth dissector and save a ref to it */ - eth_handle = find_dissector("eth"); + eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); } |