r21900 - in /branches/upstream/libnetwork-ipv4addr-perl: ./ current/ current/debian/

thialme-guest at users.alioth.debian.org thialme-guest at users.alioth.debian.org
Thu Jun 19 17:24:37 UTC 2008


Author: thialme-guest
Date: Thu Jun 19 17:24:36 2008
New Revision: 21900

URL: http://svn.debian.org/wsvn/?sc=1&rev=21900
Log:
[svn-inject] Installing original source of libnetwork-ipv4addr-perl

Added:
    branches/upstream/libnetwork-ipv4addr-perl/
    branches/upstream/libnetwork-ipv4addr-perl/current/
    branches/upstream/libnetwork-ipv4addr-perl/current/ChangeLog
    branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.pm
    branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.spec
    branches/upstream/libnetwork-ipv4addr-perl/current/MANIFEST
    branches/upstream/libnetwork-ipv4addr-perl/current/Makefile.PL
    branches/upstream/libnetwork-ipv4addr-perl/current/NEWS
    branches/upstream/libnetwork-ipv4addr-perl/current/README
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/changelog
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/control
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/copyright
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/dirs
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/docs
    branches/upstream/libnetwork-ipv4addr-perl/current/debian/rules
    branches/upstream/libnetwork-ipv4addr-perl/current/ipv4calc
    branches/upstream/libnetwork-ipv4addr-perl/current/test.pl

