Codebase list mtr / af4a50f
Import Upstream version 0.28 Samuel Henrique 5 years ago
28 changed file(s) with 860 addition(s) and 366 deletion(s). Raw diff Collapse all Expand all
0
01 Matt Kimball <mkimball@xmission.com> is the primary author of mtr.
2
3 Roger Wolff <R.E.Wolff@BitWizard.nl> is currently maintaing mtr.
4
15
26 Bug reports and feature requests should be sent to the mtr
37 mailing list. See the README file for details.
48
59 Thanks to everyone who has provided feedback on mtr.
610
7 Thanks especially to those of you who have sent me code:
11 Thanks especially to those of you who have sent code:
812
913 Brian Casey, Mircea Damian, Christophe Kalt, Simon Kirby,
10 Anand Kumria, Charles Levert, Russell Nelson,
11 Aaron Scarisbrick, Andrew Stesin, Juha Takala, Rogier Wolff
14 Anand Kumria, Bertrand Leconte, Charles Levert, Alexander
15 V. Lukyanov, Russell Nelson, Aaron Scarisbrick, Andrew
16 Stesin, Juha Takala.
1217 and anyone who has slipped through the cracks of my mail file.
0
1 The "split" format is for a separating the gui from the main program.
2 The main program can be installed setuid, and you don't want to link a
3 gui-library with a setuid program.
4
5
6 The split format is:
7
8 <pos> <host> <loss%> <rcvd pckts> <sent pckts> <best> <avg> <worst>
9
10
11 The "raw" format is:
12
13 hostline|pingline|dnsline|timestampline
14
15 hostline:
16 h <pos> <host IP>
17
18 pingline:
19 p <pos> <pingtime (ms)>
20
21 dnsline:
22 d <pos> <hostname>
23
24 timestampline:
25 t <pos> <pingtime> <timestamp>
26
27
28 Timestampline is not yet implemented. Need to find out how to do
29 ICMP timestamping first. :-)
30
77 mtr_SOURCES = mtr.c \
88 net.c net.h \
99 dns.c dns.h \
10 raw.c raw.h \
11 split.c split.h \
1012 display.c display.h \
1113 report.c report.h \
1214 getopt.c getopt1.c getopt.h \
1921 mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ)
2022
2123 EXTRA_DIST = SECURITY mtr.8
24
25 DISTCLEANFILES = *~
26
0 # Makefile.in generated automatically by automake 1.2d from Makefile.am
0 # Makefile.in generated automatically by automake 1.2 from Makefile.am
11
22 # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
33 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
4 # gives unlimited permission to copy, distribute and modify it.
115
126
137 SHELL = /bin/sh
4842 INSTALL_SCRIPT = @INSTALL_SCRIPT@
4943 transform = @program_transform_name@
5044
51 NORMAL_INSTALL = :
52 PRE_INSTALL = :
53 POST_INSTALL = :
54 NORMAL_UNINSTALL = :
55 PRE_UNINSTALL = :
56 POST_UNINSTALL = :
45 NORMAL_INSTALL = true
46 PRE_INSTALL = true
47 POST_INSTALL = true
48 NORMAL_UNINSTALL = true
49 PRE_UNINSTALL = true
50 POST_UNINSTALL = true
5751 CC = @CC@
5852 CURSES_OBJ = @CURSES_OBJ@
5953 GTK_CFLAGS = @GTK_CFLAGS@
7266 mtr_SOURCES = mtr.c \
7367 net.c net.h \
7468 dns.c dns.h \
69 raw.c raw.h \
70 split.c split.h \
7571 display.c display.h \
7672 report.c report.h \
7773 getopt.c getopt1.c getopt.h \
8480 mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ)
8581
8682 EXTRA_DIST = SECURITY mtr.8
83
84 DISTCLEANFILES = *~
8785 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8886 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
8987 CONFIG_HEADER = config.h
9593 CPPFLAGS = @CPPFLAGS@
9694 LDFLAGS = @LDFLAGS@
9795 LIBS = @LIBS@
98 mtr_OBJECTS = mtr.o net.o dns.o display.o report.o getopt.o getopt1.o \
99 select.o
96 mtr_OBJECTS = mtr.o net.o dns.o raw.o split.o display.o report.o \
97 getopt.o getopt1.o select.o
10098 mtr_LDADD = $(LDADD)
10199 CFLAGS = @CFLAGS@
102100 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
105103
106104 NROFF = nroff
107105 DIST_COMMON = README AUTHORS COPYING INSTALL Makefile.am Makefile.in \
108 NEWS acconfig.h aclocal.m4 config.h.in configure configure.in \
106 NEWS TODO acconfig.h aclocal.m4 config.h.in configure configure.in \
109107 install-sh missing mkinstalldirs stamp-h.in
110108
111109
119117 default: all
120118
121119 .SUFFIXES:
122 .SUFFIXES: .S .c .o .s
120 .SUFFIXES: .c .o
123121 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
124122 cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
125123
136134 cd $(srcdir) && $(AUTOCONF)
137135
138136 config.h: stamp-h
139 @:
140137 stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
141138 cd $(top_builddir) \
142139 && CONFIG_FILES= CONFIG_HEADERS=config.h \
152149 clean-hdr:
153150
154151 distclean-hdr:
155 -rm -f config.h
152 rm -f config.h
156153
157154 maintainer-clean-hdr:
158155
159156 mostlyclean-sbinPROGRAMS:
160157
161158 clean-sbinPROGRAMS:
162 -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
159 test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
163160
164161 distclean-sbinPROGRAMS:
165162
184181 .c.o:
185182 $(COMPILE) -c $<
186183
187 .s.o:
188 $(COMPILE) -c $<
189
190 .S.o:
191 $(COMPILE) -c $<
192
193184 mostlyclean-compile:
194 -rm -f *.o core
185 rm -f *.o core
195186
196187 clean-compile:
197188
198189 distclean-compile:
199 -rm -f *.tab.c
190 rm -f *.tab.c
200191
201192 maintainer-clean-compile:
202193
216207 uninstall-man:
217208 $(NORMAL_UNINSTALL)
218209 inst=`echo "mtr" | sed '$(transform)'`.8; \
219 -rm -f $(mandir)/man8/$$inst
210 rm -f $(mandir)/man8/$$inst
220211
221212
222213 # This directory's subdirectories are mostly independent; you can cd
232223 installdirs-recursive install-recursive uninstall-recursive \
233224 check-recursive installcheck-recursive info-recursive dvi-recursive:
234225 @set fnord $(MAKEFLAGS); amf=$$2; \
235 list='$(SUBDIRS)'; for subdir in $$list; do \
226 for subdir in $(SUBDIRS); do \
236227 target=`echo $@ | sed s/-recursive//`; \
237228 echo "Making $$target in $$subdir"; \
238229 (cd $$subdir && $(MAKE) $$target) \
242233 mostlyclean-recursive clean-recursive distclean-recursive \
243234 maintainer-clean-recursive:
244235 @set fnord $(MAKEFLAGS); amf=$$2; \
245 rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
246 rev="$$subdir $$rev"; \
247 done; \
236 rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \
248237 for subdir in $$rev; do \
249238 target=`echo $@ | sed s/-recursive//`; \
250239 echo "Making $$target in $$subdir"; \
258247
259248 tags: TAGS
260249
261 ID: $(HEADERS) $(SOURCES) $(LISP)
262 here=`pwd` && cd $(srcdir) \
263 && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
264
265 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
250 ID: $(HEADERS) $(SOURCES)
251 here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
252
253 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES)
266254 tags=; \
267255 here=`pwd`; \
268256 list='$(SUBDIRS)'; for subdir in $$list; do \
269257 test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
270258 done; \
271 test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$(LISP)$$tags" \
272 || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) $(LISP) -o $$here/TAGS)
259 test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \
260 || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS)
273261
274262 mostlyclean-tags:
275263
276264 clean-tags:
277265
278266 distclean-tags:
279 -rm -f TAGS ID
267 rm -f TAGS ID
280268
281269 maintainer-clean-tags:
282270
287275 # it guarantees that the distribution is self-contained by making another
288276 # tarfile.
289277 distcheck: dist
290 -rm -rf $(distdir)
278 rm -rf $(distdir)
291279 GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
292280 mkdir $(distdir)/=build
293281 mkdir $(distdir)/=inst
300288 && $(MAKE) install \
301289 && $(MAKE) installcheck \
302290 && $(MAKE) dist
303 -rm -rf $(distdir)
291 rm -rf $(distdir)
304292 @echo "========================"; \
305293 echo "$(distdir).tar.gz is ready for distribution"; \
306294 echo "========================"
307295 dist: distdir
308296 -chmod -R a+r $(distdir)
309297 GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
310 -rm -rf $(distdir)
298 rm -rf $(distdir)
311299 dist-all: distdir
312300 -chmod -R a+r $(distdir)
313301 GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
314 -rm -rf $(distdir)
302 rm -rf $(distdir)
315303 distdir: $(DISTFILES)
316 -rm -rf $(distdir)
304 rm -rf $(distdir)
317305 mkdir $(distdir)
318306 -chmod 777 $(distdir)
319307 @for file in $(DISTFILES); do \
322310 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
323311 || cp -p $$d/$$file $(distdir)/$$file; \
324312 done
325 for subdir in $(SUBDIRS); do \
326 test -d $(distdir)/$$subdir \
327 || mkdir $(distdir)/$$subdir \
328 || exit 1; \
329 chmod 777 $(distdir)/$$subdir; \
330 (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
313 for subdir in $(SUBDIRS); do \
314 test -d $(distdir)/$$subdir \
315 || mkdir $(distdir)/$$subdir \
316 || exit 1; \
317 chmod 777 $(distdir)/$$subdir; \
318 (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
331319 || exit 1; \
332320 done
333 curses.o curses.lo: curses.c config.h mtr-curses.h display.h net.h dns.h
334 display.o display.lo: display.c config.h display.h mtr-curses.h \
335 mtr-gtk.h report.h select.h
336 dns.o dns.lo: dns.c config.h
337 getopt.o getopt.lo: getopt.c config.h
338 getopt1.o getopt1.lo: getopt1.c config.h getopt.h
339 gtk.o gtk.lo: gtk.c config.h net.h dns.h mtr-gtk.h img/mtr_icon.xpm
340 mtr.o mtr.lo: mtr.c config.h mtr-curses.h getopt.h display.h dns.h \
341 report.h net.h
342 net.o net.lo: net.c config.h net.h
343 report.o report.lo: report.c config.h report.h net.h
344 select.o select.lo: select.c config.h display.h dns.h net.h
345
346321 info: info-recursive
347322 dvi: dvi-recursive
348323 check: all-am
379354
380355
381356 mostlyclean-generic:
382 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
357 test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
383358
384359 clean-generic:
385 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
360 test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
386361
387362 distclean-generic:
388 -rm -f Makefile $(DISTCLEANFILES)
389 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
390 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
363 rm -f Makefile $(DISTCLEANFILES)
364 rm -f config.cache config.log stamp-h stamp-h[0-9]*
365 test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
391366
392367 maintainer-clean-generic:
393 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
394 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
368 test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
369 test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
395370 mostlyclean-am: mostlyclean-hdr mostlyclean-sbinPROGRAMS \
396371 mostlyclean-compile mostlyclean-tags \
397372 mostlyclean-generic
411386 clean: clean-recursive clean-am
412387
413388 distclean: distclean-recursive distclean-am
414 -rm -f config.status
389 rm -f config.status
415390
416391 maintainer-clean: maintainer-clean-recursive maintainer-clean-am
417392 @echo "This command is intended for maintainers to use;"
418393 @echo "it deletes files that may require special tools to rebuild."
419 -rm -f config.status
394 rm -f config.status
420395
421396 .PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
422397 maintainer-clean-hdr mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \
00 WHAT'S NEW?
1
2 v0.27
3 Fixed bug that showed up on Solaris/x86.
4 Gimp mainloop now runs as it's supposed to.
5
6 v0.26
7 Added "-n" flag for numeric output.
8 fixed IP numbers displaying backwards.
9 GTK mainloop now runs at 10 packets per second.
10 - That's too much if there are only 3 hosts
11 - that's too little if there are 20 hosts.
12 -> Someone tell me how to change the "ping-timeout"
13 callback time in gtk. Can't find it in the docs.
14 The default for "hostname" is now "localhost" so that
15 you can start mtr without any arguments and later
16 fill in the host you want to trace to.
17
18 v0.25
19 Included two "raw" formats. One for separating GUI from
20 the setuid program, and one suitable for later parsing and
21 displaying. Volunteers wanted to separate the GTK
22 backend. Thanks to Bertrand Leconte for contributing
23 the format that's now called "split".
24
25 v0.24
26 Fixed number of probes. Accidentally was counted per
27 packet sent instead of per round of packets.
28
29 v0.23
30 Fixed Sparc alignment problem with statmalloc
31
32 v0.22
33 Roger has take over maintenance.
34 mtr now uses an "int" to pass options to the kernel.
35 Makes things work on Solaris and *BSD I'm told.
36 mtr doesn't fire off a flurry of packets when a new
37 second comes around. Instead they are spaced evenly
38 around the whole second. This allows people with a
39 relatively slow first link to do meaningful measurements
40 of whatever is behind that.
141
242 v0.21
343 mtr now drops root permissions after it acquires the raw
3131
3232 WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION?
3333
34 See the mtr web page at 'http://www.mkimball.org/mtr.html'.
34 See the mtr web page at
35 http://www.BitWizard.nl/mtr/
3536
3637 Subscribe to the mtr mailing list. All mtr related announcements
3738 are posted to the mtr mailing list. To subscribe, send email to
4142
4243 Bug reports and feature requests should be sent to the mtr
4344 mailing list.
45
00 SECURITY ISSUES RELATED TO MTR
1
2 You can limit mtr usage to the root user by not putting a setuid bit
3 on the mtr binary. In that case, the security implications are
4 minimal.
5
6 Or you can make mtr setuid-root, and the following applies to you....
17
28 Since mtr is installed as suid-root, some concern over security is
39 justified. Since version 0.21 of mtr, does the following two things
2026 permission to write to. The only priveledge gained is access to the
2127 raw socket descriptors, which would allow the malicious user to listen
2228 to all ICMP packets arriving at the system, and send forged packets
23 with arbitrary ncontents.
29 with arbitrary contents.
2430
2531 If you have further questions or comments about security issues,
2632 please direct them to the mtr mailing list. See README for details.
0
1 - Stuff to implement:
2
3 - Allow mtr to log the return packets, for later analysis.
4 Done: 0.25 . Todo: allow the userinterface(s) to work while
5 still logging to a file.
6
7 - Request timestamping at the remote site.
8 Andreas Fasbender has an algorithm that will allow us to
9 convert these measurements into one-way measurements, not just
10 round-trip.
11
12 - Allow mtr to also send larger packets.
13 This will enable us to get a feel for the speed of the links
14 we're traversing. (Van Jacobson was working on this His tool
15 was slow, mtr will rock with this feature.... :-)
16 (Anybody have the statistics experience to tell me how
17 to do the data analysis?)
18
19 - Allow MTR to keep on getting the icmp host unreachables, and
20 work through that. Some hosts don't answer PINGs.
21 - Auto-switch to that strategy if "host is known, but 10/10
22 pings got lost"
23
24 - The "don't probe all hosts at once" strategy can be improved a bit.
25 It should not probe more than 10 unknown hosts, but the counter need
26 not be reset at the start of the "round". This way if you probe
27 slowly (relative to the RTT time to the end host), it can probe
28 all hosts in the first "round".
29
30
31 - Bugs to fix?
32 - ?
33
0 dnl aclocal.m4 generated automatically by aclocal 1.2d
1
2 dnl Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
3 dnl This Makefile.in is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl This program is distributed in the hope that it will be useful,
8 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 dnl PARTICULAR PURPOSE.
0 dnl aclocal.m4 generated automatically by aclocal 1.2
111
122 # Do all the work for Automake. This macro actually does too much --
133 # some checks are only needed if your package does certain things.
3121 ifelse([$3],,
3222 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
3323 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
34 AC_REQUIRE([AM_SANITY_CHECK])
35 AC_REQUIRE([AC_ARG_PROGRAM])
24 AM_SANITY_CHECK
25 AC_ARG_PROGRAM
3626 dnl FIXME This is truly gross.
3727 missing_dir=`cd $ac_aux_dir && pwd`
3828 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
4030 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
4131 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
4232 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
43 AC_REQUIRE([AC_PROG_MAKE_SET])])
33 AC_PROG_MAKE_SET])
4434
4535
4636 # serial 1
6757 # directory).
6858 if (
6959 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
70 if test "[$]*" = "X"; then
60 if test "$@" = "X"; then
7161 # -L didn't work.
7262 set X `ls -t $srcdir/configure conftestfile`
7363 fi
74 if test "[$]*" != "X $srcdir/configure conftestfile" \
75 && test "[$]*" != "X conftestfile $srcdir/configure"; then
76
77 # If neither matched, then we have a broken ls. This can happen
78 # if, for instance, CONFIG_SHELL is bash and it inherits a
79 # broken ls alias from the environment. This has actually
80 # happened. Such a system could not be considered "sane".
81 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
82 alias in your environment])
83 fi
84
8564 test "[$]2" = conftestfile
8665 )
8766 then
173152 main ()
174153 {
175154 int major, minor, micro;
155 char *tmp_version;
176156
177157 system ("touch conf.gtktest");
178158
179 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
159 /* HP/UX 9 (%@#!) writes to sscanf strings */
160 tmp_version = g_strdup("$min_gtk_version");
161 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
180162 printf("%s, bad version string\n", "$min_gtk_version");
181163 exit(1);
182164 }
605605
606606 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
607607
608
609 PACKAGE=mtr
610
611 VERSION=0.28
612
613 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
614 { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
615 fi
616 cat >> confdefs.h <<EOF
617 #define PACKAGE "$PACKAGE"
618 EOF
619
620 cat >> confdefs.h <<EOF
621 #define VERSION "$VERSION"
622 EOF
623
608624 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
609 echo "configure:611: checking whether build environment is sane" >&5
625 echo "configure:627: checking whether build environment is sane" >&5
610626 # Just in case
611627 sleep 1
612628 echo timestamp > conftestfile
617633 # directory).
618634 if (
619635 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
620 if test "$*" = "X"; then
636 if test "" = "X"; then
621637 # -L didn't work.
622638 set X `ls -t $srcdir/configure conftestfile`
623639 fi
624 if test "$*" != "X $srcdir/configure conftestfile" \
625 && test "$*" != "X conftestfile $srcdir/configure"; then
626
627 # If neither matched, then we have a broken ls. This can happen
628 # if, for instance, CONFIG_SHELL is bash and it inherits a
629 # broken ls alias from the environment. This has actually
630 # happened. Such a system could not be considered "sane".
631 { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
632 alias in your environment" 1>&2; exit 1; }
633 fi
634
635640 test "$2" = conftestfile
636641 )
637642 then
662667 # sed with no file args requires a program.
663668 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
664669
665 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
666 echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5
667 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
668 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
669 echo $ac_n "(cached) $ac_c" 1>&6
670 else
671 cat > conftestmake <<\EOF
672 all:
673 @echo 'ac_maketemp="${MAKE}"'
674 EOF
675 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
676 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
677 if test -n "$ac_maketemp"; then
678 eval ac_cv_prog_make_${ac_make}_set=yes
679 else
680 eval ac_cv_prog_make_${ac_make}_set=no
681 fi
682 rm -f conftestmake
683 fi
684 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
685 echo "$ac_t""yes" 1>&6
686 SET_MAKE=
687 else
688 echo "$ac_t""no" 1>&6
689 SET_MAKE="MAKE=${MAKE-make}"
690 fi
691
692
693 PACKAGE=mtr
694
695 VERSION=0.21
696
697 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
698 { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
699 fi
700 cat >> confdefs.h <<EOF
701 #define PACKAGE "$PACKAGE"
702 EOF
703
704 cat >> confdefs.h <<EOF
705 #define VERSION "$VERSION"
706 EOF
707
708
709
710670 missing_dir=`cd $ac_aux_dir && pwd`
711671 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
712 echo "configure:714: checking for working aclocal" >&5
672 echo "configure:674: checking for working aclocal" >&5
713673 # Run test in a subshell; some versions of sh will print an error if
714674 # an executable is not found, even if stderr is redirected.
715675 # Redirect stdin to placate older versions of autoconf. Sigh.
722682 fi
723683
724684 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
725 echo "configure:727: checking for working autoconf" >&5
685 echo "configure:687: checking for working autoconf" >&5
726686 # Run test in a subshell; some versions of sh will print an error if
727687 # an executable is not found, even if stderr is redirected.
728688 # Redirect stdin to placate older versions of autoconf. Sigh.
735695 fi
736696
737697 echo $ac_n "checking for working automake""... $ac_c" 1>&6
738 echo "configure:740: checking for working automake" >&5
698 echo "configure:700: checking for working automake" >&5
739699 # Run test in a subshell; some versions of sh will print an error if
740700 # an executable is not found, even if stderr is redirected.
741701 # Redirect stdin to placate older versions of autoconf. Sigh.
748708 fi
749709
750710 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
751 echo "configure:753: checking for working autoheader" >&5
711 echo "configure:713: checking for working autoheader" >&5
752712 # Run test in a subshell; some versions of sh will print an error if
753713 # an executable is not found, even if stderr is redirected.
754714 # Redirect stdin to placate older versions of autoconf. Sigh.
761721 fi
762722
763723 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
764 echo "configure:766: checking for working makeinfo" >&5
724 echo "configure:726: checking for working makeinfo" >&5
765725 # Run test in a subshell; some versions of sh will print an error if
766726 # an executable is not found, even if stderr is redirected.
767727 # Redirect stdin to placate older versions of autoconf. Sigh.
773733 echo "$ac_t""missing" 1>&6
774734 fi
775735
736 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
737 echo "configure:739: checking whether ${MAKE-make} sets \${MAKE}" >&5
738 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
739 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
740 echo $ac_n "(cached) $ac_c" 1>&6
741 else
742 cat > conftestmake <<\EOF
743 all:
744 @echo 'ac_maketemp="${MAKE}"'
745 EOF
746 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
747 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
748 if test -n "$ac_maketemp"; then
749 eval ac_cv_prog_make_${ac_make}_set=yes
750 else
751 eval ac_cv_prog_make_${ac_make}_set=no
752 fi
753 rm -f conftestmake
754 fi
755 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
756 echo "$ac_t""yes" 1>&6
757 SET_MAKE=
758 else
759 echo "$ac_t""no" 1>&6
760 SET_MAKE="MAKE=${MAKE-make}"
761 fi
776762
777763
778764
784770 # Extract the first word of "gcc", so it can be a program name with args.
785771 set dummy gcc; ac_word=$2
786772 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
787 echo "configure:789: checking for $ac_word" >&5
773 echo "configure:775: checking for $ac_word" >&5
788774 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
789775 echo $ac_n "(cached) $ac_c" 1>&6
790776 else
813799 # Extract the first word of "cc", so it can be a program name with args.
814800 set dummy cc; ac_word=$2
815801 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
816 echo "configure:818: checking for $ac_word" >&5
802 echo "configure:804: checking for $ac_word" >&5
817803 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
818804 echo $ac_n "(cached) $ac_c" 1>&6
819805 else
861847 fi
862848
863849 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
864 echo "configure:866: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
850 echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
865851
866852 ac_ext=c
867853 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
871857 cross_compiling=$ac_cv_prog_cc_cross
872858
873859 cat > conftest.$ac_ext <<EOF
874 #line 876 "configure"
860 #line 862 "configure"
875861 #include "confdefs.h"
876862 main(){return(0);}
877863 EOF
878 if { (eval echo configure:880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
864 if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
879865 ac_cv_prog_cc_works=yes
880866 # If we can't run a trivial program, we are probably using a cross compiler.
881867 if (./conftest; exit) 2>/dev/null; then
895881 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
896882 fi
897883 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
898 echo "configure:900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
884 echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
899885 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
900886 cross_compiling=$ac_cv_prog_cc_cross
901887
902888 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
903 echo "configure:905: checking whether we are using GNU C" >&5
889 echo "configure:891: checking whether we are using GNU C" >&5
904890 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
905891 echo $ac_n "(cached) $ac_c" 1>&6
906892 else
909895 yes;
910896 #endif
911897 EOF
912 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
898 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
913899 ac_cv_prog_gcc=yes
914900 else
915901 ac_cv_prog_gcc=no
924910 ac_save_CFLAGS="$CFLAGS"
925911 CFLAGS=
926912 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
927 echo "configure:929: checking whether ${CC-cc} accepts -g" >&5
913 echo "configure:915: checking whether ${CC-cc} accepts -g" >&5
928914 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
929915 echo $ac_n "(cached) $ac_c" 1>&6
930916 else
953939
954940
955941 echo $ac_n "checking size of unsigned char""... $ac_c" 1>&6
956 echo "configure:958: checking size of unsigned char" >&5
942 echo "configure:944: checking size of unsigned char" >&5
957943 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char'+set}'`\" = set"; then
958944 echo $ac_n "(cached) $ac_c" 1>&6
959945 else
961947 ac_cv_sizeof_unsigned_char=1
962948 else
963949 cat > conftest.$ac_ext <<EOF
964 #line 966 "configure"
950 #line 952 "configure"
965951 #include "confdefs.h"
966952 #include <stdio.h>
967953 main()
972958 exit(0);
973959 }
974960 EOF
975 if { (eval echo configure:977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
961 if { (eval echo configure:963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
976962 then
977963 ac_cv_sizeof_unsigned_char=`cat conftestval`
978964 else
992978
993979
994980 echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6
995 echo "configure:997: checking size of unsigned short" >&5
981 echo "configure:983: checking size of unsigned short" >&5
996982 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then
997983 echo $ac_n "(cached) $ac_c" 1>&6
998984 else
1000986 ac_cv_sizeof_unsigned_short=2
1001987 else
1002988 cat > conftest.$ac_ext <<EOF
1003 #line 1005 "configure"
989 #line 991 "configure"
1004990 #include "confdefs.h"
1005991 #include <stdio.h>
1006992 main()
1011997 exit(0);
1012998 }
1013999 EOF
1014 if { (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1000 if { (eval echo configure:1002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
10151001 then
10161002 ac_cv_sizeof_unsigned_short=`cat conftestval`
10171003 else
10311017
10321018
10331019 echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6
1034 echo "configure:1036: checking size of unsigned int" >&5
1020 echo "configure:1022: checking size of unsigned int" >&5
10351021 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then
10361022 echo $ac_n "(cached) $ac_c" 1>&6
10371023 else
10391025 ac_cv_sizeof_unsigned_int=4
10401026 else
10411027 cat > conftest.$ac_ext <<EOF
1042 #line 1044 "configure"
1028 #line 1030 "configure"
10431029 #include "confdefs.h"
10441030 #include <stdio.h>
10451031 main()
10501036 exit(0);
10511037 }
10521038 EOF
1053 if { (eval echo configure:1055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1039 if { (eval echo configure:1041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
10541040 then
10551041 ac_cv_sizeof_unsigned_int=`cat conftestval`
10561042 else
10701056
10711057
10721058 echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
1073 echo "configure:1075: checking size of unsigned long" >&5
1059 echo "configure:1061: checking size of unsigned long" >&5
10741060 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then
10751061 echo $ac_n "(cached) $ac_c" 1>&6
10761062 else
10781064 ac_cv_sizeof_unsigned_long=4
10791065 else
10801066 cat > conftest.$ac_ext <<EOF
1081 #line 1083 "configure"
1067 #line 1069 "configure"
10821068 #include "confdefs.h"
10831069 #include <stdio.h>
10841070 main()
10891075 exit(0);
10901076 }
10911077 EOF
1092 if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1078 if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
10931079 then
10941080 ac_cv_sizeof_unsigned_long=`cat conftestval`
10951081 else
11101096
11111097
11121098 echo $ac_n "checking for initscr""... $ac_c" 1>&6
1113 echo "configure:1115: checking for initscr" >&5
1099 echo "configure:1101: checking for initscr" >&5
11141100 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
11151101 echo $ac_n "(cached) $ac_c" 1>&6
11161102 else
11171103 cat > conftest.$ac_ext <<EOF
1118 #line 1120 "configure"
1104 #line 1106 "configure"
11191105 #include "confdefs.h"
11201106 /* System header to define __stub macros and hopefully few prototypes,
11211107 which can conflict with char initscr(); below. */
11381124
11391125 ; return 0; }
11401126 EOF
1141 if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1127 if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11421128 rm -rf conftest*
11431129 eval "ac_cv_func_initscr=yes"
11441130 else
11561142 else
11571143 echo "$ac_t""no" 1>&6
11581144 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
1159 echo "configure:1161: checking for initscr in -lncurses" >&5
1145 echo "configure:1147: checking for initscr in -lncurses" >&5
11601146 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
11611147 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11621148 echo $ac_n "(cached) $ac_c" 1>&6
11641150 ac_save_LIBS="$LIBS"
11651151 LIBS="-lncurses $LIBS"
11661152 cat > conftest.$ac_ext <<EOF
1167 #line 1169 "configure"
1153 #line 1155 "configure"
11681154 #include "confdefs.h"
11691155 /* Override any gcc2 internal prototype to avoid an error. */
11701156 /* We use char because int might match the return type of a gcc2
11751161 initscr()
11761162 ; return 0; }
11771163 EOF
1178 if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1164 if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11791165 rm -rf conftest*
11801166 eval "ac_cv_lib_$ac_lib_var=yes"
11811167 else
12011187 else
12021188 echo "$ac_t""no" 1>&6
12031189 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
1204 echo "configure:1206: checking for initscr in -lcurses" >&5
1190 echo "configure:1192: checking for initscr in -lcurses" >&5
12051191 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
12061192 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
12071193 echo $ac_n "(cached) $ac_c" 1>&6
12091195 ac_save_LIBS="$LIBS"
12101196 LIBS="-lcurses $LIBS"
12111197 cat > conftest.$ac_ext <<EOF
1212 #line 1214 "configure"
1198 #line 1200 "configure"
12131199 #include "confdefs.h"
12141200 /* Override any gcc2 internal prototype to avoid an error. */
12151201 /* We use char because int might match the return type of a gcc2
12201206 initscr()
12211207 ; return 0; }
12221208 EOF
1223 if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1209 if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12241210 rm -rf conftest*
12251211 eval "ac_cv_lib_$ac_lib_var=yes"
12261212 else
12581244 fi
12591245
12601246 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1261 echo "configure:1263: checking how to run the C preprocessor" >&5
1247 echo "configure:1249: checking how to run the C preprocessor" >&5
12621248 # On Suns, sometimes $CPP names a directory.
12631249 if test -n "$CPP" && test -d "$CPP"; then
12641250 CPP=
12731259 # On the NeXT, cc -E runs the code through the compiler's parser,
12741260 # not just through cpp.
12751261 cat > conftest.$ac_ext <<EOF
1276 #line 1278 "configure"
1262 #line 1264 "configure"
12771263 #include "confdefs.h"
12781264 #include <assert.h>
12791265 Syntax Error
12801266 EOF
12811267 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1282 { (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1268 { (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12831269 ac_err=`grep -v '^ *+' conftest.out`
12841270 if test -z "$ac_err"; then
12851271 :
12901276 rm -rf conftest*
12911277 CPP="${CC-cc} -E -traditional-cpp"
12921278 cat > conftest.$ac_ext <<EOF
1293 #line 1295 "configure"
1279 #line 1281 "configure"
12941280 #include "confdefs.h"
12951281 #include <assert.h>
12961282 Syntax Error
12971283 EOF
12981284 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1299 { (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1285 { (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13001286 ac_err=`grep -v '^ *+' conftest.out`
13011287 if test -z "$ac_err"; then
13021288 :
13221308 do
13231309 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13241310 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1325 echo "configure:1327: checking for $ac_hdr" >&5
1311 echo "configure:1313: checking for $ac_hdr" >&5
13261312 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
13271313 echo $ac_n "(cached) $ac_c" 1>&6
13281314 else
13291315 cat > conftest.$ac_ext <<EOF
1330 #line 1332 "configure"
1316 #line 1318 "configure"
13311317 #include "confdefs.h"
13321318 #include <$ac_hdr>
13331319 EOF
13341320 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1335 { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1321 { (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13361322 ac_err=`grep -v '^ *+' conftest.out`
13371323 if test -z "$ac_err"; then
13381324 rm -rf conftest*
13621348 do
13631349 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13641350 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1365 echo "configure:1367: checking for $ac_hdr" >&5
1351 echo "configure:1353: checking for $ac_hdr" >&5
13661352 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
13671353 echo $ac_n "(cached) $ac_c" 1>&6
13681354 else
13691355 cat > conftest.$ac_ext <<EOF
1370 #line 1372 "configure"
1356 #line 1358 "configure"
13711357 #include "confdefs.h"
13721358 #include <$ac_hdr>
13731359 EOF
13741360 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1375 { (eval echo configure:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1361 { (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13761362 ac_err=`grep -v '^ *+' conftest.out`
13771363 if test -z "$ac_err"; then
13781364 rm -rf conftest*
14001386
14011387
14021388 echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6
1403 echo "configure:1405: checking for floor in -lm" >&5
1389 echo "configure:1391: checking for floor in -lm" >&5
14041390 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'`
14051391 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14061392 echo $ac_n "(cached) $ac_c" 1>&6
14081394 ac_save_LIBS="$LIBS"
14091395 LIBS="-lm $LIBS"
14101396 cat > conftest.$ac_ext <<EOF
1411 #line 1413 "configure"
1397 #line 1399 "configure"
14121398 #include "confdefs.h"
14131399 /* Override any gcc2 internal prototype to avoid an error. */
14141400 /* We use char because int might match the return type of a gcc2
14191405 floor()
14201406 ; return 0; }
14211407 EOF
1422 if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1408 if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
14231409 rm -rf conftest*
14241410 eval "ac_cv_lib_$ac_lib_var=yes"
14251411 else
14891475 # Extract the first word of "gtk-config", so it can be a program name with args.
14901476 set dummy gtk-config; ac_word=$2
14911477 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1492 echo "configure:1494: checking for $ac_word" >&5
1478 echo "configure:1480: checking for $ac_word" >&5
14931479 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
14941480 echo $ac_n "(cached) $ac_c" 1>&6
14951481 else
15201506
15211507 min_gtk_version=1.0.0
15221508 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
1523 echo "configure:1525: checking for GTK - version >= $min_gtk_version" >&5
1509 echo "configure:1511: checking for GTK - version >= $min_gtk_version" >&5
15241510 no_gtk=""
15251511 if test "$GTK_CONFIG" = "no" ; then
15261512 no_gtk=yes
15431529 echo $ac_n "cross compiling; assumed OK... $ac_c"
15441530 else
15451531 cat > conftest.$ac_ext <<EOF
1546 #line 1548 "configure"
1532 #line 1534 "configure"
15471533 #include "confdefs.h"
15481534
15491535 #include <gtk/gtk.h>
15531539 main ()
15541540 {
15551541 int major, minor, micro;
1542 char *tmp_version;
15561543
15571544 system ("touch conf.gtktest");
15581545
1559 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
1546 /* HP/UX 9 (%@#!) writes to sscanf strings */
1547 tmp_version = g_strdup("$min_gtk_version");
1548 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
15601549 printf("%s, bad version string\n", "$min_gtk_version");
15611550 exit(1);
15621551 }
16061595 }
16071596
16081597 EOF
1609 if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1598 if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
16101599 then
16111600 :
16121601 else
16411630 CFLAGS="$CFLAGS $GTK_CFLAGS"
16421631 LIBS="$LIBS $GTK_LIBS"
16431632 cat > conftest.$ac_ext <<EOF
1644 #line 1646 "configure"
1633 #line 1635 "configure"
16451634 #include "confdefs.h"
16461635
16471636 #include <gtk/gtk.h>
16511640 return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
16521641 ; return 0; }
16531642 EOF
1654 if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1643 if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
16551644 rm -rf conftest*
16561645 echo "*** The test program compiled, but did not run. This usually means"
16571646 echo "*** that the run-time linker is not finding GTK or finding the wrong"
16961685
16971686
16981687 echo $ac_n "checking for socket""... $ac_c" 1>&6
1699 echo "configure:1701: checking for socket" >&5
1688 echo "configure:1690: checking for socket" >&5
17001689 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
17011690 echo $ac_n "(cached) $ac_c" 1>&6
17021691 else
17031692 cat > conftest.$ac_ext <<EOF
1704 #line 1706 "configure"
1693 #line 1695 "configure"
17051694 #include "confdefs.h"
17061695 /* System header to define __stub macros and hopefully few prototypes,
17071696 which can conflict with char socket(); below. */
17241713
17251714 ; return 0; }
17261715 EOF
1727 if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1716 if { (eval echo configure:1718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
17281717 rm -rf conftest*
17291718 eval "ac_cv_func_socket=yes"
17301719 else
17421731 else
17431732 echo "$ac_t""no" 1>&6
17441733 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
1745 echo "configure:1747: checking for socket in -lsocket" >&5
1734 echo "configure:1736: checking for socket in -lsocket" >&5
17461735 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
17471736 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
17481737 echo $ac_n "(cached) $ac_c" 1>&6
17501739 ac_save_LIBS="$LIBS"
17511740 LIBS="-lsocket $LIBS"
17521741 cat > conftest.$ac_ext <<EOF
1753 #line 1755 "configure"
1742 #line 1744 "configure"
17541743 #include "confdefs.h"
17551744 /* Override any gcc2 internal prototype to avoid an error. */
17561745 /* We use char because int might match the return type of a gcc2
17611750 socket()
17621751 ; return 0; }
17631752 EOF
1764 if { (eval echo configure:1766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1753 if { (eval echo configure:1755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
17651754 rm -rf conftest*
17661755 eval "ac_cv_lib_$ac_lib_var=yes"
17671756 else
17931782
17941783
17951784 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
1796 echo "configure:1798: checking for gethostbyname" >&5
1785 echo "configure:1787: checking for gethostbyname" >&5
17971786 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
17981787 echo $ac_n "(cached) $ac_c" 1>&6
17991788 else
18001789 cat > conftest.$ac_ext <<EOF
1801 #line 1803 "configure"
1790 #line 1792 "configure"
18021791 #include "confdefs.h"
18031792 /* System header to define __stub macros and hopefully few prototypes,
18041793 which can conflict with char gethostbyname(); below. */
18211810
18221811 ; return 0; }
18231812 EOF
1824 if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1813 if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
18251814 rm -rf conftest*
18261815 eval "ac_cv_func_gethostbyname=yes"
18271816 else
18391828 else
18401829 echo "$ac_t""no" 1>&6
18411830 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
1842 echo "configure:1844: checking for gethostbyname in -lnsl" >&5
1831 echo "configure:1833: checking for gethostbyname in -lnsl" >&5
18431832 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
18441833 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
18451834 echo $ac_n "(cached) $ac_c" 1>&6
18471836 ac_save_LIBS="$LIBS"
18481837 LIBS="-lnsl $LIBS"
18491838 cat > conftest.$ac_ext <<EOF
1850 #line 1852 "configure"
1839 #line 1841 "configure"
18511840 #include "confdefs.h"
18521841 /* Override any gcc2 internal prototype to avoid an error. */
18531842 /* We use char because int might match the return type of a gcc2
18581847 gethostbyname()
18591848 ; return 0; }
18601849 EOF
1861 if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1850 if { (eval echo configure:1852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
18621851 rm -rf conftest*
18631852 eval "ac_cv_lib_$ac_lib_var=yes"
18641853 else
18901879
18911880
18921881 echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6
1893 echo "configure:1895: checking for res_mkquery" >&5
1882 echo "configure:1884: checking for res_mkquery" >&5
18941883 if eval "test \"`echo '$''{'ac_cv_func_res_mkquery'+set}'`\" = set"; then
18951884 echo $ac_n "(cached) $ac_c" 1>&6
18961885 else
18971886 cat > conftest.$ac_ext <<EOF
1898 #line 1900 "configure"
1887 #line 1889 "configure"
18991888 #include "confdefs.h"
19001889 /* System header to define __stub macros and hopefully few prototypes,
19011890 which can conflict with char res_mkquery(); below. */
19181907
19191908 ; return 0; }
19201909 EOF
1921 if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1910 if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
19221911 rm -rf conftest*
19231912 eval "ac_cv_func_res_mkquery=yes"
19241913 else
19361925 else
19371926 echo "$ac_t""no" 1>&6
19381927 echo $ac_n "checking for res_mkquery in -lresolv""... $ac_c" 1>&6
1939 echo "configure:1941: checking for res_mkquery in -lresolv" >&5
1928 echo "configure:1930: checking for res_mkquery in -lresolv" >&5
19401929 ac_lib_var=`echo resolv'_'res_mkquery | sed 'y%./+-%__p_%'`
19411930 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
19421931 echo $ac_n "(cached) $ac_c" 1>&6
19441933 ac_save_LIBS="$LIBS"
19451934 LIBS="-lresolv $LIBS"
19461935 cat > conftest.$ac_ext <<EOF
1947 #line 1949 "configure"
1936 #line 1938 "configure"
19481937 #include "confdefs.h"
19491938 /* Override any gcc2 internal prototype to avoid an error. */
19501939 /* We use char because int might match the return type of a gcc2
19551944 res_mkquery()
19561945 ; return 0; }
19571946 EOF
1958 if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1947 if { (eval echo configure:1949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
19591948 rm -rf conftest*
19601949 eval "ac_cv_lib_$ac_lib_var=yes"
19611950 else
19871976
19881977
19891978 echo $ac_n "checking for herror""... $ac_c" 1>&6
1990 echo "configure:1992: checking for herror" >&5
1979 echo "configure:1981: checking for herror" >&5
19911980 if eval "test \"`echo '$''{'ac_cv_func_herror'+set}'`\" = set"; then
19921981 echo $ac_n "(cached) $ac_c" 1>&6
19931982 else
19941983 cat > conftest.$ac_ext <<EOF
1995 #line 1997 "configure"
1984 #line 1986 "configure"
19961985 #include "confdefs.h"
19971986 /* System header to define __stub macros and hopefully few prototypes,
19981987 which can conflict with char herror(); below. */
20152004
20162005 ; return 0; }
20172006 EOF
2018 if { (eval echo configure:2020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2007 if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
20192008 rm -rf conftest*
20202009 eval "ac_cv_func_herror=yes"
20212010 else
20392028 fi
20402029
20412030 echo $ac_n "checking for strerror""... $ac_c" 1>&6
2042 echo "configure:2044: checking for strerror" >&5
2031 echo "configure:2033: checking for strerror" >&5
20432032 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
20442033 echo $ac_n "(cached) $ac_c" 1>&6
20452034 else
20462035 cat > conftest.$ac_ext <<EOF
2047 #line 2049 "configure"
2036 #line 2038 "configure"
20482037 #include "confdefs.h"
20492038 /* System header to define __stub macros and hopefully few prototypes,
20502039 which can conflict with char strerror(); below. */
20672056
20682057 ; return 0; }
20692058 EOF
2070 if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2059 if { (eval echo configure:2061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
20712060 rm -rf conftest*
20722061 eval "ac_cv_func_strerror=yes"
20732062 else
00 AC_INIT(mtr.c)
1 AM_INIT_AUTOMAKE(mtr, 0.21)
1 AM_INIT_AUTOMAKE(mtr, 0.28)
22
33 AC_SUBST(GTK_OBJ)
44 AC_SUBST(CURSES_OBJ)
9191 getyx(stdscr, y, x);
9292 move(y, startstat);
9393
94 printw(" %3d%% %4d%4d %5d%5d%7d",
94 printw(" %3d%% %3d %3d %4d %4d %6d",
9595 net_percent(at),
9696 net_returned(at), net_xmit(at),
9797 net_best(at), net_avg(at), net_worst(at));
2525
2626 extern int DisplayMode;
2727
28 #ifdef NO_CURSES
29 #define mtr_curses_open()
30 #define mtr_curses_close()
31 #define mtr_curses_redraw()
32 #define mtr_curses_keyaction()
33 #endif
34
35 #ifdef NO_GTK
36 #define gtk_open()
37 #define gtk_close()
38 #define gtk_redraw()
39 #define gtk_keyaction()
40 #define gtk_loop()
41 #endif
42
2843 void display_detect(int *argc, char ***argv) {
2944 DisplayMode = DisplayReport;
3045
4560 report_open();
4661 break;
4762
48 #ifndef NO_CURSES
4963 case DisplayCurses:
5064 mtr_curses_open();
5165 break;
52 #endif
5366
54 #ifndef NO_GTK
67 case DisplaySplit: /* BL */
68 split_open();
69 break;
70
5571 case DisplayGTK:
5672 gtk_open();
5773 break;
58 #endif
5974 }
6075 }
6176
6580 report_close();
6681 break;
6782
68 #ifndef NO_CURSES
6983 case DisplayCurses:
7084 mtr_curses_close();
7185 break;
72 #endif
7386
74 #ifndef NO_GTK
87 case DisplaySplit: /* BL */
88 split_close();
89 break;
90
7591 case DisplayGTK:
7692 gtk_close();
7793 break;
78 #endif
7994 }
8095 }
8196
8297 void display_redraw() {
8398 switch(DisplayMode) {
84 #ifndef NO_CURSES
99
85100 case DisplayCurses:
86101 mtr_curses_redraw();
87102 break;
88 #endif
89103
90 #ifndef NO_GTK
104 case DisplaySplit: /* BL */
105 split_redraw();
106 break;
107
91108 case DisplayGTK:
92109 gtk_redraw();
93110 break;
94 #endif
95111 }
96112 }
97113
98114 int display_keyaction() {
99115 switch(DisplayMode) {
100 #ifndef NO_CURSES
101116 case DisplayCurses:
102117 return mtr_curses_keyaction();
103 #endif
104118
105 #ifndef NO_GTK
119 case DisplaySplit: /* BL */
120 return split_keyaction();
121
106122 case DisplayGTK:
107123 return gtk_keyaction();
108 #endif
109124 }
110125 return 0;
111126 }
127
128
129 void display_rawping(int host, int msec) {
130 switch(DisplayMode) {
131 case DisplayReport:
132 case DisplaySplit: /* BL */
133 case DisplayCurses:
134 case DisplayGTK:
135 break;
136 case DisplayRaw:
137 raw_rawping (host, msec);
138 break;
139 }
140 }
141
142
143 void display_rawhost(int host, int ip_addr) {
144 switch(DisplayMode) {
145 case DisplayReport:
146 case DisplaySplit: /* BL */
147 case DisplayCurses:
148 case DisplayGTK:
149 break;
150 case DisplayRaw:
151 raw_rawhost (host, ip_addr);
152 break;
153 }
154 }
155
112156
113157 void display_loop() {
114158 switch(DisplayMode) {
115159 case DisplayCurses:
116160 case DisplayReport:
161 case DisplaySplit: /* BL */
162 case DisplayRaw:
117163 select_loop();
118164 break;
119165
120 #ifndef NO_GTK
121166 case DisplayGTK:
122167 gtk_loop();
123168 break;
124 #endif
125169 }
126170 }
127171
1717 */
1818
1919 enum { ActionNone, ActionQuit, ActionReset };
20 enum { DisplayReport, DisplayCurses, DisplayGTK };
20 enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw };
2121
2222 /* Prototypes for display.c */
2323 void display_detect(int *argc, char ***argv);
2424 void display_open();
2525 void display_close();
2626 void display_redraw();
27 void display_rawping(int hostnum, int msec);
28 void display_rawhost(int hostnum, int ip_addr);
2729 int display_keyaction();
2830 void display_loop();
+44
-18
dns.c less more
4949
5050 /* Hmm, it seems Irix requires this */
5151 extern int errno;
52
53 /* Defined in mtr.c */
54 extern int dns;
5255
5356 /* Defines */
5457
270273
271274 /* Code */
272275
276
277 #ifdef CorruptCheck
278 #define TOT_SLACK 2
279 #define HEAD_SLACK 1
280 /* Need an entry for sparc systems here too.
281 Don't try this on Sparc for now. */
282 #else
283 #ifdef sparc
284 #define TOT_SLACK 2
285 #define HEAD_SLACK 2
286 #else
287 #define TOT_SLACK 1
288 #define HEAD_SLACK 1
289 #endif
290 #endif
291
292
273293 void *statmalloc(size_t size){
274294 void *p;
275295 size_t mallocsize;
276296 mem+= size;
277 #ifdef CorruptCheck
278 mallocsize = size + (sizeof(dword)) + sizeof(dword);
279 #else
280 mallocsize = size + (sizeof(dword));
281 #endif
297 mallocsize = size + TOT_SLACK * sizeof(dword);
298
282299 p = malloc(mallocsize);
283300 if (!p){
284301 fprintf(stderr,"malloc() of %u bytes failed: %s\n",size,strerror(errno));
291308 *(byte *)((char *)p + size + sizeof(dword) + sizeof(byte) * 2) = 0xbe;
292309 *(byte *)((char *)p + size + sizeof(dword) + sizeof(byte) * 3) = 0xef;
293310 #endif
294 p = (void *)((dword *)p + 1);
311 p = (void *)((dword *)p + HEAD_SLACK);
295312 #ifdef WipeMallocs
296313 memset(p,0xf0,size);
297314 #endif
300317
301318 void statfree(void *p){
302319 if (p){
303 if (*((dword *)p - 1) == 0){
320 if (*((dword *)p - HEAD_SLACK) == 0){
304321 fprintf(stderr,"ERROR: Attempt to free pointer twice.\n");
305322 *(int*)0=0;
306323 exit(-1);
307324 } else {
308 if (*((dword *)p - 1) > 8192){
325 if (*((dword *)p - HEAD_SLACK) > 8192){
309326 fprintf(stderr,"ERROR: Corrupted free() buffer. (header)\n");
310327 *(int*)0=0;
311328 exit(-1);
320337 exit(-1);
321338 }
322339 #endif
323 mem-= *((dword *)p - 1);
340 mem-= *((dword *)p - HEAD_SLACK);
324341 #ifdef WipeFrees
325 memset(p,0xfe,*((dword *)p - 1));
342 memset(p,0xfe,*((dword *)p - HEAD_SLACK));
326343 *((dword *)p - 1) = 0;
327344 #endif
328 free((dword *)p - 1);
345 free((dword *)p - HEAD_SLACK);
329346 }
330347 }
331348 }
372389
373390 char *strlongip(ip_t ip){
374391 struct in_addr a;
375 a.s_addr = ip;
392 a.s_addr = htonl(ip);
376393 return inet_ntoa(a);
377394 }
378395
429446 fprintf(stderr,"statmalloc() failed: %s\n",strerror(errno));
430447 exit(-1);
431448 }
432 bzero(rp,sizeof(struct resolve));
449 memset(rp,0, sizeof(struct resolve));
433450 return rp;
434451 }
435452
11191136 (void)istime(expireresolves->expiretime,sinterval);
11201137 }
11211138
1122 char *dns_lookup(ip_t ip){
1139 char *dns_lookup2(ip_t ip){
11231140 struct resolve *rp;
11241141 ip = htonl(ip);
11251142 if ((rp = findip(ip))){
11371154 strlongip(ip));
11381155 restell(tempstring);
11391156 }
1140 return strlongip(ip);
1157 return NULL;
11411158 }
11421159 }
1143 return strlongip(ip);
1160 return NULL;
11441161 }
11451162 if (debug)
11461163 fprintf(stderr,"Resolver: Added to new record.\n");
11521169 rp->ip = ip;
11531170 linkresolveip(rp);
11541171 sendrequest(rp,T_PTR);
1155 return strlongip(ip);
1156 }
1172 return NULL;
1173 }
1174
1175
1176 char *dns_lookup(ip_t ip){
1177 char *t;
1178
1179 if (!dns) return strlongip (ip);
1180 t = dns_lookup2 (ip);
1181 return t?t:strlongip(ip);
1182 }
2323 void dns_ack();
2424 void dns_events(double *sinterval);
2525 char *dns_lookup(int address);
26 char *dns_lookup2(int address);
2627 int dns_forward(char *name);
28 char *strlongip (int address);
00 /*
11 mtr -- a network diagnostic tool
22 Copyright (C) 1997,1998 Matt Kimball
3 Changes/additions Copyright (C) 1998 R.E.Wolff@BitWizard.nl
34
45 This program is free software; you can redistribute it and/or modify
56 it under the terms of the GNU General Public License as published by
1718 */
1819
1920 #include <config.h>
21 #include <sys/time.h>
2022
2123 #ifndef NO_GTK
2224 #include <stdlib.h>
3133
3234 extern char *Hostname;
3335 extern float WaitTime;
36 extern float DeltaTime;
37
38 static int tag;
3439
3540 void gtk_do_init(int *argc, char ***argv) {
3641 static int done = 0;
126131 if(addr != 0) {
127132 name = dns_lookup(addr);
128133 if(!name) {
129 sprintf(str, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff,
130 (addr >> 8) & 0xff, addr & 0xff);
131 name = str;
134 /* Actually this is not neccesary:
135 dns_lookup always returns a printable string */
136 name = strlongip (addr);
132137 }
133138 }
134139
244249 GtkWidget *Toolbar;
245250 GtkWidget *List;
246251
247 gtk_window_set_title(GTK_WINDOW(Window), "Matt's traceroute [v" VERSION "]");
252 gtk_window_set_title(GTK_WINDOW(Window), "My traceroute [v" VERSION "]");
248253 gtk_widget_set_usize(Window, 540, 400);
249254 gtk_container_border_width(GTK_CONTAINER(Window), 10);
250255 VBox = gtk_vbox_new(FALSE, 10);
301306 gint gtk_ping(gpointer data) {
302307 gtk_redraw();
303308 net_send_batch();
304
309 gtk_timeout_remove (tag);
310 tag = gtk_timeout_add(DeltaTime*1000, gtk_ping, NULL);
305311 return TRUE;
306312 }
307313
315321 gtk_redraw();
316322 }
317323
324
318325 void gtk_loop() {
319 gtk_timeout_add((int)(1000.0 * WaitTime), gtk_ping, NULL);
326 DeltaTime = WaitTime/10;
327 tag = gtk_timeout_add(DeltaTime*1000, gtk_ping, NULL);
320328 gdk_input_add(net_waitfd(), GDK_INPUT_READ, gtk_net_data, NULL);
321329 gdk_input_add(dns_waitfd(), GDK_INPUT_READ, gtk_dns_data, NULL);
322330
0 # Makefile.in generated automatically by automake 1.2d from Makefile.am
0 # Makefile.in generated automatically by automake 1.2 from Makefile.am
11
22 # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
33 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
4 # gives unlimited permission to copy, distribute and modify it.
115
126
137 SHELL = /bin/sh
4842 INSTALL_SCRIPT = @INSTALL_SCRIPT@
4943 transform = @program_transform_name@
5044
51 NORMAL_INSTALL = :
52 PRE_INSTALL = :
53 POST_INSTALL = :
54 NORMAL_UNINSTALL = :
55 PRE_UNINSTALL = :
56 POST_UNINSTALL = :
45 NORMAL_INSTALL = true
46 PRE_INSTALL = true
47 POST_INSTALL = true
48 NORMAL_UNINSTALL = true
49 PRE_UNINSTALL = true
50 POST_UNINSTALL = true
5751 CC = @CC@
5852 CURSES_OBJ = @CURSES_OBJ@
5953 GTK_CFLAGS = @GTK_CFLAGS@
124118
125119
126120 mostlyclean-generic:
127 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
121 test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
128122
129123 clean-generic:
130 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
124 test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
131125
132126 distclean-generic:
133 -rm -f Makefile $(DISTCLEANFILES)
134 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
135 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
127 rm -f Makefile $(DISTCLEANFILES)
128 rm -f config.cache config.log stamp-h stamp-h[0-9]*
129 test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
136130
137131 maintainer-clean-generic:
138 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
139 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
132 test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
133 test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
140134 mostlyclean: mostlyclean-generic
141135
142136 clean: clean-generic mostlyclean
143137
144138 distclean: distclean-generic clean
145 -rm -f config.status
139 rm -f config.status
146140
147141 maintainer-clean: maintainer-clean-generic distclean
148142 @echo "This command is intended for maintainers to use;"
2323 ]
2424 [\c
2525 .B \-\-curses\c
26 ]
27 [\c
28 .B \-\-split\c
29 ]
30 [\c
31 .B \-\-raw\c
32 ]
33 [\c
34 .B \-\-no-dns\c
2635 ]
2736 [\c
2837 .B \-\-gtk\c
92101 .B mtr
93102 generates a significant amount of network traffic. Using
94103 .B mtr
95 at to measure the quality of your network may result in decreased
104 to measure the quality of your network may result in decreased
96105 network performance.
97106
98107 .TP
117126 interface (if available).
118127
119128 .TP
129 .B \-n
130 .TP
131 .B \-\-no-dns
132 .br
133 Use this option to force
134 .B mtr
135 to display numeric IP numbers and not try to resolve the
136 host names.
137
138 .TP
120139 .B \-g
121140 .TP
122141 .B \-\-gtk
131150 for more information about GTK+.
132151
133152 .TP
153 .B \-s
154 .TP
155 .B \-\-split
156 .br
157 Use this option to set
158 .B mtr
159 to spit out a format that is suitable for a split-user interface.
160
161 .TP
162 .B \-l
163 .TP
164 .B \-\-raw
165 .br
166 Use this option to tell
167 .B mtr
168 to use the raw output format. This format is better suited for
169 archival of the measurement results. It could be parsed to
170 be presented into any of the other display methods.
171
172 .TP
134173 .B \-i\ SECONDS
135174 .TP
136175 .B \-\-interval\ SECONDS
152191
153192 .PP
154193 For the latest version, see the mtr web page at
155 .BR http://www.mkimball.org/mtr.html .
194 .BR http://www.bitwizard.nl/mtr/ .
156195
157196 .PP
158197 Subscribe to the mtr mailing list. All mtr related announcements
+32
-12
mtr.c less more
3636 int MaxPing = 16;
3737 float WaitTime = 1.0;
3838 char *Hostname = NULL;
39 int dns = 1;
3940
4041 void parse_arg(int argc, char **argv) {
4142 int opt;
4748 { "curses", 0, 0, 't' },
4849 { "gtk", 0, 0, 'g' },
4950 { "interval", 1, 0, 'i' },
51 { "no-dns", 0, 0, 'n' },
52 { "split", 0, 0, 's' }, /* BL */
53 { "raw", 0, 0, 'l' },
5054 { 0, 0, 0, 0 }
5155 };
5256
5357 opt = 0;
5458 while(1) {
55 opt = getopt_long(argc, argv, "hvrc:tli:", long_options, NULL);
59 opt = getopt_long(argc, argv, "hvrc:tklnsi:", long_options, NULL);
5660 if(opt == -1)
5761 break;
5862
7579 case 'g':
7680 DisplayMode = DisplayGTK;
7781 break;
82 case 's': /* BL */
83 DisplayMode = DisplaySplit;
84 break;
85 case 'l':
86 DisplayMode = DisplayRaw;
87 break;
88 case 'n':
89 dns = 0;
90 break;
7891 case 'i':
7992 WaitTime = atof(optarg);
8093 if (WaitTime <= 0.0) {
8194 fprintf (stderr, "mtr: wait time must be positive\n");
82 exit (-1);
95 exit (1);
8396 }
8497 break;
8598 }
98111 int main(int argc, char **argv) {
99112 int traddr;
100113 struct hostent *host;
114 int net_preopen_result;
101115
102116 /* Get the raw sockets first thing, so we can drop to user euid immediately */
103 if(net_preopen() != 0) {
104 printf("mtr: Unable to get raw socket. (Executable not suid?)\n");
105 exit(0);
106 }
117
118 net_preopen_result = net_preopen ();
107119
108120 /* Now drop to user permissions */
109121 if(seteuid(getuid())) {
110122 printf("mtr: Unable to drop permissions.\n");
111 exit(0);
123 exit(1);
112124 }
113125
114126 /* Double check, just in case */
115127 if(geteuid() != getuid()) {
116128 printf("mtr: Unable to drop permissions.\n");
117 exit(0);
129 exit(1);
118130 }
119131
120132 display_detect(&argc, &argv);
125137 exit(0);
126138 }
127139
128 if(Hostname == NULL || PrintHelp) {
129 printf("usage: %s [-hvrctli] [--help] [--version] [--report]\n"
140 if(PrintHelp) {
141 printf("usage: %s [-hvrctlis] [--help] [--version] [--report]\n"
130142 "\t\t[--report-cycles=COUNT] [--curses] [--gtk]\n"
143 "\t\t[--raw] [--split]\n" /* BL */
131144 "\t\t[--interval=SECONDS] HOSTNAME\n", argv[0]);
132145 exit(0);
133146 }
147 if (Hostname == NULL) Hostname = "localhost";
148
149 if(net_preopen_result != 0) {
150 printf("mtr: Unable to get raw socket. (Executable not suid?)\n");
151 exit(1);
152 }
153
134154
135155 host = gethostbyname(Hostname);
136156 if(host == NULL) {
139159 #else
140160 printf("mtr: error looking up \"%s\"\n", Hostname);
141161 #endif
142 exit(0);
162 exit(1);
143163 }
144164
145165 traddr = *(int *)host->h_addr;
146166
147167 if(net_open(traddr) != 0) {
148168 printf("mtr: Unable to get raw socket. (Executable not suid?)\n");
149 exit(0);
169 exit(1);
150170 }
151171
152172 display_open();
+47
-32
net.c less more
2828 #include <netinet/in.h>
2929 #include <memory.h>
3030 #include <unistd.h>
31 #include <stdio.h>
32 #include <math.h>
3133
3234 #include "net.h"
3335
34 #define MaxHost 256
36
37 extern float WaitTime, DeltaTime;
38
3539 #define MaxTransit 4
3640
3741 /* We can't rely on header files to provide this information, because
131135
132136 ip->version = 0x45;
133137 ip->tos = 0;
134 ip->len = packetsize;
138 ip->len = htons (packetsize);
135139 ip->id = 0;
136140 ip->frag = 0;
137141 ip->ttl = 127;
173177
174178 ip->version = 0x45;
175179 ip->tos = 0;
176 ip->len = packetsize;
180 ip->len = htons (packetsize);
177181 ip->id = 0;
178182 ip->frag = 0;
179183 ip->ttl = hops;
199203 int at;
200204 struct timeval now;
201205 int totmsec;
202 int msec;
203206
204207 if(data->index >= 0) {
205208 gettimeofday(&now, NULL);
209212 /* discard this data point, stats were reset after it was generated */
210213 return;
211214
212 totmsec = (now.tv_sec - data->sec) * 1000;
213 msec = now.tv_usec / 1000 - data->msec;
214 if(msec >= 0)
215 totmsec += msec;
216 else
217 totmsec = totmsec - 1000 + 1000 - data->msec + now.tv_usec / 1000;
215 totmsec = (now.tv_sec - data->sec) * 1000 +
216 ((now.tv_usec/1000) - data->msec);
218217
219218 if(host[data->index].returned <= 0) {
220219 host[data->index].best = host[data->index].worst = totmsec;
225224
226225 if(totmsec > host[data->index].worst)
227226 host[data->index].worst = totmsec;
227
228 display_rawping (data->index, totmsec);
228229
229230 host[data->index].total += totmsec;
230231 host[data->index].returned++;
235236 return;
236237
237238 host[at].addr = addr->sin_addr.s_addr;
239 display_rawhost (at, host[at].addr);
238240 }
239241 }
240242
276278 return;
277279
278280 host[at].addr = fromaddr.sin_addr.s_addr;
281 display_rawhost (at, net_addr(at));
279282 }
280283 }
281284
341344 }
342345 }
343346
344 void net_send_batch() {
345 int at;
346 int n_unknown = 10;
347
348 for(at = 0;n_unknown && (at < MaxHost); at++) {
349 if(host[at].addr == 0) {
350 net_send_query(at + 1);
351 n_unknown--;
352 } else {
353 net_send_ping(at);
354 }
355
356 if(host[at].addr == remoteaddress.sin_addr.s_addr) {
357 break;
358 }
359 }
360 }
347
348
349 int net_send_batch() {
350 static int n_unknown = 10;
351 static int at;
352
353 if(host[at].addr == 0) {
354 net_send_query(at + 1);
355 n_unknown--;
356 } else {
357 net_send_ping(at);
358 }
359
360 if ((host[at].addr == remoteaddress.sin_addr.s_addr) ||
361 (n_unknown == 0)) {
362 DeltaTime = WaitTime / (float) (at+1);
363 at = 0;
364 n_unknown = 10;
365 return 1;
366 }
367
368 at++;
369 return 0;
370 }
371
361372
362373 int net_preopen() {
363 char trueopt = 1;
374 int trueopt = 1;
364375
365376 sendsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
366 if(sendsock == -1)
377 if(sendsock < 0)
367378 return -1;
368379
369380 #ifdef IP_HDRINCL
370381 /* FreeBSD wants this to avoid sending out packets with protocol type RAW
371382 to the network. */
372 if(setsockopt(sendsock, 0, IP_HDRINCL, &trueopt, sizeof(trueopt)))
383 if(setsockopt(sendsock, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt)))
384 {
385 perror("setsockopt(IP_HDRINCL,1)");
373386 return -1;
387 }
374388 #endif
375389
376390 recvsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
377 if(recvsock == -1)
378 return -1;
391 if(recvsock < 0)
392 return -1;
379393
380394 return 0;
381395 }
399413 remoteaddress.sin_family = AF_INET;
400414 remoteaddress.sin_addr.s_addr = addr;
401415
416 net_reset ();
402417 net_send_batch();
403418 }
404419
3131 int net_best(int at);
3232 int net_worst(int at);
3333 int net_avg(int at);
34 void net_send_batch();
34 int net_send_batch();
3535 void net_end_transit();
3636
3737 /* Added by Brian Casey, December 1997 bcasey@imagiware.com*/
4040 int net_transit(int at);
4141
4242
43 #define MaxHost 256
0 /*
1 mtr -- a network diagnostic tool
2 Copyright (C) 1998 R.E.Wolff@BitWizard.nl
3
4 raw.c -- raw output (for logging for later analysis)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #include <ctype.h>
22 #include <stdlib.h>
23 #include <stdio.h>
24
25
26 #include "raw.h"
27 #include "net.h"
28 #include "dns.h"
29
30 static int havename[MaxHost];
31
32 static char *addr_to_str(int addr)
33 {
34 static char buf[20];
35
36 sprintf (buf, "%d.%d.%d.%d",
37 (addr >> 0) & 0xff,
38 (addr >> 8) & 0xff,
39 (addr >> 16) & 0xff,
40 (addr >> 24) & 0xff);
41 return buf;
42 }
43
44
45 void raw_rawping (int host, int msec)
46 {
47 char *name;
48
49 if (!havename[host]) {
50 name = dns_lookup2(net_addr(host));
51 if (name) {
52 havename[host]++;
53 printf ("d %d %s\n", host, name);
54 }
55 }
56 printf ("p %d %d\n", host, msec);
57 }
58
59
60 void raw_rawhost (int host, int ip_addr)
61 {
62 printf ("h %d %s\n", host, addr_to_str (ip_addr));
63 }
64
65
66
67
0 /*
1 mtr -- a network diagnostic tool
2 Copyright (C) 1998 R.E.Wolff@BitWizard.nl
3
4 raw.h -- raw output (for logging for later analysis)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* Prototypes for raw.c */
22 void raw_rawping(int host, int msec);
23 void raw_rawhost(int host, int addr);
2727 #include "report.h"
2828 #include "net.h"
2929
30 extern int dns;
31
3032 void report_open() {
3133 printf("%-40s LOSS RCVD SENT BEST AVG WORST\n", "HOST");
3234 fflush(stdout);
4850 sprintf(name, "???");
4951 } else {
5052 haddr = htonl(addr);
51 host = gethostbyaddr((char *)&haddr, sizeof(int), AF_INET);
53 host = dns?gethostbyaddr((char *)&haddr, sizeof(int), AF_INET):NULL;
5254
53 if(host != NULL) {
55 if (host != NULL) {
5456 strncpy(name, host->h_name, 80);
5557 name[80] = 0;
5658 } else {
3131 extern int Interactive;
3232 extern int MaxPing;
3333 extern float WaitTime;
34 float DeltaTime;
3435 double dnsinterval;
36
37 static struct timeval intervaltime;
3538
3639 void select_loop() {
3740 fd_set readfd;
3942 int action, maxfd;
4043 int dnsfd, netfd;
4144 int NumPing;
42 struct timeval lasttime, thistime, selecttime, intervaltime;
45 struct timeval lasttime, thistime, selecttime;
46 float wt;
4347
4448 NumPing = 0;
4549 anyset = 0;
4650 gettimeofday(&lasttime, NULL);
47 intervaltime.tv_sec = (int)WaitTime;
48 intervaltime.tv_usec = 1000000.0 * (WaitTime - floor(WaitTime));
51 DeltaTime = WaitTime/10;
4952
5053 while(1) {
54 intervaltime.tv_sec = DeltaTime;
55 intervaltime.tv_usec = 1000000 *( DeltaTime - floor (DeltaTime));
56
5157 FD_ZERO(&readfd);
5258
5359 maxfd = 0;
8490 lasttime = thistime;
8591 if(NumPing >= MaxPing && !Interactive)
8692 break;
87 NumPing++;
88 net_send_batch();
93 if (net_send_batch())
94 NumPing++;
8995 }
9096
9197 selecttime.tv_usec = (thistime.tv_usec - lasttime.tv_usec);
0 /*
1 mtr -- a network diagnostic tool
2 Copyright (C) 1997 Matt Kimball
3
4 split.c -- raw output (for inclusion in KDE Network Utilities or others
5 GUI based tools)
6 Copyright (C) 1998 Bertrand Leconte <B.Leconte@mail.dotcom.fr>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #include <ctype.h>
24 #include <stdlib.h>
25 #include <stdio.h>
26
27 #include "display.h"
28 #include "dns.h"
29 /*
30 #include "net.h"
31 #include "split.h"
32 */
33
34
35 extern char *Hostname;
36 extern int WaitTime;
37
38 /* There is 256 hops max in the IP header (coded with a byte) */
39 #define MAX_LINE_COUNT 256
40 #define MAX_LINE_SIZE 256
41
42 char Lines[MAX_LINE_COUNT][MAX_LINE_SIZE];
43 int LineCount;
44
45
46 #define DEBUG 0
47
48 void
49 split_redraw() {
50 int max;
51 int at;
52 int addr;
53 char *name;
54 char newLine[MAX_LINE_SIZE];
55 int i;
56
57 #if DEBUG
58 fprintf(stderr, "split_redraw()\n");
59 #endif
60
61 /*
62 * If there is less lines than last time, we delete them
63 * TEST THIS PLEASE
64 */
65 max = net_max();
66 for (i=LineCount; i>max; i--) {
67 printf("-%d\n", i);
68 LineCount--;
69 }
70
71 /*
72 * For each line, we compute the new one and we compare it to the old one
73 */
74 for(at = 0; at < max; at++) {
75 addr = net_addr(at);
76
77 if(addr != 0) {
78 name = dns_lookup(addr);
79 if(name != NULL) {
80 /* May be we should test name's length */
81 sprintf(newLine, "%s %d %d %d %d %d %d", name,
82 net_percent(at),
83 net_returned(at), net_xmit(at),
84 net_best(at), net_avg(at), net_worst(at));
85 } else {
86 sprintf(newLine, "%d.%d.%d.%d %d %d %d %d %d %d",
87 (addr >> 24) & 0xff, (addr >> 16) & 0xff,
88 (addr >> 8) & 0xff, addr & 0xff,
89 net_percent(at),
90 net_returned(at), net_xmit(at),
91 net_best(at), net_avg(at), net_worst(at));
92 }
93 } else {
94 sprintf(newLine, "???");
95 }
96
97 if (strcmp(newLine, Lines[at]) == 0) {
98 /* The same, so do nothing */
99 #if DEBUG
100 printf("SAME LINE\n");
101 #endif
102 } else {
103 printf("%d %s\n", at+1, newLine);
104 fflush(stdout);
105 strcpy(Lines[at], newLine);
106 if (LineCount < (at+1)) {
107 LineCount = at+1;
108 }
109 }
110 }
111 }
112
113 void
114 split_open() {
115 int i;
116 #if DEBUG
117 printf("split_open()\n");
118 #endif
119 LineCount = -1;
120 for (i=0; i<MAX_LINE_COUNT; i++) {
121 strcpy(Lines[i], "???");
122 }
123 }
124
125 void
126 split_close() {
127 #if DEBUG
128 printf("split_close()\n");
129 #endif
130 }
131
132 int
133 split_keyaction() {
134 char c = getch();
135
136 #if DEBUG
137 printf("split_keyaction()\n");
138 #endif
139 if(tolower(c) == 'q')
140 return ActionQuit;
141 if(c==3)
142 return ActionQuit;
143 if(tolower(c) == 'r')
144 return ActionReset;
145
146 return 0;
147 }
0 /*
1 mtr -- a network diagnostic tool
2
3 split.h -- raw output (for inclusion in KDE Network Utilities)
4 Copyright (C) 1998 Bertrand Leconte <B.Leconte@mail.dotcom.fr>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* Prototypes for split.c */
22 void split_open();
23 void split_close();
24 void split_redraw();
25 int split_keyaction();