diff -Nru libnet-subnets-perl-0.21/Changes libnet-subnets-perl-1.0/Changes --- libnet-subnets-perl-0.21/Changes 2005-02-19 19:58:07.000000000 +0000 +++ libnet-subnets-perl-1.0/Changes 2009-12-18 19:10:07.000000000 +0000 @@ -1,52 +1,43 @@ Revision history for Perl extension Net::Subnets. -0.21 Sat Feb 19 21:00:00 2005 - - fixed pod (Jan Harders) +1.0 2009-12-10 00:00:00 + - Fixed everything. -0.20 Sun Nov 16 16:00:00 2003 +0.21 2009-02-19 00:00:00 + - Fixed pod. (Jan Harders) - - added list() function - - better documentation +0.20 2003-11-16 00:00:00 + - Added list() function. + - Better documentation. -0.19 Wed Nov 12 11:00:00 2003 +0.19 2003-11-12 00:00:00 + - Fixed a bug in subnets() and check() which produced false matches. + (Eric Johanson) + - Fixed the changelog. - - fixed a bug in subnets() and check() which produced - false matches, reported by Eric Johanson +0.18 2003-10-13 00:00:00 + - Fixed some typos - - fixed the changelog +0.17 2003-09-30 00:00:00 + - Made the constructor inheritable. (Markus Thielmann) -0.18 Tue Sep 30 21:30:00 2003 +0.16 2003-09-28 00:00:00 + - Added range() function. - - fixed some typos +0.15 2003-09-15 00:00:00 + - New test. -0.17 Tue Sep 30 21:00:00 2003 +0.14 2003-09-13 00:00:00 + - Better documentation. - - made the constructor inheritable, reported by Markus Thielmann +0.13 2003-09-12 00:00:00 + - Added example. -0.16 Sun Sep 28 22:00:00 2003 +0.12 2003-09-11 00:00:00 + - Fixed even more typos. - - added range() function +0.11 2003-09-10 00:00:00 + - Fixed some typos. -0.15 Mon Sep 15 21:00:00 2003 - - - new test - -0.14 Fri Sep 12 23:30:00 2003 - - - better documentation - -0.13 Fri Sep 12 22:55:00 2003 - - - added example - -0.12 Fri Sep 12 01:00:00 2003 - - - fixed even more typos - -0.11 Thu Sep 12 00:00:00 2003 - - - fixed some typos - -0.10 Wed Aug 27 22:00:00 2003 - - - first public release +0.10 2009-08-28 00:00:00 + - first public release diff -Nru libnet-subnets-perl-0.21/debian/changelog libnet-subnets-perl-1.0/debian/changelog --- libnet-subnets-perl-0.21/debian/changelog 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/changelog 2010-01-05 01:00:39.000000000 +0000 @@ -1,3 +1,25 @@ +libnet-subnets-perl (1.0-1) unstable; urgency=low + + [ Jonathan Yu ] + * New upstream release + * Add myself to Uploaders and Copyright + * Standards-Version 3.8.3 (drop perl version dep) + * Rewrote control description + * Install examples now provided upstream + * Refresh copyright file; notably, the copyright says only + Sebastian Riedel, not the other author + * Use new short debhelper rules format + + [ gregor herrmann ] + * debian/watch: use dist-based URL. + * debian/control: Changed: Switched Vcs-Browser field to ViewSVN + (source stanza). + + [ Nathan Handler ] + * debian/watch: Update to ignore development releases. + + -- Jonathan Yu Fri, 18 Dec 2009 16:35:55 -0500 + libnet-subnets-perl (0.21-3) unstable; urgency=low [ Stephen Gran ] diff -Nru libnet-subnets-perl-0.21/debian/compat libnet-subnets-perl-1.0/debian/compat --- libnet-subnets-perl-0.21/debian/compat 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/compat 2010-01-05 01:00:39.000000000 +0000 @@ -1 +1 @@ -5 +7 diff -Nru libnet-subnets-perl-0.21/debian/control libnet-subnets-perl-1.0/debian/control --- libnet-subnets-perl-0.21/debian/control 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/control 2010-01-05 01:00:39.000000000 +0000 @@ -1,21 +1,22 @@ Source: libnet-subnets-perl Section: perl Priority: optional -Build-Depends: debhelper (>= 5) -Build-Depends-Indep: perl (>= 5.8.0) +Build-Depends: debhelper (>= 7.0.50) +Build-Depends-Indep: perl, libtest-pod-perl, libtest-pod-coverage-perl Maintainer: Debian Perl Group -Uploaders: Ernesto Hernández-Novich (USB) +Uploaders: Ernesto Hernández-Novich (USB) , + Jonathan Yu +Standards-Version: 3.8.3 Homepage: http://search.cpan.org/dist/Net-Subnets/ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-subnets-perl/ -Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-subnets-perl/ -Standards-Version: 3.7.3 +Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnet-subnets-perl/ Package: libnet-subnets-perl Architecture: all Depends: ${perl:Depends}, ${misc:Depends}, -Description: A Perl library for subnet calculations - Net::Subnets provides very fast operations for: - . - - Matching a list of IP addresses against one or more CIDR subnets. - . - - Calculation of IP address ranges. +Description: module for IPv4 subnet calculations + Net::Subnets is a Perl module that provides a quick and simple method to + perform miscellaneous operations with IP version 4 (IPv4) addresses. It can + match a list of IP addresses against one or more CIDR (Classless Inter-Domain + Routing) subnets. It also calculates ranges of IP addresses based on a subnet + size, specified as a CIDR. diff -Nru libnet-subnets-perl-0.21/debian/copyright libnet-subnets-perl-1.0/debian/copyright --- libnet-subnets-perl-0.21/debian/copyright 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/copyright 2010-01-05 01:00:39.000000000 +0000 @@ -1,23 +1,198 @@ -This package was debianized by Ernesto Hernández-Novich -on Wed, 06 Sep 2006 15:27:24 -0400 - -It was downloaded from http://search.cpan.org/dist/Net-Subnets/ - -Upstream Authors: - -Sebastian Riedel -Juergen Peters - -Copyright: - -Copyright (c) 2003 Sebastian Riedel & Juergen Peters. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -Perl is distributed under your choice of the GNU General Public License or -the Artistic License. - -The complete text of the GNU General Public License can be found in -/usr/share/common-licenses/GPL and the Artistic License can be found -in /usr/share/common-licenses/Artistic. +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59 +Maintainer: Sebastian Riedel +Source: http://search.cpan.org/dist/Net-Subnets/ +Name: Net-Subnets + +Files: * +Copyright: 2003-2009, Sebastian Riedel +License: Artistic-2.0 + +Files: debian/* +Copyright: 2009, Jonathan Yu + 2006-2008, Ernesto Hernández-Novich (USB) + 2007, Gunnar Wolf +License: Artistic-2.0 + +License: Artistic-2.0 + Copyright (c) 2000-2006, The Perl Foundation. + . + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + . + Preamble + . + This license establishes the terms under which a given free software + Package may be copied, modified, distributed, and/or redistributed. + The intent is that the Copyright Holder maintains some artistic + control over the development of that Package while still keeping the + Package available as open source and free software. + . + You are always permitted to make arrangements wholly outside of this + license directly with the Copyright Holder of a given Package. If the + terms of this license do not permit the full use that you propose to + make of the Package, you should contact the Copyright Holder and seek + a different licensing arrangement. + . + Definitions + . + "Copyright Holder" means the individual(s) or organization(s) named in + the copyright notice for the entire Package. + . + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + . + "You" and "your" means any person who would like to copy, distribute, + or modify the Package. + . + "Package" means the collection of files distributed by the Copyright + Holder, and derivatives of that collection and/or of those files. A + given Package may consist of either the Standard Version, or a + Modified Version. + . + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + . + "Distributor Fee" means any fee that you charge for Distributing this + Package or providing support for this Package to another party. It + does not mean licensing fees. + . + "Standard Version" refers to the Package if it has not been modified, + or has been modified only in ways explicitly requested by the + Copyright Holder. + . + "Modified Version" means the Package, if it has been changed, and such + changes were not explicitly requested by the Copyright Holder. + . + "Original License" means this Artistic License as Distributed with the + Standard Version of the Package, in its current version or as it may + be modified by The Perl Foundation in the future. + . + "Source" form means the source code, documentation source, and + configuration files for the Package. + . + "Compiled" form means the compiled bytecode, object code, binary, or + any other form resulting from mechanical transformation or translation + of the Source form. + . + Permission for Use and Modification Without Distribution + . + (1) You are permitted to use the Standard Version and create and use + Modified Versions for any purpose without restriction, provided that + you do not Distribute the Modified Version. + . + Permissions for Redistribution of the Standard Version + . + (2) You may Distribute verbatim copies of the Source form of the + Standard Version of this Package in any medium without restriction, + either gratis or for a Distributor Fee, provided that you duplicate + all of the original copyright notices and associated disclaimers. At + your discretion, such verbatim copies may or may not include a + Compiled form of the Package. + . + (3) You may apply any bug fixes, portability changes, and other + modifications made available from the Copyright Holder. The resulting + Package will still be considered the Standard Version, and as such + will be subject to the Original License. + . + Distribution of Modified Versions of the Package as Source + . + (4) You may Distribute your Modified Version as Source (either gratis + or for a Distributor Fee, and with or without a Compiled form of the + Modified Version) provided that you clearly document how it differs + from the Standard Version, including, but not limited to, documenting + any non-standard features, executables, or modules, and provided that + you do at least ONE of the following: + . + (a) make the Modified Version available to the Copyright Holder of the + Standard Version, under the Original License, so that the Copyright + Holder may include your modifications in the Standard Version. (b) + ensure that installation of your Modified Version does not prevent the + user installing or running the Standard Version. In addition, the + Modified Version must bear a name that is different from the name of + the Standard Version. (c) allow anyone who receives a copy of the + Modified Version to make the Source form of the Modified Version + available to others under (i) the Original License or (ii) a license + that permits the licensee to freely copy, modify and redistribute the + Modified Version using the same licensing terms that apply to the copy + that the licensee received, and requires that the Source form of the + Modified Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor Fees are + allowed. + . + Distribution of Compiled Forms of the Standard Version or Modified + Versions without the Source + . + (5) You may Distribute Compiled forms of the Standard Version without + the Source, provided that you include complete instructions on how to + get the Source of the Standard Version. Such instructions must be + valid at the time of your distribution. If these instructions, at any + time while you are carrying out such distribution, become invalid, you + must provide new instructions on demand or cease further distribution. + If you provide valid instructions or cease distribution within thirty + days after you become aware that the instructions are invalid, then + you do not forfeit any of your rights under this license. + . + (6) You may Distribute a Modified Version in Compiled form without the + Source, provided that you comply with Section 4 with respect to the + Source of the Modified Version. + . + Aggregating or Linking the Package + . + (7) You may aggregate the Package (either the Standard Version or + Modified Version) with other packages and Distribute the resulting + aggregation provided that you do not charge a licensing fee for the + Package. Distributor Fees are permitted, and licensing fees for other + components in the aggregation are permitted. The terms of this license + apply to the use and Distribution of the Standard or Modified Versions + as included in the aggregation. + . + (8) You are permitted to link Modified and Standard Versions with + other works, to embed the Package in a larger work of your own, or to + build stand-alone binary or bytecode versions of applications that + include the Package, and Distribute the result without restriction, + provided the result does not expose a direct interface to the Package. + . + Items That are Not Considered Part of a Modified Version + . + (9) Works (including, but not limited to, modules and scripts) that + merely extend or make use of the Package, do not, by themselves, cause + the Package to be a Modified Version. In addition, such works are not + considered parts of the Package itself, and are not subject to the + terms of this license. + . + General Provisions + . + (10) Any use, modification, and distribution of the Standard or + Modified Versions is governed by this Artistic License. By using, + modifying or distributing the Package, you accept this license. Do not + use, modify, or distribute the Package, if you do not accept this + license. + . + (11) If your Modified Version has been derived from a Modified Version + made by someone other than you, you are nevertheless required to + ensure that your Modified Version complies with the requirements of + this license. + . + (12) This license does not grant you the right to use any trademark, + service mark, tradename, or logo of the Copyright Holder. + . + (13) This license includes the non-exclusive, worldwide, + free-of-charge patent license to make, have made, use, offer to sell, + sell, import and otherwise transfer the Package with respect to any + patent claims licensable by the Copyright Holder that are necessarily + infringed by the Package. If you institute patent litigation + (including a cross-claim or counterclaim) against any party alleging + that the Package constitutes direct or contributory patent + infringement, then this Artistic License to you shall terminate on the + date that such litigation is filed. + . + (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT + HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT + PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT + HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE + OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru libnet-subnets-perl-0.21/debian/libnet-subnets-perl.examples libnet-subnets-perl-1.0/debian/libnet-subnets-perl.examples --- libnet-subnets-perl-0.21/debian/libnet-subnets-perl.examples 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/debian/libnet-subnets-perl.examples 2010-01-05 01:00:39.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru libnet-subnets-perl-0.21/debian/rules libnet-subnets-perl-1.0/debian/rules --- libnet-subnets-perl-0.21/debian/rules 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/rules 2010-01-05 01:00:39.000000000 +0000 @@ -1,65 +1,7 @@ #!/usr/bin/make -f -# This debian/rules file is provided as a template for normal perl -# packages. It was created by Marc Brockschmidt for -# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may -# be used freely wherever it is useful. -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +%: + dh $@ -# If set to a true value then MakeMaker's prompt function will -# always return the default without waiting for user input. -export PERL_MM_USE_DEFAULT=1 - -PACKAGE=$(shell dh_listpackages) - -ifndef PERL -PERL = /usr/bin/perl -endif - -TMP =$(CURDIR)/debian/$(PACKAGE) - -build: build-stamp -build-stamp: - dh_testdir - $(PERL) Makefile.PL INSTALLDIRS=vendor - $(MAKE) - $(MAKE) test - touch build-stamp - -clean: - dh_testdir - dh_testroot - dh_clean build-stamp install-stamp - [ ! -f Makefile ] || $(MAKE) realclean - -install: install-stamp -install-stamp: build-stamp - dh_testdir - dh_testroot - dh_clean -k - $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr - [ ! -d $(TMP)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(TMP)/usr/lib/perl5 - touch install-stamp - -binary-arch: -# We have nothing to do by default. - -binary-indep: build install - dh_testdir - dh_testroot - dh_installdocs README - dh_installchangelogs Changes - dh_perl - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -source diff: - @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +override_dh_auto_test: + TEST_POD=1 dh_auto_test diff -Nru libnet-subnets-perl-0.21/debian/watch libnet-subnets-perl-1.0/debian/watch --- libnet-subnets-perl-0.21/debian/watch 2010-01-05 01:00:39.000000000 +0000 +++ libnet-subnets-perl-1.0/debian/watch 2010-01-05 01:00:39.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://www.cpan.org/modules/by-module/Net/Net-Subnets-([\d\.]+)\.(?:tar\.gz|tar|tgz) +http://search.cpan.org/dist/Net-Subnets/ .*/Net-Subnets-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) diff -Nru libnet-subnets-perl-0.21/examples/matching.pl libnet-subnets-perl-1.0/examples/matching.pl --- libnet-subnets-perl-0.21/examples/matching.pl 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/examples/matching.pl 2009-12-18 19:33:37.000000000 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use Net::Subnets; + +my @subnets = qw(10.0.0.0/24 10.0.1.0/24); +my @addresses = qw/10.0.0.1 10.0.1.2 10.0.3.1/; + +my $sn = Net::Subnets->new; +$sn->subnets(\@subnets); +my $results; +foreach my $address (@addresses) { + if (my $subnetref = $sn->check(\$address)) { + $results .= "$address: $$subnetref\n"; + } + else { + $results .= "$address: not found\n"; + } +} +print($results); diff -Nru libnet-subnets-perl-0.21/lib/Net/Subnets.pm libnet-subnets-perl-1.0/lib/Net/Subnets.pm --- libnet-subnets-perl-0.21/lib/Net/Subnets.pm 2005-02-19 20:00:15.000000000 +0000 +++ libnet-subnets-perl-1.0/lib/Net/Subnets.pm 2009-12-18 19:39:17.000000000 +0000 @@ -1,68 +1,64 @@ +# Copyright (C) 2003-2009, Sebastian Riedel. + package Net::Subnets; use strict; -use vars qw($VERSION); +use vars qw/$VERSION/; -$VERSION = '0.21'; +$VERSION = '1.0'; sub new { my $self = shift; - return bless( {}, ( ref($self) || $self ) ); + return bless({}, (ref($self) || $self)); } sub subnets { - my ( $self, $subnets ) = @_; + my ($self, $subnets) = @_; my %masks; foreach (@$subnets) { /^(.+?)\/(.+)$/o; - my $revmask = 32 - ( $2 || 32 ); + my $revmask = 32 - ($2 || 32); $self->{subnets}{$revmask} - { unpack( "N", pack( "C4", split( /\./, $1 ) ) ) >> $revmask } = $_; + {unpack("N", pack("C4", split(/\./, $1))) >> $revmask} = $_; $masks{$revmask}++; } - @{ $self->{masks} } = - sort( { $masks{$a} <=> $masks{$b} } keys(%masks) ); + @{$self->{masks}} = + sort({$masks{$a} <=> $masks{$b}} keys(%masks)); } sub check { - my ( $self, $address ) = @_; - foreach ( @{ $self->{masks} } ) { - my $option = - unpack( "N", pack( "C4", split( /\./, $$address ) ) ) >> $_; - if ( $self->{subnets}{$_}{$option} ) { - return \( $self->{subnets}{$_}{$option} ); + my ($self, $address) = @_; + foreach (@{$self->{masks}}) { + my $option = unpack("N", pack("C4", split(/\./, $$address))) >> $_; + if ($self->{subnets}{$_}{$option}) { + return \($self->{subnets}{$_}{$option}); } } return 0; } sub range { - my ( $self, $subnet ) = @_; + my ($self, $subnet) = @_; $$subnet =~ /^(.+?)\/(.+)$/o; my $net = - pack( 'C4', split( /\./, $1 ) ) & - pack( 'B*', ( 1 x $2 ) . ( 0 x ( 32 - ( $2 || 32 ) ) ) ); - my $lowip = - join( '.', unpack( 'C4', pack( 'B*', ( 0 x 31 ) . 1 ) | $net ) ); - my $highip = join( - '.', - unpack( - 'C4', pack( 'B*', ( 0 x $2 ) . ( 1 x ( 31 - $2 ) ) . 0 ) | $net - ) - ); - if ( $2 == 32 ) { - return ( \$highip, \$highip ); + pack('C4', split(/\./, $1)) + & pack('B*', (1 x $2) . (0 x (32 - ($2 || 32)))); + my $lowip = join('.', unpack('C4', pack('B*', (0 x 31) . 1) | $net)); + my $highip = join('.', + unpack('C4', pack('B*', (0 x $2) . (1 x (31 - $2)) . 0) | $net)); + if ($2 == 32) { + return (\$highip, \$highip); } - return ( \$lowip, \$highip ); + return (\$lowip, \$highip); } sub list { - my ( $self, $lowip, $highip ) = @_; - my $lowint = unpack( "N", pack( "C4", split( /\./, $$lowip ) ) ); - my $highint = unpack( "N", pack( "C4", split( /\./, $$highip ) ) ); - my @list = ( join( '.', unpack( 'C4', pack( 'N', $lowint ) ) ) ); - while ( $lowint lt $highint ) { - push( @list, join( '.', unpack( 'C4', pack( 'N', ++$lowint ) ) ) ); + my ($self, $lowip, $highip) = @_; + my $lowint = unpack("N", pack("C4", split(/\./, $$lowip))); + my $highint = unpack("N", pack("C4", split(/\./, $$highip))); + my @list = (join('.', unpack('C4', pack('N', $lowint)))); + while ($lowint lt $highint) { + push(@list, join('.', unpack('C4', pack('N', ++$lowint)))); } return \@list; } @@ -72,71 +68,43 @@ =head1 NAME -Net::Subnets - Computing subnets in large scale networks +Net::Subnets - Computing Subnets In Large Scale Networks =head1 SYNOPSIS use Net::Subnets; my $sn = Net::Subnets->new; - $sn->subnets( \@subnets ); - if ( my $subnetref = $sn->check( \$address ) ) { + $sn->subnets(\@subnets); + if (my $subnetref = $sn->check(\$address)) { ... } - my ( $lowipref, highipref ) = $sn->range( \$subnet ); - my $listref = $sn->list( \( $lowipref, $highipref ) ); + my ($lowipref, highipref) = $sn->range(\$subnet); + my $listref = $sn->list(\($lowipref, $highipref)); =head1 DESCRIPTION Very fast matches large lists of IP addresses against many CIDR subnets and calculates IP address ranges. -The following functions are provided by this module: - - new() - Creates an "Net::Subnets" object. - It takes no arguments. - - subnets( \@subnets ) - The subnets() function lets you prepare a list of CIDR subnets. - It takes an array reference. - - check( \$address ) - The check() function lets you check an IP address against the - previously prepared subnets. - It takes a scalar reference and returns a scalar reference to - the first matching CIDR subnet. - - range( \$subnet ) - The range() function lets you calculate the IP address range - of a subnet. - It takes a scalar reference and returns two scalar references to - the lowest and highest IP address. - - list( \$lowip, \$highip ) - The list() function lets you calculate a list containing all IP - addresses in a given range. - It takes two scalar references and returns a reference to a list - containing the IP addresses. - This is a simple and efficient example for subnet matching: use Net::Subnets; my @subnets = qw(10.0.0.0/24 10.0.1.0/24); - my @addresses = qw(10.0.0.1 10.0.1.2 10.0.3.1); + my @addresses = qw/10.0.0.1 10.0.1.2 10.0.3.1/; my $sn = Net::Subnets->new; - $sn->subnets( \@subnets ); + $sn->subnets(\@subnets); my $results; - foreach my $address ( @addresses ) { - if ( my $subnetref = $sn->check( \$address ) ) { + foreach my $address (@addresses) { + if (my $subnetref = $sn->check(\$address)) { $results .= "$address: $$subnetref\n"; } else { $results .= "$address: not found\n"; } } - print( $results ); + print($results); This is a simple example for range calculation: @@ -146,8 +114,8 @@ my $sn = Net::Subnets->new; my $results; - foreach my $subnet ( @subnets ) { - my ( $lowipref, $highipref ) = $sn->range( \$subnet ); + foreach my $subnet (@subnets) { + my ($lowipref, $highipref) = $sn->range(\$subnet); $results .= "$subnet: $$lowipref - $$highipref\n"; } print( $results ); @@ -160,23 +128,55 @@ my $highip = '192.168.0.100'; my $sn = Net::Subnets->new; - my $listref = $sn->list( \( $lowip, $highip ) ); - foreach my $address ( @{ $listref } ) { + my $listref = $sn->list(\($lowip, $highip)); + foreach my $address (@$listref) { # do something cool } +=head1 METHODS + +=head2 C + + my $subnets = Net::Subnets->new; + + Creates an "Net::Subnets" object. + +=head2 C + + $subnets->subnets([qw(10.0.0.0/24 10.0.1.0/24)]); + + The C method lets you prepare a list of CIDR subnets. + +=head2 C + + my $match = $subnets->check(\$address); + + The C method lets you check an IP address against the previously + prepared subnets. + +=head2 C + + my ($lowest, $highest) = $subnets->range(\$subnet) + + The C method lets you calculate the IP address range of a subnet. + +=head2 C + + my $list = $subnets->list(\$lowest, $highest); + + The C method lets you calculate a list containing all IP addresses + in a given range. =head1 AUTHOR Sebastian Riedel (sri@cpan.org), Juergen Peters (juergen.peters@taulmarill.de) -=head1 COPYRIGHT +=head1 COPYRIGHT AND LICENSE -Copyright 2003 Sebastian Riedel & Juergen Peters. All rights reserved. +Copyright (C) 2003-2009, Sebastian Riedel. -This library is free software. You can redistribute it and/or -modify it under the same terms -as perl itself. +This program is free software, you can redistribute it and/or modify it under +the terms of the Artistic License version 2.0. =cut diff -Nru libnet-subnets-perl-0.21/LICENSE libnet-subnets-perl-1.0/LICENSE --- libnet-subnets-perl-0.21/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/LICENSE 2009-12-18 19:01:09.000000000 +0000 @@ -0,0 +1,201 @@ + The Artistic License 2.0 + + Copyright (c) 2000-2006, The Perl Foundation. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru libnet-subnets-perl-0.21/Makefile.PL libnet-subnets-perl-1.0/Makefile.PL --- libnet-subnets-perl-0.21/Makefile.PL 2003-09-11 20:54:07.000000000 +0100 +++ libnet-subnets-perl-1.0/Makefile.PL 2009-12-18 19:31:08.000000000 +0000 @@ -1,7 +1,40 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use strict; +use warnings; + use ExtUtils::MakeMaker; +my $mm = $ExtUtils::MakeMaker::VERSION; + +# Son, when you participate in sporting events, +# it's not whether you win or lose, it's how drunk you get. WriteMakefile( NAME => 'Net::Subnets', - AUTHOR => 'Sebastian Riedel (sri@oook.de)', + AUTHOR => 'Sebastian Riedel (sri@cpan.org)', VERSION_FROM => 'lib/Net/Subnets.pm', + + ($mm < 6.3002 ? () : ('LICENSE' => 'artistic_2')), + + ( $mm < 6.46 + ? () + : ( META_MERGE => { + requires => {perl => '5.008001'}, + resources => { + license => 'http://dev.perl.org/licenses/', + repository => + 'http://github.com/kraih/net-subnets/tree/master' + }, + no_index => {directory => [qw/t/]} + }, + META_ADD => { + build_requires => {}, + configure_requires => {} + }, + ) + ), + + PREREQ_PM => {'ExtUtils::MakeMaker' => 0, 'Test::More' => 0} ); diff -Nru libnet-subnets-perl-0.21/MANIFEST libnet-subnets-perl-1.0/MANIFEST --- libnet-subnets-perl-0.21/MANIFEST 2005-02-19 19:59:45.000000000 +0000 +++ libnet-subnets-perl-1.0/MANIFEST 2009-12-18 19:40:52.000000000 +0000 @@ -1,10 +1,15 @@ +.perltidyrc Changes +examples/matching.pl lib/Net/Subnets.pm +LICENSE Makefile.PL MANIFEST This list of files -META.yml README -t/1use.t -t/2check.t -t/3range.t -t/4list.t +t/01use.t +t/02pod.t +t/03podcoverage.t +t/04check.t +t/05range.t +t/06list.t +META.yml Module meta-data (added by MakeMaker) diff -Nru libnet-subnets-perl-0.21/META.yml libnet-subnets-perl-1.0/META.yml --- libnet-subnets-perl-0.21/META.yml 2005-02-19 20:00:38.000000000 +0000 +++ libnet-subnets-perl-1.0/META.yml 2009-12-18 19:40:52.000000000 +0000 @@ -1,10 +1,26 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: Net-Subnets -version: 0.21 -version_from: lib/Net/Subnets.pm -installdirs: site +--- #YAML:1.0 +name: Net-Subnets +version: 1.0 +abstract: ~ +author: + - Sebastian Riedel (sri@cpan.org) +license: artistic_2 +distribution_type: module +configure_requires: {} +build_requires: {} requires: - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.17 + ExtUtils::MakeMaker: 0 + perl: 5.008001 + Test::More: 0 +resources: + license: http://dev.perl.org/licenses/ + repository: http://github.com/kraih/net-subnets/tree/master +no_index: + directory: + - t + - inc + - t +generated_by: ExtUtils::MakeMaker version 6.55_02 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff -Nru libnet-subnets-perl-0.21/.perltidyrc libnet-subnets-perl-1.0/.perltidyrc --- libnet-subnets-perl-0.21/.perltidyrc 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/.perltidyrc 2009-12-18 19:36:26.000000000 +0000 @@ -0,0 +1,35 @@ +# Perl Best Practices (plus errata) .perltidyrc file + +-l=98 # Max line width is 98 cols +-i=4 # Indent level is 4 cols +-ci=4 # Continuation indent is 4 cols +#-st # Output to STDOUT +-se # Errors to STDERR +-vt=2 # Maximal vertical tightness +-cti=0 # No extra indentation for closing brackets +-pt=1 # Medium parenthesis tightness +-bt=1 # Medium brace tightness +-sbt=1 # Medium square bracket tightness +-bbt=1 # Medium block brace tightness +-nsfs # No space before semicolons +-nolq # Don't outdent long quoted strings +-wbb="% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=" + # Break before all operators + +# extras/overrides/deviations from PBP + +--maximum-line-length=78 # be less generous +--warning-output # Show warnings +--maximum-consecutive-blank-lines=2 # default is 1 +--nohanging-side-comments # troublesome for commented out code + +-isbc # block comments may only be indented if they have some space characters before the # +-ci=2 # Continuation indent is 2 cols + +# we use version control, so just rewrite the file +-b + +# for the up-tight folk :) +-pt=2 # High parenthesis tightness +-bt=2 # High brace tightness +-sbt=2 # High square bracket tightness diff -Nru libnet-subnets-perl-0.21/README libnet-subnets-perl-1.0/README --- libnet-subnets-perl-0.21/README 2003-11-16 15:11:34.000000000 +0000 +++ libnet-subnets-perl-1.0/README 2009-12-18 19:38:50.000000000 +0000 @@ -1,21 +1,8 @@ -Net/Subnets version 0.20 -======================== - -Very fast matches large lists of IP addresses against many CIDR subnets, -calculates IP address ranges and provides a simple object oriented interface. - -INSTALLATION +Computing Subnets In Large Scale Networks. To install this module type the following: - perl Makefile.PL - make - make test - make install - -COPYRIGHT AND LICENCE - -Copyright (C) 2003 Sebastian Riedel & Juergen Peters. All rights reserved. - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. + perl Makefile.PL + make + make test + make install diff -Nru libnet-subnets-perl-0.21/t/01use.t libnet-subnets-perl-1.0/t/01use.t --- libnet-subnets-perl-0.21/t/01use.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/01use.t 2009-12-18 19:29:31.000000000 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::More tests => 1; + +BEGIN { use_ok('Net::Subnets') } diff -Nru libnet-subnets-perl-0.21/t/02pod.t libnet-subnets-perl-1.0/t/02pod.t --- libnet-subnets-perl-0.21/t/02pod.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/02pod.t 2009-12-18 19:33:57.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/env perl + +# Copyright (C) 2005-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::More; + +eval "use Test::Pod 1.14"; +plan skip_all => 'Test::Pod 1.14 required' if $@; +plan skip_all => 'set TEST_POD to enable this test (developer only!)' + unless $ENV{TEST_POD}; + +# Marge, it takes two to lie. One to lie and one to listen. +all_pod_files_ok(); diff -Nru libnet-subnets-perl-0.21/t/03podcoverage.t libnet-subnets-perl-1.0/t/03podcoverage.t --- libnet-subnets-perl-0.21/t/03podcoverage.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/03podcoverage.t 2009-12-18 19:34:09.000000000 +0000 @@ -0,0 +1,17 @@ +#!/usr/bin/env perl + +# Copyright (C) 2005-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::More; + +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; +plan skip_all => 'set TEST_POD to enable this test (developer only!)' + unless $ENV{TEST_POD}; + +# Marge, I'm going to miss you so much. And it's not just the sex. +# It's also the food preparation. +all_pod_coverage_ok(); diff -Nru libnet-subnets-perl-0.21/t/04check.t libnet-subnets-perl-1.0/t/04check.t --- libnet-subnets-perl-0.21/t/04check.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/04check.t 2009-12-18 19:30:00.000000000 +0000 @@ -0,0 +1,25 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::Simple tests => 4; + +use Net::Subnets; + +my @subnets = qw(10.0.0.0/24 10.0.1.0/24); +my @good_addr = qw(10.0.0.1 10.0.1.2); +my @bad_addr = qw(10.0.3.4 20.0.0.1); + +my $sn = Net::Subnets->new; +$sn->subnets(\@subnets); + +foreach my $addr (@good_addr) { + ok($sn->check(\$addr)); +} + +foreach my $addr (@bad_addr) { + ok(!$sn->check(\$addr)); +} diff -Nru libnet-subnets-perl-0.21/t/05range.t libnet-subnets-perl-1.0/t/05range.t --- libnet-subnets-perl-0.21/t/05range.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/05range.t 2009-12-18 19:30:31.000000000 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::Simple tests => 2; + +use Net::Subnets; + +my @subnets = qw(10.0.0.0/24 10.0.1.4/32); +my @lowips = qw(10.0.0.1 10.0.1.4); +my @highips = qw(10.0.0.254 10.0.1.4); + +my $sn = Net::Subnets->new; +for (my $i = 0; $i <= $#subnets; $i++) { + my ($lowip, $highip) = $sn->range(\$subnets[$i]); + ok((($lowips[$i] eq $$lowip) && ($highips[$i] eq $$highip))); +} diff -Nru libnet-subnets-perl-0.21/t/06list.t libnet-subnets-perl-1.0/t/06list.t --- libnet-subnets-perl-0.21/t/06list.t 1970-01-01 01:00:00.000000000 +0100 +++ libnet-subnets-perl-1.0/t/06list.t 2009-12-18 19:30:57.000000000 +0000 @@ -0,0 +1,532 @@ +#!/usr/bin/env perl + +# Copyright (C) 2003-2009, Sebastian Riedel. + +use strict; +use warnings; + +use Test::Simple tests => 510; + +use Net::Subnets; + +my $subnet = '10.0.0.0/23'; + +my $sn = Net::Subnets->new; +my $list = $sn->list($sn->range(\$subnet)); + +while () { + chomp; + ok(($_ eq $$list[$. - 1])); +} + +__DATA__ +10.0.0.1 +10.0.0.2 +10.0.0.3 +10.0.0.4 +10.0.0.5 +10.0.0.6 +10.0.0.7 +10.0.0.8 +10.0.0.9 +10.0.0.10 +10.0.0.11 +10.0.0.12 +10.0.0.13 +10.0.0.14 +10.0.0.15 +10.0.0.16 +10.0.0.17 +10.0.0.18 +10.0.0.19 +10.0.0.20 +10.0.0.21 +10.0.0.22 +10.0.0.23 +10.0.0.24 +10.0.0.25 +10.0.0.26 +10.0.0.27 +10.0.0.28 +10.0.0.29 +10.0.0.30 +10.0.0.31 +10.0.0.32 +10.0.0.33 +10.0.0.34 +10.0.0.35 +10.0.0.36 +10.0.0.37 +10.0.0.38 +10.0.0.39 +10.0.0.40 +10.0.0.41 +10.0.0.42 +10.0.0.43 +10.0.0.44 +10.0.0.45 +10.0.0.46 +10.0.0.47 +10.0.0.48 +10.0.0.49 +10.0.0.50 +10.0.0.51 +10.0.0.52 +10.0.0.53 +10.0.0.54 +10.0.0.55 +10.0.0.56 +10.0.0.57 +10.0.0.58 +10.0.0.59 +10.0.0.60 +10.0.0.61 +10.0.0.62 +10.0.0.63 +10.0.0.64 +10.0.0.65 +10.0.0.66 +10.0.0.67 +10.0.0.68 +10.0.0.69 +10.0.0.70 +10.0.0.71 +10.0.0.72 +10.0.0.73 +10.0.0.74 +10.0.0.75 +10.0.0.76 +10.0.0.77 +10.0.0.78 +10.0.0.79 +10.0.0.80 +10.0.0.81 +10.0.0.82 +10.0.0.83 +10.0.0.84 +10.0.0.85 +10.0.0.86 +10.0.0.87 +10.0.0.88 +10.0.0.89 +10.0.0.90 +10.0.0.91 +10.0.0.92 +10.0.0.93 +10.0.0.94 +10.0.0.95 +10.0.0.96 +10.0.0.97 +10.0.0.98 +10.0.0.99 +10.0.0.100 +10.0.0.101 +10.0.0.102 +10.0.0.103 +10.0.0.104 +10.0.0.105 +10.0.0.106 +10.0.0.107 +10.0.0.108 +10.0.0.109 +10.0.0.110 +10.0.0.111 +10.0.0.112 +10.0.0.113 +10.0.0.114 +10.0.0.115 +10.0.0.116 +10.0.0.117 +10.0.0.118 +10.0.0.119 +10.0.0.120 +10.0.0.121 +10.0.0.122 +10.0.0.123 +10.0.0.124 +10.0.0.125 +10.0.0.126 +10.0.0.127 +10.0.0.128 +10.0.0.129 +10.0.0.130 +10.0.0.131 +10.0.0.132 +10.0.0.133 +10.0.0.134 +10.0.0.135 +10.0.0.136 +10.0.0.137 +10.0.0.138 +10.0.0.139 +10.0.0.140 +10.0.0.141 +10.0.0.142 +10.0.0.143 +10.0.0.144 +10.0.0.145 +10.0.0.146 +10.0.0.147 +10.0.0.148 +10.0.0.149 +10.0.0.150 +10.0.0.151 +10.0.0.152 +10.0.0.153 +10.0.0.154 +10.0.0.155 +10.0.0.156 +10.0.0.157 +10.0.0.158 +10.0.0.159 +10.0.0.160 +10.0.0.161 +10.0.0.162 +10.0.0.163 +10.0.0.164 +10.0.0.165 +10.0.0.166 +10.0.0.167 +10.0.0.168 +10.0.0.169 +10.0.0.170 +10.0.0.171 +10.0.0.172 +10.0.0.173 +10.0.0.174 +10.0.0.175 +10.0.0.176 +10.0.0.177 +10.0.0.178 +10.0.0.179 +10.0.0.180 +10.0.0.181 +10.0.0.182 +10.0.0.183 +10.0.0.184 +10.0.0.185 +10.0.0.186 +10.0.0.187 +10.0.0.188 +10.0.0.189 +10.0.0.190 +10.0.0.191 +10.0.0.192 +10.0.0.193 +10.0.0.194 +10.0.0.195 +10.0.0.196 +10.0.0.197 +10.0.0.198 +10.0.0.199 +10.0.0.200 +10.0.0.201 +10.0.0.202 +10.0.0.203 +10.0.0.204 +10.0.0.205 +10.0.0.206 +10.0.0.207 +10.0.0.208 +10.0.0.209 +10.0.0.210 +10.0.0.211 +10.0.0.212 +10.0.0.213 +10.0.0.214 +10.0.0.215 +10.0.0.216 +10.0.0.217 +10.0.0.218 +10.0.0.219 +10.0.0.220 +10.0.0.221 +10.0.0.222 +10.0.0.223 +10.0.0.224 +10.0.0.225 +10.0.0.226 +10.0.0.227 +10.0.0.228 +10.0.0.229 +10.0.0.230 +10.0.0.231 +10.0.0.232 +10.0.0.233 +10.0.0.234 +10.0.0.235 +10.0.0.236 +10.0.0.237 +10.0.0.238 +10.0.0.239 +10.0.0.240 +10.0.0.241 +10.0.0.242 +10.0.0.243 +10.0.0.244 +10.0.0.245 +10.0.0.246 +10.0.0.247 +10.0.0.248 +10.0.0.249 +10.0.0.250 +10.0.0.251 +10.0.0.252 +10.0.0.253 +10.0.0.254 +10.0.0.255 +10.0.1.0 +10.0.1.1 +10.0.1.2 +10.0.1.3 +10.0.1.4 +10.0.1.5 +10.0.1.6 +10.0.1.7 +10.0.1.8 +10.0.1.9 +10.0.1.10 +10.0.1.11 +10.0.1.12 +10.0.1.13 +10.0.1.14 +10.0.1.15 +10.0.1.16 +10.0.1.17 +10.0.1.18 +10.0.1.19 +10.0.1.20 +10.0.1.21 +10.0.1.22 +10.0.1.23 +10.0.1.24 +10.0.1.25 +10.0.1.26 +10.0.1.27 +10.0.1.28 +10.0.1.29 +10.0.1.30 +10.0.1.31 +10.0.1.32 +10.0.1.33 +10.0.1.34 +10.0.1.35 +10.0.1.36 +10.0.1.37 +10.0.1.38 +10.0.1.39 +10.0.1.40 +10.0.1.41 +10.0.1.42 +10.0.1.43 +10.0.1.44 +10.0.1.45 +10.0.1.46 +10.0.1.47 +10.0.1.48 +10.0.1.49 +10.0.1.50 +10.0.1.51 +10.0.1.52 +10.0.1.53 +10.0.1.54 +10.0.1.55 +10.0.1.56 +10.0.1.57 +10.0.1.58 +10.0.1.59 +10.0.1.60 +10.0.1.61 +10.0.1.62 +10.0.1.63 +10.0.1.64 +10.0.1.65 +10.0.1.66 +10.0.1.67 +10.0.1.68 +10.0.1.69 +10.0.1.70 +10.0.1.71 +10.0.1.72 +10.0.1.73 +10.0.1.74 +10.0.1.75 +10.0.1.76 +10.0.1.77 +10.0.1.78 +10.0.1.79 +10.0.1.80 +10.0.1.81 +10.0.1.82 +10.0.1.83 +10.0.1.84 +10.0.1.85 +10.0.1.86 +10.0.1.87 +10.0.1.88 +10.0.1.89 +10.0.1.90 +10.0.1.91 +10.0.1.92 +10.0.1.93 +10.0.1.94 +10.0.1.95 +10.0.1.96 +10.0.1.97 +10.0.1.98 +10.0.1.99 +10.0.1.100 +10.0.1.101 +10.0.1.102 +10.0.1.103 +10.0.1.104 +10.0.1.105 +10.0.1.106 +10.0.1.107 +10.0.1.108 +10.0.1.109 +10.0.1.110 +10.0.1.111 +10.0.1.112 +10.0.1.113 +10.0.1.114 +10.0.1.115 +10.0.1.116 +10.0.1.117 +10.0.1.118 +10.0.1.119 +10.0.1.120 +10.0.1.121 +10.0.1.122 +10.0.1.123 +10.0.1.124 +10.0.1.125 +10.0.1.126 +10.0.1.127 +10.0.1.128 +10.0.1.129 +10.0.1.130 +10.0.1.131 +10.0.1.132 +10.0.1.133 +10.0.1.134 +10.0.1.135 +10.0.1.136 +10.0.1.137 +10.0.1.138 +10.0.1.139 +10.0.1.140 +10.0.1.141 +10.0.1.142 +10.0.1.143 +10.0.1.144 +10.0.1.145 +10.0.1.146 +10.0.1.147 +10.0.1.148 +10.0.1.149 +10.0.1.150 +10.0.1.151 +10.0.1.152 +10.0.1.153 +10.0.1.154 +10.0.1.155 +10.0.1.156 +10.0.1.157 +10.0.1.158 +10.0.1.159 +10.0.1.160 +10.0.1.161 +10.0.1.162 +10.0.1.163 +10.0.1.164 +10.0.1.165 +10.0.1.166 +10.0.1.167 +10.0.1.168 +10.0.1.169 +10.0.1.170 +10.0.1.171 +10.0.1.172 +10.0.1.173 +10.0.1.174 +10.0.1.175 +10.0.1.176 +10.0.1.177 +10.0.1.178 +10.0.1.179 +10.0.1.180 +10.0.1.181 +10.0.1.182 +10.0.1.183 +10.0.1.184 +10.0.1.185 +10.0.1.186 +10.0.1.187 +10.0.1.188 +10.0.1.189 +10.0.1.190 +10.0.1.191 +10.0.1.192 +10.0.1.193 +10.0.1.194 +10.0.1.195 +10.0.1.196 +10.0.1.197 +10.0.1.198 +10.0.1.199 +10.0.1.200 +10.0.1.201 +10.0.1.202 +10.0.1.203 +10.0.1.204 +10.0.1.205 +10.0.1.206 +10.0.1.207 +10.0.1.208 +10.0.1.209 +10.0.1.210 +10.0.1.211 +10.0.1.212 +10.0.1.213 +10.0.1.214 +10.0.1.215 +10.0.1.216 +10.0.1.217 +10.0.1.218 +10.0.1.219 +10.0.1.220 +10.0.1.221 +10.0.1.222 +10.0.1.223 +10.0.1.224 +10.0.1.225 +10.0.1.226 +10.0.1.227 +10.0.1.228 +10.0.1.229 +10.0.1.230 +10.0.1.231 +10.0.1.232 +10.0.1.233 +10.0.1.234 +10.0.1.235 +10.0.1.236 +10.0.1.237 +10.0.1.238 +10.0.1.239 +10.0.1.240 +10.0.1.241 +10.0.1.242 +10.0.1.243 +10.0.1.244 +10.0.1.245 +10.0.1.246 +10.0.1.247 +10.0.1.248 +10.0.1.249 +10.0.1.250 +10.0.1.251 +10.0.1.252 +10.0.1.253 +10.0.1.254 diff -Nru libnet-subnets-perl-0.21/t/1use.t libnet-subnets-perl-1.0/t/1use.t --- libnet-subnets-perl-0.21/t/1use.t 2003-09-11 15:26:51.000000000 +0100 +++ libnet-subnets-perl-1.0/t/1use.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -use strict; -use Test::More tests => 1; - -BEGIN { use_ok('Net::Subnets') } diff -Nru libnet-subnets-perl-0.21/t/2check.t libnet-subnets-perl-1.0/t/2check.t --- libnet-subnets-perl-0.21/t/2check.t 2003-09-15 14:30:11.000000000 +0100 +++ libnet-subnets-perl-1.0/t/2check.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,18 +0,0 @@ -use strict; -use Test::Simple tests => 4; -use Net::Subnets; - -my @subnets = qw(10.0.0.0/24 10.0.1.0/24); -my @good_addr = qw(10.0.0.1 10.0.1.2); -my @bad_addr = qw(10.0.3.4 20.0.0.1); - -my $sn = Net::Subnets->new; -$sn->subnets( \@subnets ); - -foreach my $addr (@good_addr) { - ok( $sn->check( \$addr ) ); -} - -foreach my $addr (@bad_addr) { - ok( !$sn->check( \$addr ) ); -} diff -Nru libnet-subnets-perl-0.21/t/3range.t libnet-subnets-perl-1.0/t/3range.t --- libnet-subnets-perl-0.21/t/3range.t 2003-09-29 17:49:49.000000000 +0100 +++ libnet-subnets-perl-1.0/t/3range.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -use strict; -use Test::Simple tests => 2; -use Net::Subnets; - -my @subnets = qw(10.0.0.0/24 10.0.1.4/32); -my @lowips = qw(10.0.0.1 10.0.1.4); -my @highips = qw(10.0.0.254 10.0.1.4); - -my $sn = Net::Subnets->new; -for ( my $i = 0 ; $i <= $#subnets ; $i++ ) { - my ( $lowip, $highip ) = $sn->range( \$subnets[$i] ); - ok( ( ( $lowips[$i] eq $$lowip ) && ( $highips[$i] eq $$highip ) ) ); -} diff -Nru libnet-subnets-perl-0.21/t/4list.t libnet-subnets-perl-1.0/t/4list.t --- libnet-subnets-perl-0.21/t/4list.t 2003-11-17 22:17:58.000000000 +0000 +++ libnet-subnets-perl-1.0/t/4list.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,525 +0,0 @@ -use strict; -use Test::Simple tests => 510; -use Net::Subnets; - -my $subnet = '10.0.0.0/23'; - -my $sn = Net::Subnets->new; -my $list = $sn->list( $sn->range( \$subnet ) ); - -while () { - chomp; - ok( ( $_ eq $$list[ $. - 1 ] ) ); -} - -__DATA__ -10.0.0.1 -10.0.0.2 -10.0.0.3 -10.0.0.4 -10.0.0.5 -10.0.0.6 -10.0.0.7 -10.0.0.8 -10.0.0.9 -10.0.0.10 -10.0.0.11 -10.0.0.12 -10.0.0.13 -10.0.0.14 -10.0.0.15 -10.0.0.16 -10.0.0.17 -10.0.0.18 -10.0.0.19 -10.0.0.20 -10.0.0.21 -10.0.0.22 -10.0.0.23 -10.0.0.24 -10.0.0.25 -10.0.0.26 -10.0.0.27 -10.0.0.28 -10.0.0.29 -10.0.0.30 -10.0.0.31 -10.0.0.32 -10.0.0.33 -10.0.0.34 -10.0.0.35 -10.0.0.36 -10.0.0.37 -10.0.0.38 -10.0.0.39 -10.0.0.40 -10.0.0.41 -10.0.0.42 -10.0.0.43 -10.0.0.44 -10.0.0.45 -10.0.0.46 -10.0.0.47 -10.0.0.48 -10.0.0.49 -10.0.0.50 -10.0.0.51 -10.0.0.52 -10.0.0.53 -10.0.0.54 -10.0.0.55 -10.0.0.56 -10.0.0.57 -10.0.0.58 -10.0.0.59 -10.0.0.60 -10.0.0.61 -10.0.0.62 -10.0.0.63 -10.0.0.64 -10.0.0.65 -10.0.0.66 -10.0.0.67 -10.0.0.68 -10.0.0.69 -10.0.0.70 -10.0.0.71 -10.0.0.72 -10.0.0.73 -10.0.0.74 -10.0.0.75 -10.0.0.76 -10.0.0.77 -10.0.0.78 -10.0.0.79 -10.0.0.80 -10.0.0.81 -10.0.0.82 -10.0.0.83 -10.0.0.84 -10.0.0.85 -10.0.0.86 -10.0.0.87 -10.0.0.88 -10.0.0.89 -10.0.0.90 -10.0.0.91 -10.0.0.92 -10.0.0.93 -10.0.0.94 -10.0.0.95 -10.0.0.96 -10.0.0.97 -10.0.0.98 -10.0.0.99 -10.0.0.100 -10.0.0.101 -10.0.0.102 -10.0.0.103 -10.0.0.104 -10.0.0.105 -10.0.0.106 -10.0.0.107 -10.0.0.108 -10.0.0.109 -10.0.0.110 -10.0.0.111 -10.0.0.112 -10.0.0.113 -10.0.0.114 -10.0.0.115 -10.0.0.116 -10.0.0.117 -10.0.0.118 -10.0.0.119 -10.0.0.120 -10.0.0.121 -10.0.0.122 -10.0.0.123 -10.0.0.124 -10.0.0.125 -10.0.0.126 -10.0.0.127 -10.0.0.128 -10.0.0.129 -10.0.0.130 -10.0.0.131 -10.0.0.132 -10.0.0.133 -10.0.0.134 -10.0.0.135 -10.0.0.136 -10.0.0.137 -10.0.0.138 -10.0.0.139 -10.0.0.140 -10.0.0.141 -10.0.0.142 -10.0.0.143 -10.0.0.144 -10.0.0.145 -10.0.0.146 -10.0.0.147 -10.0.0.148 -10.0.0.149 -10.0.0.150 -10.0.0.151 -10.0.0.152 -10.0.0.153 -10.0.0.154 -10.0.0.155 -10.0.0.156 -10.0.0.157 -10.0.0.158 -10.0.0.159 -10.0.0.160 -10.0.0.161 -10.0.0.162 -10.0.0.163 -10.0.0.164 -10.0.0.165 -10.0.0.166 -10.0.0.167 -10.0.0.168 -10.0.0.169 -10.0.0.170 -10.0.0.171 -10.0.0.172 -10.0.0.173 -10.0.0.174 -10.0.0.175 -10.0.0.176 -10.0.0.177 -10.0.0.178 -10.0.0.179 -10.0.0.180 -10.0.0.181 -10.0.0.182 -10.0.0.183 -10.0.0.184 -10.0.0.185 -10.0.0.186 -10.0.0.187 -10.0.0.188 -10.0.0.189 -10.0.0.190 -10.0.0.191 -10.0.0.192 -10.0.0.193 -10.0.0.194 -10.0.0.195 -10.0.0.196 -10.0.0.197 -10.0.0.198 -10.0.0.199 -10.0.0.200 -10.0.0.201 -10.0.0.202 -10.0.0.203 -10.0.0.204 -10.0.0.205 -10.0.0.206 -10.0.0.207 -10.0.0.208 -10.0.0.209 -10.0.0.210 -10.0.0.211 -10.0.0.212 -10.0.0.213 -10.0.0.214 -10.0.0.215 -10.0.0.216 -10.0.0.217 -10.0.0.218 -10.0.0.219 -10.0.0.220 -10.0.0.221 -10.0.0.222 -10.0.0.223 -10.0.0.224 -10.0.0.225 -10.0.0.226 -10.0.0.227 -10.0.0.228 -10.0.0.229 -10.0.0.230 -10.0.0.231 -10.0.0.232 -10.0.0.233 -10.0.0.234 -10.0.0.235 -10.0.0.236 -10.0.0.237 -10.0.0.238 -10.0.0.239 -10.0.0.240 -10.0.0.241 -10.0.0.242 -10.0.0.243 -10.0.0.244 -10.0.0.245 -10.0.0.246 -10.0.0.247 -10.0.0.248 -10.0.0.249 -10.0.0.250 -10.0.0.251 -10.0.0.252 -10.0.0.253 -10.0.0.254 -10.0.0.255 -10.0.1.0 -10.0.1.1 -10.0.1.2 -10.0.1.3 -10.0.1.4 -10.0.1.5 -10.0.1.6 -10.0.1.7 -10.0.1.8 -10.0.1.9 -10.0.1.10 -10.0.1.11 -10.0.1.12 -10.0.1.13 -10.0.1.14 -10.0.1.15 -10.0.1.16 -10.0.1.17 -10.0.1.18 -10.0.1.19 -10.0.1.20 -10.0.1.21 -10.0.1.22 -10.0.1.23 -10.0.1.24 -10.0.1.25 -10.0.1.26 -10.0.1.27 -10.0.1.28 -10.0.1.29 -10.0.1.30 -10.0.1.31 -10.0.1.32 -10.0.1.33 -10.0.1.34 -10.0.1.35 -10.0.1.36 -10.0.1.37 -10.0.1.38 -10.0.1.39 -10.0.1.40 -10.0.1.41 -10.0.1.42 -10.0.1.43 -10.0.1.44 -10.0.1.45 -10.0.1.46 -10.0.1.47 -10.0.1.48 -10.0.1.49 -10.0.1.50 -10.0.1.51 -10.0.1.52 -10.0.1.53 -10.0.1.54 -10.0.1.55 -10.0.1.56 -10.0.1.57 -10.0.1.58 -10.0.1.59 -10.0.1.60 -10.0.1.61 -10.0.1.62 -10.0.1.63 -10.0.1.64 -10.0.1.65 -10.0.1.66 -10.0.1.67 -10.0.1.68 -10.0.1.69 -10.0.1.70 -10.0.1.71 -10.0.1.72 -10.0.1.73 -10.0.1.74 -10.0.1.75 -10.0.1.76 -10.0.1.77 -10.0.1.78 -10.0.1.79 -10.0.1.80 -10.0.1.81 -10.0.1.82 -10.0.1.83 -10.0.1.84 -10.0.1.85 -10.0.1.86 -10.0.1.87 -10.0.1.88 -10.0.1.89 -10.0.1.90 -10.0.1.91 -10.0.1.92 -10.0.1.93 -10.0.1.94 -10.0.1.95 -10.0.1.96 -10.0.1.97 -10.0.1.98 -10.0.1.99 -10.0.1.100 -10.0.1.101 -10.0.1.102 -10.0.1.103 -10.0.1.104 -10.0.1.105 -10.0.1.106 -10.0.1.107 -10.0.1.108 -10.0.1.109 -10.0.1.110 -10.0.1.111 -10.0.1.112 -10.0.1.113 -10.0.1.114 -10.0.1.115 -10.0.1.116 -10.0.1.117 -10.0.1.118 -10.0.1.119 -10.0.1.120 -10.0.1.121 -10.0.1.122 -10.0.1.123 -10.0.1.124 -10.0.1.125 -10.0.1.126 -10.0.1.127 -10.0.1.128 -10.0.1.129 -10.0.1.130 -10.0.1.131 -10.0.1.132 -10.0.1.133 -10.0.1.134 -10.0.1.135 -10.0.1.136 -10.0.1.137 -10.0.1.138 -10.0.1.139 -10.0.1.140 -10.0.1.141 -10.0.1.142 -10.0.1.143 -10.0.1.144 -10.0.1.145 -10.0.1.146 -10.0.1.147 -10.0.1.148 -10.0.1.149 -10.0.1.150 -10.0.1.151 -10.0.1.152 -10.0.1.153 -10.0.1.154 -10.0.1.155 -10.0.1.156 -10.0.1.157 -10.0.1.158 -10.0.1.159 -10.0.1.160 -10.0.1.161 -10.0.1.162 -10.0.1.163 -10.0.1.164 -10.0.1.165 -10.0.1.166 -10.0.1.167 -10.0.1.168 -10.0.1.169 -10.0.1.170 -10.0.1.171 -10.0.1.172 -10.0.1.173 -10.0.1.174 -10.0.1.175 -10.0.1.176 -10.0.1.177 -10.0.1.178 -10.0.1.179 -10.0.1.180 -10.0.1.181 -10.0.1.182 -10.0.1.183 -10.0.1.184 -10.0.1.185 -10.0.1.186 -10.0.1.187 -10.0.1.188 -10.0.1.189 -10.0.1.190 -10.0.1.191 -10.0.1.192 -10.0.1.193 -10.0.1.194 -10.0.1.195 -10.0.1.196 -10.0.1.197 -10.0.1.198 -10.0.1.199 -10.0.1.200 -10.0.1.201 -10.0.1.202 -10.0.1.203 -10.0.1.204 -10.0.1.205 -10.0.1.206 -10.0.1.207 -10.0.1.208 -10.0.1.209 -10.0.1.210 -10.0.1.211 -10.0.1.212 -10.0.1.213 -10.0.1.214 -10.0.1.215 -10.0.1.216 -10.0.1.217 -10.0.1.218 -10.0.1.219 -10.0.1.220 -10.0.1.221 -10.0.1.222 -10.0.1.223 -10.0.1.224 -10.0.1.225 -10.0.1.226 -10.0.1.227 -10.0.1.228 -10.0.1.229 -10.0.1.230 -10.0.1.231 -10.0.1.232 -10.0.1.233 -10.0.1.234 -10.0.1.235 -10.0.1.236 -10.0.1.237 -10.0.1.238 -10.0.1.239 -10.0.1.240 -10.0.1.241 -10.0.1.242 -10.0.1.243 -10.0.1.244 -10.0.1.245 -10.0.1.246 -10.0.1.247 -10.0.1.248 -10.0.1.249 -10.0.1.250 -10.0.1.251 -10.0.1.252 -10.0.1.253 -10.0.1.254