Get i_vlan from Layer3 Cisco from the sub-interface ID.

This commit is contained in:
Bill Fenner
2007-07-18 16:39:11 +00:00
parent 98ceee3212
commit 123dc84f05

View File

@@ -99,6 +99,24 @@ $VERSION = '1.05';
'eigrp_peers' => \&SNMP::Info::munge_ip, 'eigrp_peers' => \&SNMP::Info::munge_ip,
); );
sub i_vlan {
my ($cisco) = shift;
my ($partial) = shift;
my ($i_type) = $cisco->i_type($partial);
my ($i_descr) = $cisco->i_description($partial);
my %i_vlan;
foreach my $idx (keys %$i_descr) {
if ($i_type->{$idx} eq 'l2vlan' || $i_type->{$idx} eq 135) {
if ($i_descr->{$idx} =~ /\.(\d+)$/) {
$i_vlan{$idx} = $1;
}
}
}
\%i_vlan;
}
1; 1;
__END__ __END__