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:



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

define_field :data, IP::Addr

#idIP::Addr

Returns:



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

define_field :id, IP::Addr

#metricInteger

Returns:

  • (Integer)


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

define_field :metric, Types::Int16

#tosArrayOfTosMetric

Additionnal TOS metrics

Returns:



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

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

#tos_countInteger

Returns:

  • (Integer)


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

define_field :tos_count, Types::Int8

#typeInteger

Returns:

  • (Integer)


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

define_field :type, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0



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

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