Class: PacketGen::Header::OSPFv3::LSR
- Inherits:
-
Types::Fields
- Object
- Types::Fields
- PacketGen::Header::OSPFv3::LSR
- 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:
-
a 16-bit #reserved field,
-
a 16-bit #type field,
-
a 32-bit #link_state_id field,
-
and a 32-bit #advertising_router field.
Instance Attribute Summary collapse
-
#advertising_router ⇒ String
The Router ID of the requested LSA.
-
#link_state_id ⇒ String
This field identifies the portion of the internet environment that is being described by the LSA to request.
-
#reserved ⇒ Integer
reserved field.
-
#type ⇒ Integer
The type of the LSA to request.
Instance Method Summary collapse
-
#human_type ⇒ String
Get human-readable type.
- #to_human ⇒ String
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_router ⇒ String
The Router ID of the requested LSA.
49 |
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 49 define_field :advertising_router, IP::Addr |
#link_state_id ⇒ String
This field identifies the portion of the internet environment that is being described by the LSA to request.
45 |
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 45 define_field :link_state_id, IP::Addr |
Instance Method Details
#human_type ⇒ String
Get human-readable type
53 54 55 |
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 53 def human_type self[:type].to_human end |
#to_human ⇒ String
58 59 60 |
# File 'lib/packetgen/header/ospfv3/ls_request.rb', line 58 def to_human "LSR<#{human_type},#{link_state_id},#{advertising_router}>" end |