From ripe-dbm at ripe.net Fri Aug 9 16:14:31 1996 From: ripe-dbm at ripe.net (RIPE Database Manager) Date: Fri, 09 Aug 1996 16:14:31 +0200 Subject: Announcement: Release of RIPE datase software 2.00 Message-ID: <9608091414.AA17887@ncc.ripe.net> Dear all, This message is to announce the new 2.00 release version of the RIPE database. Many new features and bug fixes have been added since the previous beta release. The software is available from: ftp://ftp.ripe.net/ripe/dbase/software/ripe-dbase-2.00.tar.gz The following lists the most interesting new features since the previous non-beta release (you can do 'whois -h whois.ripe.net HELP' to get the RIPE database HOWTO that includes more detailed information on the new features): - AUTO NIC handle assignment support. The (slow) finger tool is not needed any more (see the HOWTO for more details on how to use this new feature). - hierarchical authorization for creation of 'inetnum' and 'domain' objects. Use a 'mnt-lower: YOUR-MAINTAINER' attribute for these objects to use the authorization of YOUR-MAINTAINER for the creation of objects direct below in the hierarchy your object with the 'mnt-lower:' line. - role object support. Get a template by doing 'whois -h whois.ripe.net -t role'. All attributes are already known, except for the 'trouble:' attribute that can contain any free text. Note: references to the role object may not be used in the 'admin-c:' attribute, however the use of the object in 'tech-c:' & 'zone-c:' is fine. - prefix notation for 'inetnum:' updates & classless range support for whois lookups - extended 'country:' attribute syntax implemented, more then one country on a line and more 'country:' attributes per object are allowed now. - the special RIPE whois client is now fully supported and included in the distribution. - much stronger syntax checking (=as strong as specified by the original database specification) for NIC handles, phone numbers, E-mail addresses, domain names (Some people might not like this ;-)). - network updates, a method for directly updating objects by use of the program 'networkupdate'. The use of this method is restricted by an accesslist and currently only intended for the maintenance people of the database. - BSD DB dbm package is fully supported. This dbm package is a fast, platform independant and reliable dbm package. - No limitations on the number of hits (no matter what indexing package you use): a query like 'David' will give you an answer and person names like 'John George' will be found - new and more intelligent indexing program 'indexdb' that can do a raw index or a clean index (-c option) and automatically detects if it is dealing with a classless index. netdbm & cleandb are now obsoleted. Indexing speed has been improved by a factor of at least two on average although the number of indexed values is more then twice the previous number. RAM memory consumption is also limited to about 6 Mb depending on your architecture. - reverse lookup of objects (whois -i option), this enables you to find for example the routes with a given origin by doing: whois -h whois.ripe.net -i origin AS3333 - Nearly real time mirroring of the RIPE database. This feature is fully supported but has a few shortcomings that will involve a bit more administration work until the 'stored/processed' attribute and better crash recovery routines are implemented. - experimental inet6num support for ipv6 network objects, including support for -L, -m, -M queries! Note: this is not an approved object whatsoever. It is intended for testing ipv6 indexing but can serve as a good starting point for further discussion. Get a template by doing: 'whois -h whois.ripe.net -t inet6num' and many more small changes and fixes. Please read the release notes at the bottom of this message for more information and discussion about these topics. Please send bug reports/fixes directly to and I will fix the problem but be fast since I will move to new job at ISI very soon. And finally: Thanks for all your help, patience with bugs, bug reports and patches! Kind regards, David K. --- ***Warning*** for upgraders: A reindex (indexdb -c -s SOURCE) is necessary since the internal index formats changed! RELEASE NOTES (RIPE database version 2.00): - AUTO NIC handle assignment support. The (slow) finger tool is not needed any more (see the HOWTO for more details on how to use this new feature). Gabor Kiss provided be with some very usefull patches for part of the work. - hierarchical authorization for creation of 'inetnum' and 'domain' objects. Use a 'mnt-lower: YOUR-MAINTAINER' attribute for these objects to use the authorization of YOUR-MAINTAINER for the creation of objects direct below in the hierarchy your object with the 'mnt-lower:' line. - role object support. Get a template by doing 'whois -h whois.ripe.net -t role'. All attributes are already known, except for the 'trouble:' attribute that can contain any free text. Note: references to the role object should and may not be used in the 'admin-c:' attribute, however the use of the object in 'tech-c:' & 'zone-c:' is fine. - Nearly real time mirroring support: What is it: The database software now keeps serial numbers of all updates. If you have been added to an accesslist, it it possible to retrieve all the changes to the database. A program 'syncdb' has been added to the distribution that can retrieve these changes and update your mirror database automatically. This program is intended to be put in a cronjob. The whois erver has an access list so you first need to ask the site to be mirrored to add your host to the access list. Please let me now at if you are interested in trying out this feature, and I will add the IP number of your site to the access list. Short discussion: Note that this is the first version, it currently uses seperate files internally for every update. We plan to change this since this is not really what we want with 2000 (atomic) updates on some days. Furthermore, we use currently an ever increasing integer serial number. A proposal (stored/processed attribute) on how to this right has already been circulated to the RIPE database working group and discussed on the RIPE meeting. Implementation of this attribute will also allow for a better crash recovery behavior. - No limitations on the number of hits (no matter what indexing package you use): a query like 'David' will give you an answer and person names like 'John George' will be found - New and more intelligent indexing program 'indexdb' that can do a raw index or a clean index (-c option) and automatically detects if it is dealing with a classless index (from the config file). netdbm & cleandb are now obsoleted. The indexing speed has also been improved. - BSD berkeley DB support: The database software can now use the Berkeley DB dbm package. According to many people this package is superior to most other dbm packages that perl can use (unlimited size of keys/values, platform independent db files). We have put the current sources for this package at ftp://ftp.ripe.net/tools/db.1.85.tar.gz It should be possible with the BSD DB package to increase the OVERFLOWSIZE and as result get rid of (most) of the overflow files. However, it is not clear if this is desirable since it doesn't seem to make the software more memory/space/speed efficient. - a new help and HOWTO use the RIPE database file is available use 'whois -h whois.ripe.net HELP' to get the most recent version. The document gives a short introduction on the database, tells you how to create/update/delete objects, contains a section with tips and common problems and gives pointers to other documentation about the database. - BSDI/perl memory leak problems Due to a memory leak with perl on BSDI machines we needed to make the code more memory conscious. enread.pl has been rewritten completely and uses now less memory and as an (intended) side effect became faster when reading big objects. Also the special input routine for reading in an object from an E-mail has undergone the same optimizations. - Most patches (for greater speed and less memory consumption) that I received from Curtis Villamizar have been included. Thanks Curtis! - The direct network updating method is now fully supported. Currently this method is only intended for use by the registry itself, however it is possible to add support in the maintainer objects if desired by the RIPE community. You can now do you updates very rapidly by giving the command 'networkupdate' and input your object via STDIN. Of course, this is also protected with an access list. - The special magic to overrule the maintainer protection needs a password now. Syntax will be published after the main registries support this... - All support for the historical 'guarded' objects have been removed. The guardian attribute can be obsoleted if the database working group wishes to. Present guardian attributes will act as a 'notify:' attribute. - the special RIPE whois version is now fully supported and included in the distribution. - cryptpw is a new (small) program that encrypts a password with a choosen salt for use in the maintainer objects. - dbupdate -T Makes it very easy to install your own test database. The only difference with a normal update is that it doesn't need manual authorization for creation of maintainer objects and that it will add a warning to your acknowlegment message that this is not the normal behavior... - status: attribute as described in ripe-127 fully supported - whoisd changes: -D runs in daemon mode otherwise in 'inetd' mode ('inetd' mode is untested) The number of disk accesses have been further minimized and should result in a better performance. - line continuation by use of a "\" character at the end of an attribute line in your update message. The database software will then automatically concatenate the next line with the previous one. - prefix notation for 'inetnum:' updates & whois lookups - extended 'country:' attribute syntax implemented. You can now specify multiple countries in a 'country:' attribute line. - much stronger syntax checking for NIC handles, phone numbers, E-mail addresses, domain names (Some people might not like this ;-)). The syntax was too relaxed and follows our own specifications more closely. - perl5 patches. perl5 is still not supported. However, the biggest problems should be gone now (the software runs with perl5 at home with Linux & perl5.001m). The Makefiles have been changed to support perl5 and some of the database tools as 'whois' can be configured to run with perl5 by default (and work with it!). See the Makefiles on how to configure this. You are welcome to experiment with perl5 and we are interested in your comments! - Tony Bates recent patch for a problem with the maintainer notifications. Thank you Tony. - databases and serial number files that don't exist are now autogenerated. - Config file has been simplified by removing some options that can be determined by the database software itself. Of course, also a few new options appeared. Everything is documented in the config file itself. - The Makefiles have been rewritten to allow for easier installation and more logical behavior when doing make [[un]install]. - many small fixes and clean up of the code to make above changes possible. - bug that caused problems when deleting objects with(out) syntactic sugar - bug that caused a crash when one tries to delete an object that cannot be updated (object is mirrored from other database) - List of OS's that we know the RIPE database works with: - SUNOS - BSDI - Linux (Please inform me with you own results so that I can update this list!) Automatic on the fly patches implemented in the new Makefiles should make it possible to run the database on Solaris. This is untested for now and you will need a special perl4 that is available from ftp://ftp.ripe.net/tools/perl4.036-for-solaris.tar.gz. Peter Haag has made the perl version and patches available to me. Thanks! What didn't make it in this release: - checking for relations between objects: - disallow deletion of referenced object - disallow creation of objects that reference non exiting objects - the list of current proposals (soon to be reposted to the maillist. -------- Logged at Sat Aug 10 18:19:18 MET DST 1996 --------- From ripe-dbm at ripe.net Sat Aug 10 18:19:10 1996 From: ripe-dbm at ripe.net (RIPE Database Manager) Date: Sat, 10 Aug 1996 18:19:10 +0200 Subject: bug fix for 2.00 release Message-ID: <9608101619.AA29821@ncc.ripe.net> Dear all, I found this morning a bug that could case the software not to remove the lockfile when doing a database cleanup when indexing files with a full path name. Please substitute your 'donetdbm.pl' file by the included one or pick up a new distribution from: ftp://ftp.ripe.net/ripe/dbase/software/ripe-dbase-2.0.1.tar.gz Kind regards, David K. -------- # $RCSfile: donetdbm.pl,v $ # $Revision: 2.1 $ # $Author: david $ # $Date: 1996/08/10 15:53:32 $ require "defines.pl"; require "dbopen.pl"; require "dbclose.pl"; require "enread.pl"; require "enwrite.pl"; require "addkey.pl"; require "enkeys.pl"; require "enukey.pl"; # # exit cleanly when asked to ... sub quitdonetdbm { unlink(@DONETDBMFILES); print "\n$PROGRAMNAME terminated by signal.\n"; exit; } sub flushkeys { local(*database, *normalkeys)=@_; # print STDERR "do flush to disk for normal keys (happens every $MAXLISTLENGTH keys) ..."; local($oldoffsets,$key,$value,$length); # # old overflow files local(@toobig)=(); # # new overflow files local(@toobignewkeys)=(); local(@toobignewvalues)=(); # # normal keys local(@addkeys)=(); local(@addvalues)=(); while (($key,$value)=each(%normalkeys)) { $length=length($key); $key=~ s/^.{$OVERFLOWSIZE-1,$OVERFLOWSIZE-1}.*$/$1/ if ($length>=$OVERFLOWSIZE); # # check if the key already existed, that makes life # more complicated if (($oldoffsets=$database{$key})) { # # add to overflow file if ($oldoffsets=~ s/^$OVERFLOWPREFIXREGULAR//o) { push(@toobig, $oldoffsets, $value); next; } $value=join("\,", $oldoffsets, $value); } # # do a value addition $length+=length($value); if ($length>=$OVERFLOWSIZE) { push(@toobignewkeys, $key); push(@toobignewvalues, $value); } else { push(@addkeys, $key); push(@addvalues, $value); } } # # clean up the memory %normalkeys=(); # # add data to old overflow files local($dbfile)=$database[1].$OVERFLOWEXTENSION; if (@toobig) { while (@toobig) { if (open(OVERFLOWADD, ">>".$dbfile.shift(@toobig))) { print OVERFLOWADD "\,", shift(@toobig); close(OVERFLOWADD); } else { &fatalerror("in donetdbm flushkeys: cannot open for addition $dbfile.$_ value: ".shift(@toobig)." code: $!"); } } } # # create new overflow files if (@toobignewkeys) { local($filenumber)=$database{$OVERFLOWKEY}; local(@overflowvalues)=(++$filenumber .. ($filenumber+scalar(@toobignewkeys)-1)); push(@addkeys, $OVERFLOWKEY); push(@addvalues, $overflowvalues[$#overflowvalues]); #print STDERR join(" ", @toobignewkeys), "\n"; #print STDERR join(" ", @toobignewvalues), "\n"; #print STDERR join(" ", @overflowvalues), "\n"; foreach (@overflowvalues) { if (open(OVERFLOWNEW, ">".$dbfile.$_)) { print OVERFLOWNEW shift(@toobignewvalues); close(OVERFLOWNEW); } else { &fatalerror("in donetdbm flushkeys: cannot open for creation $dbfile.$_ value: ".shift(@toobignewvalues)." code: $!"); } } push(@addkeys, @toobignewkeys); push(@addvalues, (@overflowvalues=grep($_=$OVERFLOWPREFIX.$_, @overflowvalues))); } # # add all keys to the physical database in one single command !!! @database{@addkeys}=@addvalues; # print STDERR " done\n"; return 0; } sub flushclkeys { local($basename, $i, *list, *notexistingprefixes)=@_; #print STDERR "do flush to disk prefix \/$i (happens every $MAXSTRINGCOMPONENTS prefixes) ..."; local($file)=$basename.$i; push(@DONETDBMFILES, $file) if (grep($_ ne $file, @DONETDBMFILES)==scalar(@DONETDBMFILES)); open(FLUSHCLKEYS, ">>".$file); print FLUSHCLKEYS $list[$i]; close(FLUSHCLKEYS); #print STDERR " done\n"; $list[$i]=""; $notexistingprefixes[$i]=0; return 0; } sub donetdbm { local($filename, $todir, $options)=@_; local($type,$uniquekey,$offset,$prefix); local($NEWDIR, $newfilename); local($classless)=$options & $CLASSLESSOPTION; local($cleaning)=$options & $CLEANOPTION; local(%entry); local($objseen) = 0; local($processed)=0; local(@clalist)=(); local(@classlesslist)=(); local(@nrofentries)=(); local(%normalkeys)=(); local(@notexistingprefixes)=(1) x 129; local(@keys, at otherkeys, at pointsto, at otherpointsto, at classless); local($basename); local($newdb)='newdb'; local(%newdb, at newdb); local(%nothing)=(); local($lockfile); # print STDERR "donetdbm - file: $filename classless: $classless cleaning: $cleaning\n"; if ($cleaning) { ($NEWDIR, $newfilename)= $filename=~ /$SPLITFILENAME/o; $lockfile=$CLEANLOCK.$newfilename; # We will create a temporary directory to build the new database and # indexes. $NEWDIR.=$newfilename."-newindex.".$$; $newfilename=$NEWDIR."\/".$newfilename; &fatalerror("Temporary directory \"$NEWDIR\" already exists!") if (-d $NEWDIR); if (!mkdir($NEWDIR, 0750)) { &fatalerror("Failed to create temporary directory ($!): $NEWDIR"); } &dbopen(*newdb, *nothing, 1, $newfilename ) || &fatalerror("Cannot open $newfilename"); seek($newdb,0,2); } else { &delormoveindices($filename, "", $classless); } local(%dummyobject)=(); local($db)='db'; local(%db, at db); &dbopen(*db,*dummyobject,1,$filename) || &fatalerror("$0: error opening database: $filename"); seek($db,0,0); if ($cleaning) { &fatalerror("lockfile: $lockfile already exists") if (-e $lockfile); push(@DONETDBMFILES, $lockfile); open(LOCKFILE, ">".$lockfile) || &fatalerror("cannot create $lockfile"); print LOCKFILE "$$\n"; close(LOCKFILE); } if ($classless) { local($prefixfilename); if ($filename=~ /^.*\/([^\s\/]+)\s*$/) { $prefixfilename=$2; } else { $prefixfilename=$filename; } $basename=$TMPDIR."/prefixdata.".$$.".".$prefixfilename; # # remove any possible left over files... local(@files)=(); for $i (0..128) { push(@files, $basename.$i) if (-f $basename.$i); } unlink(@files) if (@files); } # # exit clean on a signal (except for the cleaning files, I am sorry # no time for the real fancy stuff) $SIG{'INT'}='quitdonetdbm'; $SIG{'KILL'}='quitdonetdbm'; $SIG{'TERM'}='quitdonetdbm'; @OPENNETDBMFILES=(); # # start gathering the keys... while ($type=&enread($db, *entry, -1)) { next if (!$OBJATSQ{$type}); # print STDERR "type: $type\n"; # $objseen++; # if ($objseen % 400 == 0) { # print STDERR "donetdbm - indexed $objseen\n"; # } # print STDERR "entry ($type): ", $entry{$type}, "\n"; # print STDERR "\noffset: ", $entry{"offset"}; # print STDERR "\nuniquekey: $uniquekey\n"; if ($cleaning) { $offset=&enwrite($newdb,*entry); } else { $offset=$entry{"offset"}; } &enkeys(*entry, $OBJKEYS{$type}, *keys, *otherkeys, *pointsto, *otherpointsto, *classless, $classless); $processed+=grep((($normalkeys{$_}) && ($normalkeys{$_}=join("\,", $normalkeys{$_}, $offset))) || ($normalkeys{$_}=$offset), ($uniquekey=&enukey(*entry, $type)), @keys, @otherkeys, @pointsto, @otherpointsto); if ($cleaning) { $processed=&flushkeys(*newdb, *normalkeys) if ($processed>$MAXLISTLENGTH); } else { $processed=&flushkeys(*db, *normalkeys) if ($processed>$MAXLISTLENGTH); } if ($classless) { foreach (@classless) { /^(.+)\/(\d+)$/; $classlesslist[$2]=join("", $classlesslist[$2], $1, "\%", $uniquekey, "\%"); $nrofentries[$2]=&flushclkeys($basename,$2,*classlesslist,*notexistingprefixes) if (++$nrofentries[$2]>$MAXSTRINGCOMPONENTS); } } } # # note: we do the wait for a child flush *after* the classless indexing # it might save us some extra time! if ($cleaning) { &flushkeys(*newdb, *normalkeys); } else { &flushkeys(*db, *normalkeys); } # # now we start with the classless indices if ($classless) { undef %normalkeys; print STDERR "docldbm - start inserting prefixes\n" if $opt_V; if ($cleaning) { &dbclopen(*dummyobject,1,$newfilename); } else { &delormoveindices($filename.$CLASSLESSEXT, "", $classless); &dbclopen(*dummyobject,1,$filename); } $objseen = 0; local($entry); local($p,$i,$cla,$newcla); # # we need to read entries separated by '%' characters # # trickey: we don't need to reset it for: # # flushclkeys, getvalues, addkey since # they are not affected. local($/)="\%"; for $i (1..128) { print STDERR "try $basename$i\n" if ($opt_V); # # flush first the remaining prefixes... &flushclkeys($basename, $i, *classlesslist, *notexistingprefixes) if ($nrofentries[$i]); next if ($notexistingprefixes[$i]); undef $nrofentries[$i]; if (open(FLUSHCLKEYS, "<".$basename.$i)) { print STDERR "opened $basename$i\n" if ($opt_V); $entry=1; while ($entry) { print STDERR "read from $basename$i\n" if ($opt_V); $processed=0; undef @clalist; while (($processed<$MAXLISTLENGTH) && ($entry=)) { $key=; chop($entry); chop($key); push(@clalist,$entry,$key); $processed++; } while ($prefix=shift(@clalist)) { # print STDERR $prefix, "\n"; if (&addkey(*mspnxl, ($cla=join("\/", $prefix, $i)), shift(@clalist))) { for ($p=$i-1; ($p>0) && (($notexistingprefixes[$p]) || (!defined($mspnxl{($newcla=join("\/", &iprightzeromask($prefix,$p), $p))}))); $p--) {}; # print STDERR $p, " ",$i, " ", $newcla, "\n"; &addkey(*mspnxl, $p>0?$newcla:"0\/0", $cla); } } } close(FLUSHCLKEYS); push(@DONETDBMFILES, $basename.$i); } else { &fatalerror("Couldn\'t open prefix file: $basename$i ($!)"); } } unlink(@DONETDBMFILES) if (@DONETDBMFILES); # # make the not existing prefixes array $mspnxl{$NOTEXISTINGPREFIXESKEY}=join(" ", @notexistingprefixes); &dbclclose(); } # # we might still have a child process for the normal keys... # wait; # print STDERR "closing\n"; if ($todir) { ($NEWDIR, $newfilename)= $filename=~ /$SPLITFILENAME/o; $lockfile=$CLEANLOCK.$newfilename; &fatalerror("lockfile: $lockfile already exists") if (-e $lockfile); # # we don't accept termination of the program from here @DONETDBMFILES=(); $SIG{'INT'}='IGNORE'; $SIG{'KILL'}='IGNORE'; $SIG{'TERM'}='IGNORE'; open(LOCKFILE, ">".$lockfile) || &fatalerror("cannot create $lockfile"); print LOCKFILE "$$\n"; close(LOCKFILE); $todir.="\/" if ($todir!~ /\/\s*$/); &dbclose(*db); &delormoveindices($filename.$CLASSLESSEXT, $todir.$newfilename.$CLASSLESSEXT, $classless) if ($classless); &delormoveindices($filename, $todir.$newfilename, 0); unlink($lockfile); } elsif ($cleaning) { &dbclose(*newdb); &dbclose(*db); # # we don't accept termination of the program from here @DONETDBMFILES=(); $SIG{'INT'}='IGNORE'; $SIG{'KILL'}='IGNORE'; $SIG{'TERM'}='IGNORE'; &delormoveindices($newfilename.$CLASSLESSEXT, $filename.$CLASSLESSEXT, $classless) if ($classless); &delormoveindices($newfilename, $filename, 0); unlink($lockfile); warn "could\'t remove directory ($NEWDIR) errorcode: $!\n" if (!rmdir($NEWDIR)); } else { # print STDERR "close db\n"; &dbclose(*db); # print STDERR "done db\n"; } # print STDERR "done -$/- db\n"; return; #print STDERR "done db\n"; } 1; -------- -------- Logged at Wed Aug 14 19:19:12 MET DST 1996 --------- From David.Kessens at ripe.net Wed Aug 14 19:19:06 1996 From: David.Kessens at ripe.net (David.Kessens at ripe.net) Date: Wed, 14 Aug 1996 19:19:06 +0200 (MET DST) Subject: bug fixes & upgraded functionality for 2.0 database release Message-ID: <9608141719.AA07301@ncc.ripe.net> A non-text attachment was scrubbed... Name: not available Type: text Size: 11055 bytes Desc: not available Url : https://www.ripe.net/mailman/private/rr-impl/attachments/19960814/b1213343/attachment.pl From Carol.Orange at ripe.net Thu Aug 15 12:34:01 1996 From: Carol.Orange at ripe.net (Carol Orange) Date: Thu, 15 Aug 1996 12:34:01 +0200 Subject: bug fixes & upgraded functionality for 2.0 database release In-Reply-To: Your message of "Wed, 14 Aug 1996 19:19:06 MDT." <9608141719.AA07301@ncc.ripe.net> Message-ID: <9608151034.AA18088@ncc.ripe.net> Dear all, Due to some mysterious problems the whois server started having with finding inetnums and route objects after the changes described below were implemented, we have rolled them back, and are again running a stable version of the database software. Note that no problems have arisen in the update mechanism, only in the lookup mechanism. We'll let you know when the changes below have again been installed, and any changes to the code that may be required. As always, please send any problems or questions to . Sorry for the inconvenience, Carol Orange -------------------------------------------------------------------- In message <9608141719.AA07301 at ncc.ripe.net>, David.Kessens writes: >> >> Dear all, >> >> I have fixed a few small bugs. >> >> I also added functionality for automatically adding the current date to >> the last 'changed:' attribute field in your update when no date is >> present. >> >> Apply the included patches or get a new distribution from: >> >> ftp://ftp.ripe.net/ripe/dbase/software/ripe-dbase-2.0.2.tar.gz >> >> Kind regards, >> >> David K. >> --- >> >> *** encmp.old Wed Aug 14 17:38:53 1996 >> --- encmp.pl Wed Aug 14 17:45:34 1996 >> *************** >> *** 1,9 **** >> # encmp - compare two associative arrays >> # >> # $RCSfile: encmp.pl,v $ >> ! # $Revision: 2.0 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/08 10:47:30 $ >> # >> # This routine takes two objects and compares them case insensitive >> # Returns 1 if objects are equal, else returns 0; >> --- 1,11 ---- >> + >> # encmp - compare two associative arrays >> + # 'syntax sugar' is removed before comparing! >> # >> # $RCSfile: encmp.pl,v $ >> ! # $Revision: 2.1 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/14 15:45:19 $ >> # >> # This routine takes two objects and compares them case insensitive >> # Returns 1 if objects are equal, else returns 0; >> *************** >> *** 88,103 **** >> # we do a compare after the syntactic sugar has been removed. >> >> if ($key eq "ae") { >> ! $a=~ s/(^|\n)exclude\s+(AS\d+)\s+to\s+/$1$2 /g; >> ! $b=~ s/(^|\n)exclude\s+(AS\d+)\s+to\s+/$1$2 /g; >> } >> elsif ($key eq "ai") { >> ! $a=~ s/(^|\n)from\s+(AS\d+\s+\d+)\s+accept\s+/$1$2 /g; >> ! $b=~ s/(^|\n)from\s+(AS\d+\s+\d+)\s+accept\s+/$1$2 /g; >> } >> elsif ($key eq "ao") { >> ! $a=~ s/(^|\n)to\s+(AS\d+)\s+announce\s+/$1$2 /g; >> ! $b=~ s/(^|\n)to\s+(AS\d+)\s+announce\s+/$1$2 /g; >> } >> elsif ($key eq "it") { >> $a=~ s/(^|\n)from\s+($match)\s+(\(\s*pref[\=\s\S]+\))?accept\s+ >> /$1$2 $3/go; >> --- 90,105 ---- >> # we do a compare after the syntactic sugar has been removed. >> >> if ($key eq "ae") { >> ! $a=~ s/(^|\n)exclude\s+(as\d+)\s+to\s+/$1$2 /g; >> ! $b=~ s/(^|\n)exclude\s+(as\d+)\s+to\s+/$1$2 /g; >> } >> elsif ($key eq "ai") { >> ! $a=~ s/(^|\n)from\s+(as\d+\s+\d+)\s+accept\s+/$1$2 /g; >> ! $b=~ s/(^|\n)from\s+(as\d+\s+\d+)\s+accept\s+/$1$2 /g; >> } >> elsif ($key eq "ao") { >> ! $a=~ s/(^|\n)to\s+(as\d+)\s+announce\s+/$1$2 /g; >> ! $b=~ s/(^|\n)to\s+(as\d+)\s+announce\s+/$1$2 /g; >> } >> elsif ($key eq "it") { >> $a=~ s/(^|\n)from\s+($match)\s+(\(\s*pref[\=\s\S]+\))?accept\s+ >> /$1$2 $3/go; >> *************** >> *** 117,119 **** >> --- 119,122 ---- >> } >> >> 1; >> + >> *** syntax.old Wed Aug 14 17:39:05 1996 >> --- syntax.pl Wed Aug 14 17:45:59 1996 >> *************** >> *** 1,8 **** >> ! # >> # $RCSfile: syntax.pl,v $ >> ! # $Revision: 2.2 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/09 12:55:04 $ >> # >> # ARGUMENTS: *ASSOC object >> # RETURNS: INTEGER object_status >> --- 1,8 ---- >> ! >> # $RCSfile: syntax.pl,v $ >> ! # $Revision: 2.3 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/14 15:45:49 $ >> # >> # ARGUMENTS: *ASSOC object >> # RETURNS: INTEGER object_status >> *************** >> *** 311,317 **** >> # >> } >> else { >> ! if ($itmp=~ /^ac|ah|tc|zc|cy|mb|ml$/) { >> local($val, $msg) = &dosyntax($itmp, $object{$itmp}, *objec >> t); >> # print STDERR "checksyntax - before attr: $itmp rtcode: $r >> tcode val: $val msg: $msg\n" if ($opt_V); >> if (defined($val)) { >> --- 311,317 ---- >> # >> } >> else { >> ! if ($itmp=~ /^ac|ah|ch|tc|zc|cy|mb|ml$/) { >> local($val, $msg) = &dosyntax($itmp, $object{$itmp}, *objec >> t); >> # print STDERR "checksyntax - before attr: $itmp rtcode: $r >> tcode val: $val msg: $msg\n" if ($opt_V); >> if (defined($val)) { >> *************** >> *** 711,759 **** >> # Try to do something clever with the changed field >> # >> # ch - changed >> # >> ! if ($key eq "ch") { >> >> ! print STDERR "dosyntax - checking ch\n" if $opt_V; >> >> ! local($date)=""; >> >> ! if ($value=~ / /) { >> ! $value=~ s/ +(\S+)$//; >> ! $date=$1; >> ! } >> >> ! # print STDERR "*", $date, "*", $value, "\n"; >> >> ! if (!(&isemail($value))) { >> ! return $O_ERROR, "syntax error in e-mail part of \"$ATTL{$key}\" >> "; >> } >> >> ! if (!$date) { >> ! return $O_ERROR, >> ! "No date specified in \"$ATTL{$key}\" attribute"; >> ! } >> ! if ($date!~ /^(\d\d)(\d\d)(\d\d)$/) { >> ! return $O_ERROR, "date part of \"$ATTL{$key}\" not in YYMMDD format >> "; >> ! } >> ! # 1988 is the start of the world. This is where we test for proper >> ! # date values of YYMMDD >> >> ! if (($1 < 88) || ($2 > 12) || ($3 > 31)) { >> ! return $O_ERROR, "date part of \"$ATTL{$key}\" is not a valid YYMMD >> D value"; >> ! } >> >> ! if ($date>$DATE) { >> ! $object{$key} =~ s/$date/$DATE/g; >> ! return $O_WARNING, >> ! "date in \"$ATTL{$key}\" ($date) is in the ". >> ! "future - changed to $DATE"; >> ! } >> >> ! $object{$key}=~ s/ +/ /g; >> >> - return $O_OK; >> - >> } >> >> # >> --- 711,804 ---- >> # Try to do something clever with the changed field >> # >> # ch - changed >> + # wd - withdrawn >> # >> ! if ($key=~ /^ch|wd$/) { >> >> ! print STDERR "dosyntax - checking ch,wd ($key)\n" if $opt_V; >> >> ! local($returncode)=$O_OK; >> >> ! local($date); >> ! local(@newchanged)=(); >> ! local(@changedvalues)=split(/\n+/, $value); >> >> ! # >> ! # add current date if needed to last specified attribute >> >> ! if ($changedvalues[$#changedvalues]!~ / \d{6,6}$/) { >> ! >> ! $changedvalues[$#changedvalues].=" ".$DATE; >> ! >> ! &addwarning(*object, "added current date to ".$ATTL{$key}." fiel >> d"); >> ! >> ! $returncode=$O_WARNING; >> ! >> } >> + >> + # >> + # sort values on date >> + >> + @changedvalues=sort sortchangedfield @changedvalues; >> + >> + #print STDERR join("\n", "values:", @changedvalues); >> + >> + foreach $value (@changedvalues) { >> + >> + $date=""; >> + >> + if ($value=~ / /) { >> + $value=~ s/ +(\S+)$//; >> + $date=$1; >> + } >> + >> + # print STDERR "*", $date, "*", $value, "\n"; >> + >> + if (!(&isemail($value))) { >> + return $O_ERROR, "syntax error in e-mail part of \"$ATTL{$key >> }\""; >> + } >> >> ! if (!$date) { >> ! return $O_ERROR, "No date specified in \"$ATTL{$key}\" attribute"; >> ! } >> ! >> ! if ($date=~ /^(\d\d)(\d\d)(\d\d)$/) { >> ! >> ! # >> ! # 1988 is the start of the world. This is where we test for proper >> ! # date values of YYMMDD >> >> ! if ($1<88) { >> ! return $O_ERROR, "date ($date) part of \"$ATTL{$key}\" is older >> then the database itself!"; >> ! } >> ! >> ! if (($2<1) || ($2>12) || ($3>31) || ($3<1)) { >> ! return $O_ERROR, "date ($date) part of \"$ATTL{$key}\" is not a >> valid YYMMDD value"; >> ! } >> ! >> ! } >> ! else { >> ! >> ! return $O_ERROR, "date part of \"$ATTL{$key}\" not in YYMMDD forma >> t"; >> >> ! } >> ! >> ! if ($date>$DATE) { >> ! >> ! &addwarning(*object, "date in \"$ATTL{$key}\" ($date) is in the fu >> ture - changed to $DATE"); >> ! $date=$DATE; >> ! $returncode=$O_WARNING; >> ! >> ! } >> ! >> ! push(@newchanged, $value." ".$date); >> >> ! } >> ! >> ! $object{$key}=join("\n", @newchanged); >> ! >> ! return $returncode; >> >> } >> >> # >> *************** >> *** 1752,1758 **** >> # >> # check if the ID is not already used >> >> ! return $O_ERROR, "error in \"$ATTL{$key}\", auto NIC handle assi >> gnment\nidentification code ($1.$2) already used in other object" if ($NICID >> {$object{"so"}, $1.$2}); >> >> # >> # find initials if not already specified >> --- 1797,1803 ---- >> # >> # check if the ID is not already used >> >> ! return $O_ERROR, "error in \"$ATTL{$key}\", auto NIC handle assi >> gnment\nidentification code ($1.$2) already used in other object" if ($NICID >> {$object{"so"}, $prefix}); >> >> # >> # find initials if not already specified >> *************** >> *** 1768,1776 **** >> >> $object{$key}=$prefix.$initials; >> >> $prefix=~ /\-(\d+)$/; >> - $NICID{$object{"so"}, $1}=1; >> >> return $O_OK; >> >> } >> --- 1813,1827 ---- >> >> $object{$key}=$prefix.$initials; >> >> + # >> + # check if the ID is not already used >> + >> $prefix=~ /\-(\d+)$/; >> >> + return $O_ERROR, "error in \"$ATTL{$key}\", auto NIC handle a >> ssignment identification code ($1) already used in other object\nplease use >> another number then $1" if ($NICID{$object{"so"}, $prefix}); >> + >> + $NICID{$object{"so"}, $prefix}=1; >> + >> return $O_OK; >> >> } >> *************** >> *** 2170,2204 **** >> return $O_OK; >> } >> >> - >> - # >> - # wd - withdrawn >> - # >> - if ($key eq "wd") { >> - >> - print STDERR "dosyntax - checking wd ($key)\n" if $opt_V; >> - >> - if ($value !~ /^(\d\d)(\d\d)(\d\d)$/) { >> - return $O_ERROR, >> - "date part of \"$ATTL{$key}\" not in YYMMDD format"; >> - } >> - >> - # 1988 is the start of the world. This is where we test for proper >> - # date values of YYMMDD >> - >> - if (($1 < 88) || ($2 > 12) || ($3 > 31)) { >> - return $O_ERROR, >> - "date part of \"$ATTL{$key}\" is not a valid YYMMDD value"; >> - } >> - >> - if ($value gt $DATE) { >> - return $O_ERROR, >> - "date in \"$ATTL{$key}\" ($1$2$3) is in the future"; >> - } >> - >> - return $O_OK; >> - } >> - >> # >> # These are not checked and not used, just in here for clarity >> # >> --- 2221,2226 ---- >> *** misc.old Wed Aug 14 17:38:41 1996 >> --- misc.pl Wed Aug 14 17:46:14 1996 >> *************** >> *** 2,13 **** >> # misc - miscellaneaous functions >> # >> # $RCSfile: misc.pl,v $ >> ! # $Revision: 2.0 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/08 10:47:30 $ >> # >> >> require "defines.pl"; >> >> sub ReplaceGlobalVars { >> local(*text)=@_; >> --- 2,45 ---- >> # misc - miscellaneaous functions >> # >> # $RCSfile: misc.pl,v $ >> ! # $Revision: 2.1 $ >> # $Author: ripe-dbm $ >> ! # $Date: 1996/08/14 15:46:06 $ >> # >> >> require "defines.pl"; >> + >> + sub sortchangedfield { >> + >> + $a=~ /(\d{6,6})$/; >> + local($date1)=$1; >> + >> + $b=~ /(\d{6,6})$/; >> + >> + # print STDERR "-$a-$b-$date1-$1-\n"; >> + >> + if ((!$date1) && (!$1)) { >> + >> + return 0; >> + >> + } >> + elsif (!$date1) { >> + >> + return -1; >> + >> + } >> + elsif (!$1) { >> + >> + return 1; >> + >> + } >> + else { >> + >> + return $date1 <=> $1; >> + >> + } >> + >> + } >> >> sub ReplaceGlobalVars { >> local(*text)=@_; >> >> -------- Logged at Mon Aug 19 13:00:30 MET DST 1996 --------- From David.Kessens at ripe.net Mon Aug 19 13:00:26 1996 From: David.Kessens at ripe.net (David.Kessens at ripe.net) Date: Mon, 19 Aug 1996 13:00:26 +0200 (MET DST) Subject: Newest patches: ripe-dbase.2.0.3 available Message-ID: <9608191100.AA13022@ncc.ripe.net> A non-text attachment was scrubbed... Name: not available Type: text Size: 1597 bytes Desc: not available Url : https://www.ripe.net/mailman/private/rr-impl/attachments/19960819/1e1d008a/attachment.pl