Class: PacketGen::Header::IGMPv3::MQ

Inherits:
Base show all
Defined in:
lib/packetgen/header/igmpv3/mq.rb

Overview

IGMPv3 Membership Query.

This is a subpayload for IGMPv3 packets only. This kind of payload is sent by IP multicast routers to query the multicast reception state of neighboring interfaces. Queries has 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Group Address                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Resv  |S| QRV |     QQIC      |     Number of Sources (N)     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Source Address [1]                      |
+-                                                             -+
|                       Source Address [2]                      |
+-                              .                              -+
.                               .                               .
.                               .                               .
+-                                                             -+
|                       Source Address [N]                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields are:

Author:

  • Sylvain Daubert

Since:

  • 2.4.0

Instance Attribute Summary collapse

Method Summary

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_sBoolean

1-bit S flag (Suppress Router-Side Processing)

Returns:

  • (Boolean)

75
# File 'lib/packetgen/header/igmpv3/mq.rb', line 75

define_bit_fields_on :u8, :resv, 4, :flag_s, :qrv, 3

#group_addrIP::Addr

IP Group address

Returns:


46
# File 'lib/packetgen/header/igmpv3/mq.rb', line 46

define_field :group_addr, IP::Addr, default: '0.0.0.0'

#number_of_sourcesInteger

16-bit Number of Sources in #source_addr

Returns:

  • (Integer)

58
# File 'lib/packetgen/header/igmpv3/mq.rb', line 58

define_field :number_of_sources, Types::Int16

#qqicInteger

Note:

May return a different value from value previously set, as a float encoding is used to encode big values. See PacketGen::Header::IGMPv3.decode.

Get QQIC value

Returns:

  • (Integer)

Since:

  • 2.4.0


54
# File 'lib/packetgen/header/igmpv3/mq.rb', line 54

define_field :qqic, Types::Int8

#qrvInteger

3-bit Querier's Robustness Variable

Returns:

  • (Integer)

75
# File 'lib/packetgen/header/igmpv3/mq.rb', line 75

define_bit_fields_on :u8, :resv, 4, :flag_s, :qrv, 3

#resvInteger

4-bit reserved field in

Returns:

  • (Integer)

75
# File 'lib/packetgen/header/igmpv3/mq.rb', line 75

define_bit_fields_on :u8, :resv, 4, :flag_s, :qrv, 3

#source_addrIP::ArrayOfAddr

Array of IP source addresses

Returns:


63
64
# File 'lib/packetgen/header/igmpv3/mq.rb', line 63

define_field :source_addr, IP::ArrayOfAddr,
builder: ->(h, t) { t.new(counter: h[:number_of_sources]) }

#u8Integer

First 8-bit field, composed of #resv, #flag_s and #qrv

Returns:

  • (Integer)

50
# File 'lib/packetgen/header/igmpv3/mq.rb', line 50

define_field :u8, Types::Int8