diff -ur mtr-0.34/AUTHORS mtr-0.35/AUTHORS --- mtr-0.34/AUTHORS Sat Apr 3 01:04:44 1999 +++ mtr-0.35/AUTHORS Wed Apr 7 10:29:05 1999 @@ -12,19 +12,20 @@ Thanks especially to those of you who have sent code: (Reverse alphabetical order) - Juha Takala, - David Sward (sward@clark.net), + Juha Takala, + David Sward (sward@clark.net), Andrew Stesin, Aaron Scarisbrick, + Craig Milo Rogers (Rogers@ISI.EDU), Russell Nelson, - Alexander V. Lukyanov, + Alexander V. Lukyanov, Charles Levert, Bertrand Leconte, Anand Kumria, - Adam Kramer (l3zqc@qcunix1.acc.qc.edu), + Adam Kramer (l3zqc@qcunix1.acc.qc.edu), Simon Kirby, Christophe Kalt, - Steve Kann (stevek@spheara.horizonlive.com), + Steve Kann (stevek@spheara.horizonlive.com), Mircea Damian, Brian Casey, diff -ur mtr-0.34/NEWS mtr-0.35/NEWS --- mtr-0.34/NEWS Sat Apr 3 01:06:04 1999 +++ mtr-0.35/NEWS Wed Apr 7 10:27:58 1999 @@ -1,5 +1,11 @@ WHAT'S NEW? + v0.35 Added Craig Milo Rogers pause/resume for GTK patch. + Added Craig Milo Rogers cleanup of "reset". (restart at the beginning) + Net_open used to send a first packet. After that the display-driver + got a chance to distort the timing by taking its time to + initialize. + v0.34 Added Matt's nifty "use the icmp unreachables to do the timing" patch. Added Steve Kann's pause/resume patch. diff -ur mtr-0.34/configure mtr-0.35/configure --- mtr-0.34/configure Sat Mar 13 22:07:18 1999 +++ mtr-0.35/configure Wed Apr 7 09:32:37 1999 @@ -700,7 +700,7 @@ PACKAGE=mtr -VERSION=0.34 +VERSION=0.35 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.34/configure.in mtr-0.35/configure.in --- mtr-0.34/configure.in Sat Mar 13 22:07:07 1999 +++ mtr-0.35/configure.in Wed Apr 7 09:30:44 1999 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.34) +AM_INIT_AUTOMAKE(mtr, 0.35) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) diff -ur mtr-0.34/gtk.c mtr-0.35/gtk.c --- mtr-0.34/gtk.c Mon Mar 15 22:16:13 1999 +++ mtr-0.35/gtk.c Wed Apr 7 09:31:36 1999 @@ -73,6 +73,22 @@ return FALSE; } +gint gtk_ping(gpointer data); + +gint Pause_clicked(GtkWidget *Button, gpointer data) { + static int paused = 0; + + if (paused) { + tag = gtk_timeout_add(DeltaTime*1000, gtk_ping, NULL); + } else { + gtk_timeout_remove (tag); + } + paused = ! paused; + gtk_redraw(); + + return FALSE; +} + gint Host_activate(GtkWidget *Entry, gpointer data) { int addr; @@ -106,6 +122,12 @@ GTK_SIGNAL_FUNC(Restart_clicked), NULL); gtk_widget_show(Button); + Button = gtk_check_button_new_with_label("Pause"); + gtk_box_pack_end(GTK_BOX(Toolbar), Button, FALSE, FALSE, 0); + gtk_signal_connect(GTK_OBJECT(Button), "clicked", + GTK_SIGNAL_FUNC(Pause_clicked), NULL); + gtk_widget_show(Button); + Label = gtk_label_new("Hostname"); gtk_box_pack_start(GTK_BOX(Toolbar), Label, FALSE, FALSE, 0); gtk_widget_show(Label); diff -ur mtr-0.34/net.c mtr-0.35/net.c --- mtr-0.34/net.c Tue Mar 23 09:01:58 1999 +++ mtr-0.35/net.c Wed Apr 7 10:18:20 1999 @@ -96,6 +96,13 @@ struct timeval time; }; + +/* Configuration parameter: How many queries to unknown hosts do we + send? (This limits the amount of traffic generated if a host is not + reachable) */ +#define MAX_UNKNOWN_HOSTS 5 + + static struct nethost host[MaxHost]; static struct sequence sequence[MaxSequence]; static struct timeval reset = { 0, 0 }; @@ -103,7 +110,11 @@ int sendsock; int recvsock; struct sockaddr_in remoteaddress; +static int batch_at = 0; + +/* This doesn't work for odd sz. I don't know enough about this to say + that this is wrong. It doesn't seem to cripple mtr though. -- REW */ int checksum(void *data, int sz) { unsigned short *ch; unsigned int sum; @@ -332,28 +343,27 @@ int net_send_batch() { - static int at; int n_unknown, i; - net_send_query(at); + net_send_query(batch_at); n_unknown = 0; - for (i=0;i 5)) { - DeltaTime = WaitTime / (float) (at+1); - at = 0; + if ((host[batch_at].addr == remoteaddress.sin_addr.s_addr) || + (n_unknown > MAX_UNKNOWN_HOSTS)) { + DeltaTime = WaitTime / (float) (batch_at+1); + batch_at = 0; return 1; } - at++; + batch_at++; return 0; } @@ -388,8 +398,6 @@ remoteaddress.sin_family = AF_INET; remoteaddress.sin_addr.s_addr = addr; - net_send_batch(); - return 0; } @@ -410,6 +418,8 @@ void net_reset() { int at; int i; + + batch_at = 0; for(at = 0; at < MaxHost; at++) { host[at].xmit = 0; .