Class: PacketGen::Header::MLDv2::MLR

Inherits:
Base show all
Defined in:
lib/packetgen/header/mldv2/mlr.rb

Overview

This class supports MLDv2 Multicast Listener Report messages.

From RFC 3810, a MLDv2 Multicast Listener Report message 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Type = 143   |    Reserved   |           Checksum            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Reserved            |Nr of Mcast Address Records (M)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                  Multicast Address Record [1]                 .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               .                               |
.                               .                               .
|                               .                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                  Multicast Address Record [M]                 .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

type, code and checksum are fields from ICMPv6 header.

MLR 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

#number_of_marInteger

16-bit Number of group records in #records

Returns:

  • (Integer)

55
# File 'lib/packetgen/header/mldv2/mlr.rb', line 55

define_field :number_of_mar, Types::Int16, default: 0

#recordsMcastAddressRecords

Array of Mcast Address Records

Returns:


60
61
# File 'lib/packetgen/header/mldv2/mlr.rb', line 60

define_field :records, McastAddressRecords,
builder: ->(h, t) { t.new(counter: h[:number_of_mar]) }

#reservedObject

16-bit reserved field


51
# File 'lib/packetgen/header/mldv2/mlr.rb', line 51

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