aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-09-29 10:40:51 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-09-29 10:40:51 +0000
commite2a851e18d29b6a10fe85a3206d399eff42917b7 (patch)
tree40e292fe3e84f52c7bb837064a01583658d52572
parentd09cfb2bb8cabfc195ef97e80dd17d1531d8a4ea (diff)
add initial scsi osd dissector but only dissect sdbs that are impoerted from SPC
various changes to the existing scsi dissector to start allowing different commandsets to be implemented in their own dissector files to prevent the scsi dissector to become as huge as the parlay dissector svn path=/trunk/; revision=19360
-rw-r--r--epan/dissectors/Makefile.common2
-rw-r--r--epan/dissectors/packet-scsi-osd.c381
-rw-r--r--epan/dissectors/packet-scsi-osd.h34
-rw-r--r--epan/dissectors/packet-scsi.c37
-rw-r--r--epan/dissectors/packet-scsi.h22
5 files changed, 457 insertions, 19 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index 0120c8416e..179b7e3456 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -582,6 +582,7 @@ DISSECTOR_SRC = \
packet-sccp.c \
packet-sccpmg.c \
packet-scsi.c \
+ packet-scsi-osd.c \
packet-sctp.c \
packet-sdlc.c \
packet-sdp.c \
@@ -924,6 +925,7 @@ DISSECTOR_INCLUDES = \
packet-s4406.h \
packet-sccp.h \
packet-scsi.h \
+ packet-scsi-osd.h \
packet-sctp.h \
packet-sdp.h \
packet-ses.h \
diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c
new file mode 100644
index 0000000000..385d2e251a
--- /dev/null
+++ b/epan/dissectors/packet-scsi-osd.c
@@ -0,0 +1,381 @@
+/* packet-scsi-osd.c
+ * Ronnie sahlberg 2006
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 2002 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.
+ *
+ * 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.
+ *
+ * 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 <glib.h>
+#include <string.h>
+#include <epan/strutil.h>
+#include <epan/packet.h>
+#include <epan/prefs.h>
+#include <epan/emem.h>
+#include <epan/conversation.h>
+#include <epan/tap.h>
+#include "packet-fc.h"
+#include "packet-scsi.h"
+#include "packet-scsi-osd.h"
+
+static int proto_scsi_osd = -1;
+int hf_scsi_osd_opcode = -1;
+static int hf_scsi_osd_control = -1;
+static int hf_scsi_osd_add_cdblen = -1;
+static int hf_scsi_osd_svcaction = -1;
+
+
+
+
+static void
+dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
+ guint offset, gboolean isreq, gboolean iscdb,
+ guint payload_len _U_, scsi_task_data_t *cdata _U_)
+{
+ guint16 svcaction;
+
+ if(!tree)
+ return;
+
+ /* dissecting the CDB */
+ if (isreq && iscdb) {
+ proto_tree_add_item (tree, hf_scsi_osd_control, tvb, offset, 1, 0);
+ proto_tree_add_item (tree, hf_scsi_osd_add_cdblen, tvb, offset+6, 1, 0);
+ svcaction=tvb_get_ntohs(tvb, offset+7);
+ proto_tree_add_item (tree, hf_scsi_osd_svcaction, tvb, offset+7, 2, 0);
+ }
+}
+
+
+/* OSD Commands */
+const value_string scsi_osd_vals[] = {
+ {SCSI_SPC2_INQUIRY , "Inquiry"},
+ {SCSI_SPC2_LOGSELECT , "Log Select"},
+ {SCSI_SPC2_LOGSENSE , "Log Sense"},
+ {SCSI_SPC2_MODESELECT10 , "Mode Select(10)"},
+ {SCSI_SPC2_MODESENSE10 , "Mode Sense(10)"},
+ {SCSI_SPC2_PERSRESVIN , "Persistent Reserve In"},
+ {SCSI_SPC2_PERSRESVOUT , "Persistent Reserve Out"},
+ {SCSI_SPC2_REPORTLUNS , "Report LUNs"},
+ {SCSI_OSD_OPCODE , "OSD Command" },
+ {0, NULL},
+};
+
+
+
+scsi_cdb_table_t scsi_osd_table[256] = {
+/*OSD 0x00*/{NULL},
+/*OSD 0x01*/{NULL},
+/*OSD 0x02*/{NULL},
+/*OSD 0x03*/{NULL},
+/*OSD 0x04*/{NULL},
+/*OSD 0x05*/{NULL},
+/*OSD 0x06*/{NULL},
+/*OSD 0x07*/{NULL},
+/*OSD 0x08*/{NULL},
+/*OSD 0x09*/{NULL},
+/*OSD 0x0a*/{NULL},
+/*OSD 0x0b*/{NULL},
+/*OSD 0x0c*/{NULL},
+/*OSD 0x0d*/{NULL},
+/*OSD 0x0e*/{NULL},
+/*OSD 0x0f*/{NULL},
+/*OSD 0x10*/{NULL},
+/*OSD 0x11*/{NULL},
+/*OSD 0x12*/{dissect_spc3_inquiry},
+/*OSD 0x13*/{NULL},
+/*OSD 0x14*/{NULL},
+/*OSD 0x15*/{NULL},
+/*OSD 0x16*/{NULL},
+/*OSD 0x17*/{NULL},
+/*OSD 0x18*/{NULL},
+/*OSD 0x19*/{NULL},
+/*OSD 0x1a*/{NULL},
+/*OSD 0x1b*/{NULL},
+/*OSD 0x1c*/{NULL},
+/*OSD 0x1d*/{NULL},
+/*OSD 0x1e*/{NULL},
+/*OSD 0x1f*/{NULL},
+/*OSD 0x20*/{NULL},
+/*OSD 0x21*/{NULL},
+/*OSD 0x22*/{NULL},
+/*OSD 0x23*/{NULL},
+/*OSD 0x24*/{NULL},
+/*OSD 0x25*/{NULL},
+/*OSD 0x26*/{NULL},
+/*OSD 0x27*/{NULL},
+/*OSD 0x28*/{NULL},
+/*OSD 0x29*/{NULL},
+/*OSD 0x2a*/{NULL},
+/*OSD 0x2b*/{NULL},
+/*OSD 0x2c*/{NULL},
+/*OSD 0x2d*/{NULL},
+/*OSD 0x2e*/{NULL},
+/*OSD 0x2f*/{NULL},
+/*OSD 0x30*/{NULL},
+/*OSD 0x31*/{NULL},
+/*OSD 0x32*/{NULL},
+/*OSD 0x33*/{NULL},
+/*OSD 0x34*/{NULL},
+/*OSD 0x35*/{NULL},
+/*OSD 0x36*/{NULL},
+/*OSD 0x37*/{NULL},
+/*OSD 0x38*/{NULL},
+/*OSD 0x39*/{NULL},
+/*OSD 0x3a*/{NULL},
+/*OSD 0x3b*/{NULL},
+/*OSD 0x3c*/{NULL},
+/*OSD 0x3d*/{NULL},
+/*OSD 0x3e*/{NULL},
+/*OSD 0x3f*/{NULL},
+/*OSD 0x40*/{NULL},
+/*OSD 0x41*/{NULL},
+/*OSD 0x42*/{NULL},
+/*OSD 0x43*/{NULL},
+/*OSD 0x44*/{NULL},
+/*OSD 0x45*/{NULL},
+/*OSD 0x46*/{NULL},
+/*OSD 0x47*/{NULL},
+/*OSD 0x48*/{NULL},
+/*OSD 0x49*/{NULL},
+/*OSD 0x4a*/{NULL},
+/*OSD 0x4b*/{NULL},
+/*OSD 0x4c*/{dissect_spc3_logselect},
+/*OSD 0x4d*/{dissect_spc3_logsense},
+/*OSD 0x4e*/{NULL},
+/*OSD 0x4f*/{NULL},
+/*OSD 0x50*/{NULL},
+/*OSD 0x51*/{NULL},
+/*OSD 0x52*/{NULL},
+/*OSD 0x53*/{NULL},
+/*OSD 0x54*/{NULL},
+/*OSD 0x55*/{dissect_spc3_modeselect10},
+/*OSD 0x56*/{NULL},
+/*OSD 0x57*/{NULL},
+/*OSD 0x58*/{NULL},
+/*OSD 0x59*/{NULL},
+/*OSD 0x5a*/{dissect_spc3_modesense10},
+/*OSD 0x5b*/{NULL},
+/*OSD 0x5c*/{NULL},
+/*OSD 0x5d*/{NULL},
+/*OSD 0x5e*/{dissect_spc3_persistentreservein},
+/*OSD 0x5f*/{dissect_spc3_persistentreserveout},
+/*OSD 0x60*/{NULL},
+/*OSD 0x61*/{NULL},
+/*OSD 0x62*/{NULL},
+/*OSD 0x63*/{NULL},
+/*OSD 0x64*/{NULL},
+/*OSD 0x65*/{NULL},
+/*OSD 0x66*/{NULL},
+/*OSD 0x67*/{NULL},
+/*OSD 0x68*/{NULL},
+/*OSD 0x69*/{NULL},
+/*OSD 0x6a*/{NULL},
+/*OSD 0x6b*/{NULL},
+/*OSD 0x6c*/{NULL},
+/*OSD 0x6d*/{NULL},
+/*OSD 0x6e*/{NULL},
+/*OSD 0x6f*/{NULL},
+/*OSD 0x70*/{NULL},
+/*OSD 0x71*/{NULL},
+/*OSD 0x72*/{NULL},
+/*OSD 0x73*/{NULL},
+/*OSD 0x74*/{NULL},
+/*OSD 0x75*/{NULL},
+/*OSD 0x76*/{NULL},
+/*OSD 0x77*/{NULL},
+/*OSD 0x78*/{NULL},
+/*OSD 0x79*/{NULL},
+/*OSD 0x7a*/{NULL},
+/*OSD 0x7b*/{NULL},
+/*OSD 0x7c*/{NULL},
+/*OSD 0x7d*/{NULL},
+/*OSD 0x7e*/{NULL},
+/*OSD 0x7f*/{dissect_osd_opcode},
+/*OSD 0x80*/{NULL},
+/*OSD 0x81*/{NULL},
+/*OSD 0x82*/{NULL},
+/*OSD 0x83*/{NULL},
+/*OSD 0x84*/{NULL},
+/*OSD 0x85*/{NULL},
+/*OSD 0x86*/{NULL},
+/*OSD 0x87*/{NULL},
+/*OSD 0x88*/{NULL},
+/*OSD 0x89*/{NULL},
+/*OSD 0x8a*/{NULL},
+/*OSD 0x8b*/{NULL},
+/*OSD 0x8c*/{NULL},
+/*OSD 0x8d*/{NULL},
+/*OSD 0x8e*/{NULL},
+/*OSD 0x8f*/{NULL},
+/*OSD 0x90*/{NULL},
+/*OSD 0x91*/{NULL},
+/*OSD 0x92*/{NULL},
+/*OSD 0x93*/{NULL},
+/*OSD 0x94*/{NULL},
+/*OSD 0x95*/{NULL},
+/*OSD 0x96*/{NULL},
+/*OSD 0x97*/{NULL},
+/*OSD 0x98*/{NULL},
+/*OSD 0x99*/{NULL},
+/*OSD 0x9a*/{NULL},
+/*OSD 0x9b*/{NULL},
+/*OSD 0x9c*/{NULL},
+/*OSD 0x9d*/{NULL},
+/*OSD 0x9e*/{NULL},
+/*OSD 0x9f*/{NULL},
+/*OSD 0xa0*/{dissect_spc3_reportluns},
+/*OSD 0xa1*/{NULL},
+/*OSD 0xa2*/{NULL},
+/*OSD 0xa3*/{NULL},
+/*OSD 0xa4*/{NULL},
+/*OSD 0xa5*/{NULL},
+/*OSD 0xa6*/{NULL},
+/*OSD 0xa7*/{NULL},
+/*OSD 0xa8*/{NULL},
+/*OSD 0xa9*/{NULL},
+/*OSD 0xaa*/{NULL},
+/*OSD 0xab*/{NULL},
+/*OSD 0xac*/{NULL},
+/*OSD 0xad*/{NULL},
+/*OSD 0xae*/{NULL},
+/*OSD 0xaf*/{NULL},
+/*OSD 0xb0*/{NULL},
+/*OSD 0xb1*/{NULL},
+/*OSD 0xb2*/{NULL},
+/*OSD 0xb3*/{NULL},
+/*OSD 0xb4*/{NULL},
+/*OSD 0xb5*/{NULL},
+/*OSD 0xb6*/{NULL},
+/*OSD 0xb7*/{NULL},
+/*OSD 0xb8*/{NULL},
+/*OSD 0xb9*/{NULL},
+/*OSD 0xba*/{NULL},
+/*OSD 0xbb*/{NULL},
+/*OSD 0xbc*/{NULL},
+/*OSD 0xbd*/{NULL},
+/*OSD 0xbe*/{NULL},
+/*OSD 0xbf*/{NULL},
+/*OSD 0xc0*/{NULL},
+/*OSD 0xc1*/{NULL},
+/*OSD 0xc2*/{NULL},
+/*OSD 0xc3*/{NULL},
+/*OSD 0xc4*/{NULL},
+/*OSD 0xc5*/{NULL},
+/*OSD 0xc6*/{NULL},
+/*OSD 0xc7*/{NULL},
+/*OSD 0xc8*/{NULL},
+/*OSD 0xc9*/{NULL},
+/*OSD 0xca*/{NULL},
+/*OSD 0xcb*/{NULL},
+/*OSD 0xcc*/{NULL},
+/*OSD 0xcd*/{NULL},
+/*OSD 0xce*/{NULL},
+/*OSD 0xcf*/{NULL},
+/*OSD 0xd0*/{NULL},
+/*OSD 0xd1*/{NULL},
+/*OSD 0xd2*/{NULL},
+/*OSD 0xd3*/{NULL},
+/*OSD 0xd4*/{NULL},
+/*OSD 0xd5*/{NULL},
+/*OSD 0xd6*/{NULL},
+/*OSD 0xd7*/{NULL},
+/*OSD 0xd8*/{NULL},
+/*OSD 0xd9*/{NULL},
+/*OSD 0xda*/{NULL},
+/*OSD 0xdb*/{NULL},
+/*OSD 0xdc*/{NULL},
+/*OSD 0xdd*/{NULL},
+/*OSD 0xde*/{NULL},
+/*OSD 0xdf*/{NULL},
+/*OSD 0xe0*/{NULL},
+/*OSD 0xe1*/{NULL},
+/*OSD 0xe2*/{NULL},
+/*OSD 0xe3*/{NULL},
+/*OSD 0xe4*/{NULL},
+/*OSD 0xe5*/{NULL},
+/*OSD 0xe6*/{NULL},
+/*OSD 0xe7*/{NULL},
+/*OSD 0xe8*/{NULL},
+/*OSD 0xe9*/{NULL},
+/*OSD 0xea*/{NULL},
+/*OSD 0xeb*/{NULL},
+/*OSD 0xec*/{NULL},
+/*OSD 0xed*/{NULL},
+/*OSD 0xee*/{NULL},
+/*OSD 0xef*/{NULL},
+/*OSD 0xf0*/{NULL},
+/*OSD 0xf1*/{NULL},
+/*OSD 0xf2*/{NULL},
+/*OSD 0xf3*/{NULL},
+/*OSD 0xf4*/{NULL},
+/*OSD 0xf5*/{NULL},
+/*OSD 0xf6*/{NULL},
+/*OSD 0xf7*/{NULL},
+/*OSD 0xf8*/{NULL},
+/*OSD 0xf9*/{NULL},
+/*OSD 0xfa*/{NULL},
+/*OSD 0xfb*/{NULL},
+/*OSD 0xfc*/{NULL},
+/*OSD 0xfd*/{NULL},
+/*OSD 0xfe*/{NULL},
+/*OSD 0xff*/{NULL}
+};
+
+
+
+
+void
+proto_register_scsi_osd(void)
+{
+ static hf_register_info hf[] = {
+ { &hf_scsi_osd_opcode,
+ {"OSD Opcode", "scsi.osd.opcode", FT_UINT8, BASE_HEX,
+ VALS (scsi_osd_vals), 0x0, "", HFILL}},
+ { &hf_scsi_osd_control,
+ {"Control", "scsi.osd.cdb.control", FT_UINT8, BASE_HEX,
+ NULL, 0x0, "", HFILL}},
+ { &hf_scsi_osd_add_cdblen,
+ {"Additional CDB Length", "scsi.osd.addcdblen", FT_UINT8, BASE_DEC,
+ NULL, 0x0, "", HFILL}},
+ { &hf_scsi_osd_svcaction,
+ {"Service Action", "scsi.osd.svcaction", FT_UINT16, BASE_HEX, NULL,
+ 0x0, "", HFILL}},
+ };
+
+ /* Setup protocol subtree array */
+ static gint *ett[] = {
+ };
+
+ /* Register the protocol name and description */
+ proto_scsi_osd = proto_register_protocol("SCSI_OSD", "SCSI_OSD", "scsi_osd");
+
+ /* Required function calls to register the header fields and subtrees used */
+ proto_register_field_array(proto_scsi_osd, hf, array_length(hf));
+/*proto_register_subtree_array(ett, array_length(ett));*/
+}
+
+void
+proto_reg_handoff_scsi_osd(void)
+{
+}
diff --git a/epan/dissectors/packet-scsi-osd.h b/epan/dissectors/packet-scsi-osd.h
new file mode 100644
index 0000000000..54c8e8888a
--- /dev/null
+++ b/epan/dissectors/packet-scsi-osd.h
@@ -0,0 +1,34 @@
+/* packet-scsi-osd.h
+ * Ronnie sahlberg 2006
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 2002 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.
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef __PACKET_SCSI_OSD_H_
+#define __PACKET_SCSI_OSD_H_
+
+#define SCSI_OSD_OPCODE 0x7f
+
+extern int hf_scsi_osd_opcode;
+extern scsi_cdb_table_t scsi_osd_table[256];
+extern const value_string scsi_osd_vals[];
+
+#endif
diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c
index b6a22d5056..425de78bd8 100644
--- a/epan/dissectors/packet-scsi.c
+++ b/epan/dissectors/packet-scsi.c
@@ -93,6 +93,7 @@
#include <epan/tap.h>
#include "packet-fc.h"
#include "packet-scsi.h"
+#include "packet-scsi-osd.h"
static int proto_scsi = -1;
static int hf_scsi_time = -1;
@@ -1002,6 +1003,7 @@ static const value_string scsi_devtype_val[] = {
static const enum_val_t scsi_devtype_options[] = {
{"block", "Block Device", SCSI_DEV_SBC},
{"sequential", "Sequential Device", SCSI_DEV_SSC},
+ {"objectbased", "Object Based Storage Device", SCSI_DEV_OSD},
{NULL, NULL, -1},
};
@@ -1677,16 +1679,6 @@ const true_false_string scsi_senddiag_pf_val = {
static gint scsi_def_devtype = SCSI_DEV_SBC;
-/* list of commands for each commandset */
-typedef void (*scsi_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, guint offset,
- gboolean isreq, gboolean iscdb,
- guint32 payload_len, scsi_task_data_t *cdata);
-
-typedef struct _scsi_cdb_table_t {
- scsi_dissector_t func;
-} scsi_cdb_table_t;
-
typedef struct _cmdset_t {
int hf_opcode;
const value_string *cdb_vals;
@@ -2085,7 +2077,7 @@ dissect_spc3_inq_reladrflags(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
return offset;
}
-static void
+void
dissect_spc3_inquiry (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint32 payload_len, scsi_task_data_t *cdata)
@@ -2223,7 +2215,7 @@ dissect_spc3_extcopy (tvbuff_t *tvb _U_, packet_info *pinfo _U_,
}
-static void
+void
dissect_spc3_logselect (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
@@ -2254,7 +2246,7 @@ dissect_spc3_logselect (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
}
}
-static void
+void
dissect_spc3_logsense (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
@@ -3149,7 +3141,7 @@ dissect_spc3_modeselect6 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
-static void
+void
dissect_spc3_modeselect10 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len, scsi_task_data_t *cdata)
@@ -3398,7 +3390,7 @@ dissect_spc3_modesense6 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
-static void
+void
dissect_spc3_modesense10 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len, scsi_task_data_t *cdata)
@@ -3522,7 +3514,7 @@ dissect_spc3_preventallowmediaremoval (tvbuff_t *tvb, packet_info *pinfo _U_, pr
}
}
-static void
+void
dissect_spc3_persistentreservein (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len, scsi_task_data_t *cdata)
@@ -3586,7 +3578,7 @@ dissect_spc3_persistentreservein (tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
}
}
-static void
+void
dissect_spc3_persistentreserveout (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
@@ -3672,7 +3664,7 @@ proto_tree *tree _U_,
}
-static void
+void
dissect_spc3_reportluns (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
@@ -7932,6 +7924,11 @@ get_cmdset_data(itlq_nexus_t *itlq, itl_nexus_t *itl)
csdata->cdb_vals=scsi_smc2_vals;
csdata->cdb_table=smc;
break;
+ case SCSI_DEV_OSD:
+ csdata->hf_opcode=hf_scsi_osd_opcode;
+ csdata->cdb_vals=scsi_osd_vals;
+ csdata->cdb_table=scsi_osd_table;
+ break;
default:
csdata->hf_opcode=hf_scsi_spcopcode;
csdata->cdb_vals=scsi_spc2_vals;
@@ -8745,7 +8742,9 @@ proto_register_scsi (void)
prefs_register_enum_preference (scsi_module, "decode_scsi_messages_as",
"Decode SCSI Messages As",
"When Target Cannot Be Identified, Decode SCSI Messages As",
- &scsi_def_devtype, scsi_devtype_options, TRUE);
+ &scsi_def_devtype,
+ scsi_devtype_options,
+ FALSE);
}
diff --git a/epan/dissectors/packet-scsi.h b/epan/dissectors/packet-scsi.h
index 0e6a27001a..69f62331f1 100644
--- a/epan/dissectors/packet-scsi.h
+++ b/epan/dissectors/packet-scsi.h
@@ -26,6 +26,17 @@
#define __PACKET_SCSI_H_
+/* list of commands for each commandset */
+typedef void (*scsi_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree, guint offset,
+ gboolean isreq, gboolean iscdb,
+ guint32 payload_len, scsi_task_data_t *cdata);
+
+typedef struct _scsi_cdb_table_t {
+ scsi_dissector_t func;
+} scsi_cdb_table_t;
+
+
/* SPC and SPC-2 Commands */
#define SCSI_SPC_CHANGE_DEFINITION 0x40
#define SCSI_SPC_COMPARE 0x39
@@ -58,6 +69,17 @@
#define SCSI_SPC2_WRITEBUFFER 0x3B
#define SCSI_SPC2_VARLENCDB 0x7F
+void dissect_spc3_inquiry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata);
+void dissect_spc3_logselect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_);
+void dissect_spc3_logsense(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_);
+void dissect_spc3_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
+void dissect_spc3_modesense10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
+void dissect_spc3_persistentreservein(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
+void dissect_spc3_persistentreserveout(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_);
+void dissect_spc3_reportluns(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_);
+
+
+
extern const value_string scsi_status_val[];
/*