Net::Frame::Layer::STP - Spanning Tree Protocol layer object


NAME

Net::Frame::Layer::STP - Spanning Tree Protocol layer object


SYNOPSIS

   use Net::Frame::Layer::STP qw(:consts);
   # Build a layer
   my $layer = Net::Packet::STP->new(
      protocolIdentifier        => NF_STP_PROTOCOL_IDENTIFIER_STP,
      protocolVersionIdentifier => 0,
      bpduType                  => 0x00,
      bpduFlags                 => 0x00,
      rootIdentifier            => '1/00:11:22:33:44:55',
      rootPathCost              => 1,
      bridgeIdentifier          => '2/11:22:33:44:55:66',
      portIdentifier            => 0x0001,
      messageAge                => 1,
      maxAge                    => 10,
      helloTime                 => 1,
      forwardDelay              => 10,
   );
   $layer->pack;
   print 'RAW: '.$layer->dump."\n";
   # Read a raw layer
   my $layer = Net::Frame::Layer::STP->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 Spanning Tree Protocol layer.

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


ATTRIBUTES

protocolIdentifier - 16 bits
protocolVersionIdentifier - 8 bits
bpduType - 8 bits
bpduFlags - 8 bits
rootIdentifier - 64 bits (16 + 56)
rootPathCost - 32 bits
bridgeIdentifier - 64 bits (16 + 56)
portIdentifier - 16 bits
messageAge - 16 bits
maxAge - 16 bits
helloTime - 16 bits
forwardDelay - 16 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
print
dump


CONSTANTS

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

NF_STP_HDR_LEN
STP header length.

NF_STP_PROTOCOL_IDENTIFIER_STP
Various supported STP protocol identifiers.


SEE ALSO

the Net::Frame::Layer manpage


AUTHOR

Patrice <GomoR> Auffret


COPYRIGHT AND LICENSE

Copyright (c) 2006-2015, Patrice <GomoR> Auffret

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

 Net::Frame::Layer::STP - Spanning Tree Protocol layer object