#!/usr/bin/perl # # Author: Geoff Huston, APNIC (c) 2008 # gih@apnic.net # # Installation: # This uses the 'combined RIR stats file' A copy of this # file (updated daily) is at http://bgp.potaroo.net/stats/nro/delegated # # Usage: # command line tool: ipv6addr # cgi-tool: copy to local cgi-bin directory # # use CGI qw(:cgi-lib); use Math::BigInt; $| = 1 ; $nro_delegated = "/var/data/bgp/stats/nro/delegated" ; if (!(-e $nro_delegated)) { $nro_delegated = "./delegated" ; } &ReadParse(); if (!($prefix = $in{"pfx"})) { $addr = shift ; $html = 0 ; } else { $html = 1 ; $addr = $prefix ; $addr =~ s/\-/:/g ; } $addr =~ s/^\s+// ; $addr =~ s/\s+$// ; if ($html) { print("Content-type: text/html\n\n") ; print("IPv6 Whois\n") ; print("\nIPv6 Address Report\n