Class: RubySMB::SMB1::Packet::ReadAndxRequest

Inherits:
GenericPacket
  • Object
show all
Defined in:
lib/ruby_smb/smb1/packet/read_andx_request.rb

Overview

A SMB1 SMB_COM_READ_ANDX Request Packet as defined in 2.2.4.42.1 Request 2.2.4.2.1 Client Request Extensions

Defined Under Namespace

Classes: DataBlock, ParameterBlock

Constant Summary collapse

COMMAND =
RubySMB::SMB1::Commands::SMB_COM_READ_ANDX

Instance Method Summary collapse

Methods inherited from GenericPacket

describe, #display, fields_hashed, format_field, from_hex, #initialize_instance, #packet_smb_version, read, #status_code, #valid?, walk_fields

Instance Method Details

#set_64_bit_offset(is_64_bit) ⇒ Object

Specifies whether the offset is a 32-bit (default) or 64-bit value. When is_64_bit is true, a 64-bit offset will be used and the OffsetHigh field will be added to the structure.

Parameters:

  • is_64_bit (TrueClass, FalseClass)

    use a 64-bit offset if set to true, 32-bit otherwise

Raises:

  • (ArgumentError.new)


74
75
76
77
# File 'lib/ruby_smb/smb1/packet/read_andx_request.rb', line 74

def set_64_bit_offset(is_64_bit)
  raise ArgumentError.new, 'The value can only be true or false' unless [true, false].include?(is_64_bit)
  parameter_block.word_count = is_64_bit ? 0x0C : 0x0A
end

#set_read_from_named_pipe(read_from_named_pipe) ⇒ Object

Sets the read_from_named_pipe flag to read_from_named_pipe value (true or false). When reading from a named pipe, this flag needs to be set to true, which forces the use of Timeout field in Timeout_or_MaxCountHigh. When set to false (default), for regular files, MaxCountHigh field will be used instead.

Parameters:

  • read_from_named_pipe (TrueClass, FalseClass)

    the value the read_from_named_pipe flag is to be set to.

Raises:

  • (ArgumentError.new)


65
66
67
68
# File 'lib/ruby_smb/smb1/packet/read_andx_request.rb', line 65

def set_read_from_named_pipe(read_from_named_pipe)
  raise ArgumentError.new, 'The value can only be true or false' unless [true, false].include?(read_from_named_pipe)
  parameter_block.read_from_named_pipe = read_from_named_pipe
end