Andrew Stesin,
Aaron Scarisbrick,
Craig Milo Rogers (Rogers@ISI.EDU),
- Russell Nelson,
- Alexander V. Lukyanov,
- Charles Levert,
- Bertrand Leconte,
+ Russell Nelson (rn-mtr@crynwr.com),
+ Alexander V. Lukyanov (lav@yars.free.net),
+ Charles Levert (charles@comm.polymtl.ca),
+ Bertrand Leconte (B.Leconte@mail.dotcom.fr),
Anand Kumria,
Adam Kramer (l3zqc@qcunix1.acc.qc.edu),
Philip Kizer (pckizer@nostrum.com),
Brian Casey,
Bill Bogstad (bogstad@pobox.com),
Moritz Barsnick (barsnick@gmx.net)
- R??? Sparks (rjsparks@nostrum.com)
+ Robert Sparks (rjsparks@nostrum.com)
and anyone who has slipped through the cracks of my mail file.
- Allow mtr to log the return packets, for later analysis.
Done: 0.25 . Todo: allow the userinterface(s) to work while
- still logging to a file.
+ still logging to a file. Write a "logfile displaying" mode to
+ mtr.
- Request timestamping at the remote site.
Andreas Fasbender has an algorithm that will allow us to
- Bugs to fix?
- Do something useful if host couldn't be resolved.
+ -- Done.
- Revert to curses mode even if DISPLAY is set, but a problem
prevents us from running in X11 mode.
--> The problem is that gtk_init simply calls exit for us if
it finds a problem. Tricky! Suggestions welcome.
+ --> Call "gtk_check_init" when available. (i.e. new enough
+ (1.2?) GTK version).
- Nice to have:
- Show state ("looking up host") while doing the DNS lookup for a new
host.
- - Check why it still tries to go for X11 display if DISPLAY is unset.
- (I saw code to handle this)
-
- Read environment variable "MTR_DEFAULTS" as a commandline before
parsing the commandline. -- DONE. (ok it's MTR_OPTIONS.)
At the moment (march 1999) autoconf 2.13 is still too new to require
everyone to upgrade. About a year from now we can put this in....
+ - Allow a toggle between hostname/IP number display. (for example a
+ click on the hostname could revert to ip number display in gtk version.
+ curses: "n" key toggles hostnames/ipnumbers?
+
AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.37)
+AM_INIT_AUTOMAKE(mtr, 0.38)
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
move(0, 0);
pwcenter("Matt's traceroute [v" VERSION "]");
printw("\n");
+ attroff(A_BOLD);
printw(LocalHostname);
- move(1, maxx - 24);
time(&t);
- printw(ctime(&t));
- attroff(A_BOLD);
+ mvprintw(1, maxx-25, ctime(&t));
printw("Keys: ");
attron(A_BOLD); printw("D"); attroff(A_BOLD);
#define getheader_pr(x) ((x->databyte_b >> 6) & 1)
#define getheader_ra(x) (x->databyte_b >> 7)
+#if 0
+
+/* The execution order inside an expression is undefined! That means that
+ this might work, but then again, it might not... Sun Lint pointed this
+ one out...*/
+
#define sucknetword(x) (((word)*(x) << 8) | (((x)+= 2)[-1]))
#define sucknetshort(x) (((short)*(x) << 8) | (((x)+= 2)[-1]))
#define sucknetdword(x) (((dword)*(x) << 24) | ((x)[1] << 16) | ((x)[2] << 8) | (((x)+= 4)[-1]))
#define sucknetlong(x) (((long)*(x) << 24) | ((x)[1] << 16) | ((x)[2] << 8) | (((x)+= 4)[-1]))
+#else
+
+#define sucknetword(x) ((word) (((x)[0] << 8) | ((x)[1] << 0))),(x)+=2
+#define sucknetshort(x) ((short) (((x)[0] << 8) | ((x)[1] << 0))),(x)+=2
+#define sucknetdword(x) ((dword) (((x)[0] << 24) | ((x)[1] << 16) | \
+ ((x)[2] << 8) | ((x)[3] << 0))),(x)+=4
+#define sucknetlong(x) ((long) (((x)[0] << 24) | ((x)[1] << 16) | \
+ ((x)[2] << 8) | ((x)[3] << 0))),(x)+=4
+#endif
enum {
STATE_FINISHED,
void dorequest(char *s,int type,word id){
packetheader *hp;
int r,i;
- byte buf[MaxPacketsize+1];
+ int buf[(MaxPacketsize/4)+1];
r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,buf,MaxPacketsize);
if (r == -1){
restell("Resolver error: Query too large.");
GTK_SIGNAL_FUNC(Pause_clicked), NULL);
gtk_widget_show(Pause_Button);
+ /* allow root only to set zero delay */
Adjustment = (GtkAdjustment *)gtk_adjustment_new(WaitTime,
- 0.00, 999.99,
+ getuid()==0 ? 0.00:1.00,
+ 999.99,
1.0, 10.0,
0.0);
Button = gtk_spin_button_new(Adjustment, 0.5, 2);
fprintf (stderr, "mtr: wait time must be positive\n");
exit (1);
}
+ if (getuid() != 0 && WaitTime < 1.0)
+ WaitTime = 1.0;
break;
}
}
}
-
-
-
-
int main(int argc, char **argv) {
int traddr;
struct hostent *host;
int max;
max = 0;
- for(at = 0; at < MaxHost; at++) {
+ for(at = 0; at < MaxHost-2; at++) {
if(host[at].addr == remoteaddress.sin_addr.s_addr) {
return at + 1;
} else if(host[at].addr != 0) {
}
if ((host[batch_at].addr == remoteaddress.sin_addr.s_addr) ||
- (n_unknown > MAX_UNKNOWN_HOSTS)) {
+ (n_unknown > MAX_UNKNOWN_HOSTS) ||
+ (batch_at >= MaxHost-2)) {
numhosts = batch_at+1;
batch_at = 0;
return 1;