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


Net-Frame-Layer-STP documentation  | view source Contained in the Net-Frame-Layer-STP distribution.

Index


NAME

Top

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

SYNOPSIS

Top

   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

Top

This modules implements the encoding and decoding of the Spanning Tree Protocol layer.

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

ATTRIBUTES

Top

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

Top

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

Top

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

Top

Net::Frame::Layer

AUTHOR

Top

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Top


Net-Frame-Layer-STP documentation  | view source Contained in the Net-Frame-Layer-STP distribution.