Class: PacketGen::Plugin::SMB::Trans::Response

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

Overview

Transaction Response.

See also Blocks, as Response 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:



84
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 84

define_field :body, PacketGen::Types::String

#byte_countInteger

Returns:

  • (Integer)


76
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 76

define_field :byte_count, PacketGen::Types::Int16le

#data_countInteger

16-bit number of transaction data bytes sent in this response.

Returns:

  • (Integer)


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

define_field :data_count, PacketGen::Types::Int16le

#data_displacementInteger

16-bit offset (in bytes) relative to all of the transaction data bytes in this transaction response at which this block of data bytes SHOULD be placed.

Returns:

  • (Integer)


62
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 62

define_field :data_displacement, 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)


57
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 57

define_field :data_offset, PacketGen::Types::Int16le

#pad1Integer

Padding before #body to align it on 32-bit boundary

Returns:

  • (Integer)


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

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(:byte_count) + h[:byte_count].sz) }) }

#param_countInteger

16-bit number of transaction parameter bytes sent in this response.

Returns:

  • (Integer)


37
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 37

define_field :param_count, PacketGen::Types::Int16le

#param_displacementInteger

16-bit offset (in bytes) relative to all of the transaction parameter bytes in this transaction response at which this block of parameter bytes SHOULD be placed.

Returns:

  • (Integer)


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

define_field :param_displacement, 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)


42
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 42

define_field :param_offset, PacketGen::Types::Int16le

#rsv1Integer

16-bit reserved field

Returns:

  • (Integer)


33
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 33

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

#rsv3Integer

8-bit reserved field

Returns:

  • (Integer)


69
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 69

define_field :rsv2, PacketGen::Types::Int8

#setupArrayPacketGen::

Array of 2-byte words.

Returns:

  • (ArrayPacketGen::)


73
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 73

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.



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

define_field :setup_count, PacketGen::Types::Int8

#total_data_countInteger

The total number of transaction data bytes.

Returns:

  • (Integer)


29
# File 'lib/packetgen/plugin/smb/trans/response.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/response.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/response.rb', line 21

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

Class Method Details

.protocol_nameString

Give protocol name for this class

Returns:



88
89
90
# File 'lib/packetgen/plugin/smb/trans/response.rb', line 88

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