Exemplo n.º 1
0
    def readcapacity16(self, **kwargs):
        """
        Returns a ReadCapacity16 Instance

        :param kwargs: a dict with key/value pairs
                       alloc_len = 32, size of requested datain
        :return: a ReadCapacity16 instance
        """
        opcode = next(get_opcode(self.device.opcodes, '9E'))
        cmd = ReadCapacity16(opcode=opcode, **kwargs)
        self.execute(cmd)
        cmd.unmarshall()
        return cmd
Exemplo n.º 2
0
    def reportpriority(self, **kwargs):
        """
        Return a ReportPriority Instance

        :param kwargs: a dict with key/value pairs
                       priority=0, specifies information to be returned in data_in buffer
                       alloclen=16384, size of requested datain
        :return: a ReportLuns instance
        """
        opcode = next(get_opcode(self.device.opcodes, 'A3'))
        cmd = ReportPriority(opcode=opcode, **kwargs)
        self.execute(cmd)
        cmd.unmarshall()
        return cmd
Exemplo n.º 3
0
    def getlbastatus(self, lba, **kwargs):
        """
        Returns a GetLBAStatus Instance

        :param lba: starting lba
        :param kwargs: a dict with key/value pairs
                       alloc_len = 16384: size of requested datain
        :return: a GetLBAStatus instance
        """
        opcode = next(get_opcode(self.device.opcodes, '9E'))
        cmd = GetLBAStatus(opcode, lba, **kwargs)
        self.execute(cmd)
        cmd.unmarshall()
        return cmd
    def build_cdb(self, priority, alloclen):
        """
        Build a ReportPriority CDB

        :param priority: specifies information to be returned in data_in buffer
        :param alloclen: the max number of bytes allocated for the data_in buffer
        :return: a byte array representing a code descriptor block
        """
        opcode = next(get_opcode(self.scsi.device.opcodes, 'A3'))
        cdb = {'opcode': opcode.value,
               'service_action': opcode.serviceaction.REPORT_PRIORITY,
               'priority_reported': priority,
               'alloc_len': alloclen, }
        return self.marshall_cdb(cdb)
Exemplo n.º 5
0
    def readcapacity16(self,
                       **kwargs):
        """
        Returns a ReadCapacity16 Instance

        :param kwargs: a dict with key/value pairs
                       alloc_len = 32, size of requested datain
        :return: a ReadCapacity16 instance
        """
        opcode = next(get_opcode(self.device.opcodes, '9E'))
        cmd = ReadCapacity16(opcode=opcode,
                             **kwargs)
        self.execute(cmd)
        SCSI.unmarshall(cmd)
        return cmd
Exemplo n.º 6
0
    def reportpriority(self,
                       **kwargs):
        """
        Return a ReportPriority Instance

        :param kwargs: a dict with key/value pairs
                       priority=0, specifies information to be returned in data_in buffer
                       alloclen=16384, size of requested datain
        :return: a ReportLuns instance
        """
        opcode = next(get_opcode(self.device.opcodes, 'A3'))
        cmd = ReportPriority(opcode=opcode,
                             **kwargs)
        self.execute(cmd)
        SCSI.unmarshall(cmd)
        return cmd
    def build_cdb(self, priority, alloclen):
        """
        Build a ReportPriority CDB

        :param priority: specifies information to be returned in data_in buffer
        :param alloclen: the max number of bytes allocated for the data_in buffer
        :return: a byte array representing a code descriptor block
        """
        opcode = next(get_opcode(self.scsi.device.opcodes, 'A3'))
        cdb = {
            'opcode': opcode.value,
            'service_action': opcode.serviceaction.REPORT_PRIORITY,
            'priority_reported': priority,
            'alloc_len': alloclen,
        }
        return self.marshall_cdb(cdb)
Exemplo n.º 8
0
    def getlbastatus(self,
                     lba,
                     **kwargs):
        """
        Returns a GetLBAStatus Instance

        :param lba: starting lba
        :param kwargs: a dict with key/value pairs
                       alloc_len = 16384: size of requested datain
        :return: a GetLBAStatus instance
        """
        opcode = next(get_opcode(self.device.opcodes, '9E'))
        cmd = GetLBAStatus(opcode,
                           lba,
                           **kwargs)
        self.execute(cmd)
        SCSI.unmarshall(cmd)
        return cmd