diff -ur mtr-0.28/AUTHORS mtr-0.29/AUTHORS --- mtr-0.28/AUTHORS Sun Nov 1 00:20:18 1998 +++ mtr-0.29/AUTHORS Wed Mar 3 00:56:47 1999 @@ -10,9 +10,26 @@ Thanks to everyone who has provided feedback on mtr. Thanks especially to those of you who have sent code: + (Reverse alphabetical order) + + Juha Takala, + David Sward (sward@clark.net), + Andrew Stesin, + Aaron Scarisbrick, + Russell Nelson, + Alexander V. Lukyanov, + Charles Levert, + Bertrand Leconte, + Anand Kumria, + Adam Kramer (l3zqc@qcunix1.acc.qc.edu), + Simon Kirby, + Christophe Kalt, + Mircea Damian, + Brian Casey, - Brian Casey, Mircea Damian, Christophe Kalt, Simon Kirby, - Anand Kumria, Bertrand Leconte, Charles Levert, Alexander - V. Lukyanov, Russell Nelson, Aaron Scarisbrick, Andrew - Stesin, Juha Takala. and anyone who has slipped through the cracks of my mail file. + +Authors: If you want your Email mentioned here, send it to me. + If you don't want your Email mentioned here, tell me. + + -- REW diff -ur mtr-0.28/Makefile.in mtr-0.29/Makefile.in --- mtr-0.28/Makefile.in Mon Nov 2 10:47:45 1998 +++ mtr-0.29/Makefile.in Mon Jan 11 23:37:34 1999 @@ -1,8 +1,14 @@ -# Makefile.in generated automatically by automake 1.2 from Makefile.am +# Makefile.in generated automatically by automake 1.3 from Makefile.am -# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. SHELL = /bin/sh @@ -26,6 +32,8 @@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -43,12 +51,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : CC = @CC@ CURSES_OBJ = @CURSES_OBJ@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -100,7 +108,8 @@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -MANS = mtr.8 +man8dir = $(mandir)/man8 +MANS = $(man_MANS) NROFF = nroff DIST_COMMON = README AUTHORS COPYING INSTALL Makefile.am Makefile.in \ @@ -115,14 +124,14 @@ SOURCES = $(mtr_SOURCES) $(EXTRA_mtr_SOURCES) OBJECTS = $(mtr_OBJECTS) -default: all +all: all-recursive-am all-am .SUFFIXES: -.SUFFIXES: .c .o -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -135,6 +144,7 @@ cd $(srcdir) && $(AUTOCONF) config.h: stamp-h + @: stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ @@ -150,14 +160,14 @@ clean-hdr: distclean-hdr: - rm -f config.h + -rm -f config.h maintainer-clean-hdr: mostlyclean-sbinPROGRAMS: clean-sbinPROGRAMS: - test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) distclean-sbinPROGRAMS: @@ -165,51 +175,81 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(sbindir) + $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(sbindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_PROGRAM) $$p $(sbindir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; \ done uninstall-sbinPROGRAMS: - $(NORMAL_UNINSTALL) + @$(NORMAL_UNINSTALL) list='$(sbin_PROGRAMS)'; for p in $$list; do \ - rm -f $(sbindir)/`echo $$p|sed '$(transform)'`; \ + rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ done .c.o: $(COMPILE) -c $< +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + mostlyclean-compile: - rm -f *.o core + -rm -f *.o core *.core clean-compile: distclean-compile: - rm -f *.tab.c + -rm -f *.tab.c maintainer-clean-compile: mtr: $(mtr_OBJECTS) $(mtr_DEPENDENCIES) @rm -f mtr $(LINK) $(mtr_LDFLAGS) $(mtr_OBJECTS) $(mtr_LDADD) $(LIBS) -install-man: $(MANS) - $(NORMAL_INSTALL) - $(mkinstalldirs) $(mandir)/man8 - @sect=8; \ - inst=`echo "mtr" | sed '$(transform)'`.8; \ - if test -f $(srcdir)/mtr.8; then file=$(srcdir)/mtr.8; \ - else file=mtr.8; fi; \ - echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \ - $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst -uninstall-man: - $(NORMAL_UNINSTALL) - inst=`echo "mtr" | sed '$(transform)'`.8; \ - rm -f $(mandir)/man8/$$inst +install-man8: + $(mkinstalldirs) $(DESTDIR)$(man8dir) + @list='$(man8_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + done +uninstall-man8: + @list='$(man8_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ + rm -f $(DESTDIR)$(man8dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) install-man8 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) uninstall-man8 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -224,7 +264,7 @@ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ - for subdir in $(SUBDIRS); do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ @@ -234,7 +274,9 @@ mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ - rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + done; \ for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ @@ -248,24 +290,29 @@ tags: TAGS -ID: $(HEADERS) $(SOURCES) - here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS) +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ done; \ - test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: - rm -f TAGS ID + -rm -f TAGS ID maintainer-clean-tags: @@ -276,7 +323,7 @@ # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - rm -rf $(distdir) + -rm -rf $(distdir) GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst @@ -289,20 +336,20 @@ && $(MAKE) install \ && $(MAKE) installcheck \ && $(MAKE) dist - rm -rf $(distdir) + -rm -rf $(distdir) @echo "========================"; \ echo "$(distdir).tar.gz is ready for distribution"; \ echo "========================" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) - rm -rf $(distdir) + -rm -rf $(distdir) distdir: $(DISTFILES) - rm -rf $(distdir) + -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ @@ -311,12 +358,12 @@ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done - for subdir in $(SUBDIRS); do \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + for subdir in $(SUBDIRS); do \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ done info: info-recursive @@ -346,28 +393,26 @@ uninstall: uninstall-recursive uninstall-am -all: all-recursive-am all-am - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: installdirs-recursive - $(mkinstalldirs) $(sbindir) $(mandir)/man8 + $(mkinstalldirs) $(DATADIR)$(sbindir) $(DESTDIR)$(mandir)/man8 mostlyclean-generic: - test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - rm -f Makefile $(DISTCLEANFILES) - rm -f config.cache config.log stamp-h stamp-h[0-9]* - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: - test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-hdr mostlyclean-sbinPROGRAMS \ mostlyclean-compile mostlyclean-tags \ mostlyclean-generic @@ -387,19 +432,20 @@ clean: clean-recursive clean-am distclean: distclean-recursive distclean-am - rm -f config.status + -rm -f config.status maintainer-clean: maintainer-clean-recursive maintainer-clean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f config.status + -rm -f config.status -.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \ -maintainer-clean-hdr mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \ -clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS clean-sbinPROGRAMS \ +maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ install-sbinPROGRAMS mostlyclean-compile distclean-compile \ -clean-compile maintainer-clean-compile install-man uninstall-man \ -install-data-recursive uninstall-data-recursive install-exec-recursive \ +clean-compile maintainer-clean-compile install-man8 uninstall-man8 \ +install-man uninstall-man install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ diff -ur mtr-0.28/NEWS mtr-0.29/NEWS --- mtr-0.28/NEWS Mon Nov 2 10:24:29 1998 +++ mtr-0.29/NEWS Wed Mar 3 00:59:33 1999 @@ -1,5 +1,17 @@ WHAT'S NEW? + v0.29 Lots of stuff. + Neato overview display by David Sward. + FreeBSD does wrong in the kernel the same that Solaris/x86 (see + note for 0.27 does right. It forces mtr to send bad packets.... + Adjusted "not too much at once" algorithm. Now probing + continues as long as not more than 5 hosts are unknown. + Returning packets usually allow us to do the first sweep + in one go. + + + v0.28 DNS lookups are now suppressed if you don't want them. + v0.27 Fixed bug that showed up on Solaris/x86. Gimp mainloop now runs as it's supposed to. diff -ur mtr-0.28/README mtr-0.29/README --- mtr-0.28/README Sun Nov 1 00:20:18 1998 +++ mtr-0.29/README Mon Jan 11 23:40:34 1999 @@ -15,7 +15,10 @@ INSTALLING - To begin mtr, first use the included configure script: + Slightly more hints are in the file INSTALL. If this doesn't work + you could try reading that too.... + + To begin compiling mtr, first use the included configure script: ./configure @@ -30,6 +33,18 @@ Note that mtr must be suid-root because it requires access to raw IP sockets. See SECURITY for security information. + If you want to build a version that doesn't use GTK, but if you + DO have GTK installed, you can use + + ./configure --with-gtk-prefix=/we_dont_want_gtk_so_we_use_a_name_that_certainly_doesnt_exist + + It seems the --no_gtk (whatever) doesn't work. Feel free to submit + a patch for this, I'm not that familiar with autoconf (it works for + me :-). + + + + WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION? See the mtr web page at @@ -43,4 +58,3 @@ Bug reports and feature requests should be sent to the mtr mailing list. - diff -ur mtr-0.28/TODO mtr-0.29/TODO --- mtr-0.28/TODO Sun Nov 1 00:20:19 1998 +++ mtr-0.29/TODO Wed Mar 3 01:03:13 1999 @@ -30,5 +30,24 @@ - Bugs to fix? - - ? + + - Do something useful if host couldn't be resolved. + +- Nice to have: + + - stop sending packets when a new host is getting entered. + + - 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) + + - 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! + + - Read environment variable "MTR_DEFAULTS" as a commandline before + parsing the commandline. diff -ur mtr-0.28/aclocal.m4 mtr-0.29/aclocal.m4 --- mtr-0.28/aclocal.m4 Mon Nov 2 10:47:44 1998 +++ mtr-0.29/aclocal.m4 Mon Jan 11 23:37:32 1999 @@ -1,4 +1,14 @@ -dnl aclocal.m4 generated automatically by aclocal 1.2 +dnl aclocal.m4 generated automatically by aclocal 1.3 + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -22,8 +32,8 @@ ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) -AM_SANITY_CHECK -AC_ARG_PROGRAM +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) @@ -31,7 +41,7 @@ AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_PROG_MAKE_SET]) +AC_REQUIRE([AC_PROG_MAKE_SET])]) # serial 1 @@ -58,10 +68,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$@" = "X"; then + if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + test "[$]2" = conftestfile ) then diff -ur mtr-0.28/config.h.in mtr-0.29/config.h.in --- mtr-0.28/config.h.in Sun Nov 1 00:20:19 1998 +++ mtr-0.29/config.h.in Thu Jan 14 11:58:53 1999 @@ -43,6 +43,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_XTI_H +/* Define if you have the bind library (-lbind). */ +#undef HAVE_LIBBIND + /* Define if you have the m library (-lm). */ #undef HAVE_LIBM diff -ur mtr-0.28/configure mtr-0.29/configure --- mtr-0.28/configure Mon Nov 2 10:47:47 1998 +++ mtr-0.29/configure Mon Jan 11 23:37:35 1999 @@ -606,24 +606,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -PACKAGE=mtr - -VERSION=0.28 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:627: checking whether build environment is sane" >&5 +echo "configure:611: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -634,10 +618,21 @@ # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "" = "X"; then + if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + test "$2" = conftestfile ) then @@ -668,9 +663,54 @@ # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=mtr + +VERSION=0.29 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 -echo "configure:674: checking for working aclocal" >&5 +echo "configure:714: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -683,7 +723,7 @@ fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:687: checking for working autoconf" >&5 +echo "configure:727: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -696,7 +736,7 @@ fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:700: checking for working automake" >&5 +echo "configure:740: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -709,7 +749,7 @@ fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:713: checking for working autoheader" >&5 +echo "configure:753: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -722,7 +762,7 @@ fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:726: checking for working makeinfo" >&5 +echo "configure:766: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -734,32 +774,6 @@ echo "$ac_t""missing" 1>&6 fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:739: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi @@ -771,7 +785,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:775: checking for $ac_word" >&5 +echo "configure:789: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -800,7 +814,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:804: checking for $ac_word" >&5 +echo "configure:818: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -848,7 +862,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:866: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -858,11 +872,11 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -882,12 +896,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:891: checking whether we are using GNU C" >&5 +echo "configure:905: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -896,7 +910,7 @@ yes; #endif EOF -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 +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 ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -911,7 +925,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:915: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:929: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -940,7 +954,7 @@ echo $ac_n "checking size of unsigned char""... $ac_c" 1>&6 -echo "configure:944: checking size of unsigned char" >&5 +echo "configure:958: checking size of unsigned char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -948,7 +962,7 @@ ac_cv_sizeof_unsigned_char=1 else cat > conftest.$ac_ext < main() @@ -959,7 +973,7 @@ exit(0); } EOF -if { (eval echo configure:963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_char=`cat conftestval` else @@ -979,7 +993,7 @@ echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6 -echo "configure:983: checking size of unsigned short" >&5 +echo "configure:997: checking size of unsigned short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -987,7 +1001,7 @@ ac_cv_sizeof_unsigned_short=2 else cat > conftest.$ac_ext < main() @@ -998,7 +1012,7 @@ exit(0); } EOF -if { (eval echo configure:1002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_short=`cat conftestval` else @@ -1018,7 +1032,7 @@ echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6 -echo "configure:1022: checking size of unsigned int" >&5 +echo "configure:1036: checking size of unsigned int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1026,7 +1040,7 @@ ac_cv_sizeof_unsigned_int=4 else cat > conftest.$ac_ext < main() @@ -1037,7 +1051,7 @@ exit(0); } EOF -if { (eval echo configure:1041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_int=`cat conftestval` else @@ -1057,7 +1071,7 @@ echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6 -echo "configure:1061: checking size of unsigned long" >&5 +echo "configure:1075: checking size of unsigned long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1065,7 +1079,7 @@ ac_cv_sizeof_unsigned_long=4 else cat > conftest.$ac_ext < main() @@ -1076,7 +1090,7 @@ exit(0); } EOF -if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_long=`cat conftestval` else @@ -1097,12 +1111,12 @@ echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:1101: checking for initscr" >&5 +echo "configure:1115: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -1143,7 +1157,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:1147: checking for initscr in -lncurses" >&5 +echo "configure:1161: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1151,7 +1165,7 @@ ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1188,7 +1202,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:1192: checking for initscr in -lcurses" >&5 +echo "configure:1206: checking for initscr in -lcurses" >&5 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1196,7 +1210,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1245,7 +1259,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1249: checking how to run the C preprocessor" >&5 +echo "configure:1263: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1260,13 +1274,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1277,13 +1291,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1309,17 +1323,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1313: checking for $ac_hdr" >&5 +echo "configure:1327: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1349,17 +1363,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1353: checking for $ac_hdr" >&5 +echo "configure:1367: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1387,7 +1401,7 @@ echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1391: checking for floor in -lm" >&5 +echo "configure:1405: checking for floor in -lm" >&5 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1395,7 +1409,7 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1476,7 +1490,7 @@ # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1480: checking for $ac_word" >&5 +echo "configure:1494: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1507,7 +1521,7 @@ min_gtk_version=1.0.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1511: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:1525: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -1530,7 +1544,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1596,7 +1610,7 @@ } EOF -if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1631,7 +1645,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -1641,7 +1655,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" @@ -1686,12 +1700,12 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:1690: checking for socket" >&5 +echo "configure:1704: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -1732,7 +1746,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1736: checking for socket in -lsocket" >&5 +echo "configure:1750: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1740,7 +1754,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1783,12 +1797,12 @@ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1787: checking for gethostbyname" >&5 +echo "configure:1801: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1829,7 +1843,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1833: checking for gethostbyname in -lnsl" >&5 +echo "configure:1847: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1837,7 +1851,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1879,13 +1893,110 @@ fi +echo $ac_n "checking for res_init""... $ac_c" 1>&6 +echo "configure:1898: checking for res_init" >&5 +if eval "test \"`echo '$''{'ac_cv_func_res_init'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_init(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_res_init) || defined (__stub___res_init) +choke me +#else +res_init(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_res_init=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_res_init=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'res_init`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for res_init in -lbind""... $ac_c" 1>&6 +echo "configure:1944: checking for res_init in -lbind" >&5 +ac_lib_var=`echo bind'_'res_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbind $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: No resolver library found" 1>&2; exit 1; } +fi + +fi + + echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6 -echo "configure:1884: checking for res_mkquery" >&5 +echo "configure:1995: checking for res_mkquery" >&5 if eval "test \"`echo '$''{'ac_cv_func_res_mkquery'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_res_mkquery=yes" else @@ -1926,7 +2037,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_mkquery in -lresolv""... $ac_c" 1>&6 -echo "configure:1930: checking for res_mkquery in -lresolv" >&5 +echo "configure:2041: checking for res_mkquery in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_mkquery | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1934,7 +2045,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1977,12 +2088,12 @@ echo $ac_n "checking for herror""... $ac_c" 1>&6 -echo "configure:1981: checking for herror" >&5 +echo "configure:2092: checking for herror" >&5 if eval "test \"`echo '$''{'ac_cv_func_herror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_herror=yes" else @@ -2029,12 +2140,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2033: checking for strerror" >&5 +echo "configure:2144: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else diff -ur mtr-0.28/configure.in mtr-0.29/configure.in --- mtr-0.28/configure.in Mon Nov 2 10:47:21 1998 +++ mtr-0.29/configure.in Sat Nov 28 17:16:17 1998 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.28) +AM_INIT_AUTOMAKE(mtr, 0.29) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) @@ -36,6 +36,9 @@ AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname, , AC_MSG_ERROR(No nameservice library found))) + +AC_CHECK_FUNC(res_init, , + AC_CHECK_LIB(bind, res_init, , AC_MSG_ERROR(No resolver library found))) AC_CHECK_FUNC(res_mkquery, , AC_CHECK_LIB(resolv, res_mkquery, , AC_MSG_ERROR(No resolver library found))) diff -ur mtr-0.28/curses.c mtr-0.29/curses.c --- mtr-0.28/curses.c Sun Nov 1 00:20:19 1998 +++ mtr-0.29/curses.c Fri Feb 12 14:11:41 1999 @@ -61,8 +61,12 @@ return ActionQuit; if(c==3) return ActionQuit; + if (c==12) + return ActionClear; if(tolower(c) == 'r') return ActionReset; + if (tolower(c) == 'd') + return ActionDisplay; return 0; } @@ -92,7 +96,7 @@ getyx(stdscr, y, x); move(y, startstat); - printw(" %3d%% %3d %3d %4d %4d %6d", + printw(" %3d%% %4d %4d %4d %4d %6d", net_percent(at), net_returned(at), net_xmit(at), net_best(at), net_avg(at), net_worst(at)); @@ -106,17 +110,120 @@ } } +static double factors[] = { 0.02, 0.05, 0.08, 0.15, 0.33, 0.50, 0.80, 1.00 }; +static int scale[8]; +static int low_ms, high_ms; + +void mtr_gen_scale(void) { + int *saved, i, max, at; + int range; + + low_ms = 1000000; + high_ms = -1; + + for (i = 0; i < 8; i++) { + scale[i] = 0; + } + max = net_max(); + for (at = 0; at < max; at++) { + saved = net_saved_pings(at); + for (i = 0; i < SAVED_PINGS; i++) { + if (saved[i] < 0) continue; + if (saved[i] < low_ms) { + low_ms = saved[i]; + } + if (saved[i] > high_ms) { + high_ms = saved[i]; + } + } + } + range = high_ms - low_ms; + for (i = 0; i < 8; i++) { + scale[i] = low_ms + ((double)range * factors[i]); + } +} + +static const char* block_map = ".123abc>"; + +void mtr_print_scaled(int ms) { + int i; + + for (i = 0; i < 8; i++) { + if (ms <= scale[i]) { + printw("%c", block_map[i]); + return; + } + } + printw(">"); +} + +void mtr_fill_graph(int at) { + int* saved; + int i; + int val; + + saved = net_saved_pings(at); + for (i = 0; i < SAVED_PINGS; i++) { + if (saved[i] == -2) { + printw(" "); + } else if (saved[i] == -1) { + attron(A_BOLD); + printw("?"); + attroff(A_BOLD); + } else { + if (display_mode == 1) { + if (saved[i] > scale[6]) { + printw("%c", block_map[7]); + } else { + printw("."); + } + } else { + mtr_print_scaled(saved[i]); + } + } + } +} + +void mtr_curses_graph(int startstat) { + int max, at, addr, y, x; + char* name; + char blocks[50]; + + max = net_max(); + for (at = 0; at < max; at++) { + printw("%2d. ", at+1); + + addr = net_addr(at); + if (!addr) { + printw("???\n"); + continue; + } + + name = dns_lookup(addr); + if (name) { + printw("%s", name); + } else { + printw("%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) && 0xff, (addr >> 8) & 0xff, addr & 0xff); + } + + getyx(stdscr, y, x); + move(y, startstat); + + printw(" "); + mtr_fill_graph(at); + printw("\n"); + } +} + void mtr_curses_redraw() { int maxx, maxy; int startstat; int rowstat; + int i; erase(); getmaxyx(stdscr, maxy, maxx); - /* Modified by Brian Casey December 1997 bcasey@imagiware.com */ - startstat = maxx - 40; - rowstat = 5; attron(A_BOLD); @@ -126,6 +233,8 @@ attroff(A_BOLD); printw("Keys: "); + attron(A_BOLD); printw("D"); attroff(A_BOLD); + printw(" - Display mode "); attron(A_BOLD); printw("R"); attroff(A_BOLD); printw(" - Restart statistics "); attron(A_BOLD); printw("Q"); attroff(A_BOLD); @@ -134,14 +243,38 @@ attron(A_BOLD); mvprintw(rowstat - 1, 0, "Hostname"); - /* Modified by Brian Casey December 1997 bcasey@imagiware.com */ - mvprintw(rowstat - 2, startstat, " Packets Pings"); - mvprintw(rowstat - 1, startstat, " %%Loss Rcv Snt Best Avg Worst"); + if (display_mode == 0) { + startstat = maxx - 40; - attroff(A_BOLD); - move(rowstat, 0); + /* Modified by Brian Casey December 1997 bcasey@imagiware.com */ + mvprintw(rowstat - 2, startstat, " Packets Pings"); + mvprintw(rowstat - 1, startstat, " %%Loss Rcv Snt Best Avg Worst"); + + attroff(A_BOLD); + move(rowstat, 0); + + mtr_curses_hosts(startstat); + } else { + /* David Sward, Jan 1999 */ + startstat = maxx - 52; - mtr_curses_hosts(startstat); + mvprintw(rowstat - 1, startstat, " Last 50 pings"); + + attroff(A_BOLD); + move(rowstat, 0); + + mtr_gen_scale(); + mtr_curses_graph(startstat); + + printw("\n"); + attron(A_BOLD); + printw("Scale:"); + attroff(A_BOLD); + + for (i = 0; i < 7; i++) { + printw(" %c:%d ms", block_map[i], scale[i]); + } + } refresh(); } @@ -157,4 +290,9 @@ void mtr_curses_close() { printw("\n"); endwin(); +} + +void mtr_curses_clear() { + mtr_curses_close(); + mtr_curses_open(); } diff -ur mtr-0.28/display.c mtr-0.29/display.c --- mtr-0.28/display.c Sun Nov 1 00:20:19 1998 +++ mtr-0.29/display.c Thu Jan 14 11:56:07 1999 @@ -170,3 +170,18 @@ } } + +void display_clear() { + switch(DisplayMode) { + case DisplayCurses: + mtr_curses_clear(); + break; + case DisplayReport: + case DisplaySplit: /* BL */ + case DisplayRaw: + break; + + case DisplayGTK: + break; + } +} diff -ur mtr-0.28/display.h mtr-0.29/display.h --- mtr-0.28/display.h Sun Nov 1 00:20:19 1998 +++ mtr-0.29/display.h Thu Jan 14 11:56:07 1999 @@ -17,7 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -enum { ActionNone, ActionQuit, ActionReset }; +enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear }; enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw }; /* Prototypes for display.c */ @@ -29,3 +29,6 @@ void display_rawhost(int hostnum, int ip_addr); int display_keyaction(); void display_loop(); +void display_clear(); + +int display_mode; diff -ur mtr-0.28/gtk.c mtr-0.29/gtk.c --- mtr-0.28/gtk.c Sun Nov 1 01:01:18 1998 +++ mtr-0.29/gtk.c Wed Mar 3 00:44:04 1999 @@ -147,12 +147,14 @@ GtkWidget *Scrollarea_create() { GtkWidget *List; + GtkWidget *scroll; int count; for(count = 0; Report_Positions[count]; count++); List = GTK_WIDGET(gtk_clist_new_with_titles(count, Report_Text)); - gtk_clist_set_policy(GTK_CLIST(List), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + scroll = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); for(count = 0; Report_Positions[count + 1]; count++) { gtk_clist_set_column_width(GTK_CLIST(List), count, Report_Positions[count + 1] - @@ -162,9 +164,11 @@ for(count = 1; Report_Positions[count]; count++) { gtk_clist_set_column_justification(GTK_CLIST(List), count, GTK_JUSTIFY_RIGHT); } + gtk_container_add(GTK_CONTAINER(scroll), List); + gtk_widget_show(List); ReportBody = List; - return List; + return scroll; } void gtk_add_row(GtkWidget *List) { diff -ur mtr-0.28/img/Makefile.in mtr-0.29/img/Makefile.in --- mtr-0.28/img/Makefile.in Mon Nov 2 10:47:59 1998 +++ mtr-0.29/img/Makefile.in Mon Jan 11 23:38:01 1999 @@ -1,8 +1,14 @@ -# Makefile.in generated automatically by automake 1.2 from Makefile.am +# Makefile.in generated automatically by automake 1.3 from Makefile.am -# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. SHELL = /bin/sh @@ -26,6 +32,8 @@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -43,12 +51,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : CC = @CC@ CURSES_OBJ = @CURSES_OBJ@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -70,13 +78,13 @@ TAR = tar GZIP = --best -default: all +all: Makefile .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps img/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -111,42 +119,40 @@ uninstall: -all: Makefile - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: mostlyclean-generic: - test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: - test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - rm -f Makefile $(DISTCLEANFILES) - rm -f config.cache config.log stamp-h stamp-h[0-9]* - test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: - test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean: mostlyclean-generic clean: clean-generic mostlyclean distclean: distclean-generic clean - rm -f config.status + -rm -f config.status maintainer-clean: maintainer-clean-generic distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." -.PHONY: default tags distdir info dvi installcheck install-exec \ -install-data install uninstall all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +.PHONY: tags distdir info dvi installcheck install-exec install-data \ +install uninstall all installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -ur mtr-0.28/mtr-curses.h mtr-0.29/mtr-curses.h --- mtr-0.28/mtr-curses.h Sun Nov 1 00:20:19 1998 +++ mtr-0.29/mtr-curses.h Thu Jan 14 11:56:07 1999 @@ -22,3 +22,4 @@ void mtr_curses_close(); void mtr_curses_redraw(); int mtr_curses_keyaction(); +void mtr_curses_clear(); diff -ur mtr-0.28/mtr.c mtr-0.29/mtr.c --- mtr-0.28/mtr.c Sun Nov 1 00:20:19 1998 +++ mtr-0.29/mtr.c Thu Jan 14 11:56:07 1999 @@ -173,6 +173,7 @@ display_open(); dns_open(); + display_mode = 0; display_loop(); net_end_transit(); diff -ur mtr-0.28/net.c mtr-0.29/net.c --- mtr-0.28/net.c Mon Nov 2 10:11:36 1998 +++ mtr-0.29/net.c Tue Mar 2 18:07:43 1999 @@ -31,11 +31,13 @@ #include #include #include +#include #include "net.h" extern float WaitTime, DeltaTime; +int timestamp; #define MaxTransit 4 @@ -66,8 +68,12 @@ #define ICMP_ECHO 8 #define ICMP_ECHOREPLY 0 + +#define ICMP_TSTAMP 13 +#define ICMP_TSTAMPREPLY 14 + #define ICMP_TIME_EXCEEDED 11 - + #ifndef SOL_IP #define SOL_IP 0 #endif @@ -77,6 +83,7 @@ int ttl; int sec; int msec; + int seq; }; struct nethost { @@ -87,6 +94,7 @@ int best; int worst; int transit; + int saved[SAVED_PINGS]; }; static struct nethost host[MaxHost]; @@ -112,6 +120,9 @@ return (~sum & 0xffff); } + +static int BSDfix = 0; + void net_send_ping(int index) { char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata)]; @@ -127,6 +138,7 @@ addr.sin_addr.s_addr = host[index].addr; host[index].xmit++; host[index].transit = 1; + net_save_xmit(index); memset(packet, 0, packetsize); @@ -136,7 +148,7 @@ ip->version = 0x45; ip->tos = 0; - ip->len = htons (packetsize); + ip->len = BSDfix? packetsize: htons (packetsize); ip->id = 0; ip->frag = 0; ip->ttl = 127; @@ -144,12 +156,13 @@ ip->saddr = 0; ip->daddr = host[index].addr; - icmp->type = ICMP_ECHO; + icmp->type = timestamp?ICMP_TSTAMP:ICMP_ECHO; icmp->id = getpid(); icmp->sequence = 0; data->ttl = 0; data->index = index; + data->seq = host[index].xmit; gettimeofday(&now, NULL); data->sec = now.tv_sec; @@ -169,6 +182,8 @@ struct ICMPHeader *icmp; struct packetdata *data; int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata); + int rv; + static int first=1; memset(packet, 0, packetsize); @@ -178,7 +193,7 @@ ip->version = 0x45; ip->tos = 0; - ip->len = htons (packetsize); + ip->len = BSDfix ? packetsize: htons (packetsize); ip->id = 0; ip->frag = 0; ip->ttl = hops; @@ -196,8 +211,19 @@ icmp->checksum = checksum(icmp, packetsize - sizeof(struct IPHeader)); ip->check = checksum(ip, packetsize); - sendto(sendsock, packet, packetsize, 0, + + rv = sendto(sendsock, packet, packetsize, 0, (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); + if (first && (rv == EINVAL)) { + first = 0; + ip->len = packetsize; + rv = sendto(sendsock, packet, packetsize, 0, + (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); + if (rv >= 0) { + fprintf (stderr, "You've got a broken (FreeBSD?) system\n"); + BSDfix = 1; + } + } } void net_process_ping(struct packetdata *data, struct sockaddr_in *addr) { @@ -212,6 +238,10 @@ || (data->sec == reset.tv_sec && (1000*data->msec) < reset.tv_usec)) /* discard this data point, stats were reset after it was generated */ return; + + if (net_duplicate(data->index, data->seq)) { + return; + } totmsec = (now.tv_sec - data->sec) * 1000 + ((now.tv_usec/1000) - data->msec); @@ -231,6 +261,7 @@ host[data->index].total += totmsec; host[data->index].returned++; host[data->index].transit = 0; + net_save_return(data->index, data->seq, totmsec); } else { at = data->ttl - 1; if(at < 0 || at > MaxHost) @@ -288,10 +319,10 @@ } int net_percent(int at) { - if(host[at].xmit == 0) + if((host[at].xmit - host[at].transit) == 0) return 0; - return 100 - (100 * (host[at].returned + host[at].transit) / host[at].xmit); + return 100 - (100 * host[at].returned / (host[at].xmit - host[at].transit)); } int net_best(int at) { @@ -348,21 +379,28 @@ int net_send_batch() { - static int n_unknown = 10; static int at; + int n_unknown, i; if(host[at].addr == 0) { net_send_query(at + 1); - n_unknown--; } else { net_send_ping(at); } - + + n_unknown = 0; + + for (i=0;i 5)) { DeltaTime = WaitTime / (float) (at+1); at = 0; - n_unknown = 10; return 1; } @@ -396,6 +434,8 @@ } int net_open(int addr) { + net_reset(); + remoteaddress.sin_family = AF_INET; remoteaddress.sin_addr.s_addr = addr; @@ -420,6 +460,7 @@ void net_reset() { int at; + int i; for(at = 0; at < MaxHost; at++) { host[at].xmit = host[at].transit; @@ -427,6 +468,9 @@ host[at].total = 0; host[at].best = 0; host[at].worst = 0; + for (i=0; i= SAVED_PINGS) { + /* ehhhh - back to the future? */ + return 3; + } + if (host[at].saved[idx] == -2) { + /* say what? must be an old ping */ + return 4; + } + if (host[at].saved[idx] != -1) { + /* it's a dup */ + return 5; + } + return 0; +} + +void net_save_return(int at, int seq, int ms) { + int idx; + idx = SAVED_PINGS - (host[at].xmit - seq) - 1; + if (idx < 0) { + return; + } + host[at].saved[idx] = ms; +} diff -ur mtr-0.28/net.h mtr-0.29/net.h --- mtr-0.28/net.h Sun Nov 1 00:20:19 1998 +++ mtr-0.29/net.h Thu Jan 14 11:56:07 1999 @@ -40,5 +40,10 @@ int net_xmit(int at); int net_transit(int at); +#define SAVED_PINGS 50 +int* net_saved_pings(int at); +void net_save_xmit(int at); +void net_save_return(int at, int seq, int ms); +int net_duplicate(int at, int seq); #define MaxHost 256 diff -ur mtr-0.28/select.c mtr-0.29/select.c --- mtr-0.28/select.c Sun Nov 1 00:20:19 1998 +++ mtr-0.29/select.c Thu Jan 14 11:56:07 1999 @@ -134,6 +134,12 @@ if(action == ActionReset) net_reset(); + if (action == ActionDisplay) + display_mode = (display_mode+1) % 3; + + if (action == ActionClear) + display_clear(); + anyset = 1; } diff -ur mtr-0.28/split.c mtr-0.29/split.c --- mtr-0.28/split.c Sun Nov 1 00:20:19 1998 +++ mtr-0.29/split.c Thu Jan 14 11:59:31 1999 @@ -32,6 +32,19 @@ #include "split.h" */ +#include + +#if defined(HAVE_NCURSES_H) +# include +#elif defined(HAVE_NCURSES_CURSES_H) +# include +#elif defined(HAVE_CURSES_H) +# include +#else +# error No curses header file available +#endif + + extern char *Hostname; extern int WaitTime; .