NAME
Net::Frame::Layer::OSPF - Open Shortest Path First layer object
SYNOPSIS
use Net::Packet::Consts qw(:ospf);
require Net::Packet::OSPF;
# Build a layer
my $layer = Net::Frame::Layer::OSPF->new(
version => 2,
type => 0,
length => NF_OSPF_HDR_LEN,
routerId => '127.0.0.1',
areaId => '127.0.0.1',
checksum => 0,
authType => NF_OSPF_AUTH_TYPE_NULL,
authData => "0000000000000000",
);
$layer->pack;
print 'RAW: '.$layer->dump."\n";
# Read a raw layer
my $layer = Net::Frame::Layer::OSPF->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 Open Shortest Path First layer.
RFC: http://www.rfc-editor.org/rfc/rfc2328.txt
RFC: http://www.rfc-editor.org/rfc/rfc2370.txt
See also Net::Frame::Layer for other attributes and methods.
ATTRIBUTES
- version - 8 bits
- type - 8 bits
- length - 16 bits
- routerId - 32 bits
- areaId - 32 bits
- checksum - 16 bits
- authType - 16 bits
- authData - 64 bits
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.
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
- computeChecksums
- pack
- unpack
- encapsulate
- getLength
- getPayloadLength
- dump
CONSTANTS
Load them: use Net::Frame::Layer::OSPF qw(:consts);
- NF_OSPF_HDR_LEN
-
OSPF header length.
- NF_OSPF_AUTH_TYPE_NULL
-
Various supported OSPF authentication types.
- NF_OSPF_TYPE_HELLO
- NF_OSPF_TYPE_DATABASEDESC
- NF_OSPF_TYPE_LINKSTATEREQUEST
- NF_OSPF_TYPE_LINKSTATEUPDATE
- NF_OSPF_TYPE_LINKSTATEACK
-
Various supported OSPF packet types.
SEE ALSO
AUTHOR
Patrice <GomoR> Auffret
COPYRIGHT AND LICENSE
Copyright (c) 2006-2007, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.