Class: PacketGen::Plugin::SMB::Blocks

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

Overview

Common blocks used for unsupported SMB messages.

Blocks handles parameter block and data block. Parameter block is composed of:

Data block is composed of:

  • a little endian 16-bit #byte_count field,

  • a #bytes field, an array of PacketGen::Types::Int8.

Author:

  • Sylvain Daubert

Direct Known Subclasses

Negotiate::Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#byte_countInteger

The size, in bytes, of the #bytes field.

Returns:

  • (Integer)


32
# File 'lib/packetgen/plugin/smb/blocks.rb', line 32

define_field :byte_count, PacketGen::Types::Int16le

#bytesPacketGen::Types::ArrayOfInt8

The message-specific data structure.

Returns:

  • (PacketGen::Types::ArrayOfInt8)


36
# File 'lib/packetgen/plugin/smb/blocks.rb', line 36

define_field :bytes, PacketGen::Types::ArrayOfInt8, builder: ->(h, t) { t.new(counter: h[:byte_count]) }

#word_countInteger

The size, in 2-byte words, of the #words field.

Returns:

  • (Integer)


24
# File 'lib/packetgen/plugin/smb/blocks.rb', line 24

define_field :word_count, PacketGen::Types::Int8

#wordsPacketGen::Types::ArrayOfInt16le

The message-specific parameters structure.

Returns:

  • (PacketGen::Types::ArrayOfInt16le)


28
# File 'lib/packetgen/plugin/smb/blocks.rb', line 28

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

Instance Method Details

#protocol_nameString

Give protocol name for this class

Returns:



40
41
42
# File 'lib/packetgen/plugin/smb/blocks.rb', line 40

def protocol_name
  'SMB::Blocks'
end