Added: branches/upstream/libnetwork-ipv4addr-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/ChangeLog?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/ChangeLog (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/ChangeLog Thu Jun 19 17:24:36 2008
@@ -1,0 +1,90 @@
+2000-08-01  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* Tag: IPV4ADDR_0_10
+
+	* IPv4Addr.spec: Updated for version 0.10.
+	Updated spec file to use new macros.
+
+	* IPv4Addr.pm (ipv4_network): Bad network for 0.0.0.0/0.
+	(ipv4_broadcast): Bad broadcast for 0.0.0.0/0.
+	(ipv4_in_network): 0.0.0.0/0 was included in any nets.
+	(VERSION): Updated version number to 0.10.
+
+	* NEWS: News for 0.10.
+
+	* README: Updated version number to 0.10.
+
+	* test.pl: Added test for ipv4_in_network( anything, 0.0.0.0/0).
+
+	* debian/rules: Merged changes from Bernd
+.
+	* debian/changelog: Merged changes from Bernd.
+
+	* debian/control: Merged changes from Bernd.
+
+	* IPv4Addr.pm: Copyright mods.
+
+2000-07-27 Francis J. Lacoste <francis.lacoste at iNsu.COM>
+
+        * IPv4Addr (%EXPORT_TAGS): ipv4_chkip was exported
+        under the wrong name.
+
+2000-05-03  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+	* Tag:	IPV4ADDR_0_09
+
+	* test.pl: Added test for different class networks.
+
+	* IPv4Addr.pm (ipv4_in_network) Fixed bug where
+		       comparison between network that differ
+		       by more than an octet failed.
+      		      (version) Incremented version number 
+		      to 0.09.
+
+1999-12-15  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* Tag: IPV4ADDR_0_08
+
+	* IPv4Addr.pm: Moved require statement inside BEGIN to
+		       fix problems with ipv4calc.
+		       
+		       Incremented version number to 0.08.
+
+1999-10-19  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	TAG: IPV4ADDR_0_07
+
+	* debian/:	Added debian packaging by Bernd Eckenfels
+			<ecki at lina.inka.de>
+	
+	TAG: IPV4ADDR_0_06
+	
+	* IPv4Addr.pm:  Renamed module to Net::IPv4Addr.
+
+1999-09-15  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* IPv4Addr.pm:	Corrected errors in the documentation.
+
+			TAG: IPV4ADDR_0_05.
+
+1999-08-15  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* IPv4Addr.pm (ipv4_in_netwrok): Fixed broken logic
+			of ipv4_in_network. It didn't handle
+			correctly network which weren't of 
+			the same size.
+
+			TAG: IPV4ADDR_0_04.
+
+1999-07-05  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* IPv4Addr.pm (ipv4_in_network): Added check for universal 
+			broadcast address (255.255.255.255) and
+			no address (0.0.0.0).
+
+			TAG: IPV4ADDR_0_03.
+
+1999-05-27  Francis J. Lacoste  <francis.lacoste at iNsu.COM>
+
+	* IPv4Addr.pm: (ipv4_parse) removed some undefined warnings.
+			Updated version to 0.02.
+

Added: branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.pm?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.pm (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.pm Thu Jun 19 17:24:36 2008
@@ -1,0 +1,385 @@
+#    IPv4Addr.pm - Perl module to manipulate IPv4 addresses.
+#
+#    Author: Francis J. Lacoste <francis.lacoste at iNsu.COM>
+#
+#    Copyright (C) 1999, 2000 iNsu Innovations Inc.
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms as perl itself.
+#
+
+package Net::IPv4Addr;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+
+BEGIN {
+    require Exporter;
+    require AutoLoader;
+
+    @ISA = qw(Exporter AutoLoader);
+
+    @EXPORT = qw();
+
+    %EXPORT_TAGS = (
+		    all => [qw{ ipv4_parse	ipv4_chkip
+				ipv4_network    ipv4_broadcast
+				ipv4_cidr2msk   ipv4_msk2cidr
+				ipv4_in_network ipv4_dflt_netmask
+				} ],
+		   );
+
+    @EXPORT_OK = qw();
+
+    Exporter::export_ok_tags('all');
+
+    $VERSION = '0.10';
+}
+
+# Preloaded methods go here.
+use Carp;
+
+# Functions to manipulate IPV4 address
+my $ip_rgx = "\\d+\\.\\d+\\.\\d+\\.\\d+";
+
+# Given an IPv4 address in host, ip/netmask or cidr format
+# returns a ip / cidr pair.
+sub ipv4_parse($;$) {
+  my ($ip,$msk);
+  # Called with 2 args, assume first is IP address
+  if ( defined $_[1] ) {
+    $ip = $_[0];
+    $msk= $_[1];
+  } else {
+    ($ip)  = $_[0] =~ /($ip_rgx)/o;
+    ($msk) = $_[0] =~ m!/(.+)!o;
+  }
+
+  # Remove white spaces
+  $ip = ipv4_chkip( $ip ) or
+    croak __PACKAGE__, ": invalid IPv4 address: ", $ip, "\n";
+  $msk =~ s/\s//g if defined $msk;
+
+  # Check Netmask to see if it is a CIDR or Network
+  if (defined $msk ) {
+    if ($msk =~ /^\d{1,2}$/) {
+      # Check cidr
+      croak __PACKAGE__, ": invalid cidr: ", $msk, "\n"
+	if $msk < 0 or $msk > 32;
+    } elsif ($msk =~ /^$ip_rgx$/o ) {
+      $msk = ipv4_msk2cidr($msk);
+    } else {
+      croak __PACKAGE__, ": invalid netmask specification: ", $msk, "\n";
+    }
+  } else {
+    # Host
+    return $ip;
+  }
+  wantarray ? ($ip,$msk) : "$ip/$msk";
+}
+
+sub ipv4_dflt_netmask($) {
+  my ($ip) = ipv4_parse($_[0]);
+
+  my ($b1) = split /\./, $ip;
+
+  return "255.0.0.0"	if $b1 <= 127;
+  return "255.255.0.0"	if $b1 <= 191;
+  return "255.255.255.0";
+}
+
+# Check form a valid IPv4 address.
+sub ipv4_chkip($) {
+  my ($ip) = $_[0] =~ /($ip_rgx)/o;
+
+  return undef unless $ip;
+
+  # Check that bytes are in range
+  for (split /\./, $ip ) {
+    return undef if $_ < 0 or $_ > 255;
+  }
+  return $ip;
+}
+
+# Transform a netmask in a CIDR mask length
+sub ipv4_msk2cidr($) {
+  my $msk = ipv4_chkip( $_[0] )
+    or croak __PACKAGE__, ": invalid netmask: ", $_[0], "\n";
+
+  my @bytes = split /\./, $msk;
+
+  my $cidr = 0;
+  for (@bytes) {
+    my $bits = unpack( "B*", pack( "C", $_ ) );
+    $cidr +=  $bits =~ tr /1/1/;
+  }
+  return $cidr;
+}
+
+# Transform a CIDR mask length in a netmask
+sub ipv4_cidr2msk($) {
+  my $cidr = shift;
+  croak __PACKAGE__, ": invalid cidr: ", $cidr, "\n"
+    if $cidr < 0 or $cidr > 32;
+
+  my $bits = "1" x $cidr . "0" x (32 - $cidr);
+
+  return join ".", (unpack 'CCCC', pack("B*", $bits ));
+}
+
+# Return the network address of
+# an IPv4 address
+sub ipv4_network($;$) {
+  my ($ip,$cidr) = ipv4_parse( $_[0], $_[1] );
+
+  # If only an host is given, use the default netmask
+  unless (defined $cidr) {
+    $cidr = ipv4_msk2cidr( ipv4_dflt_netmask($ip) );
+  }
+  my $u32 = unpack "N", pack "CCCC", split /\./, $ip;
+  my $bits = "1" x $cidr . "0" x (32 - $cidr );
+
+  my $msk = unpack "N", pack "B*", $bits;
+
+  my $net = join ".", unpack "CCCC", pack "N", $u32 & $msk;
+
+  wantarray ? ( $net, $cidr) : "$net/$cidr";
+}
+
+sub ipv4_broadcast($;$) {
+  my ($ip,$cidr) = ipv4_parse( $_[0], $_[1] );
+
+  # If only an host is given, use the default netmask
+  unless (defined $cidr) {
+    $cidr = ipv4_msk2cidr( ipv4_dflt_netmask($ip) );
+  }
+
+  my $u32 = unpack "N", pack "CCCC", split /\./, $ip;
+  my $bits = "1" x $cidr . "0" x (32 - $cidr );
+
+  my $msk = unpack "N", pack "B*", $bits;
+
+  my $broadcast = join ".", unpack "CCCC", pack "N", $u32 | ~$msk;
+
+  $broadcast;
+}
+
+sub ipv4_in_network($$;$$) {
+  my ($ip1,$cidr1,$ip2,$cidr2);
+  if ( @_ >= 3) {
+    ($ip1,$cidr1) = ipv4_parse( $_[0], $_[1] );
+    ($ip2,$cidr2) = ipv4_parse( $_[2], $_[3] );
+  } else {
+    ($ip1,$cidr1) = ipv4_parse( $_[0]);
+    ($ip2,$cidr2) = ipv4_parse( $_[1]);
+  }
+
+  # Check for magic addresses.
+  return 1 if ($ip1 eq "255.255.255.255" or $ip1 eq "0.0.0.0")
+         and !defined $cidr1;
+  return 1 if ($ip2 eq "255.255.255.255" or $ip2 eq "0.0.0.0")
+         and !defined $cidr2;
+
+  # Case where first argument is really an host
+  return $ip1 eq $ip2 unless (defined $cidr1);
+
+  # Case where second argument is an host
+  if ( not defined $cidr2) {
+      return ipv4_network( $ip1, $cidr1) eq ipv4_network( $ip2, $cidr1 );
+  } elsif ( $cidr2 >= $cidr1 ) {
+      # Network 2 is smaller or equal than network 1
+      return ipv4_network( $ip1, $cidr1 ) eq ipv4_network( $ip2, $cidr1 );
+  } else {
+      # Network 2 is bigger, so can't be wholly contained.
+      return 0;
+  }
+}
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+# Below is the stub of documentation for your module. You better edit it!
+=pod
+
+=head1 NAME
+
+Net::IPv4Addr - Perl extension for manipulating IPv4 addresses.
+
+=head1 SYNOPSIS
+
+  use Net::IPv4Addr qw( :all );
+
+  my ($ip,$cidr) = ipv4_parse( "127.0.0.1/24" );
+  my ($ip,$cidr) = ipv4_parse( "192.168.100.10 / 255.255.255.0" );
+
+  my ($net,$msk) = ipv4_network( "192.168.100.30" );
+
+  my $broadcast  = ipv4_broadcast( "192.168.100.30/26" );
+
+  if ( ipv4_in_network( "192.168.100.0", $her_ip ) ) {
+    print "Welcome !";
+  }
+
+  etc.
+
+=head1 DESCRIPTION
+
+Net::IPv4Addr provides functions for parsing IPv4 addresses both
+in traditional address/netmask format and in the new CIDR format.
+There are also methods for calculating the network and broadcast 
+address and also to see check if a given address is in a specific
+network.
+
+=head1 ADDRESSES
+
+All of Net::IPv4Addr functions accepts addresses in many
+format. The parsing is very liberal.
+
+All these addresses would be accepted:
+
+    127.0.0.1
+    192.168.001.010/24
+    192.168.10.10/255.255.255.0
+    192.168.30.10 / 21
+    10.0.0.0 / 255.0.0.0
+    255.255.0.0
+
+Those wouldn't though:
+
+    272.135.234.0
+    192.168/16
+
+Most functions accepts the address and netmask or masklength in the
+same scalar value or as separate values. That is either
+
+    my($ip,$masklength) = ipv4_parse($cidr_str);
+    my($ip,$masklength) = ipv4_parse($ip_str,$msk_str);
+
+=head1 USING
+
+No functions are exported by default. Either use the C<:all> tag 
+to import them all or explicitly import those you need.
+
+=head1 FUNCTIONS
+
+=over
+
+=item ipv4_parse
+
+    my ($ip,$msklen) = ipv4_parse($cidr_str);
+    my $cidr = ipv4_parse($ip_str,$msk_str);
+    my ($ip) = ipv4_parse($ip_str,$msk_str);
+
+Parse an IPv4 address and in scalar context the address in CIDR
+format and in an array context the address and the mask length.
+
+If the parameters doesn't contains a netmask or a mask length, 
+in scalar context only the IPv4 address is returned and in an 
+array context the mask length is undefined.
+
+If the function cannot parse its input, it croaks. Trap it using
+C<eval> if don't like that.
+
+=item ipv4_network
+
+    my $cidr = ipv4_network($ip_str);
+    my $cidr = ipv4_network($cidr_str);
+    my ($net,$msk) = ipv4_network( $net_str, $msk_str);
+
+In scalar context, this function returns the network in CIDR format in
+which the address is. In array context, it returns the network address and
+its mask length as a two elements array. If the input is an host without
+a netmask of mask length, the default netmask is assumed.
+
+Again, the function croak if the input is invalid.
+
+=item ipv4_broadcast
+
+    my ($broadcast) = ipv4_broadcast($ip_str);
+    my $broadcast   = ipv4_broadcast($ip_str,$msk_str);
+
+This function returns the broadcast address. If the input doesn't
+contains a netmask or mask length, the default netmask is assumed.
+
+This function croaks if the input is invalid.
+
+=item ipv4_network
+
+    my $cidr = ipv4_network($net_str);
+    my $cidr = ipv4_network($cidr_sstr);
+    my ($net,$msk) = ipv4_network( $ip_str, $mask_str);
+
+In scalar context, this function returns the network in CIDR format in
+which the address is. In array context, it returns the network address and
+its mask length as a two elements array. If the input is an host without
+a netmask or mask length, the default netmask is assumed.
+
+Again, the function croak if the input is invalid.
+
+=item ipv4_in_network
+
+    print "Yes" if ipv4_in_network( $cidr_str1, $cidr_str2);
+    print "Yes" if ipv4_in_network( $ip_str1, $mask_str1, $cidr_str2 );
+    print "Yes" if ipv4_in_network( $ip1, $mask1, $ip2, $msk2 );
+
+This function checks if the second network is contained in
+the first one and it implements the following semantics :
+
+   If net1 or net2 is a magic address (0.0.0.0 or 255.255.255.255)
+   than this function returns true.
+
+   If net1 is an host, net2 will be in the same net only if
+   it is the same host.
+
+   If net2 is an host, it will be contained in net1 only if
+   it is part of net1.
+
+   If net2 is only part of net1 if it is entirely contained in
+   net1.
+
+Trap bad input with C<eval> or else.
+
+=item ipv4_checkip
+
+    if ($ip = ipv4_checkip($str) ) {
+	# Do something
+    }
+
+Return the IPv4 address in the string or undef if the input 
+doesn't contains a valid IPv4 address.
+
+=item ipv4_cidr2msk
+
+    my $netmask = ipv4_cidr2msk( $cidr );
+
+Returns the netmask corresponding to the mask length given in input. 
+As usual, croaks if it doesn't like your input (in this case a number
+between 0 and 32).
+
+=item ipv4_msk2cidr
+
+    my $masklen = ipv4_msk2cidr( $msk );
+
+Returns the mask length of the netmask in input. As usual, croaks if it
+doesn't like your input.
+
+=back
+
+=head1 AUTHOR
+
+Francis J. Lacoste <francis.lacoste at iNsu.COM>
+
+=head1 COPYRIGHT
+
+Copyright (c) 1999, 2000 iNsu Innovations Inc.
+All rights reserved.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms as perl itself.
+
+=head1 SEE ALSO
+
+perl(1) ipv4calc(1).
+
+=cut
+

Added: branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.spec
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.spec?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.spec (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/IPv4Addr.spec Thu Jun 19 17:24:36 2008
@@ -1,0 +1,90 @@
+Summary: Perl modules to manipulates Ipv4 addresses.
+Name: Net-IPv4Addr
+Version: 0.10
+Release: 1i
+Source: http://iNDev.iNsu.COM/sources/%{name}-%{version}.tar.gz
+Copyright: GPL or Artistic License
+Group: Development/Libraries
+Prefix: /usr
+URL: http://iNDev.iNsu.COM/IPv4Addr/
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildArchitectures: noarch
+Obsoletes: Network-IPv4Addr
+
+%description
+Net::IPv4Addr provides methods for parsing IPv4
+addresses both in traditional address/netmask format and
+in the new CIDR format.  There are also methods for
+calculating the network and broadcast address and also to
+see check if a given address is in a specific network.
+
+%prep
+%setup -q
+%fix_perl_path
+
+%build
+perl Makefile.PL 
+make OPTIMIZE="$RPM_OPT_FLAGS"
+make test
+
+%install
+rm -fr $RPM_BUILD_ROOT
+%perl_make_install
+
+BuildDirList > %pkg_file_list
+BuildFileList >> %pkg_file_list
+
+%clean
+rm -fr $RPM_BUILD_ROOT
+
+%files -f %{name}-file-list
+%defattr(-,root,root)
+%doc README ChangeLog
+
+%changelog
+* Tue Aug 01 2000  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.10-1i]
+- Updated to version 0.10.
+- Updated spec file to use new macros.
+
+* Wed May 03 2000  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.09-1i]
+- Updated to version 0.09.
+- Updated automatic file list generation.
+- Changed group.
+
+* Wed Dec 15 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.08-1i]
+- Updated to version 0.08.
+- Added perl(Net::IPv4Addr) to list of Provides.
+- Fixed Source URL.
+
+* Tue Oct 19 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.07-1i]
+- Updated to version 0.07
+
+* Tue Oct 19 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.06-1i]
+- Updated to version 0.06.
+- Renamed package to Net-IPv4Addr.
+
+* Wed Sep 15 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.05-1i]
+- Updated to version 0.05.
+
+* Sun Aug 15 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.04-1i]
+- Updated to version 0.04.
+
+* Mon Jul 05 1999  Francis J. Lacoste <francis.lacoste at iNsu.COM> 
+  [0.03-1i]
+- Updated to version 0.03.
+
+* Sat May 15 1999  Francis J. Lacoste <francis at iNsu.COM> 
+  [0.02-2i]
+- Updated to version 0.02.
+
+* Sat May 15 1999  Francis J. Lacoste <francis at iNsu.COM> 
+  [0.01-1i]
+- First RPM release.
+

