Class: PacketGen::Header::DHCPv6::IAAddr

Inherits:
Option show all
Defined in:
lib/packetgen/header/dhcpv6/option.rb

Overview

DHCPv6 IA Address option

Author:

  • Sylvain Daubert

Since:

  • 2.5.0

Instance Attribute Summary collapse

Attributes inherited from Option

#data, #length, #type

Instance Method Summary collapse

Methods inherited from Option

#human_type, #initialize, new, subclasses, #to_human

Methods included from Types::Fieldable

#format_inspect, #read, #sz, #to_human, #to_s, #type_name

Methods inherited from Types::Fields

#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, #fields, fields, inherited, #initialize, #inspect, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field

Constructor Details

This class inherits a constructor from PacketGen::Header::DHCPv6::Option

Instance Attribute Details

#ipv6Object

IPv6 address



197
# File 'lib/packetgen/header/dhcpv6/option.rb', line 197

define_field :ipv6, IPv6::Addr

#optionsString

options field

Returns:

  • (String)


209
210
# File 'lib/packetgen/header/dhcpv6/option.rb', line 209

define_field :options, Types::String,
builder: ->(h, t) { t.new length_from: -> { h[:length].to_i - 24 } }

#preferred_lifetimeInteger

32-bit preferred lifetime

Returns:

  • (Integer)


201
# File 'lib/packetgen/header/dhcpv6/option.rb', line 201

define_field :preferred_lifetime, Types::Int32

#valid_lifetimeInteger

32-bit valid lifetime

Returns:

  • (Integer)


205
# File 'lib/packetgen/header/dhcpv6/option.rb', line 205

define_field :valid_lifetime, Types::Int32

Instance Method Details

#human_dataString

Get human-readable data (ipv6, preferred lifetime and valid lifetime)

Returns:

  • (String)

Since:

  • 2.5.0



214
215
216
# File 'lib/packetgen/header/dhcpv6/option.rb', line 214

def human_data
  "#{ipv6},#{preferred_lifetime},#{valid_lifetime}"
end