- Added Bill Bogstad's "show the local host & time" patch.
- Added R. Sparks' show-last-ping patch, submitted by Philip Kizer.
source: ftp://ftp.bitwizard.nl/mtr/mtr-0.37.tar.gz
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.
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.
AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.36)
+AM_INIT_AUTOMAKE(mtr, 0.37)
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
#include "dns.h"
#endif
+#include <time.h>
+extern LocalHostname[];
+
void pwcenter(char *str) {
int maxx, maxy;
int cx;
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 {
int startstat;
int rowstat;
int i;
+ time_t t;
erase();
getmaxyx(stdscr, maxy, maxx);
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: ");
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);
int MaxPing = 16;
float WaitTime = 1.0;
char *Hostname = NULL;
+char LocalHostname[128];
int dns = 1;
void parse_arg(int argc, char **argv) {
}
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");
exit(1);
int xmit;
int returned;
int total;
+ int last;
int best;
int worst;
int transit;
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)
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) {
return host[at].best;
}