NAME

Net::Frame::Layer::VRRP - Virtual Router Redundancy Protocol layer object

SYNOPSIS

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

my $layer = Net::Frame::Layer::VRRP->new(
   version     => NF_VRRP_VERSION,
   type        => NF_VRRP_TYPE_ADVERT,
   vrId        => 1,
   priority    => NF_VRRP_PRIORITY_DEFAULT,
   countIp     => 1,
   authType    => NF_VRRP_AUTH_NO,
   interval    => 1,
   checksum    => 0,
   ipAddresses => ['127.0.0.1'],
   authentication => '',
);

#
# Read a raw layer
#

my $layer = Net::Frame::Layer::VRRP->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 VRRP layer.

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

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

ATTRIBUTES

version

VRRP protocol version. See CONSTANTS for more information.

type

VRRP type. See CONSTANTS for more information.

vrId

VRRP ID.

priority

VRRP router priority. Higher values equal higher priority. See CONSTANTS for more information.

countIp

The number of IP addresses contained in this VRRP advertisement.

authType

The authentication method being utilized.

interval

Time interval in seconds between advertisements.

checksum

16-bit one's complement of the one's complement sum of the entire VRRP message starting with the version field. For computing the checksum, the checksum field is cleared to zero.

ipAddresses

One or more IP addresses that are associated with the virtual router.

authentication

Upto 8 characters of plain text zero-padded.

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

raw
payload
nextLayer

METHODS

new
new (hash)

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

computeChecksums

Computes the VRRP checksum.

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::VRRP qw(:consts);

NF_VRRP_ALLVRRPRTRS_MAC

Default Layer 2 destination addresses.

NF_VRRP_ALLVRRPRTRS

Default Layer 3 destination addresses.

NF_VRRP_VERSION

VRRP version.

NF_VRRP_TYPE_ADVERT

VRRP type.

NF_VRRP_PRIORITY_OWNER
NF_VRRP_PRIORITY_DEFAULT
NF_VRRP_PRIORITY_NOMASTER

VRRP priorities.

NF_VRRP_AUTH_NO
NF_VRRP_AUTH_TEXT
NF_VRRP_AUTH_AH

VRRP authentication types.

SEE ALSO

Net::Frame::Layer

AUTHOR

Michael Vincent

COPYRIGHT AND LICENSE

Copyright (c) 2016, Michael Vincent

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