lldp_platform() now tries to return something useful from either lldp_rem_sysdesc() or lldp_rem_sysname().
This commit is contained in:
13
Info/LLDP.pm
13
Info/LLDP.pm
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user