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)


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

define_field :interface_id, Types::Int32

#metricInteger

Returns:

  • (Integer)


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

define_field :metric, Types::Int16

#neighbor_interface_idInteger

Returns:

  • (Integer)


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

define_field :neighbor_interface_id, Types::Int32

#neighbor_router_idString

Returns:

  • (String)


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

define_field :neighbor_router_id, IP::Addr

#reservedInteger

Returns:

  • (Integer)


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

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

#typeInteger

Returns:

  • (Integer)


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

define_field :type, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0



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

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