mtr 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.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.22.tar.gz
This commit is contained in:
Roger Wolff 1998-10-18 00:00:00 +00:00 committed by Travis Cross
parent 090a9cfe71
commit 8f0746e26a
10 changed files with 83 additions and 23 deletions

View File

@ -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.

10
NEWS
View File

@ -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.

4
README
View File

@ -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.

View File

@ -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.

23
TODO Normal file
View File

@ -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?
- ?

View 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)

View File

@ -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));

2
mtr.8
View File

@ -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

47
net.c
View File

@ -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;
static int n_unknown = 10;
static int at;
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);
}
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);

View File

@ -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);