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

Inherits:
BinStruct::Struct
  • Object
show all
Includes:
BinStruct::Structable
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

Instance Attribute Details

#reservedInteger

8-bit reserved field.

Returns:

  • (Integer)


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

define_attr :reserved, BinStruct::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_attr :tos, BinStruct::Int8

#tos_metricInteger

16-bit TOS-specific metric information..

Returns:

  • (Integer)


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

define_attr :tos_metric, BinStruct::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