lldp_platform() now tries to return something useful from either lldp_rem_sysdesc() or lldp_rem_sysname().

This commit is contained in:
Eric A. Miller
2013-12-15 08:34:27 -05:00
parent 602bb15b47
commit 0e572db832

View File

@@ -231,7 +231,15 @@ sub lldp_platform {
my $lldp = shift; my $lldp = shift;
my $partial = shift; my $partial = shift;
return $lldp->lldp_rem_sysdesc($partial); my $rid = $lldp->lldp_rem_id($partial) || {};
my $desc = $lldp->lldp_rem_sysdesc($partial) || {};
my $name = $lldp->lldp_rem_sysname($partial) || {};
my %lldp_platform;
foreach my $key (keys %$rid) {
$lldp_platform{$key} = $desc->{$key} || $name->{$key};
}
return \%lldp_platform;
} }
#sub root_ip { #sub root_ip {
@@ -449,7 +457,8 @@ Returns remote port ID
=item $lldp->lldp_platform() =item $lldp->lldp_platform()
Alias for C<lldp_rem_sysdesc()>. Tries to return something useful from C<lldp_rem_sysdesc()> or
C<lldp_rem_sysname()>.
=back =back