* #659 speed up Macsuck::Nodes while using $snmp->cisco_comm_indexing * Do not read qb_fw_vlan when using cisco_comm_indexing
This commit is contained in:
committed by
Christian Ramseyer
parent
2b666dd445
commit
884a75a866
@@ -80,6 +80,8 @@ sub get_communities {
|
|||||||
Takes an established L<SNMP::Info> instance and makes a fresh connection using
|
Takes an established L<SNMP::Info> instance and makes a fresh connection using
|
||||||
community indexing, with the given C<$vlan> ID. Works for all SNMP versions.
|
community indexing, with the given C<$vlan> ID. Works for all SNMP versions.
|
||||||
|
|
||||||
|
Inherits the C<vtp_version> from the previous L<SNMP::Info> instance.
|
||||||
|
|
||||||
Passing VLAN "C<0>" (zero) will reset the indexing to the basic v2 community
|
Passing VLAN "C<0>" (zero) will reset the indexing to the basic v2 community
|
||||||
or v3 empty context.
|
or v3 empty context.
|
||||||
|
|
||||||
@@ -88,6 +90,7 @@ or v3 empty context.
|
|||||||
sub snmp_comm_reindex {
|
sub snmp_comm_reindex {
|
||||||
my ($snmp, $device, $vlan) = @_;
|
my ($snmp, $device, $vlan) = @_;
|
||||||
my $ver = $snmp->snmp_ver;
|
my $ver = $snmp->snmp_ver;
|
||||||
|
my $vtp = $snmp->vtp_version;
|
||||||
|
|
||||||
if ($ver == 3) {
|
if ($ver == 3) {
|
||||||
my $prefix = '';
|
my $prefix = '';
|
||||||
@@ -122,6 +125,9 @@ sub snmp_comm_reindex {
|
|||||||
$vlan ? $snmp->update(Community => $comm . '@' . $vlan)
|
$vlan ? $snmp->update(Community => $comm . '@' . $vlan)
|
||||||
: $snmp->update(Community => $comm);
|
: $snmp->update(Community => $comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$snmp->cache({ _vtp_version => $vtp });
|
||||||
|
return $snmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
|||||||
@@ -274,7 +274,8 @@ sub walk_fwtable {
|
|||||||
|
|
||||||
my $fw_mac = $snmp->fw_mac;
|
my $fw_mac = $snmp->fw_mac;
|
||||||
my $fw_port = $snmp->fw_port;
|
my $fw_port = $snmp->fw_port;
|
||||||
my $fw_vlan = $snmp->qb_fw_vlan;
|
my $fw_vlan = ($snmp->can('cisco_comm_indexing') && $snmp->cisco_comm_indexing())
|
||||||
|
? {} : $snmp->qb_fw_vlan;
|
||||||
my $bp_index = $snmp->bp_index;
|
my $bp_index = $snmp->bp_index;
|
||||||
|
|
||||||
# to map forwarding table port to device port we have
|
# to map forwarding table port to device port we have
|
||||||
|
|||||||
Reference in New Issue
Block a user