Class: PacketGen::Header::MLDv2::MLQ
- Inherits:
-
PacketGen::Header::MLD
- Object
- Types::Fields
- Base
- PacketGen::Header::MLD
- PacketGen::Header::MLDv2::MLQ
- Defined in:
- lib/packetgen/header/mldv2/mlq.rb
Overview
This class supports MLDv2 Multicast Listener Query messages.
From RFC 3810, a MLDv2 Multicast Listener Query message has the following format:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 130 | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Maximum Response Code | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
* *
| |
* Multicast Address *
| |
* *
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Resv |S| QRV | QQIC | Number of Sources (N) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
* *
| |
* Source Address [1] *
| |
* *
| |
+- -+
| |
* *
| |
* Source Address [2] *
| |
* *
| |
+- . -+
. . .
. . .
+- -+
| |
* *
| |
* Source Address [N] *
| |
* *
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
type
, code
and checksum
are fields from ICMPv6 header.
MLQ fields are:
-
#flags (Types::Int8), with sub-fields:
-
a 4-bit #flag_resv field,
-
a 1-bit #flag_s boolean,
-
a 3-bit #flag_qrv field,
-
-
#qqic (Types::Int8),
-
and #source_addr, a IPv6::ArrayOfAddr.
Max Resp Delay
Max Resp Delay is the real delay value. Max Resp Code is the encoded delay. So #max_resp_delay and PacketGen::Header::MLD#max_resp_code attributes reflect this difference.
Instance Attribute Summary collapse
-
#flag_qrv ⇒ Integer
3-bit QRV (Querier’s Robustness Variable).
-
#flag_resv ⇒ Integer
4-bit reserved field in #flags.
-
#flag_s ⇒ Boolean
S Flag (Suppress Router-Side Processing).
-
#flags ⇒ Integer
8-bit flags.
-
#number_of_sources ⇒ Integer
16-bit number of sources.
-
#qqic ⇒ Integer
Get QQIC value.
-
#source_addr ⇒ IPv6::ArrayOfAddr
Array of IPv6 source addresses.
Attributes inherited from PacketGen::Header::MLD
Instance Method Summary collapse
-
#max_resp_delay ⇒ Integer
Getter for
max_resp_code
for MLDv2 packets. -
#max_resp_delay=(value) ⇒ Integer
Setter for
max_resp_code
for MLDv2 packets.
Methods inherited from PacketGen::Header::MLD
Methods inherited from Base
bind, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, #ll_header
Methods included from PacketGen::Headerable
#added_to_packet, included, #method_name, #packet, #packet=, #parse?, #protocol_name, #read
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::Header::Base
Instance Attribute Details
#flag_qrv ⇒ Integer
3-bit QRV (Querier’s Robustness Variable)
107 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 107 define_bit_fields_on :flags, :flag_resv, 4, :flag_s, :flag_qrv, 3 |
#flag_resv ⇒ Integer
4-bit reserved field in #flags
107 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 107 define_bit_fields_on :flags, :flag_resv, 4, :flag_s, :flag_qrv, 3 |
#flag_s ⇒ Boolean
S Flag (Suppress Router-Side Processing)
107 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 107 define_bit_fields_on :flags, :flag_resv, 4, :flag_s, :flag_qrv, 3 |
#flags ⇒ Integer
8-bit flags
83 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 83 define_field_before :body, :flags, Types::Int8 |
#number_of_sources ⇒ Integer
16-bit number of sources
91 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 91 define_field_before :body, :number_of_sources, Types::Int16 |
#qqic ⇒ Integer
May return a different value from value previously set, as a float encoding is used to encode big values. See IGMPv3.decode.
Get QQIC value
87 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 87 define_field_before :body, :qqic, Types::Int8 |
#source_addr ⇒ IPv6::ArrayOfAddr
Array of IPv6 source addresses
95 96 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 95 define_field_before :body, :source_addr, IPv6::ArrayOfAddr, builder: ->(h, t) { t.new(counter: h[:number_of_sources]) } |
Instance Method Details
#max_resp_delay ⇒ Integer
May return a different value from value previously set, as a float encoding is used to encode big values. See PacketGen::Header::MLDv2.decode.
Getter for max_resp_code
for MLDv2 packets. Use PacketGen::Header::MLDv2.decode.
113 114 115 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 113 def max_resp_delay MLDv2.decode(self[:max_resp_delay].to_i) end |
#max_resp_delay=(value) ⇒ Integer
Setter for max_resp_code
for MLDv2 packets. Use PacketGen::Header::MLDv2.encode.
121 122 123 |
# File 'lib/packetgen/header/mldv2/mlq.rb', line 121 def max_resp_delay=(value) self[:max_resp_delay].value = MLDv2.encode(value) end |