From 929723ea1bb8c7f84a8bdc763dd1a82ae7feb49f Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 10 Jan 2014 20:48:59 +0000 Subject: [PATCH] [#66] store i_vlan in pvid column of device_port --- Netdisco/lib/App/Netdisco/Core/Discover.pm | 3 +-- Netdisco/lib/App/Netdisco/DB/Result/DevicePort.pm | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Core/Discover.pm b/Netdisco/lib/App/Netdisco/Core/Discover.pm index 9cdc43a9..af07df13 100644 --- a/Netdisco/lib/App/Netdisco/Core/Discover.pm +++ b/Netdisco/lib/App/Netdisco/Core/Discover.pm @@ -204,7 +204,6 @@ sub store_interfaces { my $i_duplex_admin = $snmp->i_duplex_admin; my $i_stp_state = $snmp->i_stp_state; my $i_vlan = $snmp->i_vlan; - my $i_pvid = $snmp->i_pvid; my $i_lastchange = $snmp->i_lastchange; # clear the cached uptime and get a new one @@ -277,7 +276,7 @@ sub store_interfaces { stp => $i_stp_state->{$entry}, type => $i_type->{$entry}, vlan => $i_vlan->{$entry}, - pvid => $i_pvid->{$entry}, + pvid => $i_vlan->{$entry}, lastchange => $lc, }; } diff --git a/Netdisco/lib/App/Netdisco/DB/Result/DevicePort.pm b/Netdisco/lib/App/Netdisco/DB/Result/DevicePort.pm index ff590c89..8160bb1d 100644 --- a/Netdisco/lib/App/Netdisco/DB/Result/DevicePort.pm +++ b/Netdisco/lib/App/Netdisco/DB/Result/DevicePort.pm @@ -257,6 +257,15 @@ sub neighbor { =head1 ADDITIONAL COLUMNS +=head2 native + +An alias for the C column, which stores the PVID (that is, the VLAN +ID assigned to untagged frames received on the port). + +=cut + +sub native { return (shift)->pvid } + =head2 tagged_vlans_count Returns the number of tagged VLANs active on this device port. Enable this