Wireshark-dev: Re: [Wireshark-dev] [patch] disselect scsi ssc medium partition page
From: Patrick vd Lageweg <patrick@xxxxxxxxxxxx>
Date: Wed, 11 Oct 2006 08:35:44 +0200
On Tue, Oct 10, 2006 at 04:42:31PM +0200, Jaap Keuter wrote:
> Hallo,
> 
> Mooie patch, we kunnen hem alleen niet vinden ;)
> 

oops, vergeten. Hopelijk nu beter.

	Patrick

> On Tue, 10 Oct 2006, Patrick vd Lageweg wrote:
> 
> > Hi,
> >
> > This patch impelments a dissect for the SCSI SSC Medium Partition Page.
> >
> >
> > 	Patrick
> > _______________________________________________
> > Wireshark-dev mailing list
> > Wireshark-dev@xxxxxxxxxxxxx
> > http://www.wireshark.org/mailman/listinfo/wireshark-dev
> >
> >
> 
> 
Index: epan/dissectors/packet-scsi.c
===================================================================
--- epan/dissectors/packet-scsi.c	(revision 19477)
+++ epan/dissectors/packet-scsi.c	(working copy)
@@ -2704,7 +2704,33 @@
                              (flags & 0x01));
         break;
     case SCSI_SSC2_MODEPAGE_MEDPAR1:
-        return FALSE;
+	    flags = tvb_get_guint8 (tvb, offset+2);
+	    proto_tree_add_text (tree, tvb, offset+2, 1,
+				 "Maximum Additional Partitions: %u",
+				 flags);
+	    flags = tvb_get_guint8 (tvb, offset+3);
+	    proto_tree_add_text (tree, tvb, offset+3, 1,
+				 "Additional Partitions Defined: %u",
+				 flags);
+	    flags = tvb_get_guint8 (tvb, offset+4);
+	    proto_tree_add_text (tree, tvb, offset+4, 1,
+				 "FDP: %u, DSP: %u, IDP: %u, PSUM: %u, POFM: %u, CLEAR: %u, ADDP: %u",
+				 (flags & 0x80) >> 7, (flags & 0x40) >> 6,
+				 (flags & 0x20) >> 5, (flags & 0x18) >> 3,
+				 (flags & 0x04) >> 2, (flags & 0x02) >> 1,
+				 (flags & 0x01));
+	    flags = tvb_get_guint8 (tvb, offset+5);
+	    proto_tree_add_text (tree, tvb, offset+5, 1,
+				 "Media Formar Recognition: %u",
+				 flags);
+	    flags = tvb_get_guint8 (tvb, offset+6);
+	    proto_tree_add_text (tree, tvb, offset+6, 1,
+				 "Partition Units: %u",
+				 flags & 0x0f);
+	    proto_tree_add_text (tree, tvb, offset+8, 2,
+				 "Partition Size: %u",
+				 tvb_get_ntohs (tvb, offset+8));
+	    break;
     case SCSI_SSC2_MODEPAGE_MEDPAR2:
         return FALSE;
     case SCSI_SSC2_MODEPAGE_MEDPAR3: