.B \-\-aslookup\c
]
[\c
+.BI \-\-ipinfo_provider4 \ DOMAIN\c
+]
+[\c
+.BI \-\-ipinfo_provider6 \ DOMAIN\c
+]
+[\c
.BI \-i \ INTERVAL\c
]
[\c
7. AS1850 www.isnic.is
.fi
.TP
+.B \-\-ipinfo_provider4 \fIDOMAIN
+Provider for IPv4 AS lookups. Defaults to origin.asn.cymru.com.
+.fi
+.TP
+.B \-\-ipinfo_provider6 \fIDOMAIN
+Provider for IPv6 AS lookups. Defaults to origin6.asn.cymru.com.
+.fi
+.TP
.B \-i \fISECONDS\fR, \fB\-\-interval \fISECONDS
Use this option to specify the positive number of seconds between ICMP
ECHO requests. The default value for this parameter is one second. The
static char fmtinfo[32];
/* items width: ASN, Route, Country, Registry, Allocated */
-static const int iiwidth[] = { 7, 19, 4, 8, 11 }; /* item len + space */
+static const int iiwidth[] = { 12, 19, 4, 8, 11 }; /* item len + space */
typedef char *items_t[ITEMSMAX + 1];
static items_t items_a; /* without hash: items */
if (ctl->af == AF_INET6) {
#ifdef ENABLE_IPV6
reverse_host6(addr, key, NAMELEN);
- if (snprintf(lookup_key, NAMELEN, "%s.origin6.asn.cymru.com", key)
+ if (snprintf(lookup_key, NAMELEN, "%s.%s", key, ctl->ipinfo_provider6)
>= NAMELEN)
return NULL;
#else
(key, NAMELEN, "%d.%d.%d.%d", buff[3], buff[2], buff[1],
buff[0]) >= NAMELEN)
return NULL;
- if (snprintf(lookup_key, NAMELEN, "%s.origin.asn.cymru.com", key)
+ if (snprintf(lookup_key, NAMELEN, "%s.%s", key, ctl->ipinfo_provider4)
>= NAMELEN)
return NULL;
}
fputs(" -y, --ipinfo NUMBER select IP information in output\n",
out);
fputs(" -z, --aslookup display AS number\n", out);
+ fputs(" --ipinfo_provider4 providor for IPv4 AS lookups\n", out);
+#ifdef ENABLE_IPV6
+ fputs(" --ipinfo_provider6 providor for IPv6 AS lookups\n", out);
+#endif
#endif
fputs(" -h, --help display this help and exit\n", out);
fputs(" -v, --version output version information and exit\n", out);
3/ update the help message (see usage() function).
*/
enum {
- OPT_DISPLAYMODE = CHAR_MAX + 1
+ OPT_DISPLAYMODE = CHAR_MAX + 1,
+ OPT_IPINFO4 = CHAR_MAX + 2,
+#ifdef ENABLE_IPV6
+ OPT_IPINFO6 = CHAR_MAX + 3,
+#endif /* ifdef ENABLE_IPV6 */
};
static const struct option long_options[] = {
/* option name, has argument, NULL, short name */
#ifdef HAVE_IPINFO
{"ipinfo", 1, NULL, 'y'}, /* IP info lookup */
{"aslookup", 0, NULL, 'z'}, /* Do AS lookup (--ipinfo 0) */
+ {"ipinfo_provider4", 1, NULL, OPT_IPINFO4},
+#ifdef ENABLE_IPV6
+ {"ipinfo_provider6", 1, NULL, OPT_IPINFO6},
+#endif
#endif
{"interval", 1, NULL, 'i'},
case 'z':
ctl->ipinfo_no = 0;
break;
+ case OPT_IPINFO4:
+ ctl->ipinfo_provider4 = optarg;
+ break;
+#ifdef ENABLE_IPV6
+ case OPT_IPINFO6:
+ ctl->ipinfo_provider6 = optarg;
+ break;
+#endif
#endif
#ifdef SO_MARK
case 'M':
ctl.probe_timeout = 10 * 1000000;
ctl.ipinfo_no = -1;
ctl.ipinfo_max = -1;
+#ifdef HAVE_IPINFO
+ ctl.ipinfo_provider4 = "origin.asn.cymru.com";
+#ifdef ENABLE_IPV6
+ ctl.ipinfo_provider6 = "origin6.asn.cymru.com";
+#endif
+#endif
+
xstrncpy(ctl.fld_active, "LS NABWV", 2 * MAXFLD);
/*
use_dns:1,
show_ips:1,
enablempls:1, dns:1, reportwide:1, Interactive:1, DisplayMode:5;
+#ifdef HAVE_IPINFO
+#ifdef ENABLE_IPV6
+ char *ipinfo_provider6;
+#endif
+ char *ipinfo_provider4;
+#endif
};
/* dynamic field drawing */