Remove support for the as32 dot notation

It has been deprecated long ago and is not used anymore.
This commit is contained in:
Marco d'Itri 2023-10-06 19:27:38 +02:00
parent 27549ba6cb
commit 96173f3630
2 changed files with 1 additions and 20 deletions

20
whois.c
View File

@ -499,7 +499,7 @@ const char *match_config_file(const char *s)
*/
char *guess_server(const char *s)
{
unsigned long ip, as32;
unsigned long ip;
unsigned int i;
const char *colon, *tld;
@ -557,10 +557,6 @@ char *guess_server(const char *s)
return strdup("\x05"); /* probably a unknown kind of nic handle */
}
/* ASN32? */
if (strncaseeq(s, "as", 2) && s[2] && (as32 = asn32_to_long(s + 2)) != 0)
return strdup(whereas32(as32));
/* smells like an IP? */
if ((ip = myinet_aton(s))) {
for (i = 0; ip_assign[i].serv; i++)
@ -1476,20 +1472,6 @@ unsigned long myinet_aton(const char *s)
return (a << 24) + (b << 16) + (c << 8) + d;
}
unsigned long asn32_to_long(const char *s)
{
unsigned long a, b;
char junk;
if (!s)
return 0;
if (sscanf(s, "%lu.%lu%c", &a, &b, &junk) != 2)
return 0;
if (a > 65535 || b > 65535)
return 0;
return (a << 16) + b;
}
int isasciidigit(const char c)
{
return (c >= '0' && c <= '9') ? 1 : 0;

View File

@ -26,7 +26,6 @@ void NORETURN alarm_handler(int);
void NORETURN sighandler(int);
int japanese_locale(void);
unsigned long myinet_aton(const char *);
unsigned long asn32_to_long(const char *);
int isasciidigit(const char);
int endstrcaseeq(const char *, const char *);
int in_domain(const char *, const char *);