NAME
Net::Frame::Layer::OSPF - Open Shortest Path First layer object
SYNOPSIS
use Net::Frame::Layer::OSPF qw(:consts);
# 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_AUTHTYPE_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.
- match (Net::Frame::Layer::OSPF object)
-
This method is mostly used internally. You pass a Net::Frame::Layer::OSPF 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
- computeChecksums
- pack
- unpack
- encapsulate
- getLength
- getPayloadLength
- dump
CONSTANTS
Load them: use Net::Frame::Layer::OSPF qw(:consts);
- NF_OSPF_HDR_LEN
- NF_OSPF_LSA_HDR_LEN
-
Various OSPF layer types header length.
- NF_OSPF_AUTHTYPE_NULL
- NF_OSPF_AUTHTYPE_SIMPLE
- NF_OSPF_AUTHTYPE_CRYPTO
-
Supported OSPF authentication schemes.
- NF_OSPF_TYPE_HELLO
- NF_OSPF_TYPE_DATABASEDESC
- NF_OSPF_TYPE_LINKSTATEREQUEST
- NF_OSPF_TYPE_LINKSTATEUPDATE
- NF_OSPF_TYPE_LINKSTATEACK
-
Supported OSPF message types.
- NF_OSPF_LSTYPE_ROUTER
- NF_OSPF_LSTYPE_NETWORK
- NF_OSPF_LSTYPE_SUMMARYIP
- NF_OSPF_LSTYPE_SUMMARYASBR
- NF_OSPF_LSTYPE_ASEXTERNAL
- NF_OSPF_LSTYPE_OPAQUELINKLOCAL
- NF_OSPF_LSTYPE_OPAQUEAREALOCAL
- NF_OSPF_LSTYPE_OPAQUEDOMAIN
-
Supported OSPF LinkState types.
- NF_OSPF_HELLO_OPTIONS_UNK
- NF_OSPF_HELLO_OPTIONS_E
- NF_OSPF_HELLO_OPTIONS_MC
- NF_OSPF_HELLO_OPTIONS_NP
- NF_OSPF_HELLO_OPTIONS_EA
- NF_OSPF_HELLO_OPTIONS_DC
- NF_OSPF_HELLO_OPTIONS_O
- NF_OSPF_HELLO_OPTIONS_DN
-
OSPF Hello header options flags.
- NF_OSPF_DATABASEDESC_OPTIONS_DN
- NF_OSPF_DATABASEDESC_OPTIONS_0
- NF_OSPF_DATABASEDESC_OPTIONS_DC
- NF_OSPF_DATABASEDESC_OPTIONS_L
- NF_OSPF_DATABASEDESC_OPTIONS_NP
- NF_OSPF_DATABASEDESC_OPTIONS_MC
- NF_OSPF_DATABASEDESC_OPTIONS_E
-
OSPF DatabaseDesc header options flags.
- NF_OSPF_DATABASEDESC_FLAGS_MS
- NF_OSPF_DATABASEDESC_FLAGS_M
- NF_OSPF_DATABASEDESC_FLAGS_I
-
OSPF DatabaseDesc header flags.
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.