Class: Rex::Proto::DRDA::Packet::USERID_PARAM
- Inherits:
-
Struct
- Object
- Struct
- Rex::Proto::DRDA::Packet::USERID_PARAM
- Defined in:
- lib/rex/proto/drda/packet.rb
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 = {}) ⇒ USERID_PARAM
constructor
A new instance of USERID_PARAM.
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ USERID_PARAM
Returns a new instance of USERID_PARAM.
209 210 211 212 213 |
# File 'lib/rex/proto/drda/packet.rb', line 209 def initialize(args={}) self[:codepoint] = Rex::Proto::DRDA::Constants::USERID self[:payload] = Rex::Text.to_ebcdic(args[:payload].to_s) self[:length] = self[:payload].size + 4 end |
Instance Attribute Details
#codepoint ⇒ Object
Returns the value of attribute codepoint
208 209 210 |
# File 'lib/rex/proto/drda/packet.rb', line 208 def codepoint @codepoint end |
#length ⇒ Object
Returns the value of attribute length
208 209 210 |
# File 'lib/rex/proto/drda/packet.rb', line 208 def length @length end |
#payload ⇒ Object
Returns the value of attribute payload
208 209 210 |
# File 'lib/rex/proto/drda/packet.rb', line 208 def payload @payload end |
Instance Method Details
#encode(str) ⇒ Object
214 215 216 |
# File 'lib/rex/proto/drda/packet.rb', line 214 def encode(str) Rex::Text.to_ebcdic(str) end |
#to_s ⇒ Object
217 218 219 |
# File 'lib/rex/proto/drda/packet.rb', line 217 def to_s self.to_a.pack("nna*") end |