Class: Rex::Proto::DRDA::RDBNAM_PARAM

Inherits:
Struct
  • Object
show all
Defined in:
lib/rex/proto/drda/packet.rb

Overview

Relational Database name parameter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ RDBNAM_PARAM

Returns a new instance of RDBNAM_PARAM.



62
63
64
65
66
# File 'lib/rex/proto/drda/packet.rb', line 62

def initialize(args={})
	self[:length] = 22 # Since the database name is padded out.
	self[:codepoint] = Constants::RDBNAM
	self[:payload] = encode(args[:payload].to_s)
end

Instance Attribute Details

#codepointObject

Returns the value of attribute codepoint

Returns:

  • (Object)

    the current value of codepoint



61
62
63
# File 'lib/rex/proto/drda/packet.rb', line 61

def codepoint
  @codepoint
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



61
62
63
# File 'lib/rex/proto/drda/packet.rb', line 61

def length
  @length
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



61
62
63
# File 'lib/rex/proto/drda/packet.rb', line 61

def payload
  @payload
end

Instance Method Details

#encode(str) ⇒ Object



68
69
70
# File 'lib/rex/proto/drda/packet.rb', line 68

def encode(str)
	Rex::Text.to_ebcdic([str].pack("A18"))
end

#to_sObject



76
77
78
# File 'lib/rex/proto/drda/packet.rb', line 76

def to_s
	self.to_a.pack("nna18")
end