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:



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

define_attr :body, BinStruct::String

#byte_countInteger

Returns:

  • (Integer)


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

define_attr :byte_count, BinStruct::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_attr :data_count, BinStruct::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_attr :data_offset, BinStruct::Int16le

#flagsInteger

16-bit flags

Returns:

  • (Integer)


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

define_attr :flags, BinStruct::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_attr :max_data_count, BinStruct::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_attr :max_param_count, BinStruct::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_attr :max_setup_count, BinStruct::Int8

#nameString

Pathname of the mailslot or named pipe.

Returns:



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

define_attr :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
109
# File 'lib/packetgen/plugin/smb/trans/request.rb', line 107

define_attr :pad1, BinStruct::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_attr :padname, BinStruct::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_attr :param_count, BinStruct::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_attr :param_offset, BinStruct::Int16le

#rsv1Integer

8-bit reserved field

Returns:

  • (Integer)


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

define_attr :rsv1, BinStruct::Int8, default: 0

#rsv2Integer

16-bit reserved field

Returns:

  • (Integer)


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

define_attr :rsv2, BinStruct::Int16le, default: 0

#rsv3Integer

8-bit reserved field

Returns:

  • (Integer)


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

define_attr :rsv3, BinStruct::Int8

#setupArray

Array of 2-byte words.

Returns:

  • (Array)


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

define_attr :setup, BinStruct::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_attr :setup_count, BinStruct::Int8

#timeoutInteger

32-bit timeout

Returns:

  • (Integer)


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

define_attr :timeout, BinStruct::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_attr :total_data_count, BinStruct::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_attr :total_param_count, BinStruct::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_attr :word_count, BinStruct::Int8, default: 14

Class Method Details

.protocol_nameString

Give protocol name for this class

Returns:



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

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