Added: branches/upstream/libnetwork-ipv4addr-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/MANIFEST?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/MANIFEST (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/MANIFEST Thu Jun 19 17:24:36 2008
@@ -1,0 +1,15 @@
+NEWS
+README
+ChangeLog
+IPv4Addr.pm
+MANIFEST
+Makefile.PL
+test.pl
+IPv4Addr.spec
+ipv4calc
+debian/changelog
+debian/control
+debian/copyright
+debian/dirs
+debian/docs
+debian/rules

Added: branches/upstream/libnetwork-ipv4addr-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/Makefile.PL?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/Makefile.PL (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/Makefile.PL Thu Jun 19 17:24:36 2008
@@ -1,0 +1,8 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'	=> 'Net::IPv4Addr',
+    'VERSION_FROM' => 'IPv4Addr.pm', # finds $VERSION
+    'EXE_FILES'  => [ ipv4calc ],
+);

Added: branches/upstream/libnetwork-ipv4addr-perl/current/NEWS
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/NEWS?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/NEWS (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/NEWS Thu Jun 19 17:24:36 2008
@@ -1,0 +1,28 @@
+Net::IPv4Addr NEWS -- History of User-Visible Changes.  May 03 2000
+
+* Changes in IPv4Addr 0.10
+
+    - Fixed important errors which occurs when using 
+      a /0 CIDR. Thanks to Bernd Eckenfels from Debian 
+      for the fix.
+
+    - Fixed : ipv4_in_network( anything, 0.0.0.0/0) was
+      returning true. Thanks to Bernd Eckenfels from Debian
+      for the fix.
+
+    - ipv4_chkip wasn't exported with the all tag.
+
+* Changes in IPv4Addr 0.09
+
+    - Fixed an important bug in ipv4_in_network which caused 
+      comparison between networks that where in different class
+      to fail.
+
+* Changes in IPv4Addr 0.07
+
+    -  Debian packaging done by Bernd Eckenfels <ecki at lina.inka.de>.
+
+* Change in  IPv4Addr 0.06
+
+    - Module was renamed to Net::IPv4Addr to better fit into CPAN hierarchy.
+

Added: branches/upstream/libnetwork-ipv4addr-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/README?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/README (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/README Thu Jun 19 17:24:36 2008
@@ -1,0 +1,41 @@
+Net::IPv4Addr
+=================
+
+Version: 0.10
+
+Description
+-----------
+
+Net::IPv4Addr provides functions for parsing IPv4 addresses both
+in traditional address/netmask format and in the new CIDR format.
+There are also methods for calculating the network and broadcast
+address and also to see check if a given address is in a specific
+network.
+
+Installing
+----------
+
+The usual:
+
+    perl Makefile.PL
+    make
+    make install
+
+Documentation
+-------------
+
+Documentation is included in pod format.
+
+Bugs
+----
+
+Send bug reports and suggestions to bugs at iNsu.COM.
+
+Copyright
+---------
+
+Copyright (c) 1999,2000 iNsu Innovations Inc . 
+All rights reserved.
+
+This package is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/changelog
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/changelog?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/changelog (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/changelog Thu Jun 19 17:24:36 2008
@@ -1,0 +1,37 @@
+libnetwork-ipv4addr-perl (0.09-2) frozen unstable; urgency=high
+
+  * fixed bug #66073 and fixed bug #66080
+  * changed maintainer email address to @debian.org
+  * fixed section and standards version
+ 
+ -- Bernd Eckenfels <ecki at debian.org>  Sat, 22 Jul 2000 07:02:12 +0200
+
+
+libnetwork-ipv4addr-perl (0.09-1) frozen unstable; urgency=high
+
+  * in this version #63482 is not visible anymore (fixed i guess)
+  * fixed security bug (#63529)
+ 
+ -- Bernd Eckenfels <ecki at debian.org>  Thu,  4 May 2000 05:50:32 +0200
+
+libnetwork-ipv4addr-perl (0.07-2) unstable; urgency=low
+
+  * fixed bug with 5.005 pl3 (Bug#49609:) thanks to Bitkoenig!
+ 
+ -- Bernd Eckenfels <ecki at debian.org>  Tue,  9 Nov 1999 03:05:41 +0100
+
+libnetwork-ipv4addr-perl (0.07-1) unstable; urgency=low
+
+  * new version, including a full working debian/ subdir, thanks Francis
+
+ -- Bernd Eckenfels <ecki at debian.org>  Sat, 23 Oct 1999 20:19:13 +0200
+
+libnetwork-ipv4addr-perl (0.05-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Bernd Eckenfels <ecki at debian.org>  Sat, 25 Sep 1999 01:26:34 +0200
+
+Local variables:
+mode: debian-changelog
+End:

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/control
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/control?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/control (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/control Thu Jun 19 17:24:36 2008
@@ -1,0 +1,12 @@
+Source: libnetwork-ipv4addr-perl
+Section: interpreters
+Priority: optional
+Maintainer: Bernd Eckenfels <ecki at debian.org>
+Standards-Version: 3.0.1
+
+Package: libnetwork-ipv4addr-perl
+Architecture: all
+Depends: ${perl:Depends}
+Description: The Net::IPv4Addr perl module API and ipv4calc script
+ ipv4calc can be used to calculate netmask, broadcast and netaddress of
+ an IPv4 (Internet) address.

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/copyright
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/copyright?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/copyright (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/copyright Thu Jun 19 17:24:36 2008
@@ -1,0 +1,14 @@
+This package was debianized by Bernd Eckenfels <ecki at lina.inka.de> on
+Sat, 25 Sep 1999 01:26:34 +0200.
+
+It was downloaded from http://iNDev.iNsu.COM/IPv4Addr/
+
+Upstream Author(s): Francis J. Lacoste <francis.lacoste at iNsu.COM>
+
+Copyright:
+
+Copyright (c) 1999 Francis J. Lacoste and iNsu Innovations Inc . 
+All rights reserved.
+
+This package is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/dirs
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/dirs?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/dirs (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/dirs Thu Jun 19 17:24:36 2008
@@ -1,0 +1,4 @@
+usr/bin
+usr/lib/perl5/Net/
+usr/share/man/man1
+usr/share/man/man3

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/docs
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/docs?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/docs (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/docs Thu Jun 19 17:24:36 2008
@@ -1,0 +1,4 @@
+README
+NEWS
+IPv4Addr.spec
+

Added: branches/upstream/libnetwork-ipv4addr-perl/current/debian/rules
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/debian/rules?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/debian/rules (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/debian/rules Thu Jun 19 17:24:36 2008
@@ -1,0 +1,85 @@
+#!/usr/bin/make -f
+#-*- makefile -*-
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Christoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
+ifndef PERL
+PERL = /usr/bin/perl
+endif
+
+TMP     =`pwd`/debian/tmp
+#archlib =`$(PERL) -MConfig -e 'print $$Config{installarchlib}'`
+#config  =INSTALLDIRS=perl INSTALLMAN1DIR=$(TMP)/usr/share/man/man1 INSTALLMAN3DIR=$(TMP)/usr/share/man/man3 INSTALLPRIVLIB=$(TMP)/usr/lib/perl5 INSTALLARCHLIB=$(TMP)$(archlib)
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	# Add here commands to compile the package.
+	$(PERL) Makefile.PL
+	$(MAKE) 
+	touch build-stamp
+
+clean:
+	dh_testdir
+	rm -f build-stamp install-stamp
+	# Add here commands to clean up after the build process.
+	-$(MAKE) clean
+	-rm -rf blib/ Makefile.old Makefile
+	dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	install -m 755 blib/script/ipv4calc debian/tmp/usr/bin
+	install -m 644 blib/lib/Net/IPv4Addr.pm debian/tmp/usr/lib/perl5/Net/IPv4Addr.pm
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installemacsen
+#	dh_installpam
+	dh_installinit
+	dh_installcron
+	dh_installmanpages
+#	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	# You may want to make some executables suid here.
+	dh_suidregister
+#	dh_makeshlibs
+	dh_installdeb
+	dh_perl 
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dpkg --build debian/tmp ..
+
+# Build architecture-dependent files here.
+binary-arch: build install
+# We have nothing to do by default.
+
+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 install

Added: branches/upstream/libnetwork-ipv4addr-perl/current/ipv4calc
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/ipv4calc?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/ipv4calc (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/ipv4calc Thu Jun 19 17:24:36 2008
@@ -1,0 +1,89 @@
+#!/usr/bin/perl
+
+use strict;
+use Net::IPv4Addr qw (:all);
+use Getopt::Long;
+
+my %opts = ();
+
+sub usage() {
+  die <<EOU;
+usage: ipv4calc [--network | --broadcast | --netmask |
+		 --cidr | --address ] addr
+EOU
+}
+
+GetOptions( \%opts, "network", "broadcast", "netmask", "cidr", "address")
+  or usage;
+
+my $str = shift;
+$str or usage;
+
+my ($ip,$cidr)  = ipv4_parse($str);
+my ($network,$msk)  = ipv4_network($ip,$cidr);
+my ($broadcast) = ipv4_broadcast($ip,$cidr);
+
+if ( $opts{network}) {
+  print $network,"\n";
+} elsif ($opts{broadcast}) {
+  print $broadcast,"\n";
+} elsif ( $opts{netmask} ) {
+  print ipv4_cidr2msk( $msk ), "\n";
+} elsif ( $opts{address} ) {
+  print $ip, "\n";
+} elsif ( $opts{cidr} ) {
+  print  $msk, "\n";
+} else {
+  print <<EOF;
+Host:	    $ip
+Network:    $network/$msk
+Broadcast:  $broadcast
+EOF
+}
+
+1;
+
+__END__
+# Below is the stub of documentation for your module. You better edit it!
+=pod
+
+=head1 NAME
+
+  ipv4calc - Calculates IPv4 elements from an address.
+
+=head1 SYNOPSIS
+
+  ipv4calc [ --network | --broadcast | --netmask | 
+	     --address | --cidr ] addr
+
+=head1 DESCRIPTION
+
+If an option is specified B<ipv4calc> calculates the requested element
+from the address and prints it on stdout.
+
+If multiple options are specified, only the first one is printed.
+
+If no options are specified, the program prints the host part of the
+address, the network and the broadcast address as deduced from the
+given address.
+
+If address doesn't contains a netmask or mask length, the default
+one is assumed.
+
+=head1 AUTHOR
+
+Francis J. Lacoste <francis.lacoste at iNsu.COM>
+
+=head1 COPYRIGHT
+
+Copyright (c) 1999,2000 iNsu Innovations Inc.
+All rights reserved.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms as perl itself.
+
+=head1 SEE ALSO
+
+Network::IPv4Addr(3).
+
+=cut

Added: branches/upstream/libnetwork-ipv4addr-perl/current/test.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnetwork-ipv4addr-perl/current/test.pl?rev=21900&op=file
==============================================================================
--- branches/upstream/libnetwork-ipv4addr-perl/current/test.pl (added)
+++ branches/upstream/libnetwork-ipv4addr-perl/current/test.pl Thu Jun 19 17:24:36 2008
@@ -1,0 +1,68 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+use strict;
+use Test;
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { plan tests => 37 }
+use Net::IPv4Addr qw(/^ipv4/);
+
+
+# ipv4_parse
+ok( scalar ipv4_parse( "127.0.0.1" ), "127.0.0.1" );
+ok( scalar ipv4_parse( "192.168.100.1 / 24" ), "192.168.100.1/24" );
+ok( scalar ipv4_parse( "130.10.2.10", "255.255.255.0"), "130.10.2.10/24");
+ok( scalar ipv4_parse( "130.10.2.10", "255.255.255.240"), "130.10.2.10/28");
+ok( scalar ipv4_parse( "130.10.2.10/28"), "130.10.2.10/28");
+
+# ipv4_dftl_netmask
+ok( ipv4_dflt_netmask( "127.0.0.1" ), "255.0.0.0" );
+ok( ipv4_dflt_netmask( "172.0.0.01" ), "255.255.0.0" );
+ok( ipv4_dflt_netmask( "198.0.0.20" ), "255.255.255.0" );
+
+# ipv4_network
+ok( scalar ipv4_network( "127.0.0.1"), "127.0.0.0/8" );
+ok( scalar ipv4_network( "192.168.100.10" ), "192.168.100.0/24" );
+ok( scalar ipv4_network( "192.168.100.100/255.255.255.192"), "192.168.100.64/26" );
+
+# ipv4_broadcast
+ok( ipv4_broadcast( "127.0.0.1"), "127.255.255.255" );
+ok( ipv4_broadcast( "192.168.100.10/24" ), "192.168.100.255" );
+ok( ipv4_broadcast( "192.168.100.100/255.255.255.192"), "192.168.100.127" );
+
+# ipv4_in_network
+ok( ipv4_in_network( "127.0.0.1", "127.0.0.1" ) );
+ok( not ipv4_in_network( "127.0.0.0/8", "192.168.30.1" ));
+ok( not ipv4_in_network( "192.168.100.10", "192.168.100.30"));
+ok( ipv4_in_network( "192.168.100.10/24", "192.168.100.255"));
+ok( ipv4_in_network( "192.168.100.0/24", "192.168.100.0"));
+ok( not ipv4_in_network( "192.16.100.63/26", "192.168.100.65"));
+ok( ipv4_in_network( "192.168.100.0/24", "0.0.0.0" ) );
+ok( ipv4_in_network( "192.168.100.0/24", "255.255.255.255" ) );
+ok( ipv4_in_network( "0.0.0.0", "192.168.1.1" ) );
+ok( ipv4_in_network( "255.255.255.255", "192.176.1.8" ) );
+ok( ipv4_in_network( "192.168.199.0/30", "192.168.199.1" ) );
+ok( ipv4_in_network( "212.117.64.0/19", "212.117.65.42/28" ) );
+ok( !ipv4_in_network( "21.10.0.4/24", "0.0.0.0/0" ) );
+
+# ipv4_cidr2msk
+ok( ipv4_cidr2msk( 24 ), "255.255.255.0" );
+ok( ipv4_cidr2msk( 16 ), "255.255.0.0" );
+ok( ipv4_cidr2msk( 8  ), "255.0.0.0" );
+ok( ipv4_cidr2msk( 26 ), "255.255.255.192" );
+ok( ipv4_cidr2msk( 0 ), "0.0.0.0" );
+ok( ipv4_cidr2msk( 32 ), "255.255.255.255" );
+
+# ipv4_msk2cidr
+ok( ipv4_msk2cidr( "255.255.255.0" ),  24);
+ok( ipv4_msk2cidr( "255.255.0.0" ), 16 );
+ok( ipv4_msk2cidr( "255.0.0.0" ), 8 );
+ok( ipv4_msk2cidr( "255.255.255.192" ), 26 );
+ok( ipv4_msk2cidr( "0.0.0.0" ), 0 );
+ok( ipv4_msk2cidr( "255.255.255.255" ), 32 );
+
+
+




More information about the Pkg-perl-cvs-commits mailing list