mirror of
https://github.com/rfc1036/whois.git
synced 2026-05-03 06:51:09 +00:00
Split nic_handles_list off tld_serv_list
To be able to use in_domain() for tld_serv_list
This commit is contained in:
parent
842e142f1a
commit
29b1a3a9c3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
*_del.h
|
*_del.h
|
||||||
new_gtlds.h
|
new_gtlds.h
|
||||||
|
nic_handles.h
|
||||||
tld_serv.h
|
tld_serv.h
|
||||||
servers_charset.h
|
servers_charset.h
|
||||||
version.h
|
version.h
|
||||||
|
|||||||
3
Makefile
3
Makefile
@ -87,6 +87,9 @@ ip6_del.h: ip6_del_list make_ip6_del.pl
|
|||||||
new_gtlds.h: new_gtlds_list make_new_gtlds.pl
|
new_gtlds.h: new_gtlds_list make_new_gtlds.pl
|
||||||
$(PERL) make_new_gtlds.pl < $< > $@
|
$(PERL) make_new_gtlds.pl < $< > $@
|
||||||
|
|
||||||
|
nic_handles.h: nic_handles_list make_nic_handles.pl
|
||||||
|
$(PERL) make_nic_handles.pl < $< > $@
|
||||||
|
|
||||||
tld_serv.h: tld_serv_list make_tld_serv.pl
|
tld_serv.h: tld_serv_list make_tld_serv.pl
|
||||||
$(PERL) make_tld_serv.pl < $< > $@
|
$(PERL) make_tld_serv.pl < $< > $@
|
||||||
|
|
||||||
|
|||||||
5
data.h
5
data.h
@ -159,6 +159,11 @@ const char *tld_serv[] = {
|
|||||||
NULL, NULL
|
NULL, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *nic_handles_post[] = {
|
||||||
|
#include "nic_handles.h"
|
||||||
|
NULL, NULL
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef HAVE_ICONV
|
#ifdef HAVE_ICONV
|
||||||
struct server_charset {
|
struct server_charset {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|||||||
17
make_nic_handles.pl
Executable file
17
make_nic_handles.pl
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
while (<>) {
|
||||||
|
chomp;
|
||||||
|
s/#.*$//;
|
||||||
|
s/^\s+//; s/\s+$//;
|
||||||
|
next if /^$/;
|
||||||
|
|
||||||
|
die "format error: $_" if not
|
||||||
|
(my ($a, $b) = /^(-\w+)\s+([\w\d\.:-]+)$/);
|
||||||
|
|
||||||
|
print qq| "$a",\t"$b",\n|;
|
||||||
|
}
|
||||||
|
|
||||||
22
nic_handles_list
Normal file
22
nic_handles_list
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
-arin whois.arin.net
|
||||||
|
-ripe whois.ripe.net
|
||||||
|
-mnt whois.ripe.net
|
||||||
|
-lacnic whois.lacnic.net
|
||||||
|
-afrinic whois.afrinic.net
|
||||||
|
-ap whois.apnic.net
|
||||||
|
-cznic whois.nic.cz
|
||||||
|
-dk whois.dk-hostmaster.dk
|
||||||
|
-il whois.isoc.org.il
|
||||||
|
-is whois.isnic.is
|
||||||
|
-kg whois.domain.kg
|
||||||
|
-coop whois.nic.coop
|
||||||
|
-frnic whois.nic.fr
|
||||||
|
-lrms whois.afilias.info
|
||||||
|
-metu whois.nic.tr
|
||||||
|
-nicat whois.nic.at
|
||||||
|
-nicci whois.nic.ci
|
||||||
|
-irnic whois.nic.ir
|
||||||
|
-norid whois.norid.no
|
||||||
|
-tel whois.nic.tel
|
||||||
|
-adnic whois.nic.org.uy
|
||||||
|
-sixxs whois.sixxs.net
|
||||||
@ -385,38 +385,3 @@
|
|||||||
.xn--xkc2dl3a5ee0h whois.inregistry.net # India, Tamil AW
|
.xn--xkc2dl3a5ee0h whois.inregistry.net # India, Tamil AW
|
||||||
.xn--yfro4i67o whois.sgnic.sg # Singapore, Chinese
|
.xn--yfro4i67o whois.sgnic.sg # Singapore, Chinese
|
||||||
.xn--ygbi2ammx whois.pnina.ps # Palestinian Territory
|
.xn--ygbi2ammx whois.pnina.ps # Palestinian Territory
|
||||||
|
|
||||||
-dom whois.networksolutions.com
|
|
||||||
-org whois.networksolutions.com
|
|
||||||
-hst whois.networksolutions.com
|
|
||||||
-arin whois.arin.net
|
|
||||||
-ripe whois.ripe.net
|
|
||||||
-mnt whois.ripe.net
|
|
||||||
-lacnic whois.lacnic.net
|
|
||||||
-afrinic whois.afrinic.net
|
|
||||||
-ap whois.apnic.net
|
|
||||||
-cn whois.cnnic.cn
|
|
||||||
-cz whois.nic.cz
|
|
||||||
-dk whois.dk-hostmaster.dk
|
|
||||||
-il whois.isoc.org.il
|
|
||||||
-is whois.isnic.is
|
|
||||||
-kg whois.domain.kg
|
|
||||||
-ti whois.telstra.net
|
|
||||||
-tw whois.twnic.net.tw
|
|
||||||
-coop whois.nic.coop
|
|
||||||
-frnic whois.nic.fr
|
|
||||||
-gandi whois.gandi.net
|
|
||||||
-kenic whois.kenic.or.ke
|
|
||||||
-lrms whois.afilias.info
|
|
||||||
-metu whois.nic.tr
|
|
||||||
-nicat whois.nic.at
|
|
||||||
-nicci whois.nic.ci
|
|
||||||
-nicir whois.nic.ir
|
|
||||||
-norid whois.norid.no
|
|
||||||
-rotld whois.rotld.ro
|
|
||||||
-sgnic whois.sgnic.sg
|
|
||||||
-tel whois.nic.tel
|
|
||||||
-uanic whois.ua
|
|
||||||
-cunic whois.cunic.ua
|
|
||||||
-uynic whois.nic.org.uy
|
|
||||||
-sixxs whois.sixxs.net
|
|
||||||
|
|||||||
6
whois.c
6
whois.c
@ -541,6 +541,12 @@ char *guess_server(const char *s)
|
|||||||
for (i = 0; nic_handles[i]; i += 2)
|
for (i = 0; nic_handles[i]; i += 2)
|
||||||
if (strncaseeq(s, nic_handles[i], strlen(nic_handles[i])))
|
if (strncaseeq(s, nic_handles[i], strlen(nic_handles[i])))
|
||||||
return strdup(nic_handles[i + 1]);
|
return strdup(nic_handles[i + 1]);
|
||||||
|
|
||||||
|
/* search for strings at the end of the word */
|
||||||
|
for (i = 0; nic_handles_post[i]; i += 2)
|
||||||
|
if (domcmp(s, nic_handles_post[i]))
|
||||||
|
return strdup(nic_handles_post[i + 1]);
|
||||||
|
|
||||||
/* it's probably a network name */
|
/* it's probably a network name */
|
||||||
return strdup("");
|
return strdup("");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user