GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Packet::STP(3) User Contributed Perl Documentation Net::Packet::STP(3)

Net::Packet::STP - Spanning Tree Protocol layer 4 object

   use Net::Packet::Consts qw(:stp);
   require Net::Packet::STP;

   # Build a layer
   my $layer = Net::Packet::STP->new(
      protocolIdentifier        => NP_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: '.unpack('H*', $layer->raw)."\n";

   # Read a raw layer
   my $layer = Net::Packet::STP->new(raw => $raw);

   print $layer->print."\n";
   print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
      if $layer->payload;

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

See also Net::Packet::Layer and Net::Packet::Layer4 for other attributes and methods.

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

new
Object constructor. You can pass attributes that will overwrite default ones. Default values:

protocolIdentifier: NP_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

pack
Packs all attributes into a raw format, in order to inject to network. Returns 1 on success, undef otherwise.
unpack
Unpacks raw data from network and stores attributes into the object. Returns 1 on success, undef otherwise.

Load them: use Net::Packet::Consts qw(:stp);
NP_STP_HDR_LEN
STP header length.
NP_STP_PROTOCOL_IDENTIFIER_STP
Various supported STP protocol identifiers.

Patrice <GomoR> Auffret

Copyright (c) 2004-2009, Patrice <GomoR> Auffret

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

NetPacket, Net::RawIP, Net::RawSock
2009-11-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.