diff -ru Net-Whois-IANA-0.23/IANA.pm Net-Whois-IANA-0.23-new/IANA.pm
--- Net-Whois-IANA-0.23/IANA.pm 2007-11-18 10:28:47.000000000 -0500
+++ Net-Whois-IANA-0.23-new/IANA.pm 2009-01-11 23:42:56.000000000 -0500
@@ -216,7 +216,7 @@
}
else {
$query{permission} = 'allowed';
- @{$query{cidr}} = Net::CIDR::range2cidr($query{inetnum});
+ $query{cidr} = (Net::CIDR::range2cidr($query{inetnum}));
}
return %query;
}
@@ -263,7 +263,7 @@
}
else {
$query{permission} = 'allowed';
- $query{cidr} = [Net::CIDR::range2cidr($query{inetnum})];
+ $query{cidr} = (Net::CIDR::range2cidr($query{inetnum}));
}
return %query;
}
@@ -322,7 +322,7 @@
$query{cidr} = [split(/\, /,$query{cidr})];
}
else {
- $query{cidr} = [$query{cidr}];
+ $query{cidr} = ($query{cidr});
}
}
}
@@ -361,6 +361,7 @@
close $sock;
$query{descr} = $query{owner};
$query{netname} = $query{ownerid};
+ $query{status} = $query{nettype};
$query{source} = 'LACNIC';
if ($query{inetnum}) {
my ($zone, $span) = split(/\//,$query{inetnum});
@@ -368,8 +369,8 @@
if (scalar @atom < 4) {
$zone .= '.0' x (4 - scalar @atom);
}
- $query{cidr} = [$zone . '/' . $span];
- $query{inetnum} = (Net::CIDR::cidr2range(@{$query{cidr}}))[0];
+ $query{cidr} = ($zone . '/' . $span);
+ $query{inetnum} = (Net::CIDR::cidr2range($query{cidr}))[0];
}
unless ($query{country}) {
if ($query{nserver} =~ /\.(\w\w)$/) {
@@ -413,7 +414,7 @@
}
else {
$query{permission} = 'allowed';
- @{$query{cidr}} = Net::CIDR::range2cidr($query{inetnum});
+ $query{cidr} = (Net::CIDR::range2cidr($query{inetnum}));
}
return %query;
}
Only in Net-Whois-IANA-0.23-new/: Makefile
Only in Net-Whois-IANA-0.23-new/: pm_to_blib
diff -ru Net-Whois-IANA-0.23/t/afrinic.t Net-Whois-IANA-0.23-new/t/afrinic.t
--- Net-Whois-IANA-0.23/t/afrinic.t 2005-06-22 04:32:14.000000000 -0400
+++ Net-Whois-IANA-0.23-new/t/afrinic.t 2009-01-11 23:50:56.000000000 -0500
@@ -1,8 +1,13 @@
-use Test::Simple tests=>2;
+use Test::Simple tests=>8;
use Net::Whois::IANA;
my $iana = new Net::Whois::IANA;
my $ip = '196.216.2.1';
$iana->whois_query(-ip=>$ip,-whois=>'afrinic');
ok(defined $iana);
ok($iana->country() eq 'ZA');
-
+ok($iana->descr() eq 'AfriNIC - Internal Use.');
+ok($iana->status() eq 'ASSIGNED PI');
+ok($iana->source() eq 'AFRINIC # Filtered');
+ok($iana->server() eq 'AFRINIC');
+ok($iana->inetnum() eq '196.216.2.0 - 196.216.3.255');
+ok($iana->cidr() eq '196.216.2.0/23');
diff -ru Net-Whois-IANA-0.23/t/apnic.t Net-Whois-IANA-0.23-new/t/apnic.t
--- Net-Whois-IANA-0.23/t/apnic.t 2003-07-15 04:41:03.000000000 -0400
+++ Net-Whois-IANA-0.23-new/t/apnic.t 2009-01-11 23:54:32.000000000 -0500
@@ -1,8 +1,14 @@
-use Test::Simple tests=>2;
+use Test::Simple tests=>9;
use Net::Whois::IANA;
my $iana = new Net::Whois::IANA;
my $ip = '202.12.29.13';
$iana->whois_query(-ip=>$ip,-whois=>'apnic');
ok(defined $iana);
ok($iana->country() eq 'AU');
-
+ok($iana->netname() eq 'APNIC-AP');
+ok($iana->descr() eq 'Asia Pacific Network Information Center, Pty. Ltd.Level 1 - 33 Park Road.Milton QLD 4064Australia');
+ok($iana->status() eq 'ASSIGNED PORTABLE');
+ok($iana->source() eq 'APNIC');
+ok($iana->server() eq 'APNIC');
+ok($iana->inetnum() eq '202.12.28.0 - 202.12.29.255');
+ok($iana->cidr() eq '202.12.28.0/23');
diff -ru Net-Whois-IANA-0.23/t/arin.t Net-Whois-IANA-0.23-new/t/arin.t
--- Net-Whois-IANA-0.23/t/arin.t 2003-07-15 04:40:52.000000000 -0400
+++ Net-Whois-IANA-0.23-new/t/arin.t 2009-01-11 23:31:39.000000000 -0500
@@ -1,8 +1,14 @@
-use Test::Simple tests=>2;
+use Test::Simple tests=>9;
use Net::Whois::IANA;
my $iana = new Net::Whois::IANA;
my $ip = '192.149.252.43';
$iana->whois_query(-ip=>$ip,-whois=>'arin');
ok(defined $iana);
ok($iana->country() eq 'US');
-
+ok($iana->netname() eq 'ARIN-NET');
+ok($iana->descr() eq 'American Registry for Internet Numbers');
+ok($iana->status() eq 'Direct Assignment');
+ok($iana->source() eq 'ARIN');
+ok($iana->server() eq 'ARIN');
+ok($iana->inetnum() eq '192.149.252.0 - 192.149.252.255');
+ok($iana->cidr() eq '192.149.252.0/24');
diff -ru Net-Whois-IANA-0.23/t/brnic.t Net-Whois-IANA-0.23-new/t/brnic.t
--- Net-Whois-IANA-0.23/t/brnic.t 2007-11-17 07:50:30.000000000 -0500
+++ Net-Whois-IANA-0.23-new/t/brnic.t 2009-01-11 23:44:44.000000000 -0500
@@ -1,10 +1,12 @@
-use Test::Simple tests=>2;
+use Test::Simple tests=>7;
use Net::Whois::IANA;
my $iana = new Net::Whois::IANA;
my $ip = '200.160.2.15';
$iana->whois_query(-ip=>$ip,-whois=>'lacnic');
ok(defined $iana);
-print $iana->{QUERY}{abuse}, " abuse\n";
-use Data::Dumper;
ok($iana->country() eq 'BR');
-
+ok($iana->netname() eq '005.506.560/0001-36');
+ok($iana->source() eq 'LACNIC');
+ok($iana->server() eq 'LACNIC');
+ok($iana->inetnum() eq '200.160.0.0-200.160.15.255');
+ok($iana->cidr() eq '200.160.0.0/20');
diff -ru Net-Whois-IANA-0.23/t/ripe.t Net-Whois-IANA-0.23-new/t/ripe.t
--- Net-Whois-IANA-0.23/t/ripe.t 2004-09-28 04:47:44.000000000 -0400
+++ Net-Whois-IANA-0.23-new/t/ripe.t 2009-01-11 23:58:19.000000000 -0500
@@ -1,8 +1,14 @@
-use Test::Simple tests=>2;
+use Test::Simple tests=>9;
use Net::Whois::IANA;
my $iana = new Net::Whois::IANA;
my $ip = '193.0.0.135';
$iana->whois_query(-ip=>$ip,-whois=>'ripe');
ok(defined $iana);
ok($iana->country() eq 'NL');
-
+ok($iana->netname() eq 'RIPE-NCC');
+ok($iana->descr() eq 'RIPE Network Coordination CentreAmsterdam, Netherlands');
+ok($iana->status() eq 'ASSIGNED PI');
+ok($iana->source() eq 'RIPE # Filtered');
+ok($iana->server() eq 'RIPE');
+ok($iana->inetnum() eq '193.0.0.0 - 193.0.7.255');
+ok($iana->cidr() eq '193.0.0.0/21');