Class: PacketGen::Header::DHCPv6::DUID_LLT

Inherits:
DUID
  • Object
show all
Defined in:
lib/packetgen/header/dhcpv6/duid.rb

Overview

Author:

  • Sylvain Daubert

Since:

  • 2.5.0

Constant Summary collapse

BASE_TIME =

Base time for time computation

Since:

  • 2.5.0

Time.utc(2000, 1, 1)

Constants inherited from DUID

PacketGen::Header::DHCPv6::DUID::TYPES

Instance Attribute Summary collapse

Attributes inherited from DUID

#body, #type

Instance Method Summary collapse

Methods inherited from DUID

#human_type, #read

Instance Attribute Details

#htypeInteger

16-bit hardware protocol type

Returns:

  • (Integer)


81
# File 'lib/packetgen/header/dhcpv6/duid.rb', line 81

define_attr :htype, BinStruct::Int16, default: 1

Returns:



88
# File 'lib/packetgen/header/dhcpv6/duid.rb', line 88

define_attr :link_addr, Eth::MacAddr

#timeTime

Returns:

  • (Time)

Since:

  • 2.5.0



85
# File 'lib/packetgen/header/dhcpv6/duid.rb', line 85

define_attr :time, BinStruct::Int32, default: (Time.now - BASE_TIME).to_i

Instance Method Details

#to_humanString

Get human-readable DUID description

Returns:

  • (String)

Since:

  • 2.5.0



105
106
107
# File 'lib/packetgen/header/dhcpv6/duid.rb', line 105

def to_human
  "DUID_LLT<#{time},#{link_addr}>"
end