[BACK]Return to whois.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / whois

Diff for /src/usr.bin/whois/whois.c between version 1.61 and 1.62

version 1.61, 2024/03/16 06:29:36 version 1.62, 2024/03/24 19:51:47
Line 46 
Line 46 
   
 #define NICHOST         "whois.crsnic.net"  #define NICHOST         "whois.crsnic.net"
 #define INICHOST        "whois.internic.net"  #define INICHOST        "whois.internic.net"
 #define CNICHOST        "whois.corenic.net"  
 #define DNICHOST        "whois.nic.mil"  #define DNICHOST        "whois.nic.mil"
 #define GNICHOST        "whois.nic.gov"  #define GNICHOST        "whois.nic.gov"
 #define ANICHOST        "whois.arin.net"  #define ANICHOST        "whois.arin.net"
Line 297 
Line 296 
 /*  /*
  * 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 ASN (starts
  * (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an   * with AS) or IPv6 address (contains ':').
  * ASN (starts with AS) or IPv6 address (contains ':'). Fall back to   * Fall back to NICHOST for the non-handle and non-IPv6 case.
  * 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)
Line 318 
Line 316 
         if (country != NULL)          if (country != NULL)
                 qhead = country;                  qhead = country;
         else if ((qhead = strrchr(name, '.')) == NULL) {          else if ((qhead = strrchr(name, '.')) == NULL) {
                 if (*name == '!')                  if ((strncasecmp(name, "AS", 2) == 0) &&
                         return (INICHOST);  
                 else if ((strncasecmp(name, "COCO-", 5) == 0 ||  
                     strncasecmp(name, "COHO-", 5) == 0) &&  
                     strtol(name + 5, &ep, 10) > 0 && *ep == '\0')  
                         return (CNICHOST);  
                 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 */                  else if (strchr(name, ':') != NULL) /* IPv6 address */

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62