- Draw names in red (GTK) or bold (Curses) if host doesn't respond.
source: ftp://ftp.bitwizard.nl/mtr/mtr-0.48.tar.gz
Steve Kann (stevek@spheara.horizonlive.com)
Damian Gryski (dgryski@uwaterloo.ca)
Mircea Damian
+ Cougar (cougar@random.ee)
Brian Casey
Andrew Brown (atatat@atatdot.net)
Bill Bogstad (bogstad@pobox.com)
+2002-03-06 Cougar <cougar@random.ee>
+ + If hop doesn't respond, draw its name in red (GTK) or bold (curses)
+
2002-02-09 bodq <bohdan@vstu.edu.ua>
* Added --address option to bind to given IP addess
it does not work for GLIBC2 systems (e.g., RedHat 7+).
* Fixed the subordinate CHECK_LIBS on the test for res_mkquery,
so that they test for res_mkquery, not res_init.
-
-
-
-
AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.47)
+AM_INIT_AUTOMAKE(mtr, 0.48)
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
if(addr != 0) {
name = dns_lookup(addr);
+ if (! net_up(at))
+ attron(A_BOLD);
if(name != NULL) {
printw("%s", name);
} else {
printw("%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff,
(addr >> 8) & 0xff, addr & 0xff);
}
+ attroff(A_BOLD);
getyx(stdscr, y, x);
move(y, startstat);
continue;
}
+ if (! net_up(at))
+ attron(A_BOLD);
name = dns_lookup(addr);
if (name) {
printw("%s", name);
} else {
printw("%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) && 0xff, (addr >> 8) & 0xff, addr & 0xff);
}
+ attroff(A_BOLD);
getyx(stdscr, y, x);
move(y, startstat);
void gtk_update_row(GtkCList *List, int row) {
int addr;
char str[256], *name;
+ GdkColor color;
+ GdkColormap *cmap;
addr = net_addr(row);
name = "???";
name = str;
}
}
+
+ cmap = gtk_widget_get_colormap(ReportBody);
+ if (net_up(row)) {
+ gdk_color_black(cmap, &color);
+ } else {
+ color.red = 0xffffff;
+ color.green = 0;
+ color.blue = 0;
+ }
+ gdk_color_alloc (cmap, &color);
+ gtk_clist_set_foreground(List, row, &color);
+
gtk_set_field(List, row, 0, name);
gtk_set_field_num(List, row, 1, "%d%%", net_percent(row));
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <netinet/in.h>
#include "mtr-curses.h"
#include "getopt.h"
uint32 addr;
int xmit;
int returned;
+ int sent;
+ int up;
long long total;
int last;
int best;
memset(&sequence[seq].time, 0, sizeof(sequence[seq].time));
host[index].transit = 1;
+ if (host[index].sent)
+ host[index].up = 0;
+ host[index].sent = 1;
net_save_xmit(index);
return seq;
host[index].total += totusec;
host[index].returned++;
+ host[index].sent = 0;
+ host[index].up = 1;
host[index].transit = 0;
net_save_return(index, sequence[seq].saved_seq, totusec);
return host[at].transit;
}
+int net_up(int at) {
+ return host[at].up;
+}
+
void net_end_transit() {
int at;
host[at].xmit = 0;
host[at].transit = 0;
host[at].returned = 0;
+ host[at].sent = 0;
+ host[at].up = 0;
host[at].total = 0;
host[at].best = 0;
host[at].worst = 0;
int net_xmit(int at);
int net_transit(int at);
+int net_up(int at);
+
#define SAVED_PINGS 200
int* net_saved_pings(int at);
void net_save_xmit(int at);