Re: whois: add -P for peeringdb

2013-03-05 Thread Claudio Jeker
On Tue, Mar 05, 2013 at 01:58:25PM +, Stuart Henderson wrote:
> OK?
> 
OK claudio@

> 
> Index: whois.1
> ===
> RCS file: /cvs/src/usr.bin/whois/whois.1,v
> retrieving revision 1.31
> diff -u -p -r1.31 whois.1
> --- whois.1   26 Sep 2012 16:12:14 -  1.31
> +++ whois.1   5 Mar 2013 13:56:54 -
> @@ -175,6 +175,10 @@ defaults to the
>  port listed in
>  .Pa /etc/services
>  (port 43).
> +.It Fl P
> +Use the PeeringDB database.
> +It contains details about presence at internet peering points
> +for many network operators.
>  .It Fl Q
>  Do a quick lookup.
>  This means that
> Index: whois.c
> ===
> RCS file: /cvs/src/usr.bin/whois/whois.c,v
> retrieving revision 1.43
> diff -u -p -r1.43 whois.c
> --- whois.c   4 Mar 2010 21:37:56 -   1.43
> +++ whois.c   5 Mar 2013 13:56:54 -
> @@ -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;
> @@ -112,6 +113,9 @@ main(int argc, char *argv[])
>   break;
>   case 'p':
>   port_whois = optarg;
> + break;
> + case 'P':
> + host = PDBHOST;
>   break;
>   case 'q':
>   /* deprecated, now the default */
> 

-- 
:wq Claudio



Re: whois: add -P for peeringdb

2013-03-05 Thread Stuart Henderson
On 2013/03/05 19:04, Alexander Hall wrote:
> On 03/05/13 18:58, Stuart Henderson wrote:
> >On 2013/03/05 18:31, Alexander Hall wrote:
> >>Not that I mind either way, but did we want to add more "hardcoded"
> >>flags to whois?
> >
> >Did you any some others in mind? Most of the domain-lookup ones are handled
> >by XX.whois-servers.net, of the others I know of Team Cymru's servers may be
> >useful but I don't think they're as widely used as peeringdb, probably not
> >common enough to be worth adding a flag for.
> 
> Oh, well, no. My point was rather the opposite.
> 
> Adding a hardcoded switch for a new server every now and then seems
> like a good waste of switchable characters. But I'm quite a limited
> user of whois, so maybe it makes sense.
> 

Ah I see :-) peeringdb is quite widely used amongst bgp network operators
so this is quite a useful one to have.



Re: whois: add -P for peeringdb

2013-03-05 Thread Theo de Raadt
> On 03/05/13 18:58, Stuart Henderson wrote:
> > On 2013/03/05 18:31, Alexander Hall wrote:
> >> Not that I mind either way, but did we want to add more "hardcoded"
> >> flags to whois?
> >
> > Did you any some others in mind? Most of the domain-lookup ones are handled
> > by XX.whois-servers.net, of the others I know of Team Cymru's servers may be
> > useful but I don't think they're as widely used as peeringdb, probably not
> > common enough to be worth adding a flag for.
> 
> Oh, well, no. My point was rather the opposite.
> 
> Adding a hardcoded switch for a new server every now and then seems like 
> a good waste of switchable characters. But I'm quite a limited user of 
> whois, so maybe it makes sense.

Adding a new option to whois hurts noone.  This is not a standardized
portable interface.  Adding them here does not hurt you like it would
for cp, ls, ksh, traceroute, ping, route, bgpd [trying to get you to guess
whereabouts whois fits on that line].



Re: whois: add -P for peeringdb

2013-03-05 Thread Theo de Raadt
> On 2013/03/05 18:31, Alexander Hall wrote:
> > Not that I mind either way, but did we want to add more "hardcoded"
> > flags to whois?
> 
> Did you any some others in mind? Most of the domain-lookup ones are handled
> by XX.whois-servers.net, of the others I know of Team Cymru's servers may be
> useful but I don't think they're as widely used as peeringdb, probably not
> common enough to be worth adding a flag for.

Unfortunately I have to agree with Stuart here.

Around 1998 there was a bit of an attempt to connect these databases
together in whois in an automatic fashion, but that has been falling apart
ever since.



Re: whois: add -P for peeringdb

2013-03-05 Thread Alexander Hall

On 03/05/13 18:58, Stuart Henderson wrote:

On 2013/03/05 18:31, Alexander Hall wrote:

Not that I mind either way, but did we want to add more "hardcoded"
flags to whois?


Did you any some others in mind? Most of the domain-lookup ones are handled
by XX.whois-servers.net, of the others I know of Team Cymru's servers may be
useful but I don't think they're as widely used as peeringdb, probably not
common enough to be worth adding a flag for.


Oh, well, no. My point was rather the opposite.

Adding a hardcoded switch for a new server every now and then seems like 
a good waste of switchable characters. But I'm quite a limited user of 
whois, so maybe it makes sense.




Re: whois: add -P for peeringdb

2013-03-05 Thread Stuart Henderson
On 2013/03/05 18:31, Alexander Hall wrote:
> Not that I mind either way, but did we want to add more "hardcoded"
> flags to whois?

