#12 add Cisco PortFast support via CiscoStpExtensions::i_faststart_enabled
This commit is contained in:
4
Changes
4
Changes
@@ -1,5 +1,9 @@
|
|||||||
Version 3.53 ()
|
Version 3.53 ()
|
||||||
|
|
||||||
|
[NEW FEATURES]
|
||||||
|
|
||||||
|
* #12 add Cisco PortFast support via CiscoStpExtensions::i_faststart_enabled
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
* Report serial/version on Netgear FSM (paecker)
|
* Report serial/version on Netgear FSM (paecker)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ $VERSION = '3.52';
|
|||||||
%MIBS = (
|
%MIBS = (
|
||||||
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||||
'Q-BRIDGE-MIB' => 'dot1qPvid',
|
'Q-BRIDGE-MIB' => 'dot1qPvid',
|
||||||
|
'RSTP-MIB' => 'dot1dStpPortOperEdgePort',
|
||||||
);
|
);
|
||||||
|
|
||||||
%GLOBALS = (
|
%GLOBALS = (
|
||||||
@@ -104,6 +105,10 @@ $VERSION = '3.52';
|
|||||||
'stp_p_bridge' => 'dot1dStpPortDesignatedBridge',
|
'stp_p_bridge' => 'dot1dStpPortDesignatedBridge',
|
||||||
'stp_p_port' => 'dot1dStpPortDesignatedPort',
|
'stp_p_port' => 'dot1dStpPortDesignatedPort',
|
||||||
|
|
||||||
|
# Rapid Spanning Tree Protocol Table : dot1dStpExtPortEntry
|
||||||
|
'is_edgeport_admin' => 'dot1dStpPortAdminEdgePort',
|
||||||
|
'is_edgeport_oper' => 'dot1dStpPortOperEdgePort',
|
||||||
|
|
||||||
# Q-BRIDGE-MIB : dot1qPortVlanTable
|
# Q-BRIDGE-MIB : dot1qPortVlanTable
|
||||||
'qb_i_vlan' => 'dot1qPvid',
|
'qb_i_vlan' => 'dot1qPvid',
|
||||||
'qb_i_vlan_type' => 'dot1qPortAcceptableFrameTypes',
|
'qb_i_vlan_type' => 'dot1qPortAcceptableFrameTypes',
|
||||||
|
|||||||
@@ -54,12 +54,15 @@ $VERSION = '3.52';
|
|||||||
'stpx_stp_type' => 'stpxSpanningTreeType',
|
'stpx_stp_type' => 'stpxSpanningTreeType',
|
||||||
'stpx_bpduguard_enable' => 'stpxFastStartBpduGuardEnable',
|
'stpx_bpduguard_enable' => 'stpxFastStartBpduGuardEnable',
|
||||||
'stpx_bpdufilter_enable' => 'stpxFastStartBpduFilterEnable',
|
'stpx_bpdufilter_enable' => 'stpxFastStartBpduFilterEnable',
|
||||||
|
'stpx_faststart_default' => 'stpxFastStartGlobalDefaultMode',
|
||||||
);
|
);
|
||||||
|
|
||||||
%FUNCS = (
|
%FUNCS = (
|
||||||
%SNMP::Info::Bridge::FUNCS,
|
%SNMP::Info::Bridge::FUNCS,
|
||||||
'stpx_rootguard_enabled' => 'stpxRootGuardConfigEnabled',
|
'stpx_rootguard_enabled' => 'stpxRootGuardConfigEnabled',
|
||||||
'stpx_loopguard_enabled' => 'stpxLoopGuardConfigEnabled',
|
'stpx_loopguard_enabled' => 'stpxLoopGuardConfigEnabled',
|
||||||
|
'stpx_faststart_enabled' => 'stpxFastStartPortEnable',
|
||||||
|
'stpx_faststart_operational' => 'stpxFastStartPortMode',
|
||||||
'stpx_port_bpduguard_mode' => 'stpxFastStartPortBpduGuardMode',
|
'stpx_port_bpduguard_mode' => 'stpxFastStartPortBpduGuardMode',
|
||||||
'stpx_port_bpdufilter_mode' => 'stpxFastStartPortBpduFilterMode',
|
'stpx_port_bpdufilter_mode' => 'stpxFastStartPortBpduFilterMode',
|
||||||
'stpx_smst_root' => 'stpxSMSTInstanceCISTRegionalRoot',
|
'stpx_smst_root' => 'stpxSMSTInstanceCISTRegionalRoot',
|
||||||
@@ -69,7 +72,7 @@ $VERSION = '3.52';
|
|||||||
|
|
||||||
%MUNGE = (
|
%MUNGE = (
|
||||||
%SNMP::Info::Bridge::MUNGE,
|
%SNMP::Info::Bridge::MUNGE,
|
||||||
'stpx_mst_config_digest' => \&SNMP::Info::CiscoStpExtensions::oct2str,
|
'stpx_mst_config_digest' => \&SNMP::Info::CiscoStpExtensions::oct2str,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -225,6 +228,36 @@ sub i_bpdufilter_enabled {
|
|||||||
return \%res;
|
return \%res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub i_faststart_enabled {
|
||||||
|
my $self = shift;
|
||||||
|
my $partial = shift;
|
||||||
|
|
||||||
|
my $faststart_default = $self->stpx_faststart_default();
|
||||||
|
my $bp_index = $self->bp_index($partial);
|
||||||
|
my $faststart = $self->stpx_faststart_enabled();
|
||||||
|
my $faststart_oper = $self->stpx_faststart_operational();
|
||||||
|
|
||||||
|
my %res;
|
||||||
|
# stpxFastStartPortEnable is deprecated in favour of stpxFastStartPortMode
|
||||||
|
# see https://github.com/netdisco/netdisco/issues/12
|
||||||
|
foreach my $index ( keys %$faststart, keys %$faststart_oper ){
|
||||||
|
my $mode = $faststart_oper->{$index} || $faststart->{$index};
|
||||||
|
my $iid = $bp_index->{$index};
|
||||||
|
next unless defined $iid;
|
||||||
|
next unless defined $mode;
|
||||||
|
if ( $mode eq 'default' ){
|
||||||
|
$res{$iid} = $faststart_default;
|
||||||
|
}else{
|
||||||
|
$res{$iid} = $mode;
|
||||||
|
}
|
||||||
|
$res{$iid} = 'enable' if $res{$iid} eq 'true';
|
||||||
|
$res{$iid} = 'disable' if $res{$iid} eq 'false';
|
||||||
|
$res{$iid} = 1 if $res{$iid} =~ m/enable/i; # enableForTrunk
|
||||||
|
$res{$iid} = 0 if $res{$iid} eq 'disable';
|
||||||
|
}
|
||||||
|
return \%res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub oct2str {
|
sub oct2str {
|
||||||
my ($v) = @_;
|
my ($v) = @_;
|
||||||
@@ -340,6 +373,13 @@ Format is a hash reference with key = C<ifIndex>, value = [1|0]
|
|||||||
|
|
||||||
(C<stpxFastStartBpduFilterEnable>)
|
(C<stpxFastStartBpduFilterEnable>)
|
||||||
|
|
||||||
|
=item $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 = C<ifIndex>, value = [1|0]
|
||||||
|
|
||||||
|
(C<stpxFastStartPortEnable> and C<stpxFastStartPortMode>)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=head1 MUNGES
|
=head1 MUNGES
|
||||||
|
|||||||
Reference in New Issue
Block a user