From owner-svn-src-head@FreeBSD.ORG Thu May 14 11:37:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1D6D214; Thu, 14 May 2015 11:37:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97357177F; Thu, 14 May 2015 11:37:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4EBbb4o070939; Thu, 14 May 2015 11:37:37 GMT (envelope-from fanf@FreeBSD.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4EBbbvl070937; Thu, 14 May 2015 11:37:37 GMT (envelope-from fanf@FreeBSD.org) Message-Id: <201505141137.t4EBbbvl070937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: fanf set sender to fanf@FreeBSD.org using -f From: Tony Finch Date: Thu, 14 May 2015 11:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282893 - head/usr.bin/whois X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 11:37:37 -0000 Author: fanf Date: Thu May 14 11:37:36 2015 New Revision: 282893 URL: https://svnweb.freebsd.org/changeset/base/282893 Log: whois: add an option to query the PeeringDB Modified: head/usr.bin/whois/whois.1 head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Thu May 14 11:33:31 2015 (r282892) +++ head/usr.bin/whois/whois.1 Thu May 14 11:37:36 2015 (r282893) @@ -159,6 +159,10 @@ Connect to the whois server on If this option is not specified, .Nm defaults to port 43. +.It Fl P +Use the PeeringDB database of AS numbers. +It contains details about presence at internet peering points +for many network operators. .It Fl Q Do a quick lookup. This means that Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Thu May 14 11:33:31 2015 (r282892) +++ head/usr.bin/whois/whois.c Thu May 14 11:37:36 2015 (r282893) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define LNICHOST "whois.lacnic.net" #define MNICHOST "whois.ra.net" #define NICHOST "whois.crsnic.net" +#define PDBHOST "whois.peeringdb.com" #define PNICHOST "whois.apnic.net" #define QNICHOST_HEAD "whois.nic." #define QNICHOST_TAIL ".whois-servers.net" @@ -122,7 +123,7 @@ main(int argc, char *argv[]) country = host = qnichost = NULL; flags = use_qnichost = 0; - while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:Qr")) != -1) { + while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:PQr")) != -1) { switch (ch) { case 'a': host = ANICHOST; @@ -163,6 +164,9 @@ main(int argc, char *argv[]) case 'p': port = optarg; break; + case 'P': + host = PDBHOST; + break; case 'Q': flags |= WHOIS_QUICK; break; @@ -511,7 +515,7 @@ static void usage(void) { fprintf(stderr, - "usage: whois [-aAbfgiIklmQr] [-c country-code | -h hostname] " + "usage: whois [-aAbfgiIklmPQr] [-c country-code | -h hostname] " "[-p port] name ...\n"); exit(EX_USAGE); }