Class: PacketGen::Header::OSPFv2::Link
- Inherits:
-
BinStruct::Struct
- Object
- BinStruct::Struct
- PacketGen::Header::OSPFv2::Link
- Includes:
- BinStruct::Structable
- Defined in:
- lib/packetgen/header/ospfv2/lsa.rb
Overview
This class handles links in a LSA router payload.
Instance Attribute Summary collapse
-
#data ⇒ IP::Addr
Link data.
-
#id ⇒ IP::Addr
Identify the link.
-
#metric ⇒ Integer
The cost of using this router link.
-
#tos ⇒ ArrayOfTosMetric
Additionnal TOS metrics.
-
#tos_count ⇒ Integer
Count of #TOS metrics.
-
#type ⇒ Integer
Link type.
Instance Method Summary collapse
-
#to_human ⇒ String
Get human-readable description.
Instance Attribute Details
#data ⇒ IP::Addr
Link data
67 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 67 define_attr :data, IP::Addr |
#id ⇒ IP::Addr
Identify the link
63 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 63 define_attr :id, IP::Addr |
#metric ⇒ Integer
The cost of using this router link
83 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 83 define_attr :metric, BinStruct::Int16 |
#tos ⇒ ArrayOfTosMetric
Additionnal TOS metrics
87 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 87 define_attr :tos, ArrayOfTosMetric, builder: ->(h, t) { t.new(counter: h[:tos_count]) } |
#tos_count ⇒ Integer
Count of #TOS metrics
79 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 79 define_attr :tos_count, BinStruct::Int8 |
#type ⇒ Integer
Link type.
-
1: Point-to-point connection to another router
-
2: Connection to a transit network
-
3: Connection to a stub network
-
4: Virtual link
75 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 75 define_attr :type, BinStruct::Int8 |
Instance Method Details
#to_human ⇒ String
Get human-readable description
91 92 93 |
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 91 def to_human "<type:#{type},metric:#{metric},id:#{id},data:#{data}>" end |