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

Inherits:
BinStruct::Struct
  • Object
show all
Includes:
BinStruct::Structable
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

Instance Attribute Details

#interface_idInteger

ID for the interface being described.

Returns:

  • (Integer)


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

define_attr :interface_id, BinStruct::Int32

#metricInteger

Cost of using this router interface.

Returns:

  • (Integer)


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

define_attr :metric, BinStruct::Int16

#neighbor_interface_idInteger

Interface ID the neighbor router has associated with this link.

Returns:

  • (Integer)


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

define_attr :neighbor_interface_id, BinStruct::Int32

#neighbor_router_idString

Router ID of the neighbor router.

Returns:

  • (String)


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

define_attr :neighbor_router_id, IP::Addr

#reservedInteger

Returns:

  • (Integer)


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

define_attr :reserved, BinStruct::Int8, default: 0

#typeInteger

Kind of interface being described. One of the following:

* 1: Point-to-point connection to another router
* 2: Connection to a transit network
* 4: Virtual link

Returns:

  • (Integer)


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

define_attr :type, BinStruct::Int8

Instance Method Details

#to_humanString

Human-readable description

Returns:

  • (String)

Since:

  • 2.5.0



46
47
48
49
# File 'lib/packetgen/header/ospfv3/lsa.rb', line 46

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