Class: PacketGen::Header::OSPFv3::LSR

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

Overview

This class handle LSA requests, as used in LSRequest payloads. The LSA request payload has the following format:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              0                |        LS Type                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Link State ID                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Advertising Router                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

It is composed of:

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

#advertising_routerString

The Router ID of the requested LSA.

Returns:

  • (String)


48
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 48

define_field :advertising_router, IP::Addr

This field identifies the portion of the internet environment that is being described by the LSA to request.

Returns:

  • (String)


44
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 44

define_field :link_state_id, IP::Addr

#reservedInteger

reserved field.

Returns:

  • (Integer)


35
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 35

define_field :reserved, Types::Int16, default: 0

#typeInteger

The type of the LSA to request.

Returns:

  • (Integer)


39
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 39

define_field :type, Types::Int16Enum, enum: LSAHeader::TYPES

Instance Method Details

#human_typeString

Get human-readable type

Returns:

  • (String)

Since:

  • 2.5.0



52
53
54
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 52

def human_type
  self[:type].to_human
end

#to_humanString

Returns:

  • (String)

Since:

  • 2.5.0



57
58
59
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 57

def to_human
  "LSR<#{human_type},#{link_state_id},#{advertising_router}>"
end