]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
mtr v0.22 v0.22
authorRoger Wolff <r.e.wolff@bitwizard.nl>
Sun, 18 Oct 1998 00:00:00 +0000 (00:00 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 3 Feb 2013 20:45:36 +0000 (20:45 +0000)
 - Roger has take over maintenance.
 - mtr now uses an "int" to pass options to the kernel.
 - Makes things work on Solaris and *BSD I'm told.
 - mtr doesn't fire off a flurry of packets when a new second comes
   around. Instead they are spaced evenly around the whole
   second. This allows people with a relatively slow first link to do
   meaningful measurements of whatever is behind that.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.22.tar.gz

AUTHORS
NEWS
README
SECURITY
TODO [new file with mode: 0644]
configure.in
curses.c
mtr.8
net.c
select.c

diff --git a/AUTHORS b/AUTHORS
index c3ecbfacfa4951ec89cd4297171f443163424564..a52bb4c036a2953806b97fc6b61f793e57cb3a77 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,9 @@
+
   Matt Kimball <mkimball@xmission.com> is the primary author of mtr.
 
+  Roger Wolff <R.E.Wolff@BitWizard.nl> is currently maintaing mtr. 
+
+
   Bug reports and feature requests should be sent to the mtr 
   mailing list.  See the README file for details.
 
diff --git a/NEWS b/NEWS
index 08886b9392173e67a3bd57e38883dd158a2e7779..2e58556ff1a3bc303bd0bb3a126a1b5b69133d26 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,15 @@
 WHAT'S NEW?
 
+  v0.22 
+        Roger has take over maintenance. 
+        mtr now uses an "int" to pass options to the kernel. 
+        Makes things work on Solaris and *BSD I'm told. 
+        mtr doesn't fire off a flurry of packets when a new
+        second comes around. Instead they are spaced evenly
+        around the whole second. This allows people with a 
+        relatively slow first link to do meaningful measurements
+        of whatever is behind that.
+
   v0.21
         mtr now drops root permissions after it acquires the raw
         sockets it needs.
diff --git a/README b/README
index 42d7c522243f22e82dd3bbfc0b0fa5dccaa0fade..2cae3f6c8fddecbc902b80921c37bf6263224303 100644 (file)
--- a/README
+++ b/README
@@ -32,7 +32,8 @@ INSTALLING
 
 WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION?
 
-  See the mtr web page at 'http://www.mkimball.org/mtr.html'.
+  See the mtr web page at 
+         http://www.BitWizard.nl/mtr/ 
 
   Subscribe to the mtr mailing list.  All mtr related announcements
   are posted to the mtr mailing list.  To subscribe, send email to
@@ -42,3 +43,4 @@ WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION?
 
   Bug reports and feature requests should be sent to the mtr 
   mailing list.
+
index d81a9540ec80e58235229581984db75379e9c678..a6b48ddfc5adae51773bc5506eb9507f5532d741 100644 (file)
--- a/SECURITY
+++ b/SECURITY
@@ -21,7 +21,7 @@ from or write to any system files which they wouldn't normally have
 permission to write to.  The only priveledge gained is access to the
 raw socket descriptors, which would allow the malicious user to listen
 to all ICMP packets arriving at the system, and send forged packets
-with arbitrary ncontents.
+with arbitrary contents.
 
 If you have further questions or comments about security issues,
 please direct them to the mtr mailing list.  See README for details.
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..8e45c3c
--- /dev/null
+++ b/TODO
@@ -0,0 +1,23 @@
+
+- Stuff to implement:
+
+  - Allow mtr to log the return packets, for later analysis.
+
+  - Request timestamping at the remote site.
+       Andreas Fasbender has an algorithm that will allow us to 
+       convert these measurements into one-way measurements, not just
+       round-trip.
+
+  - Allow mtr to also send larger packets. 
+       This will enable us to get a feel for the speed of the links
+       we're traversing. (Van Jacobson was working on this His tool
+       was slow, mtr will rock with this feature.... :-)
+       (Anybody have the statistics experience to tell me how
+       to do the data analysis?)
+
+  - Allow MTR to keep on getting the icmp host unreachables, and
+    work through that. Some hosts don't answer PINGs.
+
+- Bugs to fix?
+  - ?
+
index 482bd5e5c6734f0f5a471f54e26f379feb3ab5eb..7787504ce547074fd11aa86066e20e63dec13742 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.21)
+AM_INIT_AUTOMAKE(mtr, 0.22)
 
 AC_SUBST(GTK_OBJ)
 AC_SUBST(CURSES_OBJ)
