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

Inherits:
Base
  • Object
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]                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Struct 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, #to_s

Constructor Details

This class inherits a constructor from PacketGen::Header::Base

Instance Attribute Details

#flag_sInteger

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

Returns:

  • (Integer)


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

define_bit_attr :u8, resv: 4, flag_s: 1, qrv: 3

#group_addrIP::Addr

IP Group address

Returns:



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

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

#number_of_sourcesInteger

16-bit Number of Sources in #source_addr

Returns:

  • (Integer)


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

define_attr :number_of_sources, BinStruct::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



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

define_attr :qqic, BinStruct::Int8

#qrvInteger

3-bit Querier’s Robustness Variable

Returns:

  • (Integer)


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

define_bit_attr :u8, resv: 4, flag_s: 1, qrv: 3

#resvInteger

4-bit reserved field

Returns:

  • (Integer)


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

define_bit_attr :u8, resv: 4, flag_s: 1, qrv: 3

#source_addrIP::ArrayOfAddr

Array of IP source addresses

Returns:



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

define_attr :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)


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

define_bit_attr :u8, resv: 4, flag_s: 1, qrv: 3