Class: PacketGen::Header::OSPFv2::Link

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

Overview

This class handles links in a 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

#dataIP::Addr

Returns:


64
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 64

define_field :data, IP::Addr

#idIP::Addr

Returns:


61
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 61

define_field :id, IP::Addr

#metricInteger

Returns:

  • (Integer)

73
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 73

define_field :metric, Types::Int16

#tosArrayOfTosMetric

Additionnal TOS metrics

Returns:


77
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 77

define_field :tos, ArrayOfTosMetric, builder: ->(h, t) { t.new(counter: h[:tos_count]) }

#tos_countInteger

Returns:

  • (Integer)

70
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 70

define_field :tos_count, Types::Int8

#typeInteger

Returns:

  • (Integer)

67
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 67

define_field :type, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0


80
81
82
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 80

def to_human
  "<type:#{type},metric:#{metric},id:#{id},data:#{data}>"
end