struct mtr_ctl *ctl,
time_t now)
{
- int i, j, at, max;
+ int i, j, at, max, z, w;
ip_t *addr;
+ ip_t *addr2 = NULL;
char name[MAX_FORMAT_STR];
for (i = 0; i < MAXFLD; i++) {
}
}
printf("\n");
+ if (ctl->reportwide == 0)
+ continue;
+
+ for (z = 0; z < MAX_PATH; z++) {
+ int found = 0;
+ addr2 = net_addrs(at, z);
+ snprint_addr(ctl, name, sizeof(name), addr2);
+ if ((addrcmp
+ ((void *) &ctl->unspec_addr, (void *) addr2,
+ ctl->af)) == 0) {
+ break;
+ } else if ((addrcmp
+ ((void *) addr, (void *) addr2,
+ ctl->af)) == 0) {
+ continue; /* Latest Host is already printed */
+ } else {
+ for (w = 0; w < z; w++)
+ /* Ok... checking if there are ips repeated on same hop */
+ if ((addrcmp
+ ((void *) addr2, (void *) net_addrs(at, w),
+ ctl->af)) == 0) {
+ found = 1;
+ break;
+ }
+
+ if (!found) {
+#ifdef HAVE_IPINFO
+ if (!ctl->ipinfo_no) {
+ char *fmtinfo = fmt_ipinfo(ctl, addr2);
+ fmtinfo = trim(fmtinfo, '\0');
+ printf("MTR.%s,%lld,%s,%s,%d,%s,%s", PACKAGE_VERSION,
+ (long long) now, "OK", ctl->Hostname, at + 1, name,
+ fmtinfo);
+ } else
+#endif
+ printf("MTR.%s,%lld,%s,%s,%d,%s", PACKAGE_VERSION,
+ (long long) now, "OK", ctl->Hostname, at + 1, name);
+
+ /* Use values associated with the first ip discovered for this hop */
+ for (i = 0; i < MAXFLD; i++) {
+ j = ctl->fld_index[ctl->fld_active[i]];
+ if (j < 0)
+ continue;
+
+ /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */
+ if (strchr(data_fields[j].format, 'f')) {
+ printf(",%.2f",
+ (double) (data_fields[j].net_xxx(at) / 1000.0));
+ } else {
+ printf(",%d", data_fields[j].net_xxx(at));
+ }
+ }
+ printf("\n");
+ }
+ }
+ }
}
}