Import of MIKER/NetAddr-IP-4.073 from CPAN.
gitpan-cpan-distribution: NetAddr-IP
gitpan-cpan-version:      4.073
gitpan-cpan-path:         MIKER/NetAddr-IP-4.073.tar.gz
gitpan-cpan-author:       MIKER
gitpan-cpan-maturity:     released
1 parent 16a4df0 commit 6bf5cf64e07c868d1e670edc3109303bb49e5d24
@Michael Robinton Michael Robinton authored on 5 Apr 2014
Gitpan committed on 21 Oct 2014
Showing 9 changed files
View
4
Changes
Revision history for Perl extension NetAddr::IP
 
4.073 Sat Apr 5 09:32:11 PDT 2014
add documentation about FQDN conversion and
an option to disable
 
4.072 Mon Jan 27 11:59:58 PST 2014
modify Makefile.PL to bypass missing 'pod2text'
 
View
11
IP.pm
@EXPORT_FAIL = qw($_netlimit);
 
@ISA = qw(Exporter NetAddr::IP::Lite);
 
$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.72 $ =~ /\d+/g) };
$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.73 $ =~ /\d+/g) };
 
$rfc3021 = 0;
 
=pod
:upper
:old_storable
:old_nth
:rfc3021
:nofqdn
);
 
NOTE: NetAddr::IP::Util has a full complement of network address
utilities to convert back and forth between binary and text.
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF = Ones();
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:: = V4mask();
::FFFF:FFFF = V4net();
 
Will also return an ipV4 or ipV6 representation of a
resolvable Fully Qualified Domanin Name (FQDN).
 
###### DEPRECATED, will be remove in version 5 ############
 
* To accept addresses in the format as returned by
0xABCDEF, 0b111111000101011110 within the limits
of perl's number resolution
123456789012 a 'big' bcd number (bigger than perl likes)
and Math::BigInt
 
A Fully Qualified Domain Name which returns an ipV4 address or an ipV6
address, embodied in that order. This previously undocumented feature
may be disabled with:
 
use NetAddr::IP::Lite ':nofqdn';
 
If called with no arguments, 'default' is assumed.
 
If called with an empty string as the argument, returns 'undef'
View
4
Lite/Changes
Revision history for Perl extension NetAddr::IP::Lite
 
1.53 Sat Apr 5 09:32:11 PDT 2014
add documentation about FQDN conversion and
an option to disable
 
1.52 Mon Jan 27 11:59:58 PST 2014
modify Makefile.PL to bypass missing 'pod2text'
 
View
26
Lite/Lite.pm
naip_gethostbyname
havegethostbyname2
);
 
use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $AUTOLOAD *Zero);
 
$VERSION = do { my @r = (q$Revision: 1.52 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $NoFQDN $AUTOLOAD *Zero);
 
$VERSION = do { my @r = (q$Revision: 1.53 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
 
require Exporter;
 
@ISA = qw(Exporter);
:aton DEPRECATED !
:old_nth
:upper
:lower
:nofqdn
);
 
my $ip = new NetAddr::IP::Lite '127.0.0.1';
or if your prefer
:: = Zeros();
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF = Ones();
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:: = V4mask();
::FFFF:FFFF = V4net();
 
Will also return an ipV4 or ipV6 representation of a
resolvable Fully Qualified Domanin Name (FQDN).
 
=head1 INSTALLATION
 
Un-tar the distribution in an appropriate directory and type:
0xABCDEF, 0b111111000101011110 within the limits
of perl's number resolution
123456789012 a 'big' bcd number (bigger than perl likes)
and Math::BigInt
 
A Fully Qualified Domain Name which returns an ipV4 address or an ipV6
address, embodied in that order. This previously undocumented feature
may be disabled with:
 
use NetAddr::IP::Lite ':nofqdn';
 
If called with no arguments, 'default' is assumed.
 
If called with and empty string as the argument, 'undef' is returned;
return undef if hasbits($ip & $tmp);
last;
}
# check for resolvable IPv4 hosts
elsif ($ip !~ /[^a-zA-Z0-9\.-]/ && ($tmp = gethostbyname(fillIPv4($ip))) && $tmp ne $_v4zero && $tmp ne $_zero ) {
elsif (! $NoFQDN && $ip !~ /[^a-zA-Z0-9\.-]/ && ($tmp = gethostbyname(fillIPv4($ip))) && $tmp ne $_v4zero && $tmp ne $_zero ) {
$ip = ipv4to6($tmp);
last;
}
# check for resolvable IPv6 hosts
elsif ($ip !~ /[^a-zA-Z0-9\.-]/ && havegethostbyname2() && ($tmp = naip_gethostbyname($ip))) {
elsif (! $NoFQDN && $ip !~ /[^a-zA-Z0-9\.-]/ && havegethostbyname2() && ($tmp = naip_gethostbyname($ip))) {
$ip = $tmp;
$isV6 = 1;
last;
}
{
NetAddr::IP::Util::upper();
@_ = grep { $_ ne ':upper' } @_;
}
if (grep { $_ eq ':nofqdn' } @_)
{
$NoFQDN = 1;
@_ = grep { $_ ne ':nofqdn' } @_;
}
NetAddr::IP::Lite->export_to_level(1, @_);
}
 
=head1 EXPORT_OK
:aton DEPRECATED
:old_nth
:upper
:lower
:nofqdn
 
=head1 AUTHORS
 
Luis E. Muñoz E<lt>luismunoz@cpan.orgE<gt>,
View
Lite/MANIFEST
View
Lite/README
View
Lite/t/nofqdn.t 0 → 100644
View
MANIFEST
View
META.yml