Class: PacketGen::Header::OSPFv2::TosMetric

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

Overview

This class handles TOS metrics for 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

#reservedInteger

8-bit reserved field.

Returns:

  • (Integer)


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

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

#tosInteger

8-bit IP Type of Service that this metric refers to.

Returns:

  • (Integer)


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

define_field :tos, Types::Int8

#tos_metricInteger

16-bit TOS-specific metric information..

Returns:

  • (Integer)


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

define_field :tos_metric, Types::Int16

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0



43
44
45
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 43

def to_human
  "TOS<type:#{type},metric:#{tos_metric}>"
end