aboutsummaryrefslogtreecommitdiffstats
path: root/packet-fc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-03-05 07:41:24 +0000
committerGuy Harris <guy@alum.mit.edu>2003-03-05 07:41:24 +0000
commit6e797c5b9d54c505b25c3176931e8b8c791b3d88 (patch)
tree5634648b5b883a8241dc6722048c66e9bf1d42c0 /packet-fc.c
parent05c41a279fb9e2df3ded86aece0470c1b1aad887 (diff)
downloadwireshark-6e797c5b9d54c505b25c3176931e8b8c791b3d88.tar.gz
wireshark-6e797c5b9d54c505b25c3176931e8b8c791b3d88.tar.bz2
wireshark-6e797c5b9d54c505b25c3176931e8b8c791b3d88.zip
From Dinesh Dutt:
fix the Fibre Channel reassembly code; fix handling of addresses in FC frames encapsulated inside various internal Cisco protocols; display link state records & descriptors better so as to improve readability & reduce the need to expand tree to find useful information; handle older versions of SW_RSCN; fix saving of device type from Inquiry command; add another Ethertype used internally in Cisco switches. svn path=/trunk/; revision=7283
Diffstat (limited to 'packet-fc.c')
-rw-r--r--packet-fc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/packet-fc.c b/packet-fc.c
index b496dca279..68fe7f6244 100644
--- a/packet-fc.c
+++ b/packet-fc.c
@@ -2,7 +2,7 @@
* Routines for Fibre Channel Decoding (FC Header, Link Ctl & Basic Link Svc)
* Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
*
- * $Id: packet-fc.c,v 1.4 2003/03/04 06:47:09 guy Exp $
+ * $Id: packet-fc.c,v 1.5 2003/03/05 07:41:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -55,6 +55,7 @@
#define FC_HEADER_SIZE 24
#define FC_RCTL_EISL 0x50
+#define MDSHDR_TRAILER_SIZE 6
/* Size of various fields in FC header in bytes */
#define FC_RCTL_SIZE 1
@@ -471,8 +472,8 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
seqcnt = tvb_get_ntohs (tvb, offset+14);
param = tvb_get_ntohl (tvb, offset+20);
- SET_ADDRESS (&pinfo->dst, AT_FC, 3, tvb_get_ptr (tvb, 1, 3));
- SET_ADDRESS (&pinfo->src, AT_FC, 3, tvb_get_ptr (tvb, 5, 3));
+ SET_ADDRESS (&pinfo->dst, AT_FC, 3, tvb_get_ptr (tvb, offset+1, 3));
+ SET_ADDRESS (&pinfo->src, AT_FC, 3, tvb_get_ptr (tvb, offset+5, 3));
pinfo->oxid = tvb_get_ntohs (tvb, offset+16);
pinfo->rxid = tvb_get_ntohs (tvb, offset+18);
pinfo->ptype = PT_EXCHG;
@@ -648,6 +649,15 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
frag_size = tvb_reported_length (tvb)-FC_HEADER_SIZE;
+ /* If there is an MDS header, we need to subtract the MDS trailer size */
+ if ((pinfo->ethertype == ETHERTYPE_UNK) || (pinfo->ethertype == ETHERTYPE_FCFT)) {
+ frag_size -= MDSHDR_TRAILER_SIZE;
+ }
+ else if (pinfo->ethertype == ETHERTYPE_BRDWALK) {
+ frag_size -= 8; /* 4 byte of FC CRC +
+ 4 bytes of error+EOF = 8 bytes */
+ }
+
if (!is_lastframe_inseq) {
/* Show this only as a fragmented FC frame */
if (check_col (pinfo->cinfo, COL_INFO)) {
@@ -659,7 +669,7 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* present, if we're configured to reassemble.
*/
if ((ftype != FC_FTYPE_LINKCTL) && (ftype != FC_FTYPE_BLS) &&
- seqcnt && fc_reassemble &&
+ (!is_lastframe_inseq || seqcnt) && fc_reassemble &&
tvb_bytes_exist(tvb, FC_HEADER_SIZE, frag_size)) {
/* Add this to the list of fragments */
frag_id = (pinfo->oxid << 16) | is_exchg_resp;
@@ -669,7 +679,7 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fc_fragment_table,
seqcnt * fc_max_frame_size,
frag_size,
- TRUE);
+ !is_lastframe_inseq);
if (fcfrag_head) {
next_tvb = tvb_new_real_data (fcfrag_head->data,