Class: PacketGen::Header::OSPFv2::External

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

Overview

This class handles external links in LSA AS-External payloads.

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

#e_flagBoolean

Returns:

  • (Boolean)

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

define_bit_fields_on :u8, :e_flag, :tos, 7

#ext_route_tagInteger

Returns:

  • (Integer)

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

define_field :ext_route_tag, Types::Int32

#forwarding_addrIP::Addr

Returns:


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

define_field :forwarding_addr, IP::Addr

#metricInteger

Returns:

  • (Integer)

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

define_field :metric, Types::Int24

#tosInteger

Returns:

  • (Integer)

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

define_bit_fields_on :u8, :e_flag, :tos, 7

#u8Integer

Returns:

  • (Integer)

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

define_field :u8, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0


165
166
167
# File 'lib/packetgen/header/ospfv2/lsa.rb', line 165

def to_human
  "<type:#{e_flag? ? 2 : 1},tos:#{tos},metric:#{metric},fwaddr:#{forwarding_addr},tag:#{ext_route_tag}>"
end