2002-12-08 02:32:36 +00:00
|
|
|
/* packet-fcp.c
|
|
|
|
* Routines for Fibre Channel Protocol for SCSI (FCP)
|
|
|
|
* Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2002-12-08 02:32:36 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2002-12-08 02:32:36 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-07-25 23:11:32 +00:00
|
|
|
*
|
2002-12-08 02:32:36 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-07-25 23:11:32 +00:00
|
|
|
*
|
2002-12-08 02:32:36 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
2005-08-12 23:00:01 +00:00
|
|
|
#include <epan/emem.h>
|
2002-12-08 02:32:36 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/conversation.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
2006-10-11 10:38:59 +00:00
|
|
|
#include "packet-scsi.h"
|
2002-12-08 02:32:36 +00:00
|
|
|
#include "packet-fc.h"
|
|
|
|
#include "packet-fcp.h"
|
2009-10-17 10:19:18 +00:00
|
|
|
#include "packet-fcels.h"
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_fcp = -1;
|
|
|
|
static int hf_fcp_multilun = -1;
|
|
|
|
static int hf_fcp_singlelun = -1;
|
|
|
|
static int hf_fcp_crn = -1;
|
|
|
|
static int hf_fcp_taskattr = -1;
|
|
|
|
static int hf_fcp_taskmgmt = -1;
|
|
|
|
static int hf_fcp_addlcdblen = -1;
|
|
|
|
static int hf_fcp_rddata = -1;
|
|
|
|
static int hf_fcp_wrdata = -1;
|
|
|
|
static int hf_fcp_dl = -1;
|
2006-10-11 11:32:56 +00:00
|
|
|
static int hf_fcp_bidir_dl = -1;
|
2002-12-08 02:32:36 +00:00
|
|
|
static int hf_fcp_data_ro = -1;
|
|
|
|
static int hf_fcp_burstlen = -1;
|
|
|
|
static int hf_fcp_rspflags = -1;
|
2006-04-04 22:21:48 +00:00
|
|
|
static int hf_fcp_retry_delay_timer = -1;
|
2002-12-08 02:32:36 +00:00
|
|
|
static int hf_fcp_resid = -1;
|
2006-04-05 01:17:32 +00:00
|
|
|
static int hf_fcp_bidir_resid = -1;
|
2002-12-08 02:32:36 +00:00
|
|
|
static int hf_fcp_snslen = -1;
|
|
|
|
static int hf_fcp_rsplen = -1;
|
|
|
|
static int hf_fcp_rspcode = -1;
|
|
|
|
static int hf_fcp_scsistatus = -1;
|
|
|
|
static int hf_fcp_type = -1;
|
2005-09-24 22:43:15 +00:00
|
|
|
static int hf_fcp_mgmt_flags_obsolete = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_clear_aca = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_target_reset = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_lu_reset = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_rsvd = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_clear_task_set = -1;
|
|
|
|
static int hf_fcp_mgmt_flags_abort_task_set = -1;
|
2006-04-04 22:21:48 +00:00
|
|
|
static int hf_fcp_rsp_flags_bidi = -1;
|
|
|
|
static int hf_fcp_rsp_flags_bidi_rru = -1;
|
|
|
|
static int hf_fcp_rsp_flags_bidi_rro = -1;
|
2005-09-24 23:25:38 +00:00
|
|
|
static int hf_fcp_rsp_flags_conf_req = -1;
|
|
|
|
static int hf_fcp_rsp_flags_resid_under = -1;
|
|
|
|
static int hf_fcp_rsp_flags_resid_over = -1;
|
|
|
|
static int hf_fcp_rsp_flags_sns_vld = -1;
|
|
|
|
static int hf_fcp_rsp_flags_res_vld = -1;
|
2006-04-06 02:46:41 +00:00
|
|
|
static int hf_fcp_request_in = -1;
|
|
|
|
static int hf_fcp_response_in = -1;
|
|
|
|
static int hf_fcp_time = -1;
|
2009-10-17 10:19:18 +00:00
|
|
|
static int hf_fcp_srr_op = -1;
|
|
|
|
static int hf_fcp_srr_ox_id = -1;
|
|
|
|
static int hf_fcp_srr_rx_id = -1;
|
|
|
|
static int hf_fcp_srr_r_ctl = -1;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_fcp = -1;
|
2005-09-24 22:43:15 +00:00
|
|
|
static gint ett_fcp_taskmgmt = -1;
|
2005-09-24 23:25:38 +00:00
|
|
|
static gint ett_fcp_rsp_flags = -1;
|
2005-09-24 22:43:15 +00:00
|
|
|
|
2006-04-21 11:08:24 +00:00
|
|
|
typedef struct _fcp_conv_data_t {
|
2006-08-14 08:29:29 +00:00
|
|
|
emem_tree_t *luns;
|
2006-04-21 11:08:24 +00:00
|
|
|
} fcp_conv_data_t;
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
static dissector_table_t fcp_dissector;
|
|
|
|
static dissector_handle_t data_handle;
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* Information Categories based on lower 4 bits of R_CTL */
|
|
|
|
#define FCP_IU_DATA 0x1
|
2009-10-17 10:19:18 +00:00
|
|
|
#define FCP_IU_UNSOL_CTL 0x2
|
|
|
|
#define FCP_IU_SOL_CTL 0x3
|
2006-04-04 22:21:48 +00:00
|
|
|
#define FCP_IU_CONFIRM 0x3
|
|
|
|
#define FCP_IU_XFER_RDY 0x5
|
|
|
|
#define FCP_IU_CMD 0x6
|
|
|
|
#define FCP_IU_RSP 0x7
|
|
|
|
|
|
|
|
static const value_string fcp_iu_val[] = {
|
|
|
|
{FCP_IU_DATA , "FCP_DATA"},
|
2009-10-17 10:19:18 +00:00
|
|
|
{FCP_IU_UNSOL_CTL , "Control"},
|
2006-04-04 22:21:48 +00:00
|
|
|
{FCP_IU_CONFIRM , "Confirm"},
|
|
|
|
{FCP_IU_XFER_RDY , "XFER_RDY"},
|
|
|
|
{FCP_IU_CMD , "FCP_CMND"},
|
|
|
|
{FCP_IU_RSP , "FCP_RSP"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Task Attribute Values */
|
|
|
|
static const value_string fcp_task_attr_val[] = {
|
|
|
|
{0, "Simple"},
|
|
|
|
{1, "Head of Queue"},
|
|
|
|
{2, "Ordered"},
|
|
|
|
{4, "ACA"},
|
|
|
|
{5, "Untagged"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* RSP Code Definitions (from FCP_RSP_INFO) */
|
|
|
|
static const value_string fcp_rsp_code_val[] = {
|
|
|
|
{0, "Task Management Function Complete"},
|
|
|
|
{1, "FCP_DATA length Different from FCP_BURST_LEN"},
|
|
|
|
{2, "FCP_CMND Fields Invalid"},
|
|
|
|
{3, "FCP_DATA Parameter Mismatch With FCP_DATA_RO"},
|
|
|
|
{4, "Task Management Function Rejected"},
|
|
|
|
{5, "Task Management Function Failed"},
|
|
|
|
{9, "Task Management Function Incorrect LUN"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2005-09-24 22:43:15 +00:00
|
|
|
static const true_false_string fcp_mgmt_flags_obsolete_tfs = {
|
|
|
|
"OBSOLETE BIT is SET",
|
|
|
|
"OBSOLETE BIT is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_clear_aca_tfs = {
|
|
|
|
"CLEAR ACA is SET",
|
|
|
|
"Clear aca is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_target_reset_tfs = {
|
|
|
|
"TARGET RESET is SET",
|
|
|
|
"Target reset is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_lu_reset_tfs = {
|
|
|
|
"LU RESET is SET",
|
|
|
|
"Lu reset is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_rsvd_tfs = {
|
|
|
|
"RSVD is SET",
|
|
|
|
"Rsvd is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_clear_task_set_tfs = {
|
|
|
|
"CLEAR TASK SET is SET",
|
|
|
|
"Clear task set is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_mgmt_flags_abort_task_set_tfs = {
|
|
|
|
"ABORT TASK SET is SET",
|
|
|
|
"Abort task set is NOT set",
|
|
|
|
};
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2005-09-24 22:43:15 +00:00
|
|
|
static void
|
2006-02-23 22:03:55 +00:00
|
|
|
dissect_task_mgmt_flags (packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset)
|
2005-09-24 22:43:15 +00:00
|
|
|
{
|
|
|
|
proto_item *item = NULL;
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
|
|
|
|
guint8 flags;
|
|
|
|
|
|
|
|
if(parent_tree) {
|
|
|
|
item = proto_tree_add_item(parent_tree, hf_fcp_taskmgmt, tvb, offset, 1, TRUE);
|
|
|
|
tree = proto_item_add_subtree(item, ett_fcp_taskmgmt);
|
|
|
|
}
|
|
|
|
|
|
|
|
flags = tvb_get_guint8 (tvb, offset);
|
|
|
|
|
|
|
|
if (!flags)
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_item_append_text(item, " (No values set)");
|
2006-10-25 16:39:19 +00:00
|
|
|
|
2005-09-24 22:43:15 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_obsolete, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x80){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " OBSOLETE");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP OBSOLETE] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x80 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_clear_aca, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x40){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " CLEAR ACA");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP CLEAR_ACA] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x40 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_target_reset, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x20){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " TARGET RESET");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP TARGET_RESET] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x20 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_lu_reset, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x10){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " LU RESET");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP LU_RESET] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x10 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_rsvd, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x08){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " RSVD");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP RSVD] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x08 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_clear_task_set, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x04){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " CLEAR TASK SET");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP CLEAR_TASK_SET] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x04 ));
|
|
|
|
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_mgmt_flags_abort_task_set, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x02){
|
2006-02-23 22:03:55 +00:00
|
|
|
proto_item_append_text(item, " ABORT TASK SET");
|
2010-01-13 20:32:01 +00:00
|
|
|
col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "[FCP ABORT_TASK_SET] ");
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
|
|
|
flags&=(~( 0x02 ));
|
|
|
|
|
|
|
|
if(flags){
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_item_append_text(item, " Unknown bitmap value 0x%x", flags);
|
2005-09-24 22:43:15 +00:00
|
|
|
}
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
static const true_false_string fcp_rsp_flags_bidi_tfs = {
|
|
|
|
"Bidirectional residual fields are PRESENT",
|
|
|
|
"Bidirectional residual fields are NOT present",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_bidi_rru_tfs = {
|
|
|
|
"Bidirectional residual underflow is PRESENT",
|
|
|
|
"Bidirectional residual underflow is NOT present",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_bidi_rro_tfs = {
|
|
|
|
"Bidirectional residual overflow is PRESENT",
|
|
|
|
"Bidirectional residual overflow is NOT present",
|
|
|
|
};
|
2005-09-24 23:25:38 +00:00
|
|
|
static const true_false_string fcp_rsp_flags_conf_req_tfs = {
|
|
|
|
"CONF REQ is SET",
|
|
|
|
"Conf req set is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_resid_under_tfs = {
|
|
|
|
"RESID UNDER is SET",
|
|
|
|
"Resid under is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_resid_over_tfs = {
|
|
|
|
"RESID OVER is SET",
|
|
|
|
"Resid over is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_sns_vld_tfs = {
|
|
|
|
"SNS VLD is SET",
|
|
|
|
"Sns vld is NOT set",
|
|
|
|
};
|
|
|
|
static const true_false_string fcp_rsp_flags_res_vld_tfs = {
|
|
|
|
"RES VLD is SET",
|
|
|
|
"Res vld is NOT set",
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_rsp_flags(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_item *item = NULL;
|
|
|
|
proto_tree *tree = NULL;
|
2006-04-04 22:21:48 +00:00
|
|
|
gboolean bidi_resid_present=FALSE;
|
2005-09-24 23:25:38 +00:00
|
|
|
guint8 flags;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2005-09-24 23:25:38 +00:00
|
|
|
if(parent_tree) {
|
|
|
|
item = proto_tree_add_item(parent_tree, hf_fcp_rspflags, tvb, offset, 1, TRUE);
|
|
|
|
tree = proto_item_add_subtree(item, ett_fcp_rsp_flags);
|
|
|
|
}
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2005-09-24 23:25:38 +00:00
|
|
|
flags = tvb_get_guint8 (tvb, offset);
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2005-09-24 23:25:38 +00:00
|
|
|
if (!flags)
|
|
|
|
proto_item_append_text(item, " (No values set)");
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* BIDI RSP */
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_bidi, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x80){
|
|
|
|
bidi_resid_present=TRUE;
|
|
|
|
proto_item_append_text(item, " BIDI_RSP");
|
|
|
|
if (flags & (~( 0x80 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x80 ));
|
|
|
|
|
|
|
|
/* these two bits are only defined if the bidi bit is set */
|
|
|
|
if(bidi_resid_present){
|
|
|
|
/* BIDI READ RESID UNDER */
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_bidi_rru, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x40){
|
|
|
|
proto_item_append_text(item, " BIDI_RRU");
|
|
|
|
if (flags & (~( 0x40 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x40 ));
|
|
|
|
|
|
|
|
/* BIDI READ RESID OVER */
|
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_bidi_rro, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x20){
|
|
|
|
proto_item_append_text(item, " BIDI_RRO");
|
|
|
|
if (flags & (~( 0x20 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x20 ));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Conf Req */
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_conf_req, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x10){
|
|
|
|
proto_item_append_text(item, " CONF REQ");
|
|
|
|
if (flags & (~( 0x10 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x10 ));
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* Resid Under */
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_resid_under, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x08){
|
|
|
|
proto_item_append_text(item, " RESID UNDER");
|
|
|
|
if (flags & (~( 0x08 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x08 ));
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* Resid Over */
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_resid_over, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x04){
|
|
|
|
proto_item_append_text(item, " RESID OVER");
|
|
|
|
if (flags & (~( 0x04 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x04 ));
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* SNS len valid */
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_sns_vld, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x02){
|
|
|
|
proto_item_append_text(item, " SNS VLD");
|
|
|
|
if (flags & (~( 0x02 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x02 ));
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* rsp len valid */
|
2005-09-24 23:25:38 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_fcp_rsp_flags_res_vld, tvb, offset, 1, flags);
|
|
|
|
if (flags&0x01){
|
|
|
|
proto_item_append_text(item, " RES VLD");
|
|
|
|
if (flags & (~( 0x01 )))
|
|
|
|
proto_item_append_text(item, ",");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x01 ));
|
|
|
|
|
|
|
|
if(flags){
|
|
|
|
proto_item_append_text(item, " Unknown bitmap value 0x%x", flags);
|
|
|
|
}
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-21 11:08:24 +00:00
|
|
|
dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *tree, conversation_t *conversation, fc_hdr *fchdr, fcp_conv_data_t *fcp_conv_data)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
|
|
|
int offset = 0;
|
|
|
|
int len,
|
|
|
|
add_len = 0;
|
2006-10-11 11:32:56 +00:00
|
|
|
guint8 flags, rwflags, lun0;
|
2008-05-15 01:44:53 +00:00
|
|
|
guint16 lun=0xffff;
|
2005-05-29 02:55:12 +00:00
|
|
|
tvbuff_t *cdb_tvb;
|
|
|
|
int tvb_len, tvb_rlen;
|
2006-04-21 11:08:24 +00:00
|
|
|
itl_nexus_t *itl=NULL;
|
2008-05-15 01:44:53 +00:00
|
|
|
proto_item *hidden_item;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
/* Determine the length of the FCP part of the packet */
|
|
|
|
flags = tvb_get_guint8 (tvb, offset+10);
|
|
|
|
if (flags) {
|
|
|
|
add_len = tvb_get_guint8 (tvb, offset+11) & 0x7C;
|
|
|
|
add_len = add_len >> 2;
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
len = FCP_DEF_CMND_LEN + add_len;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
len = FCP_DEF_CMND_LEN;
|
|
|
|
}
|
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_uint(tree, hf_fcp_type, tvb, offset, 0, 0);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2005-02-17 12:07:45 +00:00
|
|
|
lun0 = tvb_get_guint8 (tvb, offset);
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2005-02-17 12:07:45 +00:00
|
|
|
/* Display single-level LUNs in decimal for clarity */
|
|
|
|
/* I'm taking a shortcut here by assuming that if the first byte of the
|
|
|
|
* LUN field is 0, it is a single-level LUN. This is not true. For a
|
|
|
|
* real single-level LUN, all 8 bytes except byte 1 must be 0.
|
|
|
|
*/
|
|
|
|
if (lun0) {
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_multilun, tvb, offset, 8, 0);
|
2005-02-17 12:07:45 +00:00
|
|
|
lun=tvb_get_guint8(tvb, offset)&0x3f;
|
|
|
|
lun<<=8;
|
|
|
|
lun|=tvb_get_guint8(tvb, offset+1);
|
2006-04-21 11:08:24 +00:00
|
|
|
} else {
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_singlelun, tvb, offset+1,
|
2005-02-17 12:07:45 +00:00
|
|
|
1, 0);
|
|
|
|
lun=tvb_get_guint8(tvb, offset+1);
|
|
|
|
}
|
2006-10-25 16:39:19 +00:00
|
|
|
|
|
|
|
if (fchdr->itlq)
|
|
|
|
fchdr->itlq->lun=lun;
|
2006-04-21 11:08:24 +00:00
|
|
|
|
|
|
|
itl=(itl_nexus_t *)se_tree_lookup32(fcp_conv_data->luns, lun);
|
|
|
|
if(!itl){
|
|
|
|
itl=se_alloc(sizeof(itl_nexus_t));
|
|
|
|
itl->cmdset=0xff;
|
2006-10-12 10:54:36 +00:00
|
|
|
itl->conversation=conversation;
|
2006-04-21 11:08:24 +00:00
|
|
|
se_tree_insert32(fcp_conv_data->luns, lun, itl);
|
|
|
|
}
|
2005-02-17 12:07:45 +00:00
|
|
|
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_crn, tvb, offset+8, 1, 0);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_taskattr, tvb, offset+9, 1, 0);
|
|
|
|
dissect_task_mgmt_flags(pinfo, tree, tvb, offset+10);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_addlcdblen, tvb, offset+11, 1, 0);
|
2006-10-11 11:32:56 +00:00
|
|
|
rwflags=tvb_get_guint8(tvb, offset+11);
|
|
|
|
if(fchdr->itlq){
|
|
|
|
if(rwflags&0x02){
|
|
|
|
fchdr->itlq->task_flags|=SCSI_DATA_READ;
|
|
|
|
}
|
|
|
|
if(rwflags&0x01){
|
|
|
|
fchdr->itlq->task_flags|=SCSI_DATA_WRITE;
|
|
|
|
}
|
|
|
|
}
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_rddata, tvb, offset+11, 1, 0);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_wrdata, tvb, offset+11, 1, 0);
|
2005-05-29 02:55:12 +00:00
|
|
|
|
|
|
|
tvb_len=tvb_length_remaining(tvb, offset+12);
|
|
|
|
if(tvb_len>(16+add_len))
|
|
|
|
tvb_len=16+add_len;
|
|
|
|
tvb_rlen=tvb_reported_length_remaining(tvb, offset+12);
|
|
|
|
if(tvb_rlen>(16+add_len))
|
|
|
|
tvb_rlen=16+add_len;
|
|
|
|
cdb_tvb=tvb_new_subset(tvb, offset+12, tvb_len, tvb_rlen);
|
2006-04-21 22:00:38 +00:00
|
|
|
dissect_scsi_cdb(cdb_tvb, pinfo, parent_tree, SCSI_DEV_UNKNOWN, fchdr->itlq, itl);
|
2005-05-29 02:55:12 +00:00
|
|
|
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_dl, tvb, offset+12+16+add_len,
|
2005-02-17 12:07:45 +00:00
|
|
|
4, 0);
|
2006-10-11 11:32:56 +00:00
|
|
|
if(fchdr->itlq){
|
|
|
|
fchdr->itlq->data_length=tvb_get_ntohl(tvb, offset+12+16+add_len);
|
|
|
|
}
|
|
|
|
|
|
|
|
if( ((rwflags&0x03)==0x03)
|
|
|
|
&& tvb_length_remaining(tvb, offset+12+16+add_len+4)>=4){
|
|
|
|
proto_tree_add_item(tree, hf_fcp_bidir_dl, tvb, offset+12+16+add_len+4,
|
|
|
|
4, 0);
|
|
|
|
if(fchdr->itlq){
|
|
|
|
fchdr->itlq->bidir_data_length=tvb_get_ntohl(tvb, offset+12+16+add_len+4);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2006-10-25 16:39:19 +00:00
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-02-19 22:29:23 +00:00
|
|
|
dissect_fcp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, conversation_t *conversation _U_, fc_hdr *fchdr, itl_nexus_t *itl)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
2006-10-13 09:16:45 +00:00
|
|
|
dissect_scsi_payload(tvb, pinfo, parent_tree, FALSE, fchdr->itlq, itl, fchdr->relative_offset);
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
2006-04-04 22:21:48 +00:00
|
|
|
/* fcp-3 9.5 table 24 */
|
|
|
|
static void
|
|
|
|
dissect_fcp_rspinfo(tvbuff_t *tvb, proto_tree *tree, int offset)
|
|
|
|
{
|
2008-06-10 05:41:29 +00:00
|
|
|
/* 3 reserved bytes */
|
|
|
|
offset+=3;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* rsp code */
|
|
|
|
proto_tree_add_item(tree, hf_fcp_rspcode, tvb, offset, 1, 0);
|
|
|
|
offset++;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* 4 reserved bytes */
|
|
|
|
offset+=4;
|
2006-04-04 22:21:48 +00:00
|
|
|
}
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
static void
|
2007-02-19 22:29:23 +00:00
|
|
|
dissect_fcp_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *tree, conversation_t *conversation _U_, fc_hdr *fchdr, itl_nexus_t *itl)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
2006-04-05 08:58:16 +00:00
|
|
|
guint32 offset = 0;
|
2006-04-04 22:21:48 +00:00
|
|
|
gint32 snslen = 0,
|
2005-03-26 03:56:54 +00:00
|
|
|
rsplen = 0;
|
2002-12-08 02:32:36 +00:00
|
|
|
guint8 flags;
|
|
|
|
guint8 status;
|
2008-05-15 01:44:53 +00:00
|
|
|
proto_item *hidden_item;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
status = tvb_get_guint8 (tvb, offset+11);
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
2006-04-04 22:21:48 +00:00
|
|
|
col_append_fstr (pinfo->cinfo, COL_INFO, ":%s",
|
2002-12-08 02:32:36 +00:00
|
|
|
val_to_str (status, scsi_status_val, "0x%x"));
|
|
|
|
}
|
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_uint(tree, hf_fcp_type, tvb, offset, 0, 0);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* 8 reserved bytes */
|
|
|
|
offset+=8;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* retry delay timer */
|
|
|
|
proto_tree_add_item(tree, hf_fcp_retry_delay_timer, tvb, offset, 2, 0);
|
|
|
|
offset+=2;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_guint8 (tvb, offset);
|
|
|
|
dissect_rsp_flags(tree, tvb, offset);
|
|
|
|
offset++;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* scsi status code */
|
|
|
|
proto_tree_add_item(tree, hf_fcp_scsistatus, tvb, offset, 1, 0);
|
|
|
|
dissect_scsi_rsp(tvb, pinfo, parent_tree, fchdr->itlq, itl, tvb_get_guint8(tvb, offset));
|
|
|
|
offset++;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* residual count */
|
|
|
|
if(flags & 0x0e){
|
|
|
|
proto_tree_add_item(tree, hf_fcp_resid, tvb, offset, 4, 0);
|
|
|
|
}
|
|
|
|
offset+=4;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* sense length */
|
|
|
|
if (flags & 0x2) {
|
|
|
|
snslen=tvb_get_ntohl(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_fcp_snslen, tvb, offset, 4,
|
|
|
|
snslen);
|
|
|
|
}
|
|
|
|
offset+=4;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* response length */
|
|
|
|
if (flags & 0x1) {
|
|
|
|
rsplen=tvb_get_ntohl(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_fcp_rsplen, tvb, offset, 4,
|
|
|
|
rsplen);
|
|
|
|
}
|
|
|
|
offset+=4;
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* rsp_info */
|
|
|
|
if(rsplen){
|
|
|
|
tvbuff_t *rspinfo_tvb;
|
2006-10-25 16:39:19 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
rspinfo_tvb=tvb_new_subset(tvb, offset, MIN(rsplen, tvb_length_remaining(tvb, offset)), rsplen);
|
2008-06-10 05:41:29 +00:00
|
|
|
dissect_fcp_rspinfo(rspinfo_tvb, tree, 0);
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
offset+=rsplen;
|
|
|
|
}
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* sense info */
|
|
|
|
if(snslen){
|
|
|
|
tvbuff_t *sns_tvb;
|
2006-10-25 16:39:19 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
sns_tvb=tvb_new_subset(tvb, offset, MIN(snslen, tvb_length_remaining(tvb, offset)), snslen);
|
|
|
|
dissect_scsi_snsinfo (sns_tvb, pinfo, parent_tree, 0,
|
|
|
|
snslen,
|
|
|
|
fchdr->itlq, itl);
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
offset+=snslen;
|
|
|
|
}
|
2006-04-04 22:21:48 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
/* bidir read resid (only present for bidirectional responses) */
|
|
|
|
if(flags&0x80){
|
|
|
|
if(flags&0x60){
|
|
|
|
proto_tree_add_item(tree, hf_fcp_bidir_resid, tvb, offset, 4, 0);
|
2006-04-05 01:17:32 +00:00
|
|
|
}
|
2008-05-15 01:44:53 +00:00
|
|
|
offset+=4;
|
|
|
|
}
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-06 03:15:16 +00:00
|
|
|
dissect_fcp_xfer_rdy(tvbuff_t *tvb, proto_tree *tree)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
|
|
|
int offset = 0;
|
2008-05-15 01:44:53 +00:00
|
|
|
proto_item *hidden_item;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_uint(tree, hf_fcp_type, tvb, offset, 0, 0);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2006-04-05 08:58:16 +00:00
|
|
|
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree_add_item(tree, hf_fcp_data_ro, tvb, offset, 4, 0);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_burstlen, tvb, offset+4, 4, 0);
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
2009-10-17 10:19:18 +00:00
|
|
|
static void
|
|
|
|
dissect_fcp_srr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint8 r_ctl;
|
|
|
|
|
|
|
|
r_ctl = pinfo->r_ctl & 0xf;
|
|
|
|
if (r_ctl == FCP_IU_UNSOL_CTL) { /* request */
|
|
|
|
proto_tree_add_item(tree, hf_fcp_srr_ox_id, tvb, 4, 2, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_srr_rx_id, tvb, 6, 2, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_fcp_data_ro, tvb, 8, 4, FALSE);
|
|
|
|
r_ctl = tvb_get_guint8(tvb, 12);
|
|
|
|
proto_tree_add_text(tree, tvb, 12, 1, "R_CTL: %s",
|
|
|
|
val_to_str(r_ctl, fcp_iu_val, "0x%02x"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static const value_string fcp_els_iu_val[] = {
|
|
|
|
{FCP_IU_UNSOL_CTL , "FCP ELS Request"},
|
|
|
|
{FCP_IU_SOL_CTL , "FCP ELS Response"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dissect FC-4 ELS for FCP.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_fcp_els(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint8 op;
|
|
|
|
|
|
|
|
op = tvb_get_guint8(tvb, 0);
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(op, fc_els_proto_val, "0x%x"));
|
|
|
|
proto_tree_add_text(tree, tvb, 0, 1, "Opcode: %s",
|
|
|
|
val_to_str(op, fc_els_proto_val,
|
|
|
|
"ELS 0x%02x"));
|
|
|
|
|
|
|
|
switch (op) { /* XXX should switch based on conv for LS_ACC */
|
|
|
|
case FC_ELS_SRR:
|
|
|
|
dissect_fcp_srr(tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
call_dissector(data_handle, tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
static void
|
2006-04-05 09:51:14 +00:00
|
|
|
dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2002-12-08 02:32:36 +00:00
|
|
|
{
|
2006-04-06 02:46:41 +00:00
|
|
|
proto_item *ti=NULL;
|
2006-04-05 09:51:14 +00:00
|
|
|
proto_tree *fcp_tree = NULL;
|
2006-04-06 02:46:41 +00:00
|
|
|
fc_hdr *fchdr;
|
2002-12-08 02:32:36 +00:00
|
|
|
guint8 r_ctl;
|
2006-04-21 11:08:24 +00:00
|
|
|
fcp_conv_data_t *fcp_conv_data=NULL;
|
|
|
|
itl_nexus_t *itl=NULL;
|
2009-10-17 10:19:18 +00:00
|
|
|
gboolean els;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2006-04-06 02:46:41 +00:00
|
|
|
fchdr=(fc_hdr *)pinfo->private_data;
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
/* Make entries in Protocol column and Info column on summary display */
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCP");
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
r_ctl = pinfo->r_ctl;
|
2009-10-17 10:19:18 +00:00
|
|
|
els = (r_ctl & 0xf0) == FC_RCTL_LINK_DATA;
|
2002-12-08 02:32:36 +00:00
|
|
|
r_ctl &= 0xF;
|
|
|
|
|
|
|
|
if (check_col (pinfo->cinfo, COL_INFO)) {
|
2009-10-17 10:19:18 +00:00
|
|
|
col_add_str (pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str (r_ctl, els ? fcp_els_iu_val : fcp_iu_val,
|
|
|
|
"0x%x"));
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
2005-07-25 23:11:32 +00:00
|
|
|
|
2006-04-05 09:51:14 +00:00
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_fcp, tvb, 0, -1,
|
2009-10-17 10:19:18 +00:00
|
|
|
"FCP: %s",
|
|
|
|
val_to_str(r_ctl,
|
|
|
|
els ? fcp_els_iu_val :
|
|
|
|
fcp_iu_val, "Unknown 0x%02x"));
|
2006-04-05 09:51:14 +00:00
|
|
|
fcp_tree = proto_item_add_subtree(ti, ett_fcp);
|
|
|
|
}
|
|
|
|
|
2006-04-06 01:16:23 +00:00
|
|
|
|
2006-04-21 11:08:24 +00:00
|
|
|
fcp_conv_data=conversation_get_proto_data(fchdr->conversation, proto_fcp);
|
|
|
|
if(!fcp_conv_data){
|
|
|
|
fcp_conv_data=se_alloc(sizeof(fcp_conv_data_t));
|
2006-08-14 08:29:29 +00:00
|
|
|
fcp_conv_data->luns=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "FCP Luns");
|
2006-04-21 11:08:24 +00:00
|
|
|
conversation_add_proto_data(fchdr->conversation, proto_fcp, fcp_conv_data);
|
|
|
|
}
|
|
|
|
|
2009-10-17 10:19:18 +00:00
|
|
|
if((r_ctl!=FCP_IU_CMD) && (r_ctl!=FCP_IU_UNSOL_CTL)){
|
2006-04-21 11:08:24 +00:00
|
|
|
itl=(itl_nexus_t *)se_tree_lookup32(fcp_conv_data->luns, fchdr->itlq->lun);
|
2006-04-06 01:16:23 +00:00
|
|
|
}
|
|
|
|
|
2006-04-06 02:46:41 +00:00
|
|
|
/* put a request_in in all frames except the command frame */
|
2009-10-17 10:19:18 +00:00
|
|
|
if((r_ctl!=FCP_IU_CMD) && (r_ctl!=FCP_IU_UNSOL_CTL) &&
|
|
|
|
(fchdr->itlq->first_exchange_frame)){
|
2006-04-06 02:46:41 +00:00
|
|
|
proto_item *it;
|
2006-04-20 09:43:56 +00:00
|
|
|
it=proto_tree_add_uint(fcp_tree, hf_fcp_singlelun, tvb, 0, 0, fchdr->itlq->lun);
|
2006-04-06 03:15:16 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
2006-04-20 09:43:56 +00:00
|
|
|
it=proto_tree_add_uint(fcp_tree, hf_fcp_request_in, tvb, 0, 0, fchdr->itlq->first_exchange_frame);
|
2006-04-06 02:46:41 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
|
|
|
/* only put the response time in the actual response frame */
|
|
|
|
if(r_ctl==FCP_IU_RSP){
|
|
|
|
nstime_t delta_ts;
|
2006-04-20 09:43:56 +00:00
|
|
|
nstime_delta(&delta_ts, &pinfo->fd->abs_ts, &fchdr->itlq->fc_time);
|
2006-04-06 02:46:41 +00:00
|
|
|
it=proto_tree_add_time(ti, hf_fcp_time, tvb, 0, 0, &delta_ts);
|
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* put a response_in in all frames except the response frame */
|
2009-10-17 10:19:18 +00:00
|
|
|
if((r_ctl!=FCP_IU_RSP) && (r_ctl!=FCP_IU_SOL_CTL) &&
|
|
|
|
(fchdr->itlq->last_exchange_frame)){
|
2006-04-06 02:46:41 +00:00
|
|
|
proto_item *it;
|
2006-04-20 09:43:56 +00:00
|
|
|
it=proto_tree_add_uint(fcp_tree, hf_fcp_response_in, tvb, 0, 0, fchdr->itlq->last_exchange_frame);
|
2006-04-06 02:46:41 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
|
|
|
}
|
2006-04-06 01:16:23 +00:00
|
|
|
|
2009-10-17 10:19:18 +00:00
|
|
|
if (els) {
|
|
|
|
dissect_fcp_els(tvb, pinfo, fcp_tree);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
switch (r_ctl) {
|
|
|
|
case FCP_IU_DATA:
|
2006-04-21 11:08:24 +00:00
|
|
|
dissect_fcp_data(tvb, pinfo, tree, fchdr->conversation, fchdr, itl);
|
2002-12-08 02:32:36 +00:00
|
|
|
break;
|
|
|
|
case FCP_IU_CONFIRM:
|
|
|
|
/* Nothing to be done here */
|
|
|
|
break;
|
|
|
|
case FCP_IU_XFER_RDY:
|
2006-04-06 03:15:16 +00:00
|
|
|
dissect_fcp_xfer_rdy(tvb, fcp_tree);
|
2002-12-08 02:32:36 +00:00
|
|
|
break;
|
|
|
|
case FCP_IU_CMD:
|
2006-04-21 11:08:24 +00:00
|
|
|
dissect_fcp_cmnd(tvb, pinfo, tree, fcp_tree, fchdr->conversation, fchdr, fcp_conv_data);
|
2002-12-08 02:32:36 +00:00
|
|
|
break;
|
|
|
|
case FCP_IU_RSP:
|
2006-04-21 11:08:24 +00:00
|
|
|
dissect_fcp_rsp(tvb, pinfo, tree, fcp_tree, fchdr->conversation, fchdr, itl);
|
2002-12-08 02:32:36 +00:00
|
|
|
break;
|
|
|
|
default:
|
2006-04-05 09:51:14 +00:00
|
|
|
call_dissector(data_handle, tvb, pinfo, tree);
|
2002-12-08 02:32:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-04-05 09:51:14 +00:00
|
|
|
/*xxx once the subdissectors return bytes consumed: proto_item_set_end(ti, tvb, offset);*/
|
|
|
|
|
2002-12-08 02:32:36 +00:00
|
|
|
}
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
/* this format is require because a script is used to build the C function
|
|
|
|
that calls all the protocol registration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_fcp (void)
|
2005-07-25 23:11:32 +00:00
|
|
|
{
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
/* Setup list of header fields See Section 1.6.1 for details*/
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_fcp_type,
|
|
|
|
{"Field to branch off to SCSI", "fcp.type", FT_UINT8, BASE_HEX, NULL,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
0x0, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{&hf_fcp_multilun,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Multi-Level LUN", "fcp.multilun", FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_singlelun,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"LUN", "fcp.lun", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_crn,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Command Ref Num", "fcp.crn", FT_UINT8, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_taskattr,
|
|
|
|
{"Task Attribute", "fcp.taskattr", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS (fcp_task_attr_val), 0x7, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_taskmgmt,
|
|
|
|
{"Task Management Flags", "fcp.taskmgmt", FT_UINT8, BASE_HEX, NULL,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
0x0, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_addlcdblen,
|
|
|
|
{"Additional CDB Length", "fcp.addlcdblen", FT_UINT8, BASE_DEC, NULL,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
0xFC, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_rddata,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"RDDATA", "fcp.rddata", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_wrdata,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"WRDATA", "fcp.wrdata", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_dl,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_DL", "fcp.dl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
|
2006-10-11 11:32:56 +00:00
|
|
|
{ &hf_fcp_bidir_dl,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_BIDIRECTIONAL_READ_DL", "fcp.bidir_dl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_data_ro,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_DATA_RO", "fcp.data_ro", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_burstlen,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Burst Length", "fcp.burstlen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
2006-04-04 22:21:48 +00:00
|
|
|
{ &hf_fcp_retry_delay_timer,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Retry Delay Timer", "fcp.rsp.retry_delay_timer", FT_UINT16, BASE_DEC, NULL, 0x0, NULL,
|
2006-04-04 22:21:48 +00:00
|
|
|
HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_rspflags,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_RSP Flags", "fcp.rspflags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_resid,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_RESID", "fcp.resid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
2006-04-05 01:17:32 +00:00
|
|
|
{ &hf_fcp_bidir_resid,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Bidirectional Read Resid", "fcp.bidir_resid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2006-04-05 01:17:32 +00:00
|
|
|
HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_snslen,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_SNS_LEN", "fcp.snslen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_rsplen,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"FCP_RSP_LEN", "fcp.rsplen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
|
2002-12-08 02:32:36 +00:00
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_rspcode,
|
|
|
|
{"RSP_CODE", "fcp.rspcode", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS (fcp_rsp_code_val), 0x0, NULL, HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
{ &hf_fcp_scsistatus,
|
|
|
|
{"SCSI Status", "fcp.status", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS (scsi_status_val), 0x0, NULL, HFILL}},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_obsolete,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Obsolete", "fcp.mgmt.flags.obsolete", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_obsolete_tfs), 0x80, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_clear_aca,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Clear ACA", "fcp.mgmt.flags.clear_aca", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_clear_aca_tfs), 0x40, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_target_reset,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Target Reset", "fcp.mgmt.flags.target_reset", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_target_reset_tfs), 0x20, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_lu_reset,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "LU Reset", "fcp.mgmt.flags.lu_reset", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_lu_reset_tfs), 0x10, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_rsvd,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Rsvd", "fcp.mgmt.flags.rsvd", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_rsvd_tfs), 0x08, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_clear_task_set,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Clear Task Set", "fcp.mgmt.flags.clear_task_set", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_clear_task_set_tfs), 0x04, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_mgmt_flags_abort_task_set,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Abort Task Set", "fcp.mgmt.flags.abort_task_set", FT_BOOLEAN, 8, TFS(&fcp_mgmt_flags_abort_task_set_tfs), 0x02, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_bidi,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Bidi Rsp", "fcp.rsp.flags.bidi", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_bidi_tfs), 0x80, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_bidi_rru,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Bidi Read Resid Under", "fcp.rsp.flags.bidi_rru", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_bidi_rru_tfs), 0x40, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_bidi_rro,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Bidi Read Resid Over", "fcp.rsp.flags.bidi_rro", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_bidi_rro_tfs), 0x20, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_conf_req,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Conf Req", "fcp.rsp.flags.conf_req", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_conf_req_tfs), 0x10, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_resid_under,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Resid Under", "fcp.rsp.flags.resid_under", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_resid_under_tfs), 0x08, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_resid_over,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Resid Over", "fcp.rsp.flags.resid_over", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_resid_over_tfs), 0x04, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_sns_vld,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "SNS Vld", "fcp.rsp.flags.sns_vld", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_sns_vld_tfs), 0x02, NULL, HFILL }},
|
2006-10-25 16:39:19 +00:00
|
|
|
{ &hf_fcp_rsp_flags_res_vld,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "RES Vld", "fcp.rsp.flags.res_vld", FT_BOOLEAN, 8, TFS(&fcp_rsp_flags_res_vld_tfs), 0x01, NULL, HFILL }},
|
2006-04-06 02:46:41 +00:00
|
|
|
{ &hf_fcp_request_in,
|
|
|
|
{ "Request In", "fcp.request_in", FT_FRAMENUM, BASE_NONE, NULL,
|
|
|
|
0, "The frame number for the request", HFILL }},
|
|
|
|
{ &hf_fcp_response_in,
|
|
|
|
{ "Response In", "fcp.response_in", FT_FRAMENUM, BASE_NONE, NULL,
|
|
|
|
0, "The frame number of the response", HFILL }},
|
|
|
|
{ &hf_fcp_time,
|
|
|
|
{ "Time from FCP_CMND", "fcp.time", FT_RELATIVE_TIME, BASE_NONE, NULL,
|
|
|
|
0, "Time since the FCP_CMND frame", HFILL }},
|
2009-10-17 10:19:18 +00:00
|
|
|
{ &hf_fcp_srr_op,
|
|
|
|
{"Opcode", "fcp.els.op", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
|
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_srr_ox_id,
|
|
|
|
{"OX_ID", "fcp.els.srr.ox_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL,
|
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_srr_rx_id,
|
|
|
|
{"RX_ID", "fcp.els.srr.rx_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL,
|
|
|
|
HFILL}},
|
|
|
|
{ &hf_fcp_srr_r_ctl,
|
|
|
|
{"R_CTL", "fcp.els.srr.r_ctl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
|
|
|
|
HFILL}},
|
2002-12-08 02:32:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_fcp,
|
2005-09-24 22:43:15 +00:00
|
|
|
&ett_fcp_taskmgmt,
|
2005-09-24 23:25:38 +00:00
|
|
|
&ett_fcp_rsp_flags,
|
2002-12-08 02:32:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_fcp = proto_register_protocol("Fibre Channel Protocol for SCSI",
|
|
|
|
"FCP", "fcp");
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
|
|
|
proto_register_field_array(proto_fcp, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
fcp_dissector = register_dissector_table ("fcp.type", "FCP Type", FT_UINT8,
|
|
|
|
BASE_HEX);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If this dissector uses sub-dissector registration add a registration routine.
|
|
|
|
This format is required because a script is used to find these routines and
|
|
|
|
create the code that calls these routines.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
proto_reg_handoff_fcp (void)
|
|
|
|
{
|
|
|
|
dissector_handle_t fcp_handle;
|
|
|
|
|
|
|
|
fcp_handle = create_dissector_handle (dissect_fcp, proto_fcp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("fc.ftype", FC_FTYPE_SCSI, fcp_handle);
|
2002-12-08 02:32:36 +00:00
|
|
|
|
|
|
|
data_handle = find_dissector ("data");
|
|
|
|
}
|