version 1.56, 2017/07/26 15:48:38 |
version 1.57, 2018/06/17 15:34:54 |
|
|
* If the TLD is a number, query ARIN, otherwise, use TLD.whois-server.net. |
* If the TLD is a number, query ARIN, otherwise, use TLD.whois-server.net. |
* If the domain does not contain '.', check to see if it is an NSI handle |
* If the domain does not contain '.', check to see if it is an NSI handle |
* (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an |
* (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an |
* ASN (starts with AS). Fall back to NICHOST for the non-handle case. |
* ASN (starts with AS) or IPv6 address (contains ':'). Fall back to |
|
* NICHOST for the non-handle and non-IPv6 case. |
*/ |
*/ |
char * |
char * |
choose_server(const char *name, const char *country, char **tofree) |
choose_server(const char *name, const char *country, char **tofree) |
|
|
else if ((strncasecmp(name, "AS", 2) == 0) && |
else if ((strncasecmp(name, "AS", 2) == 0) && |
strtol(name + 2, &ep, 10) > 0 && *ep == '\0') |
strtol(name + 2, &ep, 10) > 0 && *ep == '\0') |
return (MNICHOST); |
return (MNICHOST); |
|
else if (strchr(name, ':') != NULL) /* IPv6 address */ |
|
return (ANICHOST); |
else |
else |
return (NICHOST); |
return (NICHOST); |
} else if (isdigit((unsigned char)*(++qhead))) |
} else if (isdigit((unsigned char)*(++qhead))) |