Did you any some others in mind? Most of the domain-lookup ones are handled
by XX.whois-servers.net, of the others I know of Team Cymru's servers may be
useful but I don't think they're as widely used as peeringdb, probably not
common enough to be worth adding a flag for.



Re: whois: add -P for peeringdb

2013-03-05 Thread Alexander Hall
Not that I mind either way, but did we want to add more "hardcoded" 
flags to whois?


On 03/05/13 14:58, Stuart Henderson wrote:

OK?


Index: whois.1
===
RCS file: /cvs/src/usr.bin/whois/whois.1,v
retrieving revision 1.31
diff -u -p -r1.31 whois.1
--- whois.1 26 Sep 2012 16:12:14 -  1.31
+++ whois.1 5 Mar 2013 13:56:54 -
@@ -175,6 +175,10 @@ defaults to the
  port listed in
  .Pa /etc/services
  (port 43).
+.It Fl P
+Use the PeeringDB database.
+It contains details about presence at internet peering points
+for many network operators.
  .It Fl Q
  Do a quick lookup.
  This means that
Index: whois.c
===
RCS file: /cvs/src/usr.bin/whois/whois.c,v
retrieving revision 1.43
diff -u -p -r1.43 whois.c
--- whois.c 4 Mar 2010 21:37:56 -   1.43
+++ whois.c 5 Mar 2013 13:56:54 -
@@ -57,6 +57,7 @@
  #define LNICHOST  "whois.lacnic.net"
  #define   AFNICHOST   "whois.afrinic.net"
  #define BNICHOST  "whois.registro.br"
+#definePDBHOST "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;
@@ -112,6 +113,9 @@ main(int argc, char *argv[])
break;
case 'p':
port_whois = optarg;
+   break;
+   case 'P':
+   host = PDBHOST;
break;
case 'q':
/* deprecated, now the default */





Re: whois: add -P for peeringdb

2013-03-05 Thread Jérémie Courrèges-Anglas

Nice, that would be one alias less in my .kshrc. :)

-- 
Jérémie Courrèges-Anglas
GPG Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494



Re: whois: add -P for peeringdb

2013-03-05 Thread Stuart Henderson
On 2013/03/05 13:58, Stuart Henderson wrote:
> OK?

Tweak after a comment from phessler, to make it more clear what you can lookup:
change "Use the PeeringDB database" to "Use the PeeringDB database of AS 
numbers"

Index: whois.1
===
RCS file: /cvs/src/usr.bin/whois/whois.1,v
retrieving revision 1.31
diff -u -p -r1.31 whois.1
--- whois.1 26 Sep 2012 16:12:14 -  1.31
+++ whois.1 5 Mar 2013 14:11:53 -
@@ -175,6 +175,10 @@ defaults to the
 port listed in
 .Pa /etc/services
 (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
Index: whois.c
===
RCS file: /cvs/src/usr.bin/whois/whois.c,v
retrieving revision 1.43
diff -u -p -r1.43 whois.c
--- whois.c 4 Mar 2010 21:37:56 -   1.43
+++ whois.c 5 Mar 2013 14:11:53 -
@@ -57,6 +57,7 @@
 #define LNICHOST   "whois.lacnic.net"
 #defineAFNICHOST   "whois.afrinic.net"
 #define BNICHOST   "whois.registro.br"
+#definePDBHOST "whois.peeringdb.com"
 #defineQNICHOST_TAIL   ".whois-servers.net"
 
 #defineWHOIS_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;
@@ -112,6 +113,9 @@ main(int argc, char *argv[])
break;
case 'p':
port_whois = optarg;
+   break;
+   case 'P':
+   host = PDBHOST;
break;
case 'q':
/* deprecated, now the default */



whois: add -P for peeringdb

2013-03-05 Thread Stuart Henderson
OK?


Index: whois.1
===
RCS file: /cvs/src/usr.bin/whois/whois.1,v
retrieving revision 1.31
diff -u -p -r1.31 whois.1
--- whois.1 26 Sep 2012 16:12:14 -  1.31
+++ whois.1 5 Mar 2013 13:56:54 -
@@ -175,6 +175,10 @@ defaults to the
 port listed in
 .Pa /etc/services
 (port 43).
+.It Fl P
+Use the PeeringDB database.
+It contains details about presence at internet peering points
+for many network operators.
 .It Fl Q
 Do a quick lookup.
 This means that
Index: whois.c
===
RCS file: /cvs/src/usr.bin/whois/whois.c,v
retrieving revision 1.43
diff -u -p -r1.43 whois.c
--- whois.c 4 Mar 2010 21:37:56 -   1.43
+++ whois.c 5 Mar 2013 13:56:54 -
@@ -57,6 +57,7 @@
 #define LNICHOST   "whois.lacnic.net"
 #defineAFNICHOST   "whois.afrinic.net"
 #define BNICHOST   "whois.registro.br"
+#definePDBHOST "whois.peeringdb.com"
 #defineQNICHOST_TAIL   ".whois-servers.net"
 
 #defineWHOIS_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;
@@ -112,6 +113,9 @@ main(int argc, char *argv[])
break;
case 'p':
port_whois = optarg;
+   break;
+   case 'P':
+   host = PDBHOST;
break;
case 'q':
/* deprecated, now the default */