diff --git a/About-NetAddr-IP.txt b/About-NetAddr-IP.txt new file mode 100644 index 0000000..52c8244 --- /dev/null +++ b/About-NetAddr-IP.txt @@ -0,0 +1,95 @@ +About NetAddr::IP + +At some point a user wrote and asked the difference between +NetAddr::IP and NetAddr::IP::Lite + +NetAddr::IP::Lite contains only "basic" IP address operations to create IP objects, +print or return their characteristics, do basic IP arithmetic, etc... a lot of +which is implemented in XS in its sub-classes, whereas NetAddr::IP contains complex +operations on nets, net ranges , etc... all implemented in perl. If you don't use +those, you don't need the overhead of loading them, the autoloader, etc... +Likewise, NetAddr::IP::Utilities and NetAddr::IP::InetBase exist to provide +"very basic" ipv4 and ipv6 utilities without the overhead of their superclasses +for module writers need to work with ipv4 & ipv6 "numbers" but do not need object +oriented overhead or functionality. + +Take a brief look at the SRC of each to see what is supported in each without +having to wade through the man pages to figure out where the overlap is. +Basically the modules are broken down into these functional areas that cover +various aspects of manipulating IP numbers. + +NetAddr::IP::InetBase mostly XS +net to text conversion routines + inet_aton + inet_ntoa + ipv6_aton + ipv6_ntoa + ipv6_n2x + ipv6_n2d + inet_any2n + inet_n2dx + inet_n2ad + inet_ntop + inet_pton + etc... + +NetAddr::IP::Util adds to above, mostly XS + above + ip arithmetic + addconst + add128 + sub128 + bin2bcd + bcd2bin + ipv4to6 + mask4to6 + ipanyto6 + maskanyto6 + ipv6to4 + bin2bcdn + bcdn2txt + bcdn2bin + comp128 + naip_gethostbyname (platform/socket independent) + etc... + +NetAddr::IP::Lite adds to above +mostly 1 or 2 line functions and/or calls to sub classes + all the "new" functions + all overload functions ( + - ++ -- = print eq ne == > >= < <= cmp) + "copy" (clone rather than reference) + return of IP parameters such as + broadcast + network + addr + mask + masklen + bits + version + cidr + aton + range + numeric + bigint + contains + within + first + last + nth + num + +NetAddr::IP adds to above + wildcard + short + full + full6 + splitref + split + rsplit + hostenum + compact + compactref + coalesce + re + re6 + +enjoy... diff --git a/Changes b/Changes index 2bdf199..1454f1f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Perl extension NetAddr::IP +4.067 Sat Mar 30 12:57:20 PDT 2013 + Improved diagnostic message for "die" with bad mask for + hostenum, hostenumref, split, splitref, rsplit, rsplitref + Thanks to GENSYM@cpan.org for pointing out the need. + 4.066 Mon Oct 29 13:30:14 PDT 2012 update Lite.pm v1.47 to support bracketed IPv6 URI notation as described in RFC-3986 diff --git a/IP.pm b/IP.pm index f19c229..b858cbf 100644 --- a/IP.pm +++ b/IP.pm @@ -4,6 +4,7 @@ use strict; #use diagnostics; +use Carp; use NetAddr::IP::Lite 1.47 qw(Zero Zeros Ones V4mask V4net); use NetAddr::IP::Util 1.48 qw( sub128 @@ -36,7 +37,7 @@ @ISA = qw(Exporter NetAddr::IP::Lite); -$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.66 $ =~ /\d+/g) }; +$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.67 $ =~ /\d+/g) }; $rfc3021 = 0; @@ -1062,7 +1063,9 @@ sub _splitref { my $rev = shift; my($plan,$masks) = &_splitplan; - return undef unless $plan; +# bug report 82719 + croak("netmask error: overrange or spurious bits") unless defined $plan; +# return undef unless $plan; my $net = $_[0]->network(); return [$net] unless $masks; my $addr = $net->{addr}; diff --git a/Lite/MANIFEST b/Lite/MANIFEST index 19b544f..4f6ce8e 100644 --- a/Lite/MANIFEST +++ b/Lite/MANIFEST @@ -3,7 +3,6 @@ Changes Lite.pm Makefile.PL -META.yml README bug2742981 t/addr.t diff --git a/Lite/MANIFEST.SKIP b/Lite/MANIFEST.SKIP index 3dd2a78..1afffee 100644 --- a/Lite/MANIFEST.SKIP +++ b/Lite/MANIFEST.SKIP @@ -28,4 +28,4 @@ config\.h$ config\.status localperl\.h - +META.yml diff --git a/Lite/META.yml b/Lite/META.yml deleted file mode 100644 index 3a789b1..0000000 --- a/Lite/META.yml +++ /dev/null @@ -1,10 +0,0 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: NetAddr-IP-Lite -version: 0.10 -version_from: Lite.pm -installdirs: site -requires: - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 diff --git a/Lite/Makefile.PL b/Lite/Makefile.PL index 3fce927..ab98400 100644 --- a/Lite/Makefile.PL +++ b/Lite/Makefile.PL @@ -13,7 +13,7 @@ 'VERSION_FROM' => $module, # finds $VERSION 'PREREQ_PM' => {Test::More => 0, }, - 'clean' => { FILES => "*~ tmp*"}, + 'clean' => { FILES => "*~ tmp* META.yml"}, 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} ); diff --git a/Lite/Util/MANIFEST.SKIP b/Lite/Util/MANIFEST.SKIP index 61daf92..122be32 100644 --- a/Lite/Util/MANIFEST.SKIP +++ b/Lite/Util/MANIFEST.SKIP @@ -29,3 +29,4 @@ localperl\.h tlib/NetAddr/IP/Util_IS.pm Util_IS.pm +META.yml diff --git a/MANIFEST b/MANIFEST index 596f462..af7d248 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,10 +1,10 @@ +About-NetAddr-IP.txt Artistic Changes Copying IP.pm -MANIFEST This list of files +MANIFEST MANIFEST.SKIP -META.yml Module meta-data (added by MakeMaker) Makefile.PL TODO docs/rfc1884.txt @@ -42,7 +42,6 @@ Lite/Lite.pm Lite/MANIFEST Lite/MANIFEST.SKIP -Lite/META.yml Lite/Makefile.PL Lite/README Lite/bug2742981 @@ -171,3 +170,4 @@ Lite/Util/t/no6_naip_gethostbyname.t Lite/Util/typemap +META.yml Module meta-data (added by MakeMaker) diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 88bb381..963ab2a 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -29,3 +29,4 @@ config\.status localperl\.h Lite/bug2742981.pl +META.yml diff --git a/META.yml b/META.yml index 0b7c294..449a98f 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: NetAddr-IP -version: 4.066 +version: 4.067 abstract: Manages IPv4 and IPv6 addresses and subnets license: ~ author: diff --git a/Makefile.PL b/Makefile.PL index c78d8e8..da50c62 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -84,7 +84,7 @@ ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'IP.pm', AUTHOR => 'Luis E. Muñoz , Michael Robinton ') : ()), - clean => { FILES => "*~ tmp*"}, + clean => { FILES => "*~ tmp* META.yml"}, ); WriteMakefile(%makeparms);