took out some kludy cisco-specific stuff from interfaces()
This commit is contained in:
@@ -156,25 +156,20 @@ sub interfaces {
|
|||||||
my $l2 = shift;
|
my $l2 = shift;
|
||||||
my $interfaces = $l2->i_index();
|
my $interfaces = $l2->i_index();
|
||||||
my $i_descr = $l2->i_description();
|
my $i_descr = $l2->i_description();
|
||||||
my $i_name = $l2->i_name();
|
#my $i_name = $l2->i_name();
|
||||||
|
|
||||||
my %if;
|
my %if;
|
||||||
foreach my $iid (keys %$interfaces){
|
foreach my $iid (keys %$interfaces){
|
||||||
my $port = $i_descr->{$iid};
|
my $port = $i_descr->{$iid};
|
||||||
my $name = $i_name->{$iid};
|
|
||||||
$port = $name if (defined $name and $name !~ /^\s*$/);
|
|
||||||
next unless defined $port;
|
|
||||||
|
|
||||||
# Cisco 1900 has a space in some of its port descr.
|
# what device was this good for? bad idea.
|
||||||
# get rid of any weird characters
|
#my $name = $i_name->{$iid};
|
||||||
$port =~ s/[^\d\/,()\w]+//gi;
|
#$port = $name if (defined $name and $name !~ /^\s*$/);
|
||||||
|
|
||||||
# Translate Cisco 2926,etc. from 1/5 to 1.5
|
next unless defined $port;
|
||||||
$port =~ s/\//\./ if ($port =~ /^\d+\/\d+$/);
|
|
||||||
|
|
||||||
$if{$iid} = $port;
|
$if{$iid} = $port;
|
||||||
}
|
}
|
||||||
|
|
||||||
return \%if
|
return \%if
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user