libnet-xwhois-perl-0.90.orig/0040775000000000000000000000000007734114462014651 5ustar rootrootlibnet-xwhois-perl-0.90.orig/Changes0100644000000000000000000000514407547711472016151 0ustar rootroot CHANGELOG for Net::XWhois $Id: Changes,v 1.4 2001/12/30 06:52:52 vipul Exp $ -------------------------------------------------------------------------- 0.90 December 29, 2001 * Rob Woodard added support for ARIN lookups, updated RIPE definition and applied several pending patches. * Applied Erik Aronesty's patch to add reg_date, exp_date, and record_updated_date to the INTERNIC parser; parsers for whois.nic.mx and whois.adamsnames.tc responses and several new TLD -> server associations. 0.83 July 14, 2001 * Added a server() method. Thanks to Steve Weathers for the patch. * AUTHOLOAD now carp()'s about non-existant methods instead of croak()'ing. 0.82 July 14, 2001 * Minor fixes. 0.81 July 13, 2001 * Change the definition of TLDs to accomodate second level tlds. * Applied a patch by Matt Spiers that supplies parsers for NOMINET (whois.nic.uk), CENTRALNIC (whois.centralnic.com) and UKERNA (whois.ja.net). * Applied a patch by Robert Puettmann that supplies a parser for DENIC (whois.denic.de) responses. * Applied a patch by Steve Weathers that enhances the INTERNIC parser and supplies parsers for INWW (whois.InternetNamesWW.com) and BULKREG (whois.bulkregister.com) responses. * Changed "registrants" in RIPE format to "registrant". * Fixed a bug in contact_handles regex of INTERNIC parser. Thanks to Martin H . Sluka" for the patch. 0.80 July 13, 2001 * Steinar Overbeck Cook added RSPL support and split up the %ASSOC into two data structures to avoid ambiguous lookups. . . . . 0.49 December 13, 1998 * Introduced domain_status method for InterNIC domains. 0.48 December 12, 1998 * Pod changes. 0.46 December 07, 1998 * Changed contact_handles definition. 0.45 December 07, 1998 * Wrote register_cache() and corresponding pod documentation. 0.44 December 07, 1998 * Wrote $self->personality() * Introduced caching. libnet-xwhois-perl-0.90.orig/examples/0040775000000000000000000000000007734114462016467 5ustar rootrootlibnet-xwhois-perl-0.90.orig/examples/whois0100755000000000000000000000072407413535362017544 0ustar rootroot#!/usr/bin/perl -s use lib qw(lib/ ../lib); use Net::XWhois; my $whois = new Net::XWhois Domain => shift, Server => $h; if ( $e ) { my @emails = $whois->contact_emails; $" = ", "; print "Contacts: @emails\n"; exit } if ( $n ) { my @emails = $whois->nameservers; $" = ", "; print "Nameservers: @emails\n"; exit } if ( $r ) { my @emails = $whois->registrants; $" = ", "; print "Registrants: @emails\n"; exit } print $whois->response; libnet-xwhois-perl-0.90.orig/examples/creation_time0100755000000000000000000000101507024547442021227 0ustar rootroot#!/usr/bin/perl -I../ use Net::XWhois; use Data::Dumper; my $w = new Net::XWhois; $w->register_parser ( Name => 'INTERNIC', Retain => 1, Parser => { creation_time => 'Record created on (\S*?)\.\n', } ); my $domain = shift; my $whois = new Net::XWhois Domain => $domain; print "$domain --\n"; print "Registrant: ", $whois->registrant (); print "\nCreation Time of $domain: ", $whois->creation_time (); print "\n"; print Dumper $w; libnet-xwhois-perl-0.90.orig/lib/0040775000000000000000000000000007734114462015417 5ustar rootrootlibnet-xwhois-perl-0.90.orig/lib/Net/0040775000000000000000000000000007734114462016145 5ustar rootrootlibnet-xwhois-perl-0.90.orig/lib/Net/XWhois.pm0100644000000000000000000011341607547711763017736 0ustar rootroot#!/usr/bin/perl ## ## Net::XWhois ## Whois Client Interface Class. ## ## $Date: 2001/07/14 07:25:31 $ ## $Revision: 1.3 $ ## $State: Exp $ ## $Author: vipul $ ## ## Copyright (c) 1998, Vipul Ved Prakash. All rights reserved. ## This code is free software; you can redistribute it and/or modify ## it under the same terms as Perl itself. # # modified August 2002 by Rob Woodard # # Changes: # # 08/05/2002 rwoodard Merged in changes from XWhois discussion forum on # sourceforge.net; made additional changes as needed # to implement reverse lookups of IP addresses # 08/06/2002 rwoodard Added comments for internal documentation. Added # parser defs for ARIN, set APNIC and RIPE to use RPSL. # 08/07/2002 rwoodard Added ARIN-specific following of multiple netblocks; # this is done by setting the Bottom_netblock attrib # 08/08/2002 rwoodard Added Verbose attribute for displaying status info # 08/26/2002 rwoodard Revised ARIN parser to reflect updated responses # package Net::XWhois; use Data::Dumper; use IO::Socket; use Carp; use vars qw ( $VERSION $AUTOLOAD ); $VERSION = '0.90'; my $CACHE = "/tmp/whois"; my $EXPIRE = 604800; my $ERROR = "return"; my $TIMEOUT = 20; my $RETRIES = 3; my %PARSERS = ( #these are the parser definitions for each whois server. #the AUTOLOAD subroutine creates an object method for each key defined within #the server's hash of regexps; this applies the regexp to the response from #the whois server to extract the data. of course you can just write your own #parsing subroutine as described in the docs. # #there ought to be some standardization of the fields being parsed. for my #own personal purposes only RPSL and ARIN are standardized; there needs to be #some work done on the other defs to get them to return at least these fields: # # name name of registrant entity (company or person) # netname name assigned to registrant's network # inetnum address range registered # abuse_email email addresses named 'abuse@yaddayadda' # gen_email general correspondence email addresses # #yes some of these are redundant to what is already there; I saw no reason to #delete non-standardized keys, they don't take that much space and might be #needed for backwards compatibility. -rwoodard 08/2002 RPSL => { #updated by rwoodard 08/06/2002 name => '(?:descr|owner):\s+([^\n]*)\n', netname => 'netname:\s+([^\n]*)\n', inetnum => 'inetnum:\s+([^\n]*)\n', abuse_email => '\b(?:abuse|security)\@\S+', gen_email => 'e-*mail:\s+(\S+\@\S+)', country => 'country:\s+(\S+)', status => 'status:\s+([^\n]*)\n', contact_admin => '(?:admin|owner)-c:\s+([^\n]*)\n', contact_tech => 'tech-c:\s+([^\n]*)\n', contact_emails => 'email:\s+(\S+\@\S+)', contact_handles => 'nic-hdl(?:-\S*):\s+([^\n]*)\n', remarks => 'remarks:\s+([^\n]*)\n', notify => 'notify:\s+([^\n]*)\n', forwardwhois => 'remarks:\s+[^\n]*(whois.\w+.\w+)', }, ARIN => { #from Jon Gilbert 09/04/2000 updated/added to by rwoodard 08/07/2002 name => '(?:OrgName|CustName):\s*(.*?)\n', netname => 'etName:\s*(\S+)\n+', inetnum => 'etRange:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', abuse_email => '(?:abuse|security)\@\S+', gen_email => 'Coordinator:[\n\s]+.*?(\S+\@\S+)', netnum => 'Netnumber:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', hostname => 'Hostname:\s*(\S+)[\n\s]*', maintainer => 'Maintainer:\s*(\S+)', #record_update => 'Record last updated on (\S+)\.\n+', record_update => 'Updated:(\S+)\n+', database_update => 'Database last updated on (.+)\.[\n\s]+The', registrant => '^(.*?)\n\n', reverse_mapping => 'Domain System inverse[\s\w]+:[\n\s]+(.*?)\n\n', coordinator => 'Coordinator:[\n\s]+(.*?)\n\n', coordinator_handle => 'Coordinator:[\n\s]+[^\(\)]+\((\S+?)\)', coordinator_email => 'Coordinator:[\n\s]+.*?(\S+\@\S+)', address => 'Address:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', system => 'System:\s+([^\n]*)\n', non_portable => 'ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE', #multiple => 'To single out one record', multiple => '\((NET\S+)\)', net_handle => '(NET\S+)\)', country => 'Country:\s*(\S+)\n+', }, BRNIC => { name => '(?:descr|owner):\s+([^\n]*)\n', netname => 'netname:\s+([^\n]*)\n', inetnum => 'inetnum:\s+([^\n]*)\n', abuse_email => '\b(?:abuse|security)\@\S+', gen_email => 'e-*mail:\s+(\S+\@\S+)', country => 'BR', #yes this is ugly, tell BRNIC to start putting country fields in their responses status => 'status:\s+([^\n]*)\n', contact_admin => '(?:admin|owner)-c:\s+([^\n]*)\n', contact_tech => 'tech-c:\s+([^\n]*)\n', contact_emails => 'email:\s+(\S+\@\S+)', contact_handles => 'nic-hdl(?:-\S*):\s+([^\n]*)\n', remarks => 'remarks:\s+([^\n]*)\n', notify => 'notify:\s+([^\n]*)\n', forwardwhois => 'remarks:\s+[^\n]*(whois.\w+.\w+)', }, KRNIC => { #added by rwoodard 08/06/2002 }, TWNIC => { #added by rwoodard 08/06/2002 name => '^([^\n]*)\n', netname => 'etname:\s*(\S+)\n+', inetnum => 'etblock:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', abuse_email => '(?:abuse|security)\@\S+', gen_email => 'Coordinator:[\n\s]+.*?(\S+\@\S+)', netnum => 'Netnumber:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', hostname => 'Hostname:\s*(\S+)[\n\s]*', maintainer => 'Maintainer:\s*(\S+)', record_update => 'Record last updated on (\S+)\.\n+', database_update => 'Database last updated on (.+)\.[\n\s]+The', registrant => '^(.*?)\n\n', reverse_mapping => 'Domain System inverse[\s\w]+:[\n\s]+(.*?)\n\n', coordinator => 'Coordinator:[\n\s]+(.*?)\n\n', coordinator_handle => 'Coordinator:[\n\s]+[^\(\)]+\((\S+?)\)', coordinator_email => 'Coordinator:[\n\s]+.*?(\S+\@\S+)', address => 'Address:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', system => 'System:\s+([^\n]*)\n', non_portable => 'ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE', multiple => 'To single out one record', net_handle => '\((NETBLK\S+)\)', country => '\n\s+(\S+)\n\n', }, INTERNIC => { name => '[\n\r\f]+\s*[Dd]omain [Nn]ame[:\.]*\s+(\S+)', status => 'omain Status[:\.]+\s+(.*?)\s*\n', nameservers => '[\n\r\f]+\s*([a-zA-Z0-9\-\.]+\.[a-zA-Z0-9\-]+\.[a-zA-Z\-]+)[:\s\n$]', registrant => '(?:egistrant|rgani[sz]ation)[:\.]*\s*\n(.*?)\n\n', contact_admin => '(?:dministrative Contact|dmin Contact).*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_tech => '(?:echnical Contact|ech Contact).*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_zone => 'one Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_billing => 'illing Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_emails => '(\S+\@\S+)', contact_handles => '\(([^\W\d]+\d+)\)', domain_handles => '\((\S*?-DOM)\)', org_handles => '\((\S*?-ORG)\)', not_registered => 'No match', forwardwhois => 'Whois Server: (.*?)(?=\n)', }, BULKREG => { name => 'omain Name[:\.]*\s+(\S+)', status => 'omain Status[:\.]+\s+(.*?)\s*\n', nameservers => '[\n\r\f]+\s*([a-zA-Z0-9\-\.]+\.[a-zA-Z0-9\-]+\.[a-zA-Z\-]+)[:\s\n$]', registrant => '(.+)\([\w\-]+\-DOM\).*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_admin => 'dmin[a-zA-Z]*? Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_tech => 'ech[a-zA-Z]*? Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_zone => 'one Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_billing => 'illing Contact.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_emails => '(\S+\@\S+)', contact_handles => '\((\w+\d+\-BR)\)', domain_handles => '\((\S*?-DOM)\)', org_handles => '\((\S*?-ORG)\)', not_registered => 'Not found\!', forwardwhois => 'Whois Server: (.*?)(?=\n)', registrar => 'egistrar\s*\w*[\.\:]* (.*?)\.?\n', reg_date => 'reated on[\.\:]* (.*?)\.?\n', exp_date => 'xpires on[\.\:]* (.*?)\.?\n', }, INWW => { name => 'omain Name\.+ (\S+)', status => 'omain Status\.+ ([^\n]*)\n', nameservers => 'Name Server\.+ (\S+)', registrant => 'Organisation \w{4,7}\.+ ([^\n]+?)\n', contact_admin => 'Admin \w{3,7}\.+ ([^\n]*)\n', contact_tech => 'Tech \w{3,7}\.+ ([^\n]*)\n', contact_zone => 'Zone \w{3,7}\.+ ([^\n]*)\n', contact_billing => 'Billing \w{3,7}\.+ ([^\n]*)\n', contact_emails => '(\S+\@\S+)', contact_handles => '\((\w+\d+)\)', domain_handles => '\((\S*?-DOM)\)', org_handles => '\((\S*?-ORG)\)', not_registered => 'is not registered', forwardwhois => 'Whois Server: (.*?)(?=\n)', registrar => 'egistrar\s*\w*[\.\:]* (.*?)\.?\n', exp_date => 'Expiry Date\.+ ([^\n]*)\n', reg_date => 'Registration Date\.+ ([^\n]*)\n', }, INTERNIC_CONTACT => { name => '(.+?)\s+\(.*?\)(?:.*?\@)', address => '\n(.*?)\n[^\n]*?\n\n\s+Re', email => '\s+\(.*?\)\s+(\S+\@\S+)', phone => '\n([^\n]*?)\(F[^\n]+\n\n\s+Re', fax => '\(FAX\)\s+([^\n]+)\n\n\s+Re', }, CANADA => { name => 'domain:\s+(\S+)\n', nameservers => '-Netaddress:\s+(\S+)', contact_emails => '-Mailbox:\s+(\S+\@\S+)', }, RIPE => { name => 'domain:\s+(\S+)\n', nameservers => 'nserver:\s+(\S+)', contact_emails => 'e-mail:\s+(\S+\@\S+)', registrant => 'descr:\s+(.+?)\n', }, RIPE_CH => { name => 'Domain Name:[\s\n]+(\S+)\n', nameservers => 'Name servers:[\s\n]+(\S+)[\s\n]+(\S+)', }, NOMINET => { name => 'omain Name:\s+(\S+)', registrant => 'egistered For:\s*(.*?)\n', ips_tag => 'omain Registered By:\s*(.*?)\n', record_updated_date => 'Record last updated on\s*(.*?)\s+', record_updated_by => 'Record last updated on\s*.*?\s+by\s+(.*?)\n', nameservers => 'listed in order:[\s\n]+(\S+)\s.*?\n\s+(\S*?)\s.*?\n\s*\n', whois_updated => 'database last updated at\s*(.*?)\n', }, UKERNA => { name => 'omain Name:\s+(\S+)', registrant => 'egistered For:\s*(.*?)\n', ips_tag => 'omain Registered By:\s*(.*?)\n', record_updated_date => 'ecord updated on\s*(.*?)\s+', record_updated_by => 'ecord updated on\s*.*?\s+by\s+(.*?)\n', nameservers => 'elegated Name Servers:[\s\n]+(\S+)[\s\n]+(\S+).*?\n\s*\n', contact_emails => 'Domain contact:\s*(.*?)\n', }, CENTRALNIC => { name => 'omain Name:\s+(\S+)', registrant => 'egistrant:\s*(.*?)\n', contact_admin => 'lient Contact:\s*(.*?)\n\s*\n', contact_billing => 'illing Contact:\s*(.*?)\n\s*\n', contact_tech => 'echnical Contact:\s*(.*?)\n\s*\n', record_created_date => 'ecord created on\s*(.*?)\n', record_paid_date => 'ecord paid up to\s*(.*?)\n', record_updated_date => 'ecord last updated on\s*(.*?)\n', nameservers => 'in listed order:[\s\n]+(\S+)\s.*?\n\s+(\S*?)\s.*?\n\s*\n', contact_emails => '(\S+\@\S+)', }, DENIC => { name => 'domain:\s+(\S+)\n', registrants => 'descr:\s+(.+?)\n', contact_admin => 'admin-c:\s+(.*?)\s*\n', contact_tech => 'tech-c:\s+(.*?)\s*\n', contact_zone => 'zone-c:\s+(.*?)\s*\n', nameservers => 'nserver:\s+(\S+)', status => 'status:\s+(.*?)\s*\n', changed => 'changed:\s+(.*?)\s*\n', source => 'source:\s+(.*?)\s*\n', person => 'person:\s+(.*?)\s*\n', address => 'address:\s+(.+?)\n', phone => 'phone:\s+(.+?)\n', fax_no => 'fax-no:\s+(.+?)\n', contact_emails => 'e-mail:\s+(.+?)\n', }, JAPAN => { name => '\[Domain Name\]\s+(\S+)', nameservers => 'Name Server\]\s+(\S+)', contact_emails => '\[Reply Mail\]\s+(\S+\@\S+)', }, TAIWAN => { name => 'omain Name:\s+(\S+)', registrant => '^(\S+) \(\S+?DOM)', contact_emails => '(\S+\@\S+)', nameservers => 'servers in listed order:[\s\n]+\%see\-also\s+\.(\S+?)\:', }, KOREA => { name => 'Domain Name\s+:\s+(\S+)', nameservers => 'Host Name\s+:\s+(\S+)', contact_emails => 'E\-Mail\s+:\s*(\S+\@\S+)', }, MEXICO => { name => '[\n\r\f]+\s*[Nn]ombre del [Dd]ominio[:\.]*\s+(\S+)', status => 'omain Status[:\.]+\s+(.*?)\s*\n', nameservers => 'ameserver[^:]*:\s*([a-zA-Z0-9.\-])+', registrant => '(?:egistrant|rgani[sz]acion)[:\.]*\s*\n(.*?)\n\n', contact_admin => '(?:tacto [Aa]dministrativo|dmin Contact).*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_tech => '(?:tacto [Tt]ecnico|ech Contact).*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_billing => 'to de Pago.*?\n(.*?)(?=\s*\n[^\n]+?:\s*\n|[\n\r\f]{2})', contact_emails => '(\S+\@\S+)', contact_handles => '\(([^\W\d]+\d+)\)', not_registered => 'No Encontrado', reg_date => 'de creacion[\.\:]* (.*?)\.?\n', record_updated_date => 'a modificacion[\.\:]* (.*?)\.?\n', }, ADAMS => { name => '(\S+) is \S*\s*registered', not_registered => 'is not registered', }, GENERIC => { contact_emails => '(\S+\@\S+)', }, ); my %WHOIS_PARSER = ( 'whois.ripe.net' => 'RPSL', 'whois.nic.mil' => 'INTERNIC', 'whois.nic.ad.jp' => 'JAPAN', 'whois.domainz.net.nz' => 'GENERIC', 'whois.nic.gov' => 'INTERNIC', 'whois.nic.ch' => 'RIPE_CH', 'whois.twnic.net' => 'TWNIC', 'whois.internic.net' => 'INTERNIC', 'whois.aunic.net' => 'RIPE', 'whois.cdnnet.ca' => 'CANADA', 'whois.ja.net' => 'UKERNA', 'whois.nic.uk' => 'NOMINET', 'whois.krnic.net' => 'KOREA', 'whois.isi.edu' => 'INTERNIC', 'whois.norid.no' => 'RPSL', 'whois.centralnic.com' => 'CENTRALNIC', 'whois.denic.de' => 'DENIC', 'whois.InternetNamesWW.com' => 'INWW', 'whois.bulkregister.com' => 'BULKREG', 'whois.arin.net' => 'ARIN', #added 08/06/2002 by rwoodard 'whois.apnic.net' => 'RPSL', #added 08/06/2002 by rwoodard 'whois.nic.fr' => 'RPSL', 'whois.lacnic.net' => 'RPSL', 'whois.nic.br' => 'BRNIC', 'whois.nic.mx' => 'MEXICO', 'whois.adamsnames.tc' => 'ADAMS', ); my %DOMAIN_ASSOC = ( 'al' => 'whois.ripe.net', 'am' => 'whois.ripe.net', 'at' => 'whois.ripe.net', 'au' => 'whois.aunic.net', 'az' => 'whois.ripe.net', 'ba' => 'whois.ripe.net', 'be' => 'whois.ripe.net', 'bg' => 'whois.ripe.net', 'by' => 'whois.ripe.net', 'ca' => 'whois.cdnnet.ca', 'ch' => 'whois.nic.ch', 'com' => 'whois.internic.net', 'cy' => 'whois.ripe.net', 'cz' => 'whois.ripe.net', 'de' => 'whois.denic.de', 'dk' => 'whois.dk-hostmaster.dk', 'dz' => 'whois.ripe.net', 'edu' => 'whois.internic.net', 'ee' => 'whois.ripe.net', 'eg' => 'whois.ripe.net', 'es' => 'whois.ripe.net', 'fi' => 'whois.ripe.net', 'fo' => 'whois.ripe.net', 'fr' => 'whois.nic.fr', 'gb' => 'whois.ripe.net', 'ge' => 'whois.ripe.net', 'gov' => 'whois.nic.gov', 'gr' => 'whois.ripe.net', 'hr' => 'whois.ripe.net', 'hu' => 'whois.ripe.net', 'ie' => 'whois.ripe.net', 'il' => 'whois.ripe.net', 'is' => 'whois.ripe.net', 'it' => 'whois.ripe.net', 'jp' => 'whois.nic.ad.jp', 'kr' => 'whois.krnic.net', 'li' => 'whois.ripe.net', 'lt' => 'whois.ripe.net', 'lu' => 'whois.ripe.net', 'lv' => 'whois.ripe.net', 'ma' => 'whois.ripe.net', 'md' => 'whois.ripe.net', 'mil' => 'whois.nic.mil', 'mk' => 'whois.ripe.net', 'mt' => 'whois.ripe.net', 'mx' => 'whois.nic.mx', 'net' => 'whois.internic.net', 'nl' => 'whois.ripe.net', 'no' => 'whois.norid.no', 'nz' => 'whois.domainz.net.nz', 'org' => 'whois.internic.net', 'pl' => 'whois.ripe.net', 'pt' => 'whois.ripe.net', 'ro' => 'whois.ripe.net', 'ru' => 'whois.ripe.net', 'se' => 'whois.ripe.net', 'sg' => 'whois.nic.net.sg', 'si' => 'whois.ripe.net', 'sk' => 'whois.ripe.net', 'sm' => 'whois.ripe.net', 'su' => 'whois.ripe.net', 'tn' => 'whois.ripe.net', 'tr' => 'whois.ripe.net', 'tw' => 'whois.twnic.net', 'ua' => 'whois.ripe.net', 'uk' => 'whois.nic.uk', 'gov.uk' => 'whois.ja.net', 'ac.uk' => 'whois.ja.net', 'eu.com' => 'whois.centralnic.com', 'uk.com' => 'whois.centralnic.com', 'uk.net' => 'whois.centralnic.com', 'gb.com' => 'whois.centralnic.com', 'gb.net' => 'whois.centralnic.com', 'us' => 'whois.isi.edu', 'va' => 'whois.ripe.net', 'yu' => 'whois.ripe.net', ); my %ARGS = ( 'whois.nic.ad.jp' => { 'S' => '/e' }, 'whois.internic.net' => { 'P' => '=' }, 'whois.networksolutions.com' => { 'P' => '=' }, ); sub register_parser { my ( $self, %args ) = @_; $self->{ _PARSERS }->{ $args{ Name } } = {} unless $args{ Retain }; #set Retain to keep parser entries already present for ( keys %{ $args{ Parser } } ) { $self->{ _PARSERS }->{ $args{ Name } }->{$_} = $args{ Parser }->{$_}; } return 1; } sub register_association { my ( $self, %args ) = @_; foreach my $server ( keys %args ) { # Update our table for looking up the whois server => parser $self->{ _WHOIS_PARSER }->{ $server } = $args{ $server }->[0]; # Save name of whois server and associated parser # Update our table of domains and their associated server #$self->{ _DOMAIN_ASSOC }->{ $_ } = $server for ( @{$args{ $server }}->[1]); $self->{ _DOMAIN_ASSOC }->{ $_ } = $server for ( @{$args{ $server }->[1]}); #from Paul Fuchs }; return 1; } sub register_cache { my ( $self, $cache ) = @_; return ${ $self->{ _CACHE } } = $cache if $cache; } sub server { my $self = shift; return $self->{ Server }; } sub guess_server_details { my ( $self, $domain ) = @_; $domain = lc $domain; my $ip=$domain=~/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/; #processing an IP? my ( $server, $parser ); my ( $Dserver, $Dparser ) = $ip ? ( 'whois.arin.net', { %{ $self->{ _PARSERS }->{ ARIN } } }) : ( 'whois.internic.net', { %{ $self->{ _PARSERS }->{ INTERNIC } } } ) ; #figure out what our server and parser should be if ($ip) { $server= $self->{ Server } ? $self->{ Server } : 'whois.arin.net' ; } else { $domain =~ s/.*\.(\w+\.\w+)$/$1/; #peels off the last two elements $server = $self->{ _DOMAIN_ASSOC }->{ $domain }; unless ($server) { $domain =~ s/.*\.(\w+)$/$1/; #peels off the last element $server = $self->{ _DOMAIN_ASSOC }->{ $domain }; } } $parser = $self->{ _PARSERS }->{ $self->{ _WHOIS_PARSER }->{ $server } } if ($server); #print "domain $domain server $server parser $parser\n"; return $server ? [$server, $parser] : [$Dserver, $Dparser]; }; sub new { my ( $class, %args ) = @_; my $self = {}; $self->{ _PARSERS } = \%PARSERS; $self->{ _DOMAIN_ASSOC } = \%DOMAIN_ASSOC; $self->{ _WHOIS_PARSER } = \%WHOIS_PARSER; $self->{ _CACHE } = $args{Cache} || \$CACHE; $self->{ _EXPIRE } = $args{Expire} || \$EXPIRE; $self->{ _ARGS } = \%ARGS; bless $self, $class; $self->personality ( %args ); $self->lookup () if $self->{ Domain }; return $self; } sub personality { my ( $self, %args ) = @_; #set all attributes that were passed in for ( keys %args ) {chomp $args{ $_} if defined($args{ $_}); $self->{ $_ }=$args{ $_ } } $self->{ Parser } = $self->{ _PARSERS }->{ $args{ Format } } if $args{ Format }; #lets you pick an alternate parser set #if we don't have a whois server to use, guess based on the Domain (or IP) unless ( $self->{ Server } ) { my $res = $self->guess_server_details ( $self->{ Domain } ); ( $self->{ Server }, undef ) = @$res; } #if there is already a Parser defined for this server, use it if ( $self->{ _PARSERS }->{ $self->{ Server }}) { $self->{ Parser } = $self->{ _PARSERS }->{ $self->{ Server }}; } #if we still don't have a Parser to use, guess based on the Domain (or IP) unless ( $self->{ Parser } ) { my $res = $self->guess_server_details ( $self->{ Domain } ); ( undef, $self->{ Parser } ) = @$res; } #set these if they aren't already set $self->{ Timeout } = $TIMEOUT unless $self->{ Timeout }; $self->{ Error } = $ERROR unless $self->{ Error }; $self->{ Retries } = $RETRIES unless $self->{ Retries }; } sub lookup { my ( $self, %args ) = @_; $self->personality ( %args ); my $cache = $args{ Cache } || ${ $self->{ _CACHE } }; $self->{ Domain }=~s/^www\.//; #trim leading www. if present; internic doesn't like it print "looking up ", $self->{ Domain }, " on ", $self->{ Server }, "\n" if ($self->{ Verbose }); #see if we already have a response in the cache, unless told not to unless ( $self->{ Nocache } ) { READCACHE: { if ( -d $cache ) { last READCACHE unless -e "$cache/$domain"; my $current = time (); open D, "$cache/$domain" || last READCACHE; my @stat = stat ( D ); if ( $current - $stat[ 9 ] > ${ $self->{ _EXPIRE } } ) { close D; last READCACHE; } undef $/; $self->{ Response } = ; return 1; } } } #connect to whois server my $server = $self->{ Server }; my $suffix = $self->{ _ARGS }->{ $server }->{S} || ''; my $prefix = $self->{ _ARGS }->{ $server }->{P} || ''; my $sock = $self->_connect ( $self->{ Server } ); return undef unless $sock; #request whois info, then disconnect print $sock $prefix , $self->{ Domain }, "$suffix\r\n"; #print $sock $prefix , $domain, "$suffix\r\n"; { local $/; undef $/; $self->{ Response } = <$sock>; } close($sock); undef $sock; #did we get forwarded? my $fw = eval { ($self->forwardwhois)[0] }; my @fwa = (); #if ($fw =~ m/\n/) { unless (defined($fw) && $fw=~/whois/) { #if forwardwhois is a server, use it; otherwise... #ARIN forwarding kludge 08/06/2002 rwoodard if ( $self->{ Server } eq "whois.arin.net" ) { $fw="whois.apnic.net" if ( $self->{ Response }=~/Asia Pacific Network Information (?:Center|Centre)/misg ); $fw="whois.ripe.net" if ( $self->{ Response }=~/European Regional Internet Registry|RIPE Network Coordination Centre/misg ); $fw="whois.lacnic.net" if ( $self->{ Response }=~/Latin American and Caribbean IP address Regional Registry/misg ); } #APNIC forwarding kludge 08/06/2002 rwoodard elsif ($self->{ Server } eq 'whois.apnic.net') { $fw="whois.krnic.net" if ($self->{ Response }=~/Allocated to KRNIC/misg ); $fw="whois.twnic.net" if ($self->{ Response }=~/Allocated to TWNIC/misg ); } else { #original code @fwa = $self->{ Response } =~ m/\s+$self->{ Domain }\n.*?\n*?\s*?.*?Whois Server: (.*?)(?=\n)/isg; $fw = shift @fwa; return undef unless (defined($fw) && length($fw) > 0); # pattern not found } return undef if (defined($fw) && $self->{ Server } eq $fw); #avoid infinite loop } if ( defined($fw) && $fw ne "" ) { $self->personality( Format => $self->{_WHOIS_PARSER}->{$fw}); return undef if ($self->{ Server } eq $fw); #avoid infinite loop $self->{ Server } = $fw; $self->{ Response } = ""; #$self->lookup(); print " forwarded to server $fw\n" if ($self->{ Verbose }); $self->lookup( Server => "$fw" ); #from Paul Fuchs } #are there multiple netblocks? If so, do we pursue them? (ARIN only for now) if ( $self->{Server} eq 'whois.arin.net' && $self->multiple && $self->{ Bottom_netblock } && $self->net_handle ) { my @netblocks=($self->net_handle); my $cnt=$#netblocks; #print "mult blocks, looking up ", $netblocks[$cnt], " on ", $self->{ Server }, "\n"; $self->{ Response } = ""; $self->lookup( Domain => $netblocks[$cnt], Server => $self->{ Server }); } #cache the response if ( (-d $cache) && (!($self->{Nocache})) ) { open D, "> $cache/$domain" || return; print D $self->{ Response }; close D; } #print "done with lookup\n"; } sub AUTOLOAD { my $self = shift; return undef unless $self->{ Response }; #we didn't get a response, nothing to return my $key = $AUTOLOAD; $key =~ s/.*://; #croak "Method $key not defined" unless exists ${$self->{ Parser }}{$key}; return undef unless exists ${$self->{ Parser }}{$key}; #don't croak(), just don't do anything my @matches = (); if ( ref(${$self->{ Parser } }{ $key }) !~ /^CODE/ ) { #not an array or hash, i.e. a regexp #get everything in the response that matches the regexp; each match is an element in the array @matches = $self->{ Response } =~ /${ $self->{ Parser } }{ $key }/sg; #print "matches for $key: @matches\n"; } else { #assumes you have defined your own subroutine with register_parser, pass the whole response to it @matches = &{ $self->{ Parser }{$key}}($self->response); } my @tmp = split /\n/, join "\n", @matches; for (@tmp) { s/^\s+//; s/\s+$//; chomp }; #trim leading/trailing whitespace and newline #print "tmp: @tmp\n"; #depending on calling context, return an array or a newline-delimited string return wantarray ? @tmp : join "\n", @tmp ; } sub response { my $self = shift; return $self->{ Response }; } sub _connect { my $self = shift; my $machine = shift; my $error = $self->{Error}; my $maxtries = $self->{Retries}; my $sock; my $retries=0; until ($sock || $retries == $maxtries) { #print " connecting to $machine\n"; $sock = new IO::Socket::INET PeerAddr => $machine, PeerPort => 'whois', Proto => 'tcp', Timeout => $self->{Timeout}; # or &$error( "[$@]" ); $retries++ unless ($sock); print "try $retries failed\n" if ( $self->{ Verbose } && !$sock); } &$error( "[$@]" ) unless ($sock); $sock->autoflush if $sock; return $sock; } sub ignore {} sub DESTROY {} #from Gregory Karpinsky 'True Value.'; =head1 NAME Net::XWhois - Whois Client Interface for Perl5. =head1 SYNOPSIS use Net::XWhois; $whois = new Net::XWhois Domain => "vipul.net" ; $whois = new Net::XWhois Domain => "bit.ch", Server => "domreg.nic.ch", Retain => 1, Parser => { nameservers => 'nserver:\s+(\S+)', }; =head1 DESCRIPTION The Net::XWhois class provides a generic client framework for doing Whois queries and parsing server response. The class maintains an array of top level domains and whois servers associated with them. This allows the class to transparently serve requests for different tlds, selecting servers appropriate for the tld. The server details are, therefore, hidden from the user and "vipul.net" (from InterNIC), gov.ru (from RIPE) and "bit.ch" (from domreg.nic.ch) are queried in the same manner. This behaviour can be overridden by specifying different bindings at object construction or by registering associations with the class. See L<"register_associations()"> and L<"new()">. One of the more important goals of this module is to enable the design of consistent and predictable interfaces to incompatible whois response formats. The Whois RFC (954) does not define a template for presenting server data; consequently there is a large variation in layout styles as well as content served across servers. (There is, however, a new standard called RPSL (RFC2622) used by RIPE (http://www.ripe.net), the European main whois server.) To overcome this, Net::XWhois maintains another set of tables - parsing rulesets - for a few, popular response formats. (See L<"%PARSERS">). These parsing tables contain section names (labels) together with regular expressions that I the corresponding section text. The section text is accessed "via" labels which are available as data instance methods at runtime. By following a consistent nomenclature for labels, semantically related information encoded in different formats can be accessed with the same methods. =head1 CONSTRUCTOR =over 4 =item new () Creates a Net::XWhois object. Takes an optional argument, a hash, that specifies the domain name to be queried. Calls lookup() if a name is provided. The argument hash can also specify a whois server, a parsing rule-set or a parsing rule-set format. (See L<"personality()">). Omitting the argument will create an "empty" object that can be used for accessing class data. =item personality () Alters an object's personality. Takes a hash with following arguments. (Note: These arguments can also be passed to the constructor). =over 8 =item B Domain name to be queried. =item B Server to query. =item B Parsing Rule-set. See L<"%PARSERS">. Parser => { name => 'domain:\s+(\S+)\n', nameservers => 'nserver:\s+(\S+)', contact_emails => 'e-mail:\s+(\S+\@\S+)', }; =item B A pre-defined parser format like INTERNIC, INTERNIC_FORMAT, RIPE, RIPE_CH, JAPAN etc. Format => 'INTERNIC_CONTACT', =item B Force XWhois to ignore the cached records. =item B Determines how a network connection error is handled. By default Net::XWhois will croak() if it can't connect to the whois server. The Error attribute specifies a function call name that will be invoked when a network connection error occurs. Possible values are croak, carp, confess (imported from Carp.pm) and ignore (a blank function provided by Net::XWhois). You can, of course, write your own function to do error handling, in which case you'd have to provide a fully qualified function name. Example: main::logerr. =item B Timeout value for establishing a network connection with the server. The default value is 60 seconds. =back =back =head1 CLASS DATA & ACCESS METHODS =over 4 =item %PARSERS An associative array that contains parsing rule-sets for various response formats. Keys of this array are format names and values are hash refs that contain section labels and corresponding parser code. The parser code can either be a regex or a reference to a subroutine. In the case of a subroutine, the whois 'response' information is available to the sub in $_[0]. Parsers can be added and extended with the register_parser() method. Also see L. my %PARSERS = ( INTERNIC => { contact_tech => 'Technical Contact.*?\n(.*?)(?=\... contact_zone => 'Zone Contact.*?\n(.*?)(?=\s*\n[... contact_billing => 'Billing Contact.*?\n(.*?)(?=\s*... contact_emails => \&example_email_parser }, { etc. ... }, ); sub example_email_parser { # Note that the default internal implemenation for # the INTERNIC parser is not a user-supplied code # block. This is just an instructive example. my @matches = $_[0] =~ /(\S+\@\S+)/sg; return @matches; } See XWhois.pm for the complete definition of %PARSERS. =item %WHOIS_PARSER %WHOIS_PARSER is a table that associates each whois server with their output format. my %WHOIS_PARSER = ( 'whois.ripe.net' => 'RPSL', 'whois.nic.mil' => 'INTERNIC', 'whois.nic.ad.jp' => 'JAPAN', 'whois.domainz.net.nz' => 'GENERIC', 'whois.nic.gov' => 'INTERNIC', 'whois.nic.ch' => 'RIPE_CH', 'whois.twnic.net' => 'TAIWAN', 'whois.internic.net' => 'INTERNIC', 'whois.nic.net.sg' => 'RIPE', 'whois.aunic.net' => 'RIPE', 'whois.cdnnet.ca' => 'CANADA', 'whois.nic.uk' => 'INTERNIC', 'whois.krnic.net' => 'KOREA', 'whois.isi.edu' => 'INTERNIC', 'whois.norid.no' => 'RPSL', ( etc.....) Please note that there is a plethora of output formats, allthough there are RFCs on this issue, like for instance RFC2622, there are numerous different formats being used! =item %DOMAIN_ASSOC %DOMAIN_ASSOC is a table that associates top level domain names with their respective whois servers. You'd need to modity this table if you wish to extend the module's functionality to handle a new set of domain names. Or alter existing information. I provides an interface to this array. See XWhois.pm for the complete definition. my %DOMAIN_ASSOC = ( 'al' => 'whois.ripe.net', 'am' => 'whois.ripe.net', 'at' => 'whois.ripe.net', 'au' => 'whois.aunic.net', 'az' => 'whois.ripe.net', 'ba' => 'whois.ripe.net', 'be' => 'whois.ripe.net', =item register_parser() Extend, modify and override entries in %PARSERS. Accepts a hash with three keys - Name, Retain and Parser. If the format definition for the specified format exists and the Retain key holds a true value, the keys from the specified Parser are added to the existing definition. A new definition is created when Retain is false/not specified. my $w = new Net::Whois; $w->register_parser ( Name => "INTERNIC", Retain => 1, Parser => { creation_time => 'created on (\S*?)\.\n', some_randome_entity => \&random_entity_subroutine }; Instructions on how to create a workable random_entity_subroutine are availabe in the I<%PARSERS> description, above. =item register_association() Override and add entries to %ASSOC. Accepts a hash that contains representation specs for a whois server. The keys of this hash are server machine names and values are list-refs to the associated response formats and the top-level domains handled by the servers. See Net/XWhois.pm for more details. my $w = new Net::XWhois; $w->register_association ( 'whois.aunic.net' => [ RIPE, [ qw/au/ ] ] ); =item register_cache() By default, Net::XWhois caches all whois responses and commits them, as separate files, to /tmp/whois. register_cache () gets and sets the cache directory. Setting to "undef" will disable caching. $w->register_cache ( "/some/place/else" ); $w->register_cache ( undef ); =back =head1 OBJECT METHODS =over 4 =item B Access to the whois response data is provided via AUTOLOADED methods specified in the Parser. The methods return scalar or list data depending on the context. Internic Parser provides the following methods: =over 8 =item B Domain name. =item B Domain Status when provided. When the domain is on hold, this method will return "On Hold" string. =item B Nameservers along with their IPs. =item B Registrant's name and address. =item B Administrative Contact. =item B Technical Contact. =item B Zone Contact. =item B Billing Contact. =item B List of email addresses of contacts. =item B List of contact handles in the response. Contact and Domain handles are valid query data that can be used instead of contact and domain names. =item B List of domain handles in the response. Can be used for sorting out reponses that contain multiple domain names. =back =item B Does a whois lookup on the specified domain. Takes the same arguments as new(). my $w = new Net::XWhois; $w->lookup ( Domain => "perl.com" ); print $w->response (); =back =head1 EXAMPLES Look at example programs that come with this package. "whois" is a replacement for the standard RIPE/InterNIC whois client. "creation" overrides the Parser value at object init and gets the Creation Time of an InterNIC domain. "creation2" does the same thing by extending the Class Parser. "contacts" queries and prints information about domain's Tech/Billing/Admin contacts. contribs/ containts parsers for serveral whois servers, which have not been patched into the module. =head1 AUTHOR Vipul Ved Prakash =head1 THANKS Curt Powell , Matt Spiers , Richard Dice , Robert Chalmers , Steinar Overbeck Cook , Steve Weathers , Robert Puettmann , Martin H . Sluka" , Rob Woodard , Jon Gilbert, Erik Aronesty for patches, bug-reports and many cogent suggestions. =head1 MAILING LIST Net::XWhois development has moved to the sourceforge mailing list, xwhois-devel@lists.sourceforge.net. Please send all Net::XWhois related communication directly to the list address. The subscription interface is at: http://lists.sourceforge.net/mailman/listinfo/xwhois-devel =head1 SEE ALSO RFC 954 RFC 2622 =head1 COPYRIGHT Copyright (c) 1998-2001 Vipul Ved Prakash. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. libnet-xwhois-perl-0.90.orig/MANIFEST0100644000000000000000000000021207323735005015764 0ustar rootrootChanges ARTISTIC MANIFEST Makefile.PL lib/Net/XWhois.pm test.pl TODO examples/creation_time examples/whois contribs/jon.p contribs/matt.p libnet-xwhois-perl-0.90.orig/Makefile.PL0100644000000000000000000000100107323735047016610 0ustar rootroot#!/usr/bin/perl -sw ## ## Makefile.PL for Net::XWhois. ## ## $Date: 2001/07/14 03:18:56 $ ## $Revision: 1.2 $ ## $State: Exp $ ## $Author: vipul $ ## ## Copyright (c) 1998, Vipul Ved Prakash. All rights reserved. ## This code is free software; you can redistribute it and/or modify ## it under the same terms as Perl itself. use ExtUtils::MakeMaker; WriteMakefile( 'VERSION_FROM' => 'lib/Net/XWhois.pm', 'NAME' => 'Net::XWhois', ); libnet-xwhois-perl-0.90.orig/TODO0100644000000000000000000000047707147623670015350 0ustar rootrooto Complete RIPE and other parser definitions. ( Sat Dec 5 05:18:01 IST 1998 ) o Optimize Regular Expressions. ( Sat Dec 12 21:42:47 IST 1998 ) o Change ASSOC Structure. Should also take regexes for figuring out the appropriate server. ( Sun Dec 13 04:47:11 IST 1998 ) libnet-xwhois-perl-0.90.orig/contribs/0040775000000000000000000000000007734114462016474 5ustar rootrootlibnet-xwhois-perl-0.90.orig/contribs/jon.p0100644000000000000000000000736407155664637017463 0ustar rootrootFrom POPmail Tue Sep 5 00:25:13 2000 Return-Path: Envelope-To: mail@vipul.net Delivery-Date: Tue, 05 Sep 2000 09:22:08 +0530 Received: from mail1.sourceforge.net ([198.186.203.35] helo=lists.sourceforge.net) by krypton.netropolis.org with esmtp (Exim 3.12 #1 (Debian)) id 13W9mK-0003Ml-00 for ; Tue, 05 Sep 2000 09:22:08 +0530 Received: from mail1.sourceforge.net (localhost [127.0.0.1]) by lists.sourceforge.net (8.9.3/8.9.3) with ESMTP id QAA11911; Mon, 4 Sep 2000 16:56:02 -0700 Received: from munitions2.xs4all.nl (root@munitions2.xs4all.nl [194.109.217.74]) by lists.sourceforge.net (8.9.3/8.9.3) with ESMTP id QAA11896 for ; Mon, 4 Sep 2000 16:55:27 -0700 Date: Tue, 5 Sep 2000 05:31:39 +0530 From: Vipul Ved Prakash To: xwhois-devel@lists.sourceforge.net Message-Id: <20000905053139.B13603@fountainhead.vipul.net> Reply-To: mail@vipul.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i X-Operating-System: Linux fountainhead.vipul.net 2.2.16 X-PGP-Fingerprint: D5F78D9FC694A45A00AE086062498922 Subject: [Xwhois-devel] [jong@larva.jong.org: Net::XWhois extension for ARIN] Sender: xwhois-devel-admin@lists.sourceforge.net Errors-To: xwhois-devel-admin@lists.sourceforge.net X-Beenthere: xwhois-devel@lists.sourceforge.net X-Mailman-Version: 2.0beta5 Precedence: bulk List-Id: Status: RO Content-Length: 2286 Lines: 73 This will go in next release as well. best, vipul. ----- Forwarded message from Jon Gilbert ----- Envelope-To: mail@vipul.net Delivery-Date: Tue, 05 Sep 2000 08:59:58 +0530 Date: Mon, 4 Sep 2000 16:33:14 -0700 To: mail@vipul.net Subject: Net::XWhois extension for ARIN User-Agent: Mutt/1.2i From: Jon Gilbert Greetings, I'm not sure if you're still supporting the Net::XWhois module for perl5, but if so, here's a %PARSER and %ASSOC addition for a whois type of ARIN. It's not the most efficent parser set (but it works and I'm not really complaining). Anyway, if you're needing more associations, here's one that I've found very useful. Thanks for the module. jong. my $w = Net::XWhois->new; $w->register_parser(Name => 'ARIN', Retain => 1, Parser => { netname => 'etname:\s*(\S+)\n+', netblock => 'etblock:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', netnumber => 'Netnumber:\s*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\n\s]*', hostname => 'Hostname:\s*(\S+)[\n\s]*', maintainer => 'Maintainer:\s*(\S+)', record_update => 'Record last updated on (\S+)\.\n+', database_update => 'Database last updated on (.+)\.[\n\s]+The', registrant => '^(.*?)\n\n', reverse_mapping => 'Domain System inverse[\s\w]+:[\n\s]+(.*?)\n\n', coordinator => 'Coordinator:[\n\s]+(.*?)\n\n', coordinator_handle =>'Coordinator:[\n\s]+[^\(\)]+\((\S+?)\)', address => 'Address:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', system => 'System:\s+([^\n]*)\n', non_portable => 'ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE', }, ); $w->register_association('arin.net' => [ ARIN, [ qw/*/]]); $w->lookup(Domain => '198.95.251.10', Format => 'ARIN', Server => 'arin.net'); ----- End forwarded message ----- -- VIPUL VED PRAKASH | Cryptography mail@vipul.net | Distributed Systems http://www.vipul.net | Network Agents 91 11 2233328 | Perl Hacking _______________________________________________ Xwhois-devel mailing list Xwhois-devel@lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/xwhois-devel libnet-xwhois-perl-0.90.orig/contribs/matt.p0100644000000000000000000001143607155664557017636 0ustar rootrootFrom POPmail Thu Aug 31 17:19:55 2000 Return-Path: Envelope-To: mail@vipul.net Delivery-Date: Fri, 01 Sep 2000 02:36:07 +0530 Received: from mail1.sourceforge.net ([198.186.203.35] helo=lists.sourceforge.net) by krypton.netropolis.org with esmtp (Exim 3.12 #1 (Debian)) id 13UbXC-00029Y-00 for ; Fri, 01 Sep 2000 02:36:06 +0530 Received: from mail1.sourceforge.net (localhost [127.0.0.1]) by lists.sourceforge.net (8.9.3/8.9.3) with ESMTP id KAA17978; Thu, 31 Aug 2000 10:09:46 -0700 Received: from core.pavilion.net (core.pavilion.net [212.74.0.24]) by lists.sourceforge.net (8.9.3/8.9.3) with ESMTP id JAA16807 for ; Thu, 31 Aug 2000 09:55:23 -0700 Received: (from matt@localhost) by core.pavilion.net (8.9.3/8.8.8) id RAA21712; Thu, 31 Aug 2000 17:55:11 +0100 (BST) (envelope-from matt) Date: Thu, 31 Aug 2000 17:55:11 +0100 From: Matt Spiers To: Robert Chalmers Cc: xwhois-devel@lists.sourceforge.net Subject: Re: [Xwhois-devel] ... RE: Registrant problem Message-Id: <20000831175511.D99042@pavilion.net> References: <20000830155354.P19357@pavilion.net> <006c01c012da$48048480$1a6001cb@chalmers.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <006c01c012da$48048480$1a6001cb@chalmers.com.au>; from robert@chalmers.com.au on Thu, Aug 31, 2000 at 09:30:28AM +1000 X-NCC-Regid: uk.pavilion Sender: xwhois-devel-admin@lists.sourceforge.net Errors-To: xwhois-devel-admin@lists.sourceforge.net X-Beenthere: xwhois-devel@lists.sourceforge.net X-Mailman-Version: 2.0beta5 Precedence: bulk List-Id: Status: RO Content-Length: 3085 Lines: 94 > > In the examples/whois example... > > if ( $opts{r} ) { my @emails = $whois->registrant; $" = ", "; print > "Registrants: @emails\n"; exit } > > > This line has the word registrants, (plural) it should be 'registrant' > singular. > > It then works fine. > > Bob In the XWhois module the RIPE parser definition has 'registrants' rather than 'registrant' as well. Below is what I've knocked up so far. I notice that at present all parser definitions in the XWhois module conform to the INTERNIC so these don't fit in with that format. All .uk domains have a tag holder, which represents who has authority to alter the record (see http://www.nic.uk/ref/tags.html). As the .uk whois do not include any contact info I guess this should be set as contact_tech. Also the list @centralnic_tlds is only a small subset of what they offer. Matt. ----------------------------------------- my @nominet_tlds = ("co.uk","org.uk","ltd.uk","plc.uk","net.uk", "sch.uk","nhs.uk","police.uk", "mod.uk") ; my @ukerna_tlds = ("ac.uk", "gov.uk"); my @centralnic_tlds = ("uk.com", "eu.com", "gb.com", "uk.net", "gb.net"); my $w = new Net::XWhois; $w->register_cache ( undef ); $w->register_association ( 'whois.nic.uk' => ["NOMINET", [ @nominet_tlds ] ], 'whois.ja.net' => ["UKERNA", [ @ukerna_tlds ] ], 'whois.centralnic.com' => ["CENTRALNIC", [ @centralnic_tlds ] ], ); $w->register_parser ( Name => "NOMINET", Parser => { name => 'omain Name:\s+(\S+)', registrant => 'egistered For:\s*(.*?)\n', ips_tag => 'omain Registered By:\s*(.*?)\n', record_updated_date => 'Record last updated on\s*(.*?)\s+', record_updated_by => 'Record last updated on\s*.*?\s+by\s+(.*?)\n', nameservers => 'listed in order:[\s\n]+(\S+)\s.*?\n\s+(\S*?)\s.*?\n\s*\n', whois_updated => 'database last updated at\s*(.*?)\n', }, ); $w->register_parser ( Name => "CENTRALNIC", Parser => { name => 'omain Name:\s+(\S+)', registrant => 'egistrant:\s*(.*?)\n', contact_admin => 'lient Contact:\s*(.*?)\n\s*\n', contact_billing => 'illing Contact:\s*(.*?)\n\s*\n', contact_tech => 'echnical Contact:\s*(.*?)\n\s*\n', record_created_date => 'ecord created on\s*(.*?)\n', record_paid_date => 'ecord paid up to\s*(.*?)\n', record_updated_date => 'ecord last updated on\s*(.*?)\n', nameservers => 'listed in order:[\s\n]+(\S+)\s.*?\n\s+(\S*?)\s.*?\n\s*\n', }, ); $w->register_parser ( Name => "UKERNA", Parser => { name => 'omain Name:\s+(\S+)', registrant => 'egistered For:\s*(.*?)\n', ips_tag => 'omain Registered By:\s*(.*?)\n', record_updated_date => 'ecord updated on\s*(.*?)\s+', record_updated_by => 'ecord updated on\s*.*?\s+by\s+(.*?)\n', nameservers => 'elegated Name Servers:[\s\n]+(\S+)[\s\n]+(\S+).*?\n\s*\n', domain_contact => 'Domain contact:\s*(.*?)\n', } ); _______________________________________________ Xwhois-devel mailing list Xwhois-devel@lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/xwhois-devel libnet-xwhois-perl-0.90.orig/ARTISTIC0100644000000000000000000001146706632072401016012 0ustar rootroot The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End libnet-xwhois-perl-0.90.orig/test.pl0100644000000000000000000000122006632033721016145 0ustar rootroot# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..1\n"; } END {print "not ok 1\n" unless $loaded;} use Net::XWhois; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code):