version 1.37, 2006/06/01 18:17:35 |
version 1.38, 2006/09/17 17:07:16 |
|
|
* If no country is specified determine the top level domain from the query. |
* If no country is specified determine the top level domain from the query. |
* 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]+). |
* (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an |
* Fall back to NICHOST for the non-handle case. |
* ASN (starts with AS). Fall back to NICHOST for the non-handle case. |
*/ |
*/ |
char * |
char * |
choose_server(const char *name, const char *country) |
choose_server(const char *name, const char *country) |
|
|
strncasecmp(name, "COHO-", 5) == 0) && |
strncasecmp(name, "COHO-", 5) == 0) && |
strtol(name + 5, &ep, 10) > 0 && *ep == '\0') |
strtol(name + 5, &ep, 10) > 0 && *ep == '\0') |
return (CNICHOST); |
return (CNICHOST); |
|
else if ((strncasecmp(name, "AS", 2) == 0) && |
|
strtol(name + 2, &ep, 10) > 0 && *ep == '\0') |
|
return (MNICHOST); |
else |
else |
return (NICHOST); |
return (NICHOST); |
} else if (isdigit(*(++qhead))) |
} else if (isdigit(*(++qhead))) |