Exemplo n.º 1
0
        public NOPInPDU(byte[] buffer) : base(buffer)
        {
            LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);

            TargetTransferTag = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
            StatSN            = BigEndianConverter.ToUInt32(OpCodeSpecific, 4);
            ExpCmdSN          = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);
            MaxCmdSN          = BigEndianConverter.ToUInt32(OpCodeSpecific, 12);
        }
Exemplo n.º 2
0
        public SCSIDataOutPDU(byte[] buffer) : base(buffer)
        {
            LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);

            TargetTransferTag = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
            ExpStatSN         = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);
            DataSN            = BigEndianConverter.ToUInt32(OpCodeSpecific, 16);
            BufferOffset      = BigEndianConverter.ToUInt32(OpCodeSpecific, 20);
        }
Exemplo n.º 3
0
 public ReadyToTransferPDU(byte[] buffer, int offset) : base(buffer, offset)
 {
     LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);
     TargetTransferTag         = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
     StatSN                    = BigEndianConverter.ToUInt32(OpCodeSpecific, 4);
     ExpCmdSN                  = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);
     MaxCmdSN                  = BigEndianConverter.ToUInt32(OpCodeSpecific, 12);
     R2TSN                     = BigEndianConverter.ToUInt32(OpCodeSpecific, 16);
     BufferOffset              = BigEndianConverter.ToUInt32(OpCodeSpecific, 20);
     DesiredDataTransferLength = BigEndianConverter.ToUInt32(OpCodeSpecific, 24);
 }
Exemplo n.º 4
0
        public TextRequestPDU(byte[] buffer, int offset) : base(buffer, offset)
        {
            Continue = (OpCodeSpecificHeader[0] & 0x40) != 0;

            LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);

            TargetTransferTag = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
            CmdSN             = BigEndianConverter.ToUInt32(OpCodeSpecific, 4);
            ExpStatSN         = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);

            Text = ASCIIEncoding.ASCII.GetString(Data);
        }
Exemplo n.º 5
0
        public ReportLUNsParameter(byte[] buffer)
        {
            uint listLength = BigEndianConverter.ToUInt32(buffer, 0);
            // uint reserved = BigEndianConverter.ToUInt32(buffer, 4);
            int offset   = 8;
            int lunCount = (int)(listLength / 8);

            for (int index = 0; index < lunCount; index++)
            {
                LUNStructure structure = new LUNStructure(buffer, offset);
                LUNList.Add(structure);
                offset += 8;
            }
        }
Exemplo n.º 6
0
        public SCSICommandPDU(byte[] buffer, int offset) : base(buffer, offset)
        {
            Read           = (OpCodeSpecificHeader[0] & 0x40) != 0;
            Write          = (OpCodeSpecificHeader[0] & 0x20) != 0;
            TaskAttributes = (byte)(OpCodeSpecificHeader[0] & 0x7);

            LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);

            ExpectedDataTransferLength = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
            CmdSN     = BigEndianConverter.ToUInt32(OpCodeSpecific, 4);
            ExpStatSN = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);

            CommandDescriptorBlock = ByteReader.ReadBytes(OpCodeSpecific, 12, 16);
        }
Exemplo n.º 7
0
        public SCSIDataInPDU(byte[] buffer, int offset) : base(buffer, offset)
        {
            Acknowledge       = (OpCodeSpecificHeader[0] & 0x40) != 0;
            ResidualOverflow  = (OpCodeSpecificHeader[0] & 0x04) != 0;
            ResidualUnderflow = (OpCodeSpecificHeader[0] & 0x02) != 0;
            StatusPresent     = (OpCodeSpecificHeader[0] & 0x01) != 0;

            Status = (SCSIStatusCodeName)OpCodeSpecificHeader[2];

            LUN = new LUNStructure(LUNOrOpCodeSpecific, 0);

            TargetTransferTag = BigEndianConverter.ToUInt32(OpCodeSpecific, 0);
            StatSN            = BigEndianConverter.ToUInt32(OpCodeSpecific, 4);
            ExpCmdSN          = BigEndianConverter.ToUInt32(OpCodeSpecific, 8);
            MaxCmdSN          = BigEndianConverter.ToUInt32(OpCodeSpecific, 12);
            DataSN            = BigEndianConverter.ToUInt32(OpCodeSpecific, 16);
            BufferOffset      = BigEndianConverter.ToUInt32(OpCodeSpecific, 20);
            ResidualCount     = BigEndianConverter.ToUInt32(OpCodeSpecific, 24);
        }