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;
See also Net::Packet::Layer and Net::Packet::Layer4 for other attributes and methods.
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
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.