diff -ur mtr-0.47/AUTHORS mtr-0.48/AUTHORS --- mtr-0.47/AUTHORS Tue Feb 19 17:50:52 2002 +++ mtr-0.48/AUTHORS Wed Mar 6 12:27:00 2002 @@ -36,6 +36,7 @@ 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) diff -ur mtr-0.47/ChangeLog mtr-0.48/ChangeLog --- mtr-0.47/ChangeLog Sun Feb 10 00:09:31 2002 +++ mtr-0.48/ChangeLog Wed Mar 6 12:25:54 2002 @@ -1,3 +1,6 @@ +2002-03-06 Cougar + + If hop doesn't respond, draw its name in red (GTK) or bold (curses) + 2002-02-09 bodq * Added --address option to bind to given IP addess @@ -8,7 +11,3 @@ 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. - - - - diff -ur mtr-0.47/configure mtr-0.48/configure --- mtr-0.47/configure Tue Feb 19 17:58:31 2002 +++ mtr-0.48/configure Tue Feb 19 17:59:55 2002 @@ -1157,7 +1157,7 @@ PACKAGE=mtr -VERSION=0.47 +VERSION=0.48 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:1163: error: source directory already configured; run \"make distclean\" there first" >&5 diff -ur mtr-0.47/configure.in mtr-0.48/configure.in --- mtr-0.47/configure.in Sun Feb 10 00:09:31 2002 +++ mtr-0.48/configure.in Tue Feb 19 17:59:51 2002 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.47) +AM_INIT_AUTOMAKE(mtr, 0.48) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) diff -ur mtr-0.47/curses.c mtr-0.48/curses.c --- mtr-0.47/curses.c Sun Feb 10 00:09:31 2002 +++ mtr-0.48/curses.c Wed Mar 6 12:25:54 2002 @@ -109,12 +109,15 @@ 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); @@ -224,12 +227,15 @@ 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); diff -ur mtr-0.47/gtk.c mtr-0.48/gtk.c --- mtr-0.47/gtk.c Sun Feb 10 00:09:31 2002 +++ mtr-0.48/gtk.c Wed Mar 6 12:25:54 2002 @@ -283,6 +283,8 @@ void gtk_update_row(GtkCList *List, int row) { int addr; char str[256], *name; + GdkColor color; + GdkColormap *cmap; addr = net_addr(row); name = "???"; @@ -294,6 +296,18 @@ 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)); diff -ur mtr-0.47/mtr.c mtr-0.48/mtr.c --- mtr-0.47/mtr.c Tue Feb 19 17:52:00 2002 +++ mtr-0.48/mtr.c Wed Mar 6 12:25:54 2002 @@ -22,6 +22,7 @@ #include #include #include +#include #include "mtr-curses.h" #include "getopt.h" diff -ur mtr-0.47/net.c mtr-0.48/net.c --- mtr-0.47/net.c Sun Feb 10 00:09:31 2002 +++ mtr-0.48/net.c Wed Mar 6 12:25:54 2002 @@ -85,6 +85,8 @@ uint32 addr; int xmit; int returned; + int sent; + int up; long long total; int last; int best; @@ -166,6 +168,9 @@ 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; @@ -254,6 +259,8 @@ 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); @@ -359,6 +366,10 @@ return host[at].transit; } +int net_up(int at) { + return host[at].up; +} + void net_end_transit() { int at; @@ -454,6 +465,8 @@ 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; diff -ur mtr-0.47/net.h mtr-0.48/net.h --- mtr-0.47/net.h Sun Feb 10 00:09:31 2002 +++ mtr-0.48/net.h Wed Mar 6 12:25:54 2002 @@ -43,6 +43,8 @@ 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); .