NAME
SNMP::Info::CiscoStpExtensions - SNMP Interface to CISCO-STP-EXTENSIONS-MIB
AUTHOR
Carlos Vicente
SYNOPSIS
my $stpx = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $stpx->class();
print " Using device sub class : $class\n";
DESCRIPTION
Create or use a subclass of SNMP::Info that inherits this class. Do not use directly.
For debugging you can call new() directly as you would in SNMP::Info
my $stpx = new SNMP::Info::CiscoStpExtensions(...);
In the default context, i_stp_state() reports VLAN 1's tree under PVST+ and Rapid-PVST+, with rows for VLAN 1's member ports only. Under MST the BRIDGE-MIB globals are the CIST's and the port rows are again VLAN 1's member ports.
Inherited Classes
Required MIBs
GLOBALS
These are methods that return scalar values from SNMP
- $stpx->stp_ver()
-
Returns the particular STP version running on this device. Meant to override SNMP::Info::Brigde::stp_ver()
Values:
pvstPlus,mistp,mistpPvstPlus,mst,rapidPvstPlus(
stpxSpanningTreeType) - $stpx->hasPVST()
-
Returns 1 when
stpxSpanningTreeTypeispvstPlus. - $stpx->hasRapidPVST()
-
Returns 1 when
stpxSpanningTreeTypeisrapidPvstPlus. - $stpx->hasMSTP()
-
Returns 1 when
stpxSpanningTreeTypeismst. The MST region and its instances are served under every mode, so they are not the test. - $stpx->context_kinds($feature)
-
See "context_kinds" in SNMP::Info. Returns
['vlan']forstp: each VLAN's tree is served in that VLAN's context. - $stpx->snmp_context($kind, $id)
-
See "snmp_context" in SNMP::Info. A
vlancontext is reached as the community suffix@Nunder SNMPv2c and the contextvlan-Nunder SNMPv3. Nomstcontext is served.
TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash.
- $stpx->mst_config_digest()
-
Returns the Multiple Spanning Tree (MST) configuration digest
(
stpxSMSTConfigDigest) - $stpx->mst_region_name()
-
Returns the Multiple Spanning Tree (MST) region name
(
stpxMSTRegionName) - $stpx->mst_region_rev()
-
Returns the Multiple Spanning Tree (MST) region name
(
stpxSMSTRegionRevision) - $stpx->mst_vlan2instance()
-
Returns the mapping of vlan to MST instance in the form of a hash reference with key = VLAN id, value = STP instance
- $stpx->i_rootguard_enabled()
-
Returns 1 or 0 depending on whether
RootGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxRootGuardConfigEnabled) - $stpx->i_loopguard_enabled()
-
Returns 1 or 0 depending on whether
LoopGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxLoopGuardConfigEnabled) - $stpx->i_bpduguard_enabled()
-
Returns 1 or 0 depending on whether
BpduGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartPortBpduGuardMode) - $stpx->i_bpdufilter_enabled()
-
Returns 1 or 0 depending on whether
BpduFilteris enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartBpduFilterEnable) - $stpx->i_faststart_enabled()
-
Returns 1 or 0 depending on whether FastStart (aka PortFast) is enabled on a given port. Format is a hash reference with key =
ifIndex, value = [1|0](
stpxFastStartPortEnableandstpxFastStartPortMode)
Spanning Tree Trees
These override "Spanning Tree Trees" in SNMP::Info::Bridge; records are as described there. The tree list, protocol, port roles and MST VLAN map are served in the default context; each tree's port states and designated bridge and port are served in BRIDGE-MIB in the tree's own context. To switch contexts, see "SNMP Contexts" in SNMP::Info.
Trees are keyed vlan.N (one per VLAN under PVST+ and Rapid-PVST+, with vlan the VLAN id), cist.0 and msti.N under MST. Each record's contexts lists where to read its ports: VLAN 1's tree is the default context's; an MSTI is read through the context of any VLAN mapped to it, and every such VLAN is listed. bridge is undef: IOS serves a placeholder dot1dBaseBridgeAddress, not the bridge address. root is set only where the default context serves it (vlan.1, cist.0); read stp_root() in a tree's context for the others. On IOS the CIST's trunk ports are served in no context, so cist.0 has ports_complete 0.
- $stpx->stp_protocols()
-
Returns reference to an array holding
pvst,rapid-pvstormstpfromstpxSpanningTreeType, or nothing (including under MISTP). - $stpx->stp_trees()
-
Returns reference to hash of tree records. Under PVST+ and Rapid-PVST+ the VLANs come from the index of (
stpxFastStartOperModeTable) and (stpxRSTPPortRoleTable), or, where neither serves a row, from (stpxPVSTVlanEnable), keeping only VLANs whosevtpVlanTypeisethernetwhere VTP is served. Under MST the instances come from (stpxSMSTInstanceTable). - $stpx->stp_trees_complete()
-
Returns 1 when trees were read, 0 otherwise.
- $stpx->stp_vlan_map()
-
Returns reference to hash mapping each VLAN 1 to 4094 to its tree key under MST, from (
stpxSMSTInstanceVlansMapped1k2k) and (stpxSMSTInstanceVlansMapped3k4k), as served; nothing under PVST+ and Rapid-PVST+, where each VLAN is its own tree. - $stpx->stp_tree_ports($tree_key)
-
Returns reference to hash of port records keyed by ifIndex, read in the session's current context: states and designated bridge and port from BRIDGE-MIB, and
role(stpxRSTPPortRoleValuenormalized bymunge_stpx_port_role(), undef for a label it does not know) androle_raw(as served) from (stpxRSTPPortRoleTable) where the context serves it. IOL-L2 serves no role in a VLAN context, and PVST+ serves no role anywhere. Rows are labeled from$tree_key, never from the context string.Call it in the default context for a tree whose
contextsincludekindnone, or in one of the tree's own contexts. In the default context it refuses, witherror()naming the contexts, a tree that is read elsewhere; in another context it cannot check the key against the list, and rows read in a context the tree does not list describe another tree. - $stpx->stpx_pvst_vlan_enable()
-
(
stpxPVSTVlanEnable) - $stpx->stpx_faststart_oper()
-
(
stpxFastStartOperMode) - $stpx->stpx_rstp_port_role()
-
(
stpxRSTPPortRoleValue)