summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2013-03-05 16:09:10 +0000
committersthen <sthen@openbsd.org>2013-03-05 16:09:10 +0000
commit52d4b2ee660a0de33b7d1c20e0de628b8ca938e6 (patch)
tree91fa3dda7bcf5e595e1d65d07cc6218e98301e42
parentcomment out example code. (diff)
downloadwireguard-openbsd-52d4b2ee660a0de33b7d1c20e0de628b8ca938e6.tar.xz
wireguard-openbsd-52d4b2ee660a0de33b7d1c20e0de628b8ca938e6.zip
let whois -P do a query against peeringdb. ok deraadt phessler, feedback jmc
-rw-r--r--usr.bin/whois/whois.110
-rw-r--r--usr.bin/whois/whois.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.bin/whois/whois.1 b/usr.bin/whois/whois.1
index b470b2cb70d..4ecd0b4c8cc 100644
--- a/usr.bin/whois/whois.1
+++ b/usr.bin/whois/whois.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: whois.1,v 1.31 2012/09/26 16:12:14 jmc Exp $
+.\" $OpenBSD: whois.1,v 1.32 2013/03/05 16:09:10 sthen Exp $
.\" $NetBSD: whois.1,v 1.5 1995/08/31 21:51:32 jtc Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)whois.1 8.2 (Berkeley) 6/20/94
.\"
-.Dd $Mdocdate: September 26 2012 $
+.Dd $Mdocdate: March 5 2013 $
.Dt WHOIS 1
.Os
.Sh NAME
@@ -38,7 +38,7 @@
.Nd Internet domain name and network number directory service
.Sh SYNOPSIS
.Nm whois
-.Op Fl AadgilmQRr
+.Op Fl AadgilmPQRr
.Oo
.Fl c Ar country-code | Fl h Ar host
.Oc
@@ -165,6 +165,10 @@ Use the Route Arbiter Database
database.
It contains route policy specifications for a large
number of operators' networks.
+.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 p Ar port
Connect to the whois server on
.Ar port .
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 12f588c403d..080d1ccf1b1 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whois.c,v 1.43 2010/03/04 21:37:56 jmc Exp $ */
+/* $OpenBSD: whois.c,v 1.44 2013/03/05 16:09:10 sthen Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -57,6 +57,7 @@
#define LNICHOST "whois.lacnic.net"
#define AFNICHOST "whois.afrinic.net"
#define BNICHOST "whois.registro.br"
+#define PDBHOST "whois.peeringdb.com"
#define QNICHOST_TAIL ".whois-servers.net"
#define WHOIS_PORT "whois"
@@ -81,7 +82,7 @@ main(int argc, char *argv[])
country = host = NULL;
flags = rval = 0;
- while ((ch = getopt(argc, argv, "aAc:dgh:ilmp:qQrR")) != -1)
+ while ((ch = getopt(argc, argv, "aAc:dgh:ilmp:PqQrR")) != -1)
switch (ch) {
case 'a':
host = ANICHOST;
@@ -113,6 +114,9 @@ main(int argc, char *argv[])
case 'p':
port_whois = optarg;
break;
+ case 'P':
+ host = PDBHOST;
+ break;
case 'q':
/* deprecated, now the default */
break;
@@ -306,7 +310,7 @@ usage(void)
extern char *__progname;
fprintf(stderr,
- "usage: %s [-AadgilmQRr] [-c country-code | -h host] "
+ "usage: %s [-AadgilmPQRr] [-c country-code | -h host] "
"[-p port] name ...\n", __progname);
exit(1);
}