Class: Rex::Proto::DRDA::RDBNAM_PARAM
- Inherits:
-
Struct
- Object
- Struct
- Rex::Proto::DRDA::RDBNAM_PARAM
- Defined in:
- lib/rex/proto/drda/packet.rb
Overview
Relational Database name parameter.
Instance Attribute Summary collapse
-
#codepoint ⇒ Object
Returns the value of attribute codepoint.
-
#length ⇒ Object
Returns the value of attribute length.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #encode(str) ⇒ Object
-
#initialize(args = {}) ⇒ RDBNAM_PARAM
constructor
A new instance of RDBNAM_PARAM.
- #to_s ⇒ Object
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
#codepoint ⇒ Object
Returns the value of attribute codepoint
61 62 63 |
# File 'lib/rex/proto/drda/packet.rb', line 61 def codepoint @codepoint end |
#length ⇒ Object
Returns the value of attribute length
61 62 63 |
# File 'lib/rex/proto/drda/packet.rb', line 61 def length @length end |
#payload ⇒ Object
Returns the value of attribute 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_s ⇒ Object
76 77 78 |
# File 'lib/rex/proto/drda/packet.rb', line 76 def to_s self.to_a.pack("nna18") end |