Class: PacketGen::Plugin::SMB::Trans::Request

Inherits:
Header::Base
  • Object
show all
Defined in:
lib/packetgen/plugin/smb/trans/request.rb

Overview

Transaction Request.

See also Blocks, as Request is a specialization of Blocks#words and Blocks#bytes.

Author:

  • Sylvain Daubert

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyString

Returns:



111
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 111

define_field :body, PacketGen::Types::String

#byte_countInteger

Returns:

  • (Integer)


94
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 94

define_field :byte_count, PacketGen::Types::Int16le

#data_countInteger

16-bit number of transaction data bytes that the clients sends to the server in this request.

Returns:

  • (Integer)


75
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 75

define_field :data_count, PacketGen::Types::Int16le

#data_offsetInteger

16-bit offset (in bytes) from the start of the SMB header to the start of the data field.

Returns:

  • (Integer)


80
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 80

define_field :data_offset, PacketGen::Types::Int16le

#flagsInteger

16-bit flags

Returns:

  • (Integer)


52
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 52

define_field :flags, PacketGen::Types::Int16le

#max_data_countInteger

The maximum number of data bytes that the client will accept in transaction response.

Returns:

  • (Integer)


39
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 39

define_field :max_data_count, PacketGen::Types::Int16le

#max_param_countInteger

The maximum number of parameter bytes that the client will accept in transaction response.

Returns:

  • (Integer)


34
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 34

define_field :max_param_count, PacketGen::Types::Int16le

#max_setup_countInteger

The maximum number of setup bytes that the client will accept in transaction response.

Returns:

  • (Integer)


44
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 44

define_field :max_setup_count, PacketGen::Types::Int8

#nameString

Pathname of the mailslot or named pipe.

Returns:



103
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 103

define_field :name, SMB::String, builder: ->(h, t) { t.new(unicode: !h.packet || h.packet.smb.flags2_unicode?) }

#pad1String

Padding to align #body on 4-byte boundary.

Returns:



107
108
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 107

define_field :pad1, PacketGen::Types::String, default: "\0" * 4,
builder: ->(h, t) { t.new(length_from: -> { h.data_offset - SMB.new.sz - (h.offset_of(:name) + h[:name].sz) }) }

#padnameInteger

8-bit optional padding to align #name on a 2-byte boundary. Only present if PacketGen::Plugin::SMB#flags2_unicode? is true.

Returns:

  • (Integer)


99
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 99

define_field :padname, PacketGen::Types::Int8, optional: ->(h) { h&.packet&.smb&.flags2_unicode? }

#param_countInteger

16-bit number of transaction parameter bytes that the clients attempts to send to the server in this request.

Returns:

  • (Integer)


65
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 65

define_field :param_count, PacketGen::Types::Int16le

#param_offsetInteger

16-bit offset (in bytes) from the start of the SMB header to the start of the transaction parameters.

Returns:

  • (Integer)


70
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 70

define_field :param_offset, PacketGen::Types::Int16le

#rsv1Integer

8-bit reserved field

Returns:

  • (Integer)


48
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 48

define_field :rsv1, PacketGen::Types::Int8, default: 0

#rsv2Integer

16-bit reserved field

Returns:

  • (Integer)


60
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 60

define_field :rsv2, PacketGen::Types::Int16le, default: 0

#rsv3Integer

8-bit reserved field

Returns:

  • (Integer)


87
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 87

define_field :rsv3, PacketGen::Types::Int8

#setupArray

Array of 2-byte words.

Returns:

  • (Array)


91
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 91

define_field :setup, PacketGen::Types::ArrayOfInt16le, builder: ->(h, t) { t.new(counter: h[:setup_count]) }

#setup_countObject

8-bit number of setup words (ie 16-bit words) contained in #setup field.



83
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 83

define_field :setup_count, PacketGen::Types::Int8

#timeoutInteger

32-bit timeout

Returns:

  • (Integer)


56
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 56

define_field :timeout, PacketGen::Types::Int32le

#total_data_countInteger

The total number of transaction data bytes.

Returns:

  • (Integer)


29
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 29

define_field :total_data_count, PacketGen::Types::Int16le

#total_param_countInteger

The total number of transaction parameter bytes.

Returns:

  • (Integer)


25
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 25

define_field :total_param_count, PacketGen::Types::Int16le

#word_countInteger

The size, in 2-byte words, of the SMB command parameters. It should be 14 setup_count+.

Returns:

  • (Integer)


21
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 21

define_field :word_count, PacketGen::Types::Int8, default: 14

Class Method Details

.protocol_nameString

Give protocol name for this class

Returns:



115
116
117
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 115

def self.protocol_name
  'SMB::Trans::Request'
end