From owner-freebsd-bugs Thu Oct 24 19:20: 6 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4972F37B401 for ; Thu, 24 Oct 2002 19:20:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7545643E91 for ; Thu, 24 Oct 2002 19:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9P2K1x3017429 for ; Thu, 24 Oct 2002 19:20:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9P2K1Xn017428; Thu, 24 Oct 2002 19:20:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97E0E37B401 for ; Thu, 24 Oct 2002 19:16:54 -0700 (PDT) Received: from bunrab.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3F4F43E75 for ; Thu, 24 Oct 2002 19:16:53 -0700 (PDT) (envelope-from david@catwhisker.org) Received: from bunrab.catwhisker.org (localhost [127.0.0.1]) by bunrab.catwhisker.org (8.12.6/8.12.6) with ESMTP id g9P2GrZ9015568 for ; Thu, 24 Oct 2002 19:16:53 -0700 (PDT) (envelope-from david@bunrab.catwhisker.org) Received: (from david@localhost) by bunrab.catwhisker.org (8.12.6/8.12.6/Submit) id g9P2Grxb015567; Thu, 24 Oct 2002 19:16:53 -0700 (PDT) Message-Id: <200210250216.g9P2Grxb015567@bunrab.catwhisker.org> Date: Thu, 24 Oct 2002 19:16:53 -0700 (PDT) From: David Wolfskill Reply-To: David Wolfskill To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/44448: Add support for whois to automagically query whois.lacnic.net Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44448 >Category: bin >Synopsis: Add support for whois to automagically query whois.lacnic.net >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Oct 24 19:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: David Wolfskill >Release: FreeBSD 4.7-STABLE i386 >Organization: Wolfskill & Dowling residence >Environment: System: FreeBSD bunrab.catwhisker.org 4.7-STABLE FreeBSD 4.7-STABLE #26: Sun Oct 20 07:49:39 PDT 2002 root@freebeast.catwhisker.org:/common/S1/obj/usr/src/sys/BUNRAB i386 Since the -STABLE and -CURRENT sources for whois are presently in sync, this ought to be OK on -CURRENT, too. (And I just tested same on: freebeast(5.0-C)[22] uname -a FreeBSD freebeast.catwhisker.org 5.0-CURRENT FreeBSD 5.0-CURRENT #33: Thu Oct 24 07:17:02 PDT 2002 root@freebeast.catwhisker.org:/common/S4/obj/usr/src/sys/FREEBEAST i386 freebeast(5.0-C)[23] . Yes, it worked as described.) >Description: Just as one actually queries whois.ripe.net to determine delegation of European netblocks, there is now a Latin American WHOIS server, whois.lacnic.net. The supplied patch adds support to query whois.lacnic.net, both automagically, and via (explicit) -l flag. >How-To-Repeat: whois 200.34.123.2 # as a quasi-random IP address that I # figured would be under LACNIC's ovesight. Note that what you see is a referral to LACNIC. Then apply the below patches; re-make whois, and try again. This time, you see that the 200.34.112/20 CIDR block has been reassigned to CITI, of Monterrey, Nuevo Leon, Mexico. I took a stab at updating the man page, too. >Fix: Index: whois.1 =================================================================== RCS file: /cvs/freebsd/src/usr.bin/whois/whois.1,v retrieving revision 1.27 diff -u -r1.27 whois.1 --- whois.1 20 Apr 2002 12:18:02 -0000 1.27 +++ whois.1 25 Oct 2002 02:02:10 -0000 @@ -108,7 +108,8 @@ If a query to .Tn ARIN references -.Tn APNIC +.Tn APNIC , +.Tn LACNIC , or .Tn RIPE , that server will be queried also, provided that the @@ -149,6 +150,12 @@ .Tn NIC handle in the query.) .Pp +.It Fl l +Use the Latin American and Caribbean IP address Regional Registry +.Pq Tn LACNIC +database. +It contains network numbers used in much of Latin America and the +Caribbean. .It Fl m Use the Route Arbiter Database .Pq Tn RADB Index: whois.c =================================================================== RCS file: /cvs/freebsd/src/usr.bin/whois/whois.c,v retrieving revision 1.31 diff -u -r1.31 whois.c --- whois.c 18 Sep 2002 07:51:46 -0000 1.31 +++ whois.c 25 Oct 2002 02:13:33 -0000 @@ -65,6 +65,7 @@ #define DNICHOST "whois.nic.mil" #define GNICHOST "whois.nic.gov" #define ANICHOST "whois.arin.net" +#define LNICHOST "whois.lacnic.net" #define RNICHOST "whois.ripe.net" #define PNICHOST "whois.apnic.net" #define MNICHOST "whois.ra.net" @@ -79,7 +80,7 @@ #define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-') -const char *ip_whois[] = { RNICHOST, PNICHOST, BNICHOST, NULL }; +const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, NULL }; const char *port = DEFAULT_PORT; static char *choose_server(char *); @@ -101,7 +102,7 @@ country = host = qnichost = NULL; flags = use_qnichost = 0; - while ((ch = getopt(argc, argv, "aAc:dgh:imp:QrR6")) != -1) { + while ((ch = getopt(argc, argv, "aAc:dgh:ilmp:QrR6")) != -1) { switch (ch) { case 'a': host = ANICHOST; @@ -123,6 +124,9 @@ break; case 'i': host = INICHOST; + break; + case 'l': + host = LNICHOST; break; case 'm': host = MNICHOST; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message