Class: PacketGen::Header::OSPFv3::Link

Inherits:
Types::Fields show all
Includes:
Types::Fieldable
Defined in:
lib/packetgen/header/ospfv3/lsa.rb

Overview

This class handles links in a OSPFv3 LSA router payload.

Author:

  • Sylvain Daubert

Since:

  • 2.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Types::Fieldable

#format_inspect, #read, #sz, #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::Types::Fields

Instance Attribute Details

#interface_idInteger

Returns:

  • (Integer)

27
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 27

define_field :interface_id, Types::Int32

#metricInteger

Returns:

  • (Integer)

24
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 24

define_field :metric, Types::Int16

#neighbor_interface_idInteger

Returns:

  • (Integer)

30
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 30

define_field :neighbor_interface_id, Types::Int32

#neighbor_router_idString

Returns:

  • (String)

33
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 33

define_field :neighbor_router_id, IP::Addr

#reservedInteger

Returns:

  • (Integer)

21
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 21

define_field :reserved, Types::Int8, default: 0

#typeInteger

Returns:

  • (Integer)

18
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 18

define_field :type, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0


36
37
38
39
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 36

def to_human
  "Link<type:#{type},metric:#{metric},id:#{interface_id}," \
    "neighbor_id:#{neighbor_interface_id},neighbor_router:#{neighbor_router_id}>"
end