index f49da443f5d8e26e4d64b812972fc55daeb8d4b5..4932e6f48a7ef26b4ab2eb20224177c3c51299fe 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -92,7 +92,7 @@ void mtr_curses_hosts(int startstat) {
       getyx(stdscr, y, x);
       move(y, startstat);
 
-      printw("  %3d%% %4d%4d %5d%5d%7d", 
+      printw("  %3d%% %3d %3d %4d %4d %6d", 
              net_percent(at),
              net_returned(at), net_xmit(at),
              net_best(at), net_avg(at), net_worst(at));
diff --git a/mtr.8 b/mtr.8
index 616cfd72b1d8312c208ec55d12bdc60fc5cd64bc..ae2e2ae3599a10d3039efd2314d73771e13ae977 100644 (file)
--- a/mtr.8
+++ b/mtr.8
@@ -153,7 +153,7 @@ these routers.
 
 .PP
 For the latest version, see the mtr web page at 
-.BR http://www.mkimball.org/mtr.html .
+.BR http://www.bitwizard.nl/mtr/ .
 
 .PP
 Subscribe to the mtr mailing list.  All mtr related announcements
diff --git a/net.c b/net.c
index 1dc7372dde9975af6aca22918113726f4b4e2357..1769a41ed31a846f60c6ceddb428e0d2cc0f613b 100644 (file)
--- a/net.c
+++ b/net.c
@@ -342,26 +342,40 @@ void net_end_transit() {
   }
 }
 
+
+extern float WaitTime;
+extern struct timeval intervaltime;
+#include <stdio.h>
+#include <math.h>
+
 void net_send_batch() {
-  int at;
-  int n_unknown = 10;
-
-  for(at = 0;n_unknown && (at < MaxHost); at++) {
-    if(host[at].addr == 0) {
-      net_send_query(at + 1);
-      n_unknown--;
-    } else {
-      net_send_ping(at);
-    }
+  static int n_unknown = 10;
+  static int at;
 
-    if(host[at].addr == remoteaddress.sin_addr.s_addr) {
-      break;
-    }
+  if(host[at].addr == 0) {
+    net_send_query(at + 1);
+    n_unknown--;
+  } else {
+    net_send_ping(at);
   }
+  
+  if ((host[at].addr == remoteaddress.sin_addr.s_addr) ||
+      (n_unknown == 0)) {
+    float wt = WaitTime / (float) at;
+
+    intervaltime.tv_sec = (int)(wt);
+    intervaltime.tv_usec = 1000000.0 * (wt - floor(wt));
+    at = 0;
+    n_unknown = 10;
+    return;
+  }
+
+  at++;
 }
 
+
 int net_preopen() {
-  char trueopt = 1;
+  int trueopt = 1;
 
   sendsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
   if(sendsock == -1)
@@ -370,8 +384,11 @@ int net_preopen() {
 #ifdef IP_HDRINCL
   /*  FreeBSD wants this to avoid sending out packets with protocol type RAW
       to the network.  */
-  if(setsockopt(sendsock, 0, IP_HDRINCL, &trueopt, sizeof(trueopt)))
+  if(setsockopt(sendsock, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt)))
+  {
+    perror("setsockopt(IP_HDRINCL,1)");
     return -1;
+  }
 #endif
 
   recvsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
index f68df52aa5f5aa3b7b511606067e3f8918e2b335..bf269c0278763c40f7e8163ebc58b3337d8b8ef3 100644 (file)
--- a/select.c
+++ b/select.c
@@ -34,19 +34,23 @@ extern int MaxPing;
 extern float WaitTime;
 double dnsinterval;
 
+struct timeval intervaltime;
+
 void select_loop() {
   fd_set readfd;
   int anyset;
   int action, maxfd;
   int dnsfd, netfd;
   int NumPing;
-  struct timeval lasttime, thistime, selecttime, intervaltime;
+  struct timeval lasttime, thistime, selecttime;
+  float wt;
 
   NumPing = 0;
   anyset = 0;
   gettimeofday(&lasttime, NULL);
-  intervaltime.tv_sec = (int)WaitTime;
-  intervaltime.tv_usec = 1000000.0 * (WaitTime - floor(WaitTime));
+  wt = WaitTime/10;
+  intervaltime.tv_sec = (int)wt;
+  intervaltime.tv_usec = 1000000.0 * (wt - floor(wt));
 
   while(1) {
     FD_ZERO(&readfd);