Class: PacketGen::Header::IPv6::Option

Inherits:
AbstractTLV
  • Object
show all
Defined in:
lib/packetgen/header/ipv6/hop_by_hop.rb,
lib/packetgen/header/ipv6/hop_by_hop.rb

Overview

Option for HopByHop IPv6 extension header.

Since:

  • 2.4.0

  • 3.1.0 subclass of BinStruct::AbstractTLV

Constant Summary collapse

TYPES =

Known option types

Since:

  • 2.4.0

  • 3.1.0 subclass of BinStruct::AbstractTLV

{
  1 => 'padn',
  5 => 'router_alert'
}.freeze

Instance Method Summary collapse

Instance Method Details

#to_humanString

Get human-readable string

Returns:

  • (String)

Since:

  • 2.4.0

  • 3.1.0 subclass of BinStruct::AbstractTLV



29
30
31
32
33
34
35
36
# File 'lib/packetgen/header/ipv6/hop_by_hop.rb', line 29

def to_human
  case type
  when 1
    "pad#{self.sz}"
  else
    "#{human_type}(#{value.to_s.inspect})"
  end
end