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)


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

define_bit_fields_on :u8, :e_flag, :tos, 7

#ext_route_tagInteger

Returns:

  • (Integer)


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

define_field :ext_route_tag, Types::Int32

#forwarding_addrIP::Addr

Returns:



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

define_field :forwarding_addr, IP::Addr

#metricInteger

Returns:

  • (Integer)


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

define_field :metric, Types::Int24

#tosInteger

Returns:

  • (Integer)


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

define_bit_fields_on :u8, :e_flag, :tos, 7

#u8Integer

Returns:

  • (Integer)


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

define_field :u8, Types::Int8

Instance Method Details

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0



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

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