Class: PacketGen::Header::DHCPv6::StatusCode
- Defined in:
- lib/packetgen/header/dhcpv6/option.rb
Overview
DHCPv6 Status Code option
Instance Attribute Summary collapse
-
#status_code ⇒ Integer
16-bit status code.
-
#status_message ⇒ ::String
UTF-8 encoded text string suitable for display to an end user.
Attributes inherited from Option
Instance Method Summary collapse
-
#human_data ⇒ String
Get human-readable data (status code).
-
#initialize(options = {}) ⇒ StatusCode
constructor
A new instance of StatusCode.
Methods inherited from Option
human_type, initialize, new, subclasses, to_human
Constructor Details
#initialize(options = {}) ⇒ StatusCode
Returns a new instance of StatusCode.
318 319 320 321 322 |
# File 'lib/packetgen/header/dhcpv6/option.rb', line 318 def initialize(={}) [:length] = [:status_message].to_s.size + 2 if [:status_message] super self.length = self.sz - 4 if [:status_message].nil? end |
Instance Attribute Details
#status_code ⇒ Integer
16-bit status code
311 |
# File 'lib/packetgen/header/dhcpv6/option.rb', line 311 define_attr :status_code, BinStruct::Int16 |
#status_message ⇒ ::String
UTF-8 encoded text string suitable for display to an end user
315 |
# File 'lib/packetgen/header/dhcpv6/option.rb', line 315 define_attr :status_message, BinStruct::String |
Instance Method Details
#human_data ⇒ String
Get human-readable data (status code)
326 327 328 |
# File 'lib/packetgen/header/dhcpv6/option.rb', line 326 def human_data status_code.to_s end |