From bbc9695075505d466e07beb69a3f83bebf2477b8 Mon Sep 17 00:00:00 2001 From: Jeroen van Ingen Date: Mon, 29 Jun 2015 17:02:48 +0200 Subject: [PATCH] Report L2 capability on PacketFront devices if they have bridge ports --- Info.pm | 1 + Info/Layer3/PacketFront.pm | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Info.pm b/Info.pm index 63b34514..f8665888 100644 --- a/Info.pm +++ b/Info.pm @@ -1560,6 +1560,7 @@ sub device_type { 4526 => 'SNMP::Info::Layer2::Netgear', 5624 => 'SNMP::Info::Layer3::Enterasys', 6486 => 'SNMP::Info::Layer3::AlcatelLucent', + 9303 => 'SNMP::Info::Layer3::PacketFront', 11898 => 'SNMP::Info::Layer2::Orinoco', 14179 => 'SNMP::Info::Layer2::Airespace', 14525 => 'SNMP::Info::Layer2::Trapeze', diff --git a/Info/Layer3/PacketFront.pm b/Info/Layer3/PacketFront.pm index b66e8dec..85af2456 100644 --- a/Info/Layer3/PacketFront.pm +++ b/Info/Layer3/PacketFront.pm @@ -108,6 +108,21 @@ sub i_ignore { return \%i_ignore; } +sub layers { + my $pfront = shift; + + my $layers = $pfront->SUPER::layers(); + # Some models or softwware versions don't report L2 properly + # so add L2 capability to the output if the device has bridge ports. + my $bports = $pfront->b_ports(); + + if ($bports) { + my $l = substr $layers, 6, 1, "1"; + } + + return $layers; +} + 1; __END__ @@ -210,6 +225,11 @@ Returns reference to hash. Increments value of IID if port is to be ignored. Ignores loopback +=item $pfront->layers() + +L2 capability isn't always reported correctly by the device itself; what the +device reports is augmented with L2 capability if the device has bridge ports. + =back =head2 Table Methods imported from SNMP::Info::Layer3