- 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.
source: ftp://ftp.bitwizard.nl/mtr/mtr-0.35.tar.gz
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,
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.
AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.34)
+AM_INIT_AUTOMAKE(mtr, 0.35)
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
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;
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);
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 };
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;
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<at;i++) {
+ for (i=0;i<batch_at;i++) {
if (host[i].addr == 0)
n_unknown++;
if (host[i].addr == remoteaddress.sin_addr.s_addr)
n_unknown = 100; /* Make sure we drop into "we should restart" */
}
- if ((host[at].addr == remoteaddress.sin_addr.s_addr) ||
- (n_unknown > 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;
}
remoteaddress.sin_family = AF_INET;
remoteaddress.sin_addr.s_addr = addr;
- net_send_batch();
-
return 0;
}
int at;
int i;
+ batch_at = 0;
+
for(at = 0; at < MaxHost; at++) {
host[at].xmit = 0;
host[at].transit = 0;