diff -ur mtr-0.36/AUTHORS mtr-0.37/AUTHORS --- mtr-0.36/AUTHORS Sat Apr 10 10:26:58 1999 +++ mtr-0.37/AUTHORS Mon Apr 12 15:57:22 1999 @@ -23,12 +23,15 @@ Bertrand Leconte, Anand Kumria, Adam Kramer (l3zqc@qcunix1.acc.qc.edu), + Philip Kizer (pckizer@nostrum.com), Simon Kirby, Christophe Kalt, Steve Kann (stevek@spheara.horizonlive.com), Mircea Damian, Brian Casey, + Bill Bogstad (bogstad@pobox.com), Moritz Barsnick (barsnick@gmx.net) + R??? Sparks (rjsparks@nostrum.com) and anyone who has slipped through the cracks of my mail file. diff -ur mtr-0.36/NEWS mtr-0.37/NEWS --- mtr-0.36/NEWS Sat Apr 10 10:33:58 1999 +++ mtr-0.37/NEWS Mon Apr 12 15:58:05 1999 @@ -1,5 +1,8 @@ WHAT'S NEW? + v0.37 Added Bill Bogstad's "show the local host & time" patch. + Added R. Sparks' show-last-ping patch, submitted by Philip Kizer. + v0.36 Added Craigs change-the-interval-on-the-fly patch. Added Moritz Barsnick's "do something sensible if host not found" patch. diff -ur mtr-0.36/configure mtr-0.37/configure --- mtr-0.36/configure Sat Apr 10 09:38:32 1999 +++ mtr-0.37/configure Mon Apr 12 20:30:09 1999 @@ -700,7 +700,7 @@ PACKAGE=mtr -VERSION=0.36 +VERSION=0.37 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur mtr-0.36/configure.in mtr-0.37/configure.in --- mtr-0.36/configure.in Sat Apr 10 09:38:02 1999 +++ mtr-0.37/configure.in Sun Apr 11 15:48:01 1999 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.36) +AM_INIT_AUTOMAKE(mtr, 0.37) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) diff -ur mtr-0.36/curses.c mtr-0.37/curses.c --- mtr-0.36/curses.c Sat Apr 10 09:21:11 1999 +++ mtr-0.37/curses.c Mon Apr 12 15:52:54 1999 @@ -43,6 +43,9 @@ #include "dns.h" #endif +#include +extern LocalHostname[]; + void pwcenter(char *str) { int maxx, maxy; int cx; @@ -100,10 +103,10 @@ getyx(stdscr, y, x); move(y, startstat); - printw(" %3d%% %4d %4d %4d %4d %6d", + printw(" %3d%% %4d %4d %4d %4d %4d %6d", net_percent(at), net_returned(at), net_xmit(at), - net_best(at), net_avg(at), net_worst(at)); + net_last(at),net_best(at), net_avg(at), net_worst(at)); } else { @@ -224,6 +227,7 @@ int startstat; int rowstat; int i; + time_t t; erase(); getmaxyx(stdscr, maxy, maxx); @@ -233,7 +237,11 @@ attron(A_BOLD); move(0, 0); pwcenter("Matt's traceroute [v" VERSION "]"); - printw("\n\n"); + printw("\n"); + printw(LocalHostname); + move(1, maxx - 24); + time(&t); + printw(ctime(&t)); attroff(A_BOLD); printw("Keys: "); @@ -251,8 +259,8 @@ startstat = maxx - 40; /* Modified by Brian Casey December 1997 bcasey@imagiware.com */ - mvprintw(rowstat - 2, startstat, " Packets Pings"); - mvprintw(rowstat - 1, startstat, " %%Loss Rcv Snt Best Avg Worst"); + mvprintw(rowstat - 2, startstat, " Packets Pings"); + mvprintw(rowstat - 1, startstat, " %%Loss Rcv Snt Last Best Avg Worst"); attroff(A_BOLD); move(rowstat, 0); diff -ur mtr-0.36/mtr.c mtr-0.37/mtr.c --- mtr-0.36/mtr.c Sat Apr 10 09:21:11 1999 +++ mtr-0.37/mtr.c Mon Apr 12 07:56:02 1999 @@ -37,6 +37,7 @@ int MaxPing = 16; float WaitTime = 1.0; char *Hostname = NULL; +char LocalHostname[128]; int dns = 1; void parse_arg(int argc, char **argv) { @@ -174,6 +175,10 @@ exit(0); } if (Hostname == NULL) Hostname = "localhost"; + + if(gethostname(LocalHostname, sizeof(LocalHostname))) { + strcpy(LocalHostname, "UNKNOWNHOST"); + } if(net_preopen_result != 0) { printf("mtr: Unable to get raw socket. (Executable not suid?)\n"); diff -ur mtr-0.36/net.c mtr-0.37/net.c --- mtr-0.36/net.c Sat Apr 10 09:50:51 1999 +++ mtr-0.37/net.c Mon Apr 12 15:52:54 1999 @@ -81,6 +81,7 @@ int xmit; int returned; int total; + int last; int best; int worst; int transit; @@ -235,6 +236,7 @@ if(host[index].returned <= 0) { host[index].best = host[index].worst = totmsec; } + host[index].last = totmsec; if(totmsec < host[index].best) host[index].best = totmsec; if(totmsec > host[index].worst) @@ -298,6 +300,10 @@ return 0; return 100 - (100 * host[at].returned / (host[at].xmit - host[at].transit)); +} + +int net_last(int at) { + return host[at].last; } int net_best(int at) { .