#       test - easy program to do tests
#
# Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999 by RIPE NCC
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of the author not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
# AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# $Id: test.pl,v 2.4 1999/10/06 16:41:24 marek Exp $
#
#	$RCSfile: test.pl,v $
#	$Revision: 2.4 $
#	$Author: marek $
#	$Date: 1999/10/06 16:41:24 $
#

require "getopts.pl";

require "rconf.pl";
require "misc.pl";
require "net2net.pl";

# &Getopts('cV');

local($conffile) = $ENV{"RIPEDBCNF"};
$conffile = $RIPEConfig{DEFCONFIG} unless $conffile;
&rconf($conffile);

#$db='HANDLE';
#
#open(HANDLE, "</home/david/db.test/conf");
#
#flock($db, $LOCK_EX);
#
#print <HANDLE>;
#
#sleep 10;
#
#close(db);


local(@pest)=("161.23.0.0 - 161.23.0.15",
     "161.30.0.0 - 161.30.0.255",
    "161.30.0.0 - 161.30.0.254",
    "161.30.0.1 - 161.30.0.2",
    "161.30.0.2 - 161.30.0.2",
    "161.30.0.0 - 161.30.0.2",
    "161.30.0.2 - 161.30.0.3"); 

foreach (@pest) {

   print STDERR $_, ": ";
   print STDERR join(" ", &range2prefixes($_)), "\n";

}

exit;

#foreach $j ("ab-","ab1-ripe","ac","xxaa","a1b","a-apni","","ripe-ripe","ap-ap","op0",op1, op1-nl)  {
#                   $j=~ tr/a-z/A-Z/;

foreach (@ARGV) {                   
   
   open(INP,$_);
   
   while (<INP>) {
   
   if (/^\*(nh|ac|tc|zc)\:\s*(\S+)\s*$/) {
      $type=$1;
      $j=$2;
   if (&isnichandle($j)) {
      print $type, ": ", $j, "\n";
   }
   else {
      print STDERR $type, ": ", $j, "\n";
   }
   }
   }
   close (INP)

}
