From david@catwhisker.org  Thu Oct 24 19:16:54 2002
Return-Path: <david@catwhisker.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 97E0E37B401
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <david@catwhisker.org>
Reply-To: David Wolfskill <david@catwhisker.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Add support for whois to automagically query whois.lacnic.net
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         44448
>Category:       bin
>Synopsis:       Add support for whois to automagically query whois.lacnic.net
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mike
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 24 19:20:01 PDT 2002
>Closed-Date:    Sun Nov 17 07:10:19 PST 2002
>Last-Modified:  Sun Nov 17 07:10:19 PST 2002
>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:
Responsible-Changed-From-To: freebsd-bugs->mike 
Responsible-Changed-By: mike 
Responsible-Changed-When: Sun Nov 10 07:52:02 PST 2002 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44448 
State-Changed-From-To: open->patched 
State-Changed-By: mike 
State-Changed-When: Sun Nov 10 09:02:50 PST 2002 
State-Changed-Why:  
Committed to -current; MFC in one week.  The only change I made in the 
committed version is the addition of -l to usage() and synopsis in the 
manual. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44448 
State-Changed-From-To: patched->closed 
State-Changed-By: mike 
State-Changed-When: Sun Nov 17 07:09:13 PST 2002 
State-Changed-Why:  

MFC completed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44448 
>Unformatted:
