#195 IP address table - IPv4 Address Table will use the IP-MIB::ipAddressTable if the deprecated IP-MIB::ipAddrTable doesn't return results

This commit is contained in:
Eric A. Miller
2018-05-07 21:09:16 -04:00
parent 4ff904f3cd
commit 1a80138026
7 changed files with 249 additions and 34 deletions

View File

@@ -508,8 +508,8 @@ sub ip_index {
my $airespace = shift;
my $partial = shift;
my $ip_index = $airespace->orig_ip_index($partial) || {};
my $if_ip = $airespace->airespace_if_ip() || {};
my $ip_index = $airespace->SUPER::ip_index($partial) || {};
my $if_ip = $airespace->airespace_if_ip() || {};
my %ip_index;
foreach my $ip ( keys %$ip_index ) {
@@ -534,9 +534,9 @@ sub ip_netmask {
my $airespace = shift;
my $partial = shift;
my $ip_mask = $airespace->orig_ip_netmask($partial) || {};
my $if_ip = $airespace->airespace_if_ip() || {};
my $if_mask = $airespace->airespace_if_mask() || {};
my $ip_mask = $airespace->SUPER::ip_netmask($partial) || {};
my $if_ip = $airespace->airespace_if_ip() || {};
my $if_mask = $airespace->airespace_if_mask() || {};
my %ip_netmask;
foreach my $ip ( keys %$ip_mask ) {

View File

@@ -143,7 +143,7 @@ sub model {
# override methods in ipAddrTable
sub ip_table {
my $nexus = shift;
my $orig_ip_table = $nexus->orig_ip_table();
my $orig_ip_table = $nexus->SUPER::ip_table();
my %ip_table;
foreach my $iid ( keys %$orig_ip_table ) {
@@ -163,8 +163,8 @@ sub ip_table {
sub ip_index {
my $nexus = shift;
my $orig_ip_table = $nexus->orig_ip_table();
my $orig_ip_index = $nexus->orig_ip_index();
my $orig_ip_table = $nexus->SUPER::ip_table();
my $orig_ip_index = $nexus->SUPER::ip_index();
my %ip_index;
foreach my $iid ( keys %$orig_ip_table ) {
@@ -186,8 +186,8 @@ sub ip_index {
sub ip_netmask {
my $nexus = shift;
my $orig_ip_table = $nexus->orig_ip_table();
my $orig_ip_netmask = $nexus->orig_ip_netmask();
my $orig_ip_table = $nexus->SUPER::ip_table();
my $orig_ip_netmask = $nexus->SUPER::ip_netmask();
my %ip_netmask;
foreach my $iid ( keys %$orig_ip_table ) {
@@ -209,8 +209,8 @@ sub ip_netmask {
sub ip_broadcast {
my $nexus = shift;
my $orig_ip_table = $nexus->orig_ip_table();
my $orig_ip_broadcast = $nexus->orig_ip_broadcast();
my $orig_ip_table = $nexus->SUPER::ip_table();
my $orig_ip_broadcast = $nexus->SUPER::ip_broadcast();
my %ip_broadcast;
foreach my $iid ( keys %$orig_ip_table ) {

View File

@@ -450,7 +450,7 @@ sub ip_index {
my $partial = shift;
my $model = $passport->model();
my $ip_index = $passport->orig_ip_index($partial) || {};
my $ip_index = $passport->SUPER::ip_index($partial) || {};
my %ip_index;
foreach my $ip ( keys %$ip_index ) {
@@ -492,7 +492,7 @@ sub ip_netmask {
my $partial = shift;
my $model = $passport->model();
my $ip_mask = $passport->orig_ip_netmask($partial) || {};
my $ip_mask = $passport->SUPER::ip_netmask($partial) || {};
my %ip_index;
foreach my $iid ( keys %$ip_mask ) {

View File

@@ -55,8 +55,8 @@ $VERSION = '3.60';
%FUNCS = (
%SNMP::Info::Layer7::FUNCS,
# IP Address Table - NS-ROOT-MIB::nsIpAddrTable
'ip_index' => 'ipAddr',
'ip_netmask' => 'ipNetmask',
'ns_ip_index' => 'ipAddr',
'ns_ip_netmask' => 'ipNetmask',
# TODO VLAN - NS-ROOT-MIB::vlanTable
'ns_vid' =>'vlanId',
'ns_vlan_mem' => 'vlanMemberInterfaces',
@@ -89,13 +89,24 @@ sub model {
sub os_ver {
my $ns = shift;
my $ver = $ns->build_ver() || '';
if ($ver =~ /^.+\bNS(\d+\.\d+)/) {
$ver = $1;
}
return $ver;
}
sub ip_index {
my $ns = shift;
return $ns->ns_ip_index();
}
sub ip_netmask {
my $ns = shift;
return $ns->ns_ip_netmask();
}
1;
__END__