From c97dc06177d69dfd0e842c583e94fb2c849dbf15 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Tue, 11 Nov 2014 22:02:07 -0500 Subject: [PATCH] Add stp_i_time(), stp_i_ntop(), stp_i_root(), stp_i_root_port(), stp_i_priority() methods which return a hash reference to ease API compatibility with MST and PVST implementations indexed by a spanning tree instance id. --- Info/Bridge.pm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Info/Bridge.pm b/Info/Bridge.pm index e2aae8d4..1330c091 100644 --- a/Info/Bridge.pm +++ b/Info/Bridge.pm @@ -84,6 +84,16 @@ $VERSION = '3.20'; 'bs_to' => 'dot1dStaticAllowedToGoTo', 'bs_status' => 'dot1dStaticStatus', + # These leafs are not part of a table, but placed here + # to return a hash reference to ease API compatibility with + # MST and PVST implementations indexed by a spanning tree + # instance id + 'stp_i_time' => 'dot1dStpTimeSinceTopologyChange', + 'stp_i_ntop' => 'dot1dStpTopChanges', + 'stp_i_root' => 'dot1dStpDesignatedRoot', + 'stp_i_root_port' => 'dot1dStpRootPort', + 'stp_i_priority' => 'dot1dStpPriority', + # Spanning Tree Protocol Table : dot1dStpPortTable 'stp_p_id' => 'dot1dStpPort', 'stp_p_priority' => 'dot1dStpPortPriority', @@ -126,6 +136,7 @@ $VERSION = '3.20'; 'fw_mac' => \&SNMP::Info::munge_mac, 'bs_mac' => \&SNMP::Info::munge_mac, 'stp_root' => \&SNMP::Info::munge_prio_mac, + 'stp_i_root' => \&SNMP::Info::munge_prio_mac, 'stp_p_root' => \&SNMP::Info::munge_prio_mac, 'stp_p_bridge' => \&SNMP::Info::munge_prio_mac, 'stp_p_port' => \&SNMP::Info::munge_prio_port, @@ -758,6 +769,48 @@ to this port. =back +=head2 Spanning Tree Instance Globals + +These are not part of a table, but return a hash reference to ease API +compatibility with MST and PVST implementations indexed by a spanning tree +instance id. + +=over + +=item $bridge->stp_i_time() + +Returns time since last topology change detected. (100ths/second) + +(C) + +=item $bridge->stp_i_time() + +Returns the total number of topology changes detected. + +(C) + +=item $bridge->stp_i_root() + +Returns root of STP. + +(C) + +=item $bridge->stp_i_root_port() + +Returns the port number of the port that offers the lowest cost path +to the root bridge. + +(C) + +=item $bridge->stp_i_priority() + +Returns the port number of the port that offers the lowest cost path +to the root bridge. + +(C) + +=back + =head2 Spanning Tree Protocol Table (C) Descriptions are straight from F