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)

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

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

#tosInteger

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

Returns:

  • (Integer)

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

define_field :tos, Types::Int8

#tos_metricInteger

16-bit TOS-specific metric information..

Returns:

  • (Integer)

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

define_field :tos_metric, Types::Int16

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0


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

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