From 3eab28ef541fe7a44eb366220fade3a66e93a03d Mon Sep 17 00:00:00 2001 From: ijackson Date: Fri, 18 Jun 1999 16:14:15 +0000 Subject: [PATCH] Continuing. --- bcp5-registry.pl | 61 ++++++++ config.pl | 2 + template.html | 362 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 425 insertions(+) create mode 100755 bcp5-registry.pl create mode 100644 config.pl create mode 100644 template.html diff --git a/bcp5-registry.pl b/bcp5-registry.pl new file mode 100755 index 0000000..887b553 --- /dev/null +++ b/bcp5-registry.pl @@ -0,0 +1,61 @@ +#!/usr/bin/perl + +require "$ARGV[0]/config.pl"; +require 'database.pl'; + +if ("$ARGV[1]" eq '--cgi') { + require 'cgi-lib.pl'; + &ReadParse; +} else { + foreach $x (@ARGV) { + $x =~ s/^(\w+)\=//; + $in{$1}= $x; + } +} + +if ($in{'dbid'}) { + database(); + $id= $in{$dbid}; + if (!exists $db{$id}) { + $notfound= 1; + } else { + $details= 1; + getinfo(); + } +} else { + $intro= 1; +} + +open X, "template.html" or die $!; +@x= ; +close X or die $!; + +$x[$#x] eq "\@\@\@eof:\@\@\@\n" or die $!; +$#x--; + +$cl= 0; +process(1); + +sub process ($) { + my ($doing) = @_; + for (;;) { + return if $cl > $#x; + $_= $x[$cl++]; + s/\n$//; s/\s*$//; + return if m/^\@\@\@end\w+\:\@\@\@$/; + + if (m/^\@\@\@(if|ifnot):(\w+)\@\@\@$/) { + $v= $$2; + $do= $1 eq 'if' ? !!$v : !$v; + process($doing && $do); + } elsif (m/^\@\@\@foreach\: + } else { + + $do= $1 eq 'if' ? ${$2} : $$ + $ifnot= $1; + $v= eval $2; + + while ($i < $e) { + + +$i= process(0,$#x); diff --git a/config.pl b/config.pl new file mode 100644 index 0000000..6fae0d1 --- /dev/null +++ b/config.pl @@ -0,0 +1,2 @@ +$whose= "Cambridge Geeks'"; +$adminemail= ;ijackson+cam-bcp5@chiark.greenend.org.uk'; diff --git a/template.html b/template.html new file mode 100644 index 0000000..dfa7e0a --- /dev/null +++ b/template.html @@ -0,0 +1,362 @@ + + +@@@if:intro@@@ +@@@whose@@@ BCP5 (RFC1918) Registry +@@@endif:@@@ + +@@@ifnot:intro@@@ +@@@whose@@@ BCP5 Registry - + +@@@if:picked@@@ +@@@net@@@ picked +@@@endif + +@@@if:details@@@ +details of @@@name@@@ +@@@endif:@@@ + +@@@if:created@@@ +registered @@@name@@@ +@@@endif:@@@ + +@@@if:updated@@@ +updated @@@name@@@ +@@@endif:@@@ + +@@@if:viewingall@@@ +entire database +@@@endif:@@@ + +@@@if:viewingarea@@@ +subset for @@@viewarea@@@ +@@@endif:@@@ + +@@@if:viewingoverlap@@@ +overlapping with @@@viewoverlap@@@ +@@@endif:@@@ + +@@@if:notfound@@@ +entry not found +@@@endif:@@@ + + +@@@endif:@@@ + + + + + +

@@@whose@@@ BCP5 (RFC1918) network numbers registry + +@@@ifnot:intro@@@ +
+@@@endif:@@@ + +@@@if:picked@@@ +Random network picked: @@@net@@@ +@@@endif:@@@ + +@@@if:details@@@ +Database entry details: @@@name@@@ +@@@endif:@@@ + +@@@if:created@@@ +@@@name@@@ registered in database +@@@endif:@@@ + +@@@if:updated@@@ +Database entry updated: @@@name@@@ +@@@endif:@@@ + +@@@if:viewingall@@@ +Entire database listing +@@@endif:@@@ + +@@@if:viewingarea@@@ +Database subset listing for @@@viewarea@@@ +@@@endif:@@@ + +@@@if:viewingoverlap@@@ +Database search, entries overlapping with @@@viewoverlap@@@ +@@@endif:@@@ + +@@@if:notfound@@@ +Database entry not found +@@@endif:@@@ + +

+ + +@@@if:intro@@@ + +

Introduction

+ +BCP5 (currently +RFC1918, `Address Allocation for Private Internets') describes +circumstances where it can be useful to have non-globally-unique IP +addresses, and specifies three address IPv4 address ranges which can +be used for this purpose. + +

+ +RFC1918 +recommends that, to minimise the risk of clashes when private +internets need to be merged, address ranges should be chosen at +random. + +

+ +This web page and database exists to help people choose ranges at +random, and to help them choose ranges which are not currently in use +by anyone else. + +@@@endif:@@@ + + +@@@if:registernew@@@ +

Register a network range you are using

+You may register an existing network range you are using in our +database. +@@@endif:@@@ + +@@@if:picked@@@ +

Random network range chosen

+I have picked the random network numbering range +@@@net@@@ for you. You can see its relationship +to other entries in the database of networks people are using - +it is shown below, in amongst the +registered database entries. +

+If you are happy with it, you are of course free to use it straight +away without telling anyone. However, it may be to your advantage to +register it in our database. +@@@endif:@@@ + +@@@if:registernew|picked@@@ +

+You must enter an email address to `own' the database entry. This +email address will be mailed a reminder asking you to confirm/renew +your entry periodically, and will also be used to authorise changes to +the entry. +@@@endif:@@@ + +@@@if:details|fulldetails@@@ +

Entry details

+@@@endif + +@@@if:created@@@ +

Entry created

+The database entry has been created, but will only persist for a short +time unless you confirm it. You have beeen sent an email requesting +confirmation. You may use `confirm/update', below, to do the +confirmation, or return at a later date when you have received the +email. +@@@endif:@@@ + +@@@if:updated@@@ +

Entry updated/confirmed

+The database entry below has been updated/confirmed/renewed. +@@@endif:@@@ + + +@@@if:registernew|details|fulldetails|created|updated|picked@@@ + +

+

+ + + +Network range: +@@@if:picked@@@ +@@@net@@@ +@@@endif:@@@ +@@@ifnot:picked@@@ + +@@@endif:@@@ +
+ +Network name: +
+ +@@@if:showemail@@@ +Contact email address: +@@@endif:@@@ +@@@ifnot:showemail@@@ +Contact email address hidden. +New address: +@@@endif:@@@ + +
+ + +Hide email address from public database. + +

+ +@@@if:registernew|picked@@@ + +@@@endif:@@@ + +@@@if:details|fulldetails|created|updated@@@ +Entry created: @@@datecreated@@@
+Last update: @@@datechanged@@@
+Confirmed/renewed: @@@dateconfirmed@@@ +@@@endif:@@@ + +@@@if:details@@@ +Use this to obtain your password. Passwords expire after a while; if +you do not have a recent notification of your password, you should +request a current password:
+ +

+@@@endif:@@@ + +@@@if:details|created@@@ +Using your password, you can update the details above (if you have +changed them), confirm or renew your entry (to stop it expiring), and +view the full details, including any hidden email address:
+Password: +@@@endif:@@@ + +@@@if:fulldetails|updated@@@ + +Password: supplied. +@@@endif:@@@ + +@@@if:details|created|updated@@@ +
+@@@endif:@@@ + +@@@if:details|fulldetails|created|updated@@@ + + +@@@endif:@@@ + +

+ +@@@endif:@@@ + + +@@@if:pick@@@ + +

Pick a random network range

+ +
+with 24-bit prefix (ie, 254 hosts) + +from +
+ +@@@foreach:area@@@ + + +@@@area_string@@@ +@@@if:area_recommended@@@ +recommended +@@@endif +
+ +@@@endforeach@@@ + +@@@ifnot:picked@@@ + +@@@endif:@@@ +@@@if:picked@@@ + +@@@endif:@@@ + +
+ +@@@endif@@@ + + +@@@if:notfound@@@ +Sorry, the database entry cannot be found. Perhaps the entry has been +deleted or expired. +

+ +If you believe that this has happened to you in error, contact the +registry administrator, @@@adminemail@@@, quoting identifier @@@id@@@. + +@@@endif:@@@ + + +@@@ifnot:notfound@@@ + +

View database

+ +
+ +@@@ifnot:viewingall@@@ + + +

+ +@@@endif:@@@ + +

Entries allocated from

+ +@@@foreach:area@@@ + +@@@ifnot:area_viewing@@@ + +@@@endif:@@@ +@@@if:area_viewing@@@ +@@@area_string@@@ +@@@endif:@@@ +

+ +@@@endforeach:@@@ + +@@@endif:@@@ + + +

Entries overlapping with

+ + + + +
+ +@@@if:viewingall|viewingoverlap|viewingarea@@@ + +

Database

+ +

+@@@if:viewingall@@@ +Entire database +@@@endif:@@@ +@@@if:viewingoverlap@@@ +Entries which overlap with @@@viewoverlap@@@ +@@@endif:@@@ +@@@if:viewingarea@@@ +Database for entries allocated from @@@viewarea@@@ +@@@ +

+ +@@@if:picked@@@ +The range picked for you has been emphasized below. +@@@endif:@@@ +

+ +You can get details about an existing entry by clicking on its address +range; this can also be used to modify it. + +@@@endif:@@@ + + +
+@@@foreach:db@@@ +
+@@@endforeach:@@@ +
Range Name Contact email +
@@@db_net@@@ +@@@db_name@@@ +@@@db_email@@@ +
+ +@@@endif:@@@ + + + +@@@eof:@@@ -- 2.30.2