NAME

Net::Frame::Layer::IGMP - Internet Group Management Protocol layer object

SYNOPSIS

use Net::Frame::Simple;
use Net::Frame::Layer::IGMP qw(:consts);

my $layer = Net::Frame::Layer::IGMP->new(
   type         => NF_IGMP_TYPE_QUERY,
   maxResp      => 0,
   checksum     => 0,
   groupAddress => '0.0.0.0',
);

# v3 Report
my $layer = Net::Frame::Layer::IGMP->v3report(
   type         => NF_IGMP_TYPE_REPORTv3,
   maxResp      => 0,
   checksum     => 0,
   reserved     => 0,
   numGroupRecs => 0,
);

#
# Read a raw layer
#

my $layer = Net::Frame::Layer::IGMP->new(raw => $raw);

print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
   if $layer->payload;

DESCRIPTION

This modules implements the encoding and decoding of the IGMP layer.

RFC: ftp://ftp.rfc-editor.org/in-notes/rfc1112.txt

RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2236.txt

RFC: ftp://ftp.rfc-editor.org/in-notes/rfc3376.txt

See also Net::Frame::Layer for other attributes and methods.

ATTRIBUTES

type

IGMP message type. See CONSTANTS for more information.

maxResp

Max response time (version 2) or code (version 3). Unused in version 1.

checksum

Message checksum.

groupAddress

Multicast group address.

The following are inherited attributes. See Net::Frame::Layer for more information.

raw
payload
nextLayer

METHODS

new
new (hash)
v3query
v3query (hash)

Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for default values.

v3report
v3report (hash)

Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for default values.

computeChecksums

Computes the IGMP checksum.

getKey
getKeyReverse

These two methods are basically used to increase the speed when using recv method from Net::Frame::Simple. Usually, you write them when you need to write match method.

match (Net::Frame::Layer::IGMP object)

This method is mostly used internally. You pass a Net::Frame::Layer::IGMP layer as a parameter, and it returns true if this is a response corresponding for the request, or returns false if not.

The following are inherited methods. Some of them may be overriden in this layer, and some others may not be meaningful in this layer. See Net::Frame::Layer for more information.

layer
computeLengths
pack
unpack
encapsulate
getLength
getPayloadLength
print
dump

CONSTANTS

Load them: use Net::Frame::Layer::IGMP qw(:consts);

NF_IGMP_ALLIGMPRTRS_MAC

Default Layer 2 destination addresses.

NF_IGMP_ALLIGMPRTRS

Default Layer 3 destination addresses.

NF_IGMP_TYPE_QUERY
NF_IGMP_TYPE_DVMRP
NF_IGMP_TYPE_REPORTv1
NF_IGMP_TYPE_REPORTv2
NF_IGMP_TYPE_REPORTv3
NF_IGMP_TYPE_LEAVE

IGMP message types.

SEE ALSO

Net::Frame::Layer

AUTHOR

Michael Vincent

COPYRIGHT AND LICENSE

Copyright (c) 2013, Michael Vincent

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.