diff -ur mtr-0.67/AUTHORS mtr-0.68/AUTHORS --- mtr-0.67/AUTHORS Thu Aug 26 09:56:53 2004 +++ mtr-0.68/AUTHORS Tue Jan 11 09:41:13 2005 @@ -25,6 +25,7 @@ Mike Simons (msimons@moria.simons-clan.com) Aaron Scarisbrick, Craig Milo Rogers (Rogers@ISI.EDU) + Antonio Querubin Russell Nelson (rn-mtr@crynwr.com) Davin Milun (milun@acm.org) Josh Martin (jmartin@columbiaservices.net) diff -ur mtr-0.67/Makefile.am mtr-0.68/Makefile.am --- mtr-0.67/Makefile.am Thu Aug 26 09:56:53 2004 +++ mtr-0.68/Makefile.am Tue Jan 11 09:10:13 2005 @@ -2,7 +2,7 @@ sbin_PROGRAMS = mtr man_MANS = mtr.8 -install-exec-am: +install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/mtr mtr_SOURCES = mtr.c \ diff -ur mtr-0.67/Makefile.in mtr-0.68/Makefile.in --- mtr-0.67/Makefile.in Sun Dec 12 17:45:24 2004 +++ mtr-0.68/Makefile.in Tue Jan 11 09:37:48 2005 @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am +# Makefile.in generated automatically by automake 1.5 from Makefile.am. -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,6 +11,7 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ SHELL = @SHELL@ @@ -31,13 +33,9 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . ACLOCAL = @ACLOCAL@ @@ -46,11 +44,11 @@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : @@ -68,7 +66,6 @@ GTK_LIBS = @GTK_LIBS@ GTK_OBJ = @GTK_OBJ@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ @@ -82,9 +79,20 @@ sbin_PROGRAMS = mtr man_MANS = mtr.8 -mtr_SOURCES = mtr.c net.c net.h dns.c dns.h raw.c raw.h split.c split.h display.c display.h report.c report.h getopt.c getopt1.c getopt.h select.c select.h mtr-curses.h mtr-gtk.h +mtr_SOURCES = mtr.c \ + net.c net.h \ + dns.c dns.h \ + raw.c raw.h \ + split.c split.h \ + display.c display.h \ + report.c report.h \ + getopt.c getopt1.c getopt.h \ + select.c select.h \ + mtr-curses.h \ + mtr-gtk.h -EXTRA_mtr_SOURCES = curses.c gtk.c +EXTRA_mtr_SOURCES = curses.c \ + gtk.c mtr_DEPENDENCIES = $(GTK_OBJ) $(CURSES_OBJ) mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ) @@ -92,138 +100,168 @@ EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist DISTCLEANFILES = *~ +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(sbin_PROGRAMS) - +CONFIG_CLEAN_FILES = +sbin_PROGRAMS = mtr$(EXEEXT) +PROGRAMS = $(sbin_PROGRAMS) + +am_mtr_OBJECTS = mtr.$(OBJEXT) net.$(OBJEXT) dns.$(OBJEXT) raw.$(OBJEXT) \ + split.$(OBJEXT) display.$(OBJEXT) report.$(OBJEXT) \ + getopt.$(OBJEXT) getopt1.$(OBJEXT) select.$(OBJEXT) +mtr_OBJECTS = $(am_mtr_OBJECTS) +mtr_LDADD = $(LDADD) -DEFS = @DEFS@ -I. -I$(srcdir) -I. +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -mtr_OBJECTS = mtr.o net.o dns.o raw.o split.o display.o report.o \ -getopt.o getopt1.o select.o -mtr_LDADD = $(LDADD) -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/curses.Po $(DEPDIR)/display.Po \ +@AMDEP_TRUE@ $(DEPDIR)/dns.Po $(DEPDIR)/getopt.Po \ +@AMDEP_TRUE@ $(DEPDIR)/getopt1.Po $(DEPDIR)/gtk.Po \ +@AMDEP_TRUE@ $(DEPDIR)/mtr.Po $(DEPDIR)/net.Po $(DEPDIR)/raw.Po \ +@AMDEP_TRUE@ $(DEPDIR)/report.Po $(DEPDIR)/select.Po \ +@AMDEP_TRUE@ $(DEPDIR)/split.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -man8dir = $(mandir)/man8 -MANS = $(man_MANS) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(mtr_SOURCES) $(EXTRA_mtr_SOURCES) NROFF = nroff -DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ -Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.h.in \ -configure configure.in install-sh missing mkinstalldirs - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) +MANS = $(man_MANS) -TAR = tar -GZIP_ENV = --best +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ + Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \ + config.h.in configure configure.in depcomp install-sh missing \ + mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) SOURCES = $(mtr_SOURCES) $(EXTRA_mtr_SOURCES) -OBJECTS = $(mtr_OBJECTS) - -all: all-redirect -.SUFFIXES: -.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 - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive -$(ACLOCAL_M4): configure.in - cd $(srcdir) && $(ACLOCAL) +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$@ $(SHELL) ./config.status -config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h stamp-hT + @echo timestamp > stamp-hT 2> /dev/null cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: $(srcdir)/stamp-h.in + @mv stamp-hT stamp-h +$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ + rm -f $(srcdir)/./stamp-h.in; \ + $(MAKE) $(srcdir)/./stamp-h.in; \ else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h +$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h + @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT + @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: + @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in distclean-hdr: -rm -f config.h - -maintainer-clean-hdr: - -mostlyclean-sbinPROGRAMS: - -clean-sbinPROGRAMS: - -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) - -distclean-sbinPROGRAMS: - -maintainer-clean-sbinPROGRAMS: - install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) - list='$(sbin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ + rm -f $(DESTDIR)$(sbindir)/$$f; \ done -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< +clean-sbinPROGRAMS: + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) +mtr$(EXEEXT): $(mtr_OBJECTS) $(mtr_DEPENDENCIES) + @rm -f mtr$(EXEEXT) + $(LINK) $(mtr_LDFLAGS) $(mtr_OBJECTS) $(mtr_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c -maintainer-clean-compile: +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/curses.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/gtk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mtr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/raw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/report.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/select.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/split.Po@am__quote@ -mtr: $(mtr_OBJECTS) $(mtr_DEPENDENCIES) - @rm -f mtr - $(LINK) $(mtr_LDFLAGS) $(mtr_OBJECTS) $(mtr_LDADD) $(LIBS) +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: -install-man8: +man8dir = $(mandir)/man8 +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man8dir) - @list='$(man8_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ @@ -233,14 +271,16 @@ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ 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 \ + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ @@ -248,16 +288,11 @@ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man8 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man8 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -265,12 +300,7 @@ # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: +$(RECURSIVE_TARGETS): @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ @@ -293,11 +323,16 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ + rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ @@ -316,84 +351,65 @@ tags: TAGS -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique $(LISP) -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ + fi; \ done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + 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: + || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -clean-tags: +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -maintainer-clean-tags: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +top_distdir = . +# Avoid unsightly `./'. distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) +GZIP_ENV = --best + distdir: $(DISTFILES) - -rm -rf $(distdir) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) mkdir $(distdir) - -chmod 777 $(distdir) @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ else \ test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ fi; \ done for subdir in $(SUBDIRS); do \ @@ -401,103 +417,154 @@ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ || exit 1; \ fi; \ done -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || (echo "Error: files left after uninstall" 1>&2; \ + exit 1) ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && $(MAKE) $(AM_MAKEFLAGS) distclean \ + && rm -f $(distdir).tar.gz \ + && (test `find . -type f -print | wc -l` -eq 0 \ + || (echo "Error: files left after distclean" 1>&2; \ + exit 1) ) + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' check-am: all-am check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive +all-am: Makefile $(PROGRAMS) $(MANS) config.h +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) -install-exec-am: install-sbinPROGRAMS +install: install-recursive install-exec: install-exec-recursive - -install-data-am: install-man install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: uninstall-sbinPROGRAMS uninstall-man -uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) $(MANS) config.h -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 - +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-sbinPROGRAMS \ - mostlyclean-compile mostlyclean-tags \ - mostlyclean-generic + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive -mostlyclean: mostlyclean-recursive +clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am -clean-am: clean-hdr clean-sbinPROGRAMS clean-compile clean-tags \ - clean-generic mostlyclean-am +dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) +distclean: distclean-recursive + -rm -f config.status config.cache config.log +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-hdr distclean-local distclean-tags -clean: clean-recursive +dvi: dvi-recursive -distclean-am: distclean-hdr distclean-sbinPROGRAMS distclean-compile \ - distclean-tags distclean-generic clean-am \ - distclean-local +dvi-am: -distclean: distclean-recursive - -rm -f config.status +info: info-recursive -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-sbinPROGRAMS \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info-am: + +install-data-am: install-man + +install-exec-am: install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-recursive + +install-man: install-man8 + +installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f config.status -.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-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 \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic -install-exec-am: +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS + +uninstall-info: uninstall-info-recursive + +uninstall-man: uninstall-man8 + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive clean-sbinPROGRAMS dist dist-all \ + distcheck distclean distclean-compile distclean-depend \ + distclean-generic distclean-hdr distclean-local \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-man8 install-recursive install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-recursive \ + tags tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-man uninstall-man8 \ + uninstall-recursive uninstall-sbinPROGRAMS + +install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/mtr distclean-local: cp Makefile.dist Makefile rm -f *.orig - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -ur mtr-0.67/NEWS mtr-0.68/NEWS --- mtr-0.67/NEWS Sun Dec 12 17:47:12 2004 +++ mtr-0.68/NEWS Tue Jan 11 09:40:47 2005 @@ -1,4 +1,10 @@ WHAT'S NEW? + v0.68 included some old patches. + included patch from Antonio Querubin for better IPV6 support + restructured some more whitespace. + added mtr.h where "global" things should go. Not finished + moving things around, but now that the infrastructure is there, + it should be easy. v0.67 Bad keyboarding by REW caused this one out the door. Sorry. No changes. v0.66 Through the Debian bugtracking system a bug report and Only in mtr-0.68: autom4te.cache diff -ur mtr-0.67/config.h.in mtr-0.68/config.h.in --- mtr-0.67/config.h.in Thu Aug 26 09:56:53 2004 +++ mtr-0.68/config.h.in Tue Jan 11 09:27:35 2005 @@ -79,6 +79,9 @@ /* Version number of package */ #undef VERSION +/* Define to enable IPv6 */ +#undef ENABLE_IPV6 + /* Find the proper type for 8 bits */ #if SIZEOF_UNSIGNED_CHAR == 1 diff -ur mtr-0.67/configure mtr-0.68/configure --- mtr-0.67/configure Sun Dec 12 17:45:25 2004 +++ mtr-0.68/configure Tue Jan 11 09:37:49 2005 @@ -19,6 +19,8 @@ ac_help="$ac_help --enable-gtk2 Compile against GTK2 instead of GTK+" ac_help="$ac_help + --disable-ipv6 Do not enable IPv6" +ac_help="$ac_help --disable-gtktest do not try to compile and run a test GTK+ program" ac_help="$ac_help --with-gtk-prefix=PFX Prefix where GTK is installed (optional)" @@ -571,7 +573,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:575: checking for a BSD compatible install" >&5 +echo "configure:577: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -624,7 +626,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:628: checking whether build environment is sane" >&5 +echo "configure:630: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftest.file @@ -695,7 +697,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:699: checking for $ac_word" >&5 +echo "configure:701: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -725,7 +727,7 @@ done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:729: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:731: 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 @@ -793,7 +795,7 @@ # Define the identity of the package. PACKAGE=mtr -VERSION=0.67 +VERSION=0.68 cat >> confdefs.h <&6 -echo "configure:856: checking for $ac_word" >&5 +echo "configure:858: 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 @@ -882,7 +884,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:886: checking for $ac_word" >&5 +echo "configure:888: 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 @@ -933,7 +935,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:937: checking for $ac_word" >&5 +echo "configure:939: 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 @@ -965,7 +967,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:969: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:971: 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. @@ -976,12 +978,12 @@ cat > conftest.$ac_ext << EOF -#line 980 "configure" +#line 982 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 @@ -1007,12 +1009,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:1011: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1013: 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:1016: checking whether we are using GNU C" >&5 +echo "configure:1018: 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 @@ -1021,7 +1023,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1025: \"$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:1027: \"$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 @@ -1040,7 +1042,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1044: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1046: 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 @@ -1079,7 +1081,7 @@ END # If we don't find an include directive, just comment out the code. echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6 -echo "configure:1083: checking for style of include used by $am_make" >&5 +echo "configure:1085: checking for style of include used by $am_make" >&5 am__include='#' am__quote= _am_result=none @@ -1113,7 +1115,7 @@ depcc="$CC" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1117: checking dependency style of $depcc" >&5 +echo "configure:1119: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1181,7 +1183,7 @@ echo $ac_n "checking size of unsigned char""... $ac_c" 1>&6 -echo "configure:1185: checking size of unsigned char" >&5 +echo "configure:1187: 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 @@ -1189,7 +1191,7 @@ ac_cv_sizeof_unsigned_char=1 else cat > conftest.$ac_ext < #include @@ -1201,7 +1203,7 @@ exit(0); } EOF -if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_char=`cat conftestval` else @@ -1221,7 +1223,7 @@ echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6 -echo "configure:1225: checking size of unsigned short" >&5 +echo "configure:1227: 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 @@ -1229,7 +1231,7 @@ ac_cv_sizeof_unsigned_short=2 else cat > conftest.$ac_ext < #include @@ -1241,7 +1243,7 @@ exit(0); } EOF -if { (eval echo configure:1245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_short=`cat conftestval` else @@ -1261,7 +1263,7 @@ echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6 -echo "configure:1265: checking size of unsigned int" >&5 +echo "configure:1267: 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 @@ -1269,7 +1271,7 @@ ac_cv_sizeof_unsigned_int=4 else cat > conftest.$ac_ext < #include @@ -1281,7 +1283,7 @@ exit(0); } EOF -if { (eval echo configure:1285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_int=`cat conftestval` else @@ -1301,7 +1303,7 @@ echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6 -echo "configure:1305: checking size of unsigned long" >&5 +echo "configure:1307: 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 @@ -1309,7 +1311,7 @@ ac_cv_sizeof_unsigned_long=4 else cat > conftest.$ac_ext < #include @@ -1321,7 +1323,7 @@ exit(0); } EOF -if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_long=`cat conftestval` else @@ -1349,7 +1351,7 @@ # We have to trust the linker not to mess things up... (It should not # pull in anything if we don't refer to anything in the lib). echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:1353: checking for tgetent in -ltermcap" >&5 +echo "configure:1355: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1357,7 +1359,7 @@ ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1397,12 +1399,12 @@ echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:1401: checking for initscr" >&5 +echo "configure:1403: 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${ac_exeext}; then +if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -1443,7 +1445,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:1447: checking for initscr in -lncurses" >&5 +echo "configure:1449: 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 @@ -1451,7 +1453,7 @@ ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1488,7 +1490,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:1492: checking for initscr in -lcurses" >&5 +echo "configure:1494: 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 @@ -1496,7 +1498,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1533,7 +1535,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lcursesX""... $ac_c" 1>&6 -echo "configure:1537: checking for initscr in -lcursesX" >&5 +echo "configure:1539: checking for initscr in -lcursesX" >&5 ac_lib_var=`echo cursesX'_'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 @@ -1541,7 +1543,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcursesX $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1595,12 +1597,12 @@ for ac_func in attron do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1599: checking for $ac_func" >&5 +echo "configure:1601: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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${ac_exeext}; then +if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1650,7 +1652,7 @@ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1654: checking how to run the C preprocessor" >&5 +echo "configure:1656: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1665,13 +1667,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:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1682,13 +1684,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:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1699,13 +1701,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1733,17 +1735,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1737: checking for $ac_hdr" >&5 +echo "configure:1739: 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:1747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1773,17 +1775,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1777: checking for $ac_hdr" >&5 +echo "configure:1779: 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:1787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1811,7 +1813,7 @@ echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1815: checking for floor in -lm" >&5 +echo "configure:1817: 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 @@ -1819,7 +1821,7 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1877,6 +1879,15 @@ fi +# Check whether --enable-ipv6 or --disable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then + enableval="$enable_ipv6" + WANTS_IPV6=$enableval +else + WANTS_IPV6=yes +fi + + if test "x$WANTS_GTK" = "xyes"; then if test "x$WANTS_GTK2" = "xyes"; then # Check whether --enable-gtktest or --disable-gtktest was given. @@ -1903,7 +1914,7 @@ # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1907: checking for $ac_word" >&5 +echo "configure:1918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1941,7 +1952,7 @@ if pkg-config --atleast-pkgconfig-version 0.7 ; then : else - echo "*** pkg-config too old; version 0.7 or better required." + echo *** pkg-config too old; version 0.7 or better required. no_gtk=yes PKG_CONFIG=no fi @@ -1951,7 +1962,7 @@ min_gtk_version=2.0.0 echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1955: checking for GTK+ - version >= $min_gtk_version" >&5 +echo "configure:1966: checking for GTK+ - version >= $min_gtk_version" >&5 if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs @@ -1986,7 +1997,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -2061,7 +2072,7 @@ } EOF -if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2094,7 +2105,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -2104,7 +2115,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:2108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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" @@ -2193,7 +2204,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:2197: checking for $ac_word" >&5 +echo "configure:2208: 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 @@ -2228,7 +2239,7 @@ min_gtk_version=1.0.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:2232: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:2243: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -2251,7 +2262,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -2329,7 +2340,7 @@ } EOF -if { (eval echo configure:2333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2364,7 +2375,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -2374,7 +2385,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:2378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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" @@ -2427,12 +2438,12 @@ fi echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:2431: checking for socket" >&5 +echo "configure:2442: 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${ac_exeext}; then +if { (eval echo configure:2470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -2473,7 +2484,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2477: checking for socket in -lsocket" >&5 +echo "configure:2488: 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 @@ -2481,7 +2492,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2524,12 +2535,12 @@ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:2528: checking for gethostbyname" >&5 +echo "configure:2539: 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${ac_exeext}; then +if { (eval echo configure:2567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -2570,7 +2581,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2574: checking for gethostbyname in -lnsl" >&5 +echo "configure:2585: 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 @@ -2578,7 +2589,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2627,12 +2638,12 @@ for ac_func in seteuid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2631: checking for $ac_func" >&5 +echo "configure:2642: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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${ac_exeext}; then +if { (eval echo configure:2670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2682,12 +2693,12 @@ # AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or setuid)) echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6 -echo "configure:2686: checking for res_mkquery" >&5 +echo "configure:2697: 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${ac_exeext}; then +if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_res_mkquery=yes" else @@ -2728,7 +2739,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_mkquery in -lbind""... $ac_c" 1>&6 -echo "configure:2732: checking for res_mkquery in -lbind" >&5 +echo "configure:2743: checking for res_mkquery in -lbind" >&5 ac_lib_var=`echo bind'_'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 @@ -2736,7 +2747,7 @@ ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2773,7 +2784,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_mkquery in -lresolv""... $ac_c" 1>&6 -echo "configure:2777: checking for res_mkquery in -lresolv" >&5 +echo "configure:2788: 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 @@ -2781,7 +2792,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2826,12 +2837,12 @@ echo $ac_n "checking for herror""... $ac_c" 1>&6 -echo "configure:2830: checking for herror" >&5 +echo "configure:2841: 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${ac_exeext}; then +if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_herror=yes" else @@ -2878,12 +2889,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2882: checking for strerror" >&5 +echo "configure:2893: 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${ac_exeext}; then +if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -2930,9 +2941,62 @@ fi +echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 +echo "configure:2946: checking for getaddrinfo" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+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 getaddrinfo(); + +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_getaddrinfo) || defined (__stub___getaddrinfo) +choke me +#else +getaddrinfo(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_getaddrinfo=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_getaddrinfo=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'getaddrinfo`\" = yes"; then + echo "$ac_t""yes" 1>&6 + if test "$WANTS_IPV6" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_IPV6 +EOF + +fi +else + echo "$ac_t""no" 1>&6 +fi + echo $ac_n "checking for C flags to get more warnings""... $ac_c" 1>&6 -echo "configure:2936: checking for C flags to get more warnings" >&5 +echo "configure:3000: checking for C flags to get more warnings" >&5 ac_save_CFLAGS="$CFLAGS" if test "x$ac_cv_prog_gcc" = "xyes" ; then warning_CFLAGS="-Wall" @@ -2941,14 +3005,14 @@ irix*) CFLAGS="$CFLAGS -fullwarn" cat > conftest.$ac_ext < int main() { printf("test"); ; return 0; } EOF -if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* warning_CFLAGS="-fullwarn" else @@ -2962,14 +3026,14 @@ if "$CC" = "acc" ; then CFLAGS="$CFLAGS -vc" cat > conftest.$ac_ext < int main() { printf("test"); ; return 0; } EOF -if { (eval echo configure:2973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* warning_CFLAGS="-vc" else diff -ur mtr-0.67/configure.in mtr-0.68/configure.in --- mtr-0.67/configure.in Sun Dec 12 17:45:24 2004 +++ mtr-0.68/configure.in Tue Jan 11 09:10:13 2005 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.67) +AM_INIT_AUTOMAKE(mtr, 0.68) AC_SUBST(GTK_OBJ) @@ -49,6 +49,10 @@ [ --enable-gtk2 Compile against GTK2 instead of GTK+], WANTS_GTK2=$enableval, WANTS_GTK2=no) +AC_ARG_ENABLE(ipv6, +[ --disable-ipv6 Do not enable IPv6], +WANTS_IPV6=$enableval, WANTS_IPV6=yes) + if test "x$WANTS_GTK" = "xyes"; then if test "x$WANTS_GTK2" = "xyes"; then AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS" @@ -88,6 +92,10 @@ AC_CHECK_FUNC(herror, , AC_DEFINE(NO_HERROR)) AC_CHECK_FUNC(strerror, , AC_DEFINE(NO_STRERROR)) +AC_CHECK_FUNC(getaddrinfo, +[if test "$WANTS_IPV6" = "yes"; then + AC_DEFINE([ENABLE_IPV6], [], [Define to enable IPv6]) +fi]) dnl Add C flags to display more warnings AC_MSG_CHECKING(for C flags to get more warnings) diff -ur mtr-0.67/curses.c mtr-0.68/curses.c --- mtr-0.67/curses.c Sun Dec 12 17:43:11 2004 +++ mtr-0.68/curses.c Tue Jan 11 09:32:11 2005 @@ -18,6 +18,7 @@ */ #include +#include #ifndef NO_CURSES #include @@ -57,6 +58,7 @@ # define getmaxyx(win,y,x) ((y) = (win)->_maxy + 1, (x) = (win)->_maxx + 1) #endif +#include "mtr.h" #include "mtr-curses.h" #include "display.h" #include "net.h" @@ -72,7 +74,7 @@ extern int bitpattern; extern int tos; extern float WaitTime; - +extern int af; void pwcenter(char *str) { @@ -86,7 +88,8 @@ printw(str); } -int mtr_curses_keyaction() + +int mtr_curses_keyaction(void) { int c = getch(); int i=0; @@ -119,7 +122,7 @@ mvprintw(3, 0, "Size Range: %d-%d, <0 random.\n", MINPACKET, MAXPACKET); move(2,20); refresh(); - while ( (c=getch ()) != '\n' && i> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff); + printw("%s", strlongip( addr ) ); } attroff(A_BOLD); @@ -330,17 +333,15 @@ /* Multi path by Min */ for (i=0; i < MAXPATH; i++ ) { addrs = net_addrs(at, i); - if (addrs == addr) continue; - if (addrs == 0) break; + if ( addrcmp( (void *) addrs, (void *) addr, af ) == 0 ) continue; + if ( addrcmp( (void *) addrs, (void *) &unspec_addr, af ) == 0 ) break; name = dns_lookup(addrs); if (! net_up(at)) attron(A_BOLD); if (name != NULL) { printw("\n %s", name); } else { - printw("\n %d.%d.%d.%d", - (addrs >> 24) & 0xff, (addrs >> 16) & 0xff, - (addrs >> 8) & 0xff, addrs & 0xff); + printw("\n %s", strlongip( addrs ) ); } attroff(A_BOLD); } @@ -354,6 +355,7 @@ move(2, 0); } + 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; @@ -388,6 +390,7 @@ } } + static const char* block_map = ".123abc>"; void mtr_print_scaled(int ms) @@ -403,6 +406,7 @@ printw(">"); } + void mtr_fill_graph(int at, int cols) { int* saved; @@ -430,9 +434,11 @@ } } + void mtr_curses_graph(int startstat, int cols) { - int max, at, addr, y, x; + int max, at, y, x; + ip_t * addr; char* name; max = net_max(); @@ -452,7 +458,7 @@ if (name) { printw("%s", name); } else { - printw("%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) && 0xff, (addr >> 8) & 0xff, addr & 0xff); + printw("%s", strlongip( addr ) ); } attroff(A_BOLD); @@ -465,7 +471,8 @@ } } -void mtr_curses_redraw() + +void mtr_curses_redraw(void) { int maxx, maxy; int startstat; @@ -488,7 +495,7 @@ pwcenter("My traceroute [v" VERSION "]"); attroff(A_BOLD); - mvprintw(1, 0, "%s (%s)", LocalHostname, inet_ntoa(*net_localaddr())); + mvprintw(1, 0, "%s (%s)", LocalHostname, net_localaddr()); printw("(tos=0x%X ", tos); printw("psize=%d ", abs(packetsize) ); printw("bitpattern=0x%02X)", (unsigned char)(abs(bitpattern))); @@ -562,7 +569,7 @@ } -void mtr_curses_open() +void mtr_curses_open(void) { initscr(); raw(); @@ -572,14 +579,14 @@ } -void mtr_curses_close() +void mtr_curses_close(void) { printw("\n"); endwin(); } -void mtr_curses_clear() +void mtr_curses_clear(void) { mtr_curses_close(); mtr_curses_open(); diff -ur mtr-0.67/display.c mtr-0.68/display.c --- mtr-0.67/display.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/display.c Tue Jan 11 09:35:21 2005 @@ -19,12 +19,17 @@ #include #include +#include +#include + +#include "mtr.h" #include "display.h" #include "mtr-curses.h" #include "mtr-gtk.h" #include "report.h" #include "select.h" #include "raw.h" +#include "dns.h" extern int DisplayMode; @@ -71,7 +76,9 @@ #endif } -void display_open() { + +void display_open(void) +{ switch(DisplayMode) { case DisplayReport: @@ -98,7 +105,9 @@ } } -void display_close() { + +void display_close(void) +{ switch(DisplayMode) { case DisplayReport: report_close(); @@ -124,7 +133,9 @@ } } -void display_redraw() { + +void display_redraw(void) +{ switch(DisplayMode) { case DisplayCurses: @@ -141,7 +152,9 @@ } } -int display_keyaction() { + +int display_keyaction(void) +{ switch(DisplayMode) { case DisplayCurses: return mtr_curses_keyaction(); @@ -156,7 +169,8 @@ } -void display_rawping(int host, int msec) { +void display_rawping(int host, int msec) +{ switch(DisplayMode) { case DisplayReport: case DisplayTXT: @@ -173,7 +187,8 @@ } -void display_rawhost(int host, int ip_addr) { +void display_rawhost(int host, ip_t *ip_addr) +{ switch(DisplayMode) { case DisplayReport: case DisplayTXT: @@ -190,7 +205,8 @@ } -void display_loop() { +void display_loop(void) +{ switch(DisplayMode) { case DisplayReport: case DisplayTXT: @@ -208,7 +224,8 @@ } -void display_clear() { +void display_clear(void) +{ switch(DisplayMode) { case DisplayCurses: mtr_curses_clear(); diff -ur mtr-0.67/display.h mtr-0.68/display.h --- mtr-0.67/display.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/display.h Tue Jan 11 09:30:58 2005 @@ -17,6 +17,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear, ActionPause, ActionResume, ActionDNS, ActionScrollDown, ActionScrollUp, }; @@ -25,16 +27,14 @@ /* Prototypes for display.c */ void display_detect(int *argc, char ***argv); -void display_open(); -void display_close(); -void display_redraw(); +void display_open(void); +void display_close(void); +void display_redraw(void); void display_rawping(int hostnum, int msec); -void display_rawhost(int hostnum, int ip_addr); -int display_keyaction(); -void display_loop(); -void display_clear(); +void display_rawhost(int hostnum, ip_t *ip_addr); +int display_keyaction(void); +void display_loop(void); +void display_clear(void); extern int display_mode; -extern int use_dns; -extern int dns; extern int display_offset; /* only used in text mode */ diff -ur mtr-0.67/dns.c mtr-0.68/dns.c --- mtr-0.67/dns.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/dns.c Tue Jan 11 09:32:42 2005 @@ -44,7 +44,9 @@ #include #include +#include "mtr.h" #include "dns.h" +#include "net.h" #ifdef NO_STRERROR extern int sys_nerr; @@ -55,6 +57,8 @@ /* Hmm, it seems Irix requires this */ extern int errno; +extern int af; + /* Defines */ #undef Debug @@ -268,10 +272,18 @@ long idseed = 0xdeadbeef; long aseed; -struct sockaddr_in from; +#ifdef ENABLE_IPV6 +struct sockaddr_storage from_sastruct; +struct sockaddr_in6 * from6 = (struct sockaddr_in6 *) &from_sastruct; +#else +struct sockaddr_in from_sastruct; +#endif + +struct sockaddr_in * from4 = (struct sockaddr_in *) &from_sastruct; +struct sockaddr * from = (struct sockaddr *) &from_sastruct; int resfd; -int fromlen = sizeof(struct sockaddr_in); +int fromlen = sizeof from_sastruct; char tempstring[16384+1+1]; char sendstring[1024+1]; @@ -413,28 +425,36 @@ } -char *strlongip(ip_t ip) +char *strlongip(ip_t * ip) { - struct in_addr a; - a.s_addr = htonl(ip); - return inet_ntoa(a); +#ifdef ENABLE_IPV6 + static char buf[INET6_ADDRSTRLEN]; + + return (char *) inet_ntop( af, ip, buf, sizeof buf ); +#else + return inet_ntoa( *ip ); +#endif } -ip_t longipstr(char *s) +int longipstr(char *s, ip_t *dst) { - return inet_addr(s); +#ifdef ENABLE_IPV6 + return inet_pton( af, s, dst ); +#else + return inet_aton( s, dst ); +#endif } -int dns_forward(char *name) +struct hostent * dns_forward(char *name) { struct hostent *host; if ((host = gethostbyname(name))) - return *(int *)host->h_addr; + return host; else - return 0; + return NULL; } @@ -468,7 +488,7 @@ strerror(errno)); exit(-1); } - localhost = longipstr("127.0.0.1"); + longipstr( "127.0.0.1", &localhost ); aseed = time(NULL) ^ (time(NULL) << 3) ^ (dword)getpid(); for (i = 0;i < BashSize;i++) { idbash[i] = NULL; @@ -497,9 +517,27 @@ } -dword getipbash(ip_t ip) +dword getipbash(ip_t * ip) { - return (dword)BashModulo(ip); + char *p = (char *) ip; + int i, len = 0; + dword bashvalue = 0; + + switch ( af ) { + case AF_INET: + len = sizeof (struct in_addr); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + len = sizeof (struct in6_addr); + break; +#endif + } + for (i = 0; i < len; i++, p++) { + bashvalue^= *p; + bashvalue+= (*p >> 1) + (bashvalue >> 1); + } + return BashModulo(bashvalue); } @@ -611,14 +649,18 @@ struct resolve *rp; dword bashnum; - bashnum = getipbash(addrp->ip); + bashnum = getipbash( &(addrp->ip) ); rp = ipbash[bashnum]; if (rp) { - while ((rp->nextip) && (addrp->ip > rp->nextip->ip)) + while ((rp->nextip) && + ( addrcmp( (void *) &(addrp->ip), + (void *) &(rp->nextip->ip), af ) > 0 )) rp = rp->nextip; - while ((rp->previousip) && (addrp->ip < rp->previousip->ip)) + while ((rp->previousip) && + ( addrcmp( (void *) &(addrp->ip), + (void *) &(rp->previousip->ip), af ) < 0 )) rp = rp->previousip; - if (rp->ip < addrp->ip) { + if ( addrcmp( (void *) &(rp->ip), (void *) &(addrp->ip), af ) < 0 ) { addrp->previousip = rp; addrp->nextip = rp->nextip; if (rp->nextip) @@ -641,7 +683,7 @@ { dword bashnum; - bashnum = getipbash(rp->ip); + bashnum = getipbash( &(rp->ip) ); if (ipbash[bashnum] == rp) ipbash[bashnum] = (rp->previousip)? rp->previousip : rp->nextip; if (rp->nextip) @@ -781,7 +823,7 @@ } -struct resolve *findip(ip_t ip) +struct resolve *findip(ip_t * ip) { struct resolve *rp; dword bashnum; @@ -789,11 +831,13 @@ bashnum = getipbash(ip); rp = ipbash[bashnum]; if (rp) { - while ((rp->nextip) && (ip >= rp->nextip->ip)) + while ((rp->nextip) && + ( addrcmp( (void *) ip, (void *) &(rp->nextip->ip), af ) >= 0 )) rp = rp->nextip; - while ((rp->previousip) && (ip <= rp->previousip->ip)) + while ((rp->previousip) && + ( addrcmp( (void *) ip, (void *) &(rp->previousip->ip), af ) <= 0 )) rp = rp->previousip; - if (ip == rp->ip) { + if ( addrcmp( (void *) ip, (void *) &(rp->ip), af ) == 0 ) { ipbash[bashnum] = rp; return rp; } else @@ -838,15 +882,24 @@ restell(tempstring); } } else if (type == T_PTR) { + switch ( af ) { + case AF_INET: sprintf(tempstring,"%u.%u.%u.%u.in-addr.arpa", ((byte *)&rp->ip)[3], ((byte *)&rp->ip)[2], ((byte *)&rp->ip)[1], ((byte *)&rp->ip)[0]); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + addr2ip6arpa( &(rp->ip), tempstring ); + break; +#endif + } dorequest(tempstring,type,rp->id); if (debug) { sprintf(tempstring,"Resolver: Sent domain lookup request for \"%s\".", - strlongip(rp->ip)); + strlongip( &(rp->ip) )); restell(tempstring); } } @@ -887,7 +940,7 @@ } -void parserespacket(byte *s,int l) +void parserespacket(byte *s, int l) { struct resolve *rp; packetheader *hp; @@ -898,11 +951,11 @@ word rr,datatype,class,qdatatype,qclass; byte rdatalength; - if (l < sizeof(packetheader)) { + if (l < (int) sizeof(packetheader)) { restell("Resolver error: Packet smaller than standard header size."); return; } - if (l == sizeof(packetheader)) { + if (l == (int) sizeof(packetheader)) { restell("Resolver error: Packet has empty body."); return; } @@ -954,12 +1007,20 @@ case STATE_PTRREQ1: case STATE_PTRREQ2: case STATE_PTRREQ3: + switch ( af ) { + case AF_INET: sprintf(stackstring,"%u.%u.%u.%u.in-addr.arpa", ((byte *)&rp->ip)[3], ((byte *)&rp->ip)[2], ((byte *)&rp->ip)[1], ((byte *)&rp->ip)[0]); break; +#ifdef ENABLE_IPV6 + case AF_INET6: + addr2ip6arpa( &(rp->ip), stackstring ); + break; +#endif + } } *namestring = '\0'; r = dn_expand(s,s + l,c,namestring,MAXDNAME); @@ -1068,17 +1129,17 @@ restell(tempstring); return; } - if (memcmp(&rp->ip,(ip_t *)c,sizeof(ip_t))) { + if ( addrcmp( (void *) &(rp->ip), (void *) c, af ) == 0 ) { sprintf(tempstring,"Resolver: Reverse authentication failed: %s != ", - strlongip(rp->ip)); - memcpy(&alignedip,(ip_t *)c,sizeof(ip_t)); - strcat(tempstring,strlongip(alignedip)); + strlongip( &(rp->ip) )); + addrcpy( (void *) &alignedip, (void *) c, af ); + strcat(tempstring,strlongip( &alignedip )); restell(tempstring); res_hostipmismatch++; failrp(rp); } else { sprintf(tempstring,"Resolver: Reverse authentication complete: %s == \"%s\".", - strlongip(rp->ip),nonull(rp->hostname)); + strlongip( &(rp->ip) ),nonull(rp->hostname)); restell(tempstring); res_reversesuccess++; passrp(rp,ttl); @@ -1157,21 +1218,26 @@ { int r,i; - r = recvfrom(resfd,(byte *)resrecvbuf,MaxPacketsize,0,(struct sockaddr *)&from,&fromlen); + r = recvfrom(resfd,(byte *)resrecvbuf,MaxPacketsize,0, + from, &fromlen); if (r > 0) { /* Check to see if this server is actually one we sent to */ - if (from.sin_addr.s_addr == localhost) { + if ( addrcmp( (void *) &(from4->sin_addr), (void *) &localhost, + (int) AF_INET ) == 0 ) { for (i = 0;i < _res.nscount;i++) - if ((_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) || - (!_res.nsaddr_list[i].sin_addr.s_addr)) /* 0.0.0.0 replies as 127.0.0.1 */ + if ( addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + (void *) &(from4->sin_addr), (int) AF_INET ) == 0 || + addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + (void *) &unspec_addr, (int) AF_INET ) != 0 ) /* 0.0.0.0 replies as 127.0.0.1 */ break; } else for (i = 0;i < _res.nscount;i++) - if (_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) + if ( addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + (void *) &(from4->sin_addr), AF_INET ) == 0 ) break; if (i == _res.nscount) { sprintf(tempstring,"Resolver error: Received reply from unknown source: %s", - inet_ntoa(from.sin_addr)); + inet_ntoa(from4->sin_addr )); restell(tempstring); } else parserespacket((byte *)resrecvbuf,r); @@ -1206,7 +1272,8 @@ case STATE_FAILED: /* Fake TTL has expired */ if (debug) { sprintf(tempstring,"Resolver: Cache record for \"%s\" (%s) has expired. (state: %u) Marked for expire at: %g, time: %g.", - nonull(rp->hostname),strlongip(rp->ip),rp->state,rp->expiretime,sweeptime); + nonull(rp->hostname), strlongip( &(rp->ip) ), + rp->state, rp->expiretime, sweeptime); restell(tempstring); } unlinkresolve(rp); @@ -1240,11 +1307,10 @@ } -char *dns_lookup2(ip_t ip) +char *dns_lookup2(ip_t * ip) { struct resolve *rp; - ip = htonl(ip); if ((rp = findip(ip))) { if ((rp->state == STATE_FINISHED) || (rp->state == STATE_FAILED)) { if ((rp->state == STATE_FINISHED) && (rp->hostname)) { @@ -1270,16 +1336,16 @@ rp = allocresolve(); rp->state = STATE_PTRREQ1; rp->expiretime = sweeptime + ResRetryDelay1; - rp->ip = ip; + addrcpy( (void *) &(rp->ip), (void *) ip, af ); linkresolve(rp); - rp->ip = ip; + addrcpy( (void *) &(rp->ip), (void *) ip, af ); linkresolveip(rp); sendrequest(rp,T_PTR); return NULL; } -char *dns_lookup(ip_t ip) +char *dns_lookup(ip_t * ip) { char *t; @@ -1287,3 +1353,19 @@ t = dns_lookup2 (ip); return (t&&use_dns)?t:strlongip(ip); } + +#ifdef ENABLE_IPV6 +/* Returns an ip6.arpa character string. */ +void addr2ip6arpa( ip_t * ip, char * buf ) { + unsigned char * p = (char *) ip; + unsigned char * b = buf; + int i; + + for ( i = sizeof (struct in6_addr) - 1; i >= 0; i-- ) { + sprintf( b, "%x.%x.", p[i] % 16, p[i] >> 4 ); + b += 4; + } + sprintf( b, "ip6.arpa" ); + return; +} +#endif diff -ur mtr-0.67/dns.h mtr-0.68/dns.h --- mtr-0.67/dns.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/dns.h Tue Jan 11 09:30:14 2005 @@ -17,25 +17,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Typedefs */ - -typedef unsigned char byte; -typedef unsigned short word; -typedef unsigned long dword; - -typedef unsigned int ip_t; - +#include /* Prototypes for dns.c */ -void dns_open(); -int dns_waitfd(); -void dns_ack(); +void dns_open(void); +int dns_waitfd(void); +void dns_ack(void); void dns_events(double *sinterval); -char *dns_lookup(ip_t address); -char *dns_lookup2(ip_t address); -int dns_forward(char *name); -char *strlongip(ip_t ip); +char *dns_lookup(ip_t * address); +char *dns_lookup2(ip_t * address); +struct hostent * dns_forward(char *name); +char *strlongip(ip_t * ip); + +void addr2ip6arpa( ip_t * ip, char * buf ); -extern int dns; diff -ur mtr-0.67/getopt.h mtr-0.68/getopt.h --- mtr-0.67/getopt.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/getopt.h Sun Jan 9 13:39:34 2005 @@ -101,7 +101,7 @@ errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ -extern int getopt (); +extern int getopt (void); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); @@ -115,11 +115,11 @@ const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); +extern int getopt (void); +extern int getopt_long (void); +extern int getopt_long_only (void); -extern int _getopt_internal (); +extern int _getopt_internal (void); #endif /* __STDC__ */ #ifdef __cplusplus diff -ur mtr-0.67/gtk.c mtr-0.68/gtk.c --- mtr-0.67/gtk.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/gtk.c Tue Jan 11 09:36:49 2005 @@ -27,9 +27,13 @@ #include #ifndef NO_GTK +#include #include +#include +#include #include +#include "mtr.h" #include "net.h" #include "dns.h" #include "mtr-gtk.h" @@ -37,12 +41,12 @@ #include "img/mtr_icon.xpm" #endif - gint gtk_ping(gpointer data); extern char *Hostname; extern float WaitTime; +extern int af; static int tag; static GtkWidget *Pause_Button; @@ -67,7 +71,8 @@ } } -int gtk_detect(int *argc, char ***argv) + +int gtk_detect(UNUSED int *argc, UNUSED char ***argv) { if(getenv("DISPLAY") != NULL) { /* If we do this here, gtk_init exits on an error. This happens @@ -79,14 +84,16 @@ } } -gint Window_destroy(GtkWidget *Window, gpointer data) + +gint Window_destroy(UNUSED GtkWidget *Window, UNUSED gpointer data) { gtk_main_quit(); return FALSE; } -gint Restart_clicked(GtkWidget *Button, gpointer data) + +gint Restart_clicked(UNUSED GtkWidget *Button, UNUSED gpointer data) { net_reset(); gtk_redraw(); @@ -95,7 +102,7 @@ } -gint Pause_clicked(GtkWidget *Button, gpointer data) +gint Pause_clicked(UNUSED GtkWidget *Button, UNUSED gpointer data) { static int paused = 0; @@ -110,6 +117,7 @@ return FALSE; } + /* * There is a small problem with the following code: * The timeout is canceled and removed in order to ensure that @@ -119,7 +127,7 @@ * What's the problem with this? (-> "I don't think so) -- REW */ -gint WaitTime_changed(GtkAdjustment *Adj, GtkWidget *Button) +gint WaitTime_changed(UNUSED GtkAdjustment *Adj, UNUSED GtkWidget *Button) { WaitTime = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(Button)); gtk_timeout_remove (tag); @@ -129,9 +137,10 @@ return FALSE; } -gint Host_activate(GtkWidget *Entry, gpointer data) + +gint Host_activate(GtkWidget *Entry, UNUSED gpointer data) { - int addr; + struct hostent * addr; addr = dns_forward(gtk_entry_get_text(GTK_ENTRY(Entry))); if(addr) { @@ -147,6 +156,7 @@ return FALSE; } + GdkPixmap *gtk_load_pixmap(char **pixmap) { return gdk_pixmap_colormap_create_from_xpm_d(NULL, @@ -154,6 +164,7 @@ NULL, NULL, pixmap); } + void Toolbar_fill(GtkWidget *Toolbar) { GtkWidget *Button; @@ -207,6 +218,7 @@ gtk_widget_show(Entry); } + char *Report_Text[] = { "Hostname", "Loss", "Rcv", "Snt", "Last", "Best", "Avg", "Worst", "StDev", NULL }; int Report_Positions[] = { 10, 200, 240, 280, 320, 360, 400, 440, 480, 0 }; GtkWidget *Report; @@ -214,7 +226,7 @@ GtkWidget *GetRow(int index) { - int addr; + ip_t * addr; char *name; GtkWidget *Row, *Label; @@ -222,7 +234,7 @@ addr = net_addr(index); name = "???"; - if(addr != 0) { + if ( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) { name = dns_lookup(addr); if(!name) { /* Actually this is not neccesary: @@ -238,7 +250,8 @@ return Row; } -GtkWidget *Scrollarea_create() + +GtkWidget *Scrollarea_create(void) { GtkWidget *List; GtkWidget *scroll; @@ -265,6 +278,7 @@ return scroll; } + void gtk_add_row(GtkWidget *List) { int at; @@ -286,10 +300,12 @@ gtk_widget_show(Row); } + void gtk_set_field(GtkCList *List, int row, int ix, char *str) { gtk_clist_set_text(List, row, ix, str); } + //void gtk_set_field_num(GtkCList *List, int row, int ix, char *format, int num) { // changed int to dobule byMin void gtk_set_field_num(GtkCList *List, int row, int ix, char *format, double num) @@ -300,20 +316,20 @@ gtk_set_field(List, row, ix, str); } + void gtk_update_row(GtkCList *List, int row) { - int addr; + ip_t *addr; char str[256], *name; GdkColor color; GdkColormap *cmap; addr = net_addr(row); name = "???"; - if(addr != 0) { + if ( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) { name = dns_lookup(addr); if(!name) { - sprintf(str, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff); + sprintf(str, "%s", strlongip( addr )); name = str; } } @@ -333,7 +349,7 @@ /* the row - net_min() is kind of not clean, need some more work */ gtk_set_field(List, row - net_min(), 0, name); - gtk_set_field_num(List, row - net_min(), 1, "%.0f%%", net_loss(row)/1000.0); + gtk_set_field_num(List, row - net_min(), 1, "%.1f%%", net_loss(row)/1000.0); gtk_set_field_num(List, row - net_min(), 2, "%.0f", net_returned(row)); gtk_set_field_num(List, row - net_min(), 3, "%.0f", net_xmit(row)); @@ -342,10 +358,10 @@ gtk_set_field_num(List, row - net_min(), 6, "%.0f", net_avg(row)/1000.0); gtk_set_field_num(List, row - net_min(), 7, "%.0f", net_worst(row)/1000.0); gtk_set_field_num(List, row - net_min(), 8, "%.2f", net_stdev(row)/1000.0); - } -void gtk_redraw() + +void gtk_redraw(void) { int at = net_min(); // changed from 0 to net_min for TTL stuff byMin int max = net_max(); @@ -368,6 +384,7 @@ gtk_clist_thaw(GTK_CLIST(ReportBody)); } + void Window_fill(GtkWidget *Window) { GtkWidget *VBox; @@ -393,7 +410,8 @@ gtk_widget_show(VBox); } -void gtk_open() + +void gtk_open(void) { GtkWidget *Window; GdkPixmap *icon; @@ -423,16 +441,19 @@ gdk_window_set_icon_name(Window->window, "mtr"); } -void gtk_close() + +void gtk_close(void) { } -int gtk_keyaction() + +int gtk_keyaction(void) { return 0; } -gint gtk_ping(gpointer data) + +gint gtk_ping(UNUSED gpointer data) { gtk_redraw(); net_send_batch(); @@ -441,20 +462,21 @@ return TRUE; } -void gtk_net_data(gpointer data, gint fd, GdkInputCondition cond) + +void gtk_net_data(UNUSED gpointer data, UNUSED gint fd, UNUSED GdkInputCondition cond) { net_process_return(); } -void gtk_dns_data(gpointer data, gint fd, GdkInputCondition cond) + +void gtk_dns_data(UNUSED gpointer data, UNUSED gint fd, UNUSED GdkInputCondition cond) { dns_ack(); - gtk_redraw(); } -void gtk_loop() +void gtk_loop(void) { gtk_add_ping_timeout (); gdk_input_add(net_waitfd(), GDK_INPUT_READ, gtk_net_data, NULL); @@ -462,3 +484,5 @@ gtk_main(); } + + diff -ur mtr-0.67/img/Makefile.in mtr-0.68/img/Makefile.in --- mtr-0.67/img/Makefile.in Sun Dec 12 17:11:03 2004 +++ mtr-0.68/img/Makefile.in Tue Jan 11 09:27:36 2005 @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am +# Makefile.in generated automatically by automake 1.5 from Makefile.am. -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,6 +11,7 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ SHELL = @SHELL@ @@ -31,13 +33,9 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. ACLOCAL = @ACLOCAL@ @@ -46,11 +44,11 @@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : @@ -68,7 +66,6 @@ GTK_LIBS = @GTK_LIBS@ GTK_OBJ = @GTK_OBJ@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ @@ -78,109 +75,120 @@ install_sh = @install_sh@ EXTRA_DIST = mtr_icon.xpm +subdir = img mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = -DIST_COMMON = Makefile.am Makefile.in - +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -all: all-redirect .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu img/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu img/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: tags: TAGS TAGS: -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -subdir = img +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu img/Makefile @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ else \ test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ fi; \ done -info-am: -info: info-am -dvi-am: -dvi: dvi-am check-am: all-am check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am +all-am: Makefile -install-data-am: -install-data: install-data-am +installdirs: -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall-am: +install-exec: install-exec-am +install-data: install-data-am uninstall: uninstall-am -all-am: Makefile -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-generic mostlyclean-am -clean-am: clean-generic mostlyclean-am +distclean: distclean-am -clean: clean-am +distclean-am: clean-am distclean-generic -distclean-am: distclean-generic clean-am +dvi: dvi-am -distclean: distclean-am +dvi-am: -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: maintainer-clean: maintainer-clean-am -.PHONY: tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -ur mtr-0.67/mtr-curses.h mtr-0.68/mtr-curses.h --- mtr-0.67/mtr-curses.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/mtr-curses.h Sun Jan 9 13:39:34 2005 @@ -18,8 +18,8 @@ */ /* Prototypes for curses.c */ -void mtr_curses_open(); -void mtr_curses_close(); -void mtr_curses_redraw(); -int mtr_curses_keyaction(); -void mtr_curses_clear(); +void mtr_curses_open(void); +void mtr_curses_close(void); +void mtr_curses_redraw(void); +int mtr_curses_keyaction(void); +void mtr_curses_clear(void); diff -ur mtr-0.67/mtr-gtk.h mtr-0.68/mtr-gtk.h --- mtr-0.67/mtr-gtk.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/mtr-gtk.h Sun Jan 9 13:39:34 2005 @@ -19,8 +19,8 @@ /* Prototypes for gtk.c */ int gtk_detect(int *argc, char ***argv); -void gtk_open(); -void gtk_close(); -void gtk_redraw(); -int gtk_keyaction(); -void gtk_loop(); +void gtk_open(void); +void gtk_close(void); +void gtk_redraw(void); +int gtk_keyaction(void); +void gtk_loop(void); diff -ur mtr-0.67/mtr.8 mtr-0.68/mtr.8 --- mtr-0.67/mtr.8 Thu Aug 26 09:56:53 2004 +++ mtr-0.68/mtr.8 Tue Jan 11 09:10:13 2005 @@ -8,7 +8,7 @@ .SH SYNOPSIS .B mtr [\c -.B \-hvrctglsni\c +.B \-hvrctglsni46\c ] [\c .B \-\-help\c @@ -203,6 +203,16 @@ .br Use this option to specify the positive number of seconds between ICMP ECHO requests. The default value for this parameter is one second. + +.TP +.B \-4 +.br +Use IPv4 only. + +.TP +.B \-6 +.br +Use IPv6 only. .SH BUGS diff -ur mtr-0.67/mtr.c mtr-0.68/mtr.c --- mtr-0.67/mtr.c Thu Dec 9 17:11:40 2004 +++ mtr-0.68/mtr.c Tue Jan 11 09:33:41 2005 @@ -26,7 +26,9 @@ #include #include #include +#include +#include "mtr.h" #include "mtr-curses.h" #include "getopt.h" #include "display.h" @@ -141,6 +143,8 @@ { "address", 1, 0, 'a' }, { "first-ttl", 1, 0, 'f' }, /* -f & -m are borrowed from traceroute */ { "max-ttl", 1, 0, 'm' }, + { "inet", 0, 0, '4' }, /* IPv4 only */ + { "inet6", 0, 0, '6' }, /* IPv6 only */ { 0, 0, 0, 0 } }; @@ -148,7 +152,7 @@ while(1) { /* added f:m:o: byMin */ opt = getopt_long(argc, argv, - "vhrxtglpo:i:c:s:b:Q:na:f:m:", long_options, NULL); + "vhrxtglpo:i:c:s:b:Q:na:f:m:46", long_options, NULL); if(opt == -1) break; @@ -253,6 +257,17 @@ tos = 0; } break; + case '4': + af = AF_INET; + break; + case '6': +#ifdef ENABLE_IPV6 + af = AF_INET6; + break; +#else + fprintf( stderr, "IPv6 not enabled.\n" ); + break; +#endif } } @@ -288,11 +303,11 @@ argv[0] = "mtr"; argc = 1; p = strtok (string, " \t"); - while (p && (argc < (sizeof(argv)/sizeof(argv[0])))) { + while (p != NULL && ((size_t) argc < (sizeof(argv)/sizeof(argv[0])))) { argv[argc++] = p; p = strtok (NULL, " \t"); } - if (p) { + if (p != NULL) { fprintf (stderr, "Warning: extra arguments ignored: %s", p); } @@ -303,13 +318,24 @@ int main(int argc, char **argv) { - int traddr; + ip_t * traddr; struct hostent * host = NULL; int net_preopen_result; +#ifdef ENABLE_IPV6 + struct addrinfo hints, *res; + int error; + struct hostent trhost; + char * alptr[2]; + struct sockaddr_in * sa4; + struct sockaddr_in6 * sa6; +#endif /* Get the raw sockets first thing, so we can drop to user euid immediately */ - net_preopen_result = net_preopen (); + if ( ( net_preopen_result = net_preopen () ) ) { + fprintf( stderr, "mtr: unable to get raw sockets.\n" ); + exit( EXIT_FAILURE ); + } /* Now drop to user permissions */ if (setuid(getuid())) { @@ -342,7 +368,7 @@ } if (PrintHelp) { - printf("usage: %s [-hvrctglsni] [--help] [--version] [--report]\n" + printf("usage: %s [-hvrctglsni46] [--help] [--version] [--report]\n" "\t\t[--report-cycles=COUNT] [--curses] [--gtk]\n" "\t\t[--raw] [--split] [--no-dns] [--address interface]\n" /* BL */ "\t\t[--psize=bytes/-p=bytes]\n" /* ok */ @@ -368,40 +394,53 @@ } #ifdef ENABLE_IPV6 - if (af == AF_UNSPEC) { - af = AF_INET6; - host = gethostbyname2(Hostname, af); - if (host == NULL) af = AF_INET; + /* gethostbyname2() is deprecated so we'll use getaddrinfo() instead. */ + bzero( &hints, sizeof hints ); + hints.ai_family = af; + hints.ai_socktype = SOCK_DGRAM; + error = getaddrinfo( Hostname, "0", &hints, &res ); + if ( error ) { + perror( gai_strerror(error) ); + exit( EXIT_FAILURE ); + } + /* Convert the first addrinfo into a hostent. */ + host = &trhost; + bzero( host, sizeof trhost ); + host->h_name = res->ai_canonname; + host->h_aliases = NULL; + host->h_addrtype = res->ai_family; + af = res->ai_family; + host->h_length = res->ai_addrlen; + host->h_addr_list = alptr; + switch ( af ) { + case AF_INET: + sa4 = (struct sockaddr_in *) res->ai_addr; + alptr[0] = (void *) &(sa4->sin_addr); + break; + case AF_INET6: + sa6 = (struct sockaddr_in6 *) res->ai_addr; + alptr[0] = (void *) &(sa6->sin6_addr); + break; + default: + fprintf( stderr, "mtr unknown address type\n" ); + exit( EXIT_FAILURE ); } -#endif - - if (host == NULL) { + alptr[1] = NULL; +#else host = gethostbyname(Hostname); - } - if (host == NULL) { - herror("mtr"); + herror("mtr gethostbyname"); exit(1); } + af = host->h_addrtype; +#endif - switch (af) { - case AF_INET: - traddr = *(int *)host->h_addr; + traddr = (ip_t *) host->h_addr; - if (net_open(traddr) != 0) { + if (net_open(host) != 0) { fprintf(stderr, "mtr: Unable to start net module.\n"); exit(1); } - break; -#ifdef ENABLE_IPV6 - case AF_INET6: - if(net6_open((struct in6_addr *)host->h_addr) != 0) { - printf("mtr: Unable to get raw socket. (Executable not suid?)\n"); - exit(1); - } - break; -#endif - } display_open(); dns_open(); Only in mtr-0.68: mtr.h diff -ur mtr-0.67/net.c mtr-0.68/net.c --- mtr-0.67/net.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/net.c Tue Jan 11 09:34:34 2005 @@ -36,10 +36,12 @@ #include #include #include +#include +#include "mtr.h" #include "net.h" #include "display.h" - +#include "dns.h" /* We can't rely on header files to provide this information, because the fields have different names between, for instance, Linux and @@ -81,8 +83,8 @@ #endif struct nethost { - uint32 addr; - uint32 addrs[MAXPATH]; /* for multi paths byMin */ + ip_t addr; + ip_t addrs[MAXPATH]; /* for multi paths byMin */ int xmit; int returned; int sent; @@ -127,13 +129,40 @@ static struct timeval reset = { 0, 0 }; int timestamp; +int sendsock4; +int recvsock4; +int sendsock6; +int recvsock6; int sendsock; int recvsock; -struct sockaddr_in sourceaddress; -struct sockaddr_in remoteaddress; + +#ifdef ENABLE_IPV6 +struct sockaddr_storage sourcesockaddr_struct; +struct sockaddr_storage remotesockaddr_struct; +struct sockaddr_in6 * ssa6 = (struct sockaddr_in6 *) &sourcesockaddr_struct; +struct sockaddr_in6 * rsa6 = (struct sockaddr_in6 *) &remotesockaddr_struct; +#else +struct sockaddr_in sourcesockaddr_struct; +struct sockaddr_in remotesockaddr_struct; +#endif + +struct sockaddr * sourcesockaddr = (struct sockaddr *) &sourcesockaddr_struct; +struct sockaddr * remotesockaddr = (struct sockaddr *) &remotesockaddr_struct; +struct sockaddr_in * ssa4 = (struct sockaddr_in *) &sourcesockaddr_struct; +struct sockaddr_in * rsa4 = (struct sockaddr_in *) &remotesockaddr_struct; + +ip_t * sourceaddress; +ip_t * remoteaddress; /* XXX How do I code this to be IPV6 compatible??? -- REW */ -struct in_addr localaddr; +#ifdef ENABLE_IPV6 +char localaddr[INET6_ADDRSTRLEN]; +#else +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 +#endif +char localaddr[INET_ADDRSTRLEN]; +#endif static int batch_at = 0; static int numhosts = 10; @@ -143,7 +172,7 @@ extern int packetsize; /* packet size used by ping */ extern int bitpattern; /* packet bit pattern used by ping */ extern int tos; /* type of service set in ping packet*/ - +extern int af; /* address family of remote target */ /* return the number of microseconds to wait before sending the next @@ -204,50 +233,77 @@ { /*ok char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader)];*/ char packet[MAXPACKET]; - struct IPHeader *ip; + struct IPHeader *ip = (struct IPHeader *) packet; struct ICMPHeader *icmp; /*ok int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + datasize;*/ int rv; static int first=1; + int ttl, iphsize = 0, echotype = 0, salen = 0; + + ttl = index + 1; if ( packetsize < MINPACKET ) packetsize = MINPACKET; if ( packetsize > MAXPACKET ) packetsize = MAXPACKET; memset(packet, (unsigned char) abs(bitpattern), abs(packetsize)); - ip = (struct IPHeader *)packet; - icmp = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); + switch ( af ) { + case AF_INET: + iphsize = sizeof (struct IPHeader); ip->version = 0x45; ip->tos = tos; ip->len = BSDfix ? abs(packetsize): htons (abs(packetsize)); ip->id = 0; ip->frag = 0; /* 1, if want to find mtu size? Min */ - ip->ttl = index + 1; + ip->ttl = ttl; ip->protocol = IPPROTO_ICMP; ip->check = 0; /* BSD needs the source address here, Linux & others do not... */ - ip->saddr = saddr_correction(sourceaddress.sin_addr.s_addr); - ip->daddr = remoteaddress.sin_addr.s_addr; + addrcpy( (void *) &(ip->saddr), (void *) &(ssa4->sin_addr), AF_INET ); + addrcpy( (void *) &(ip->daddr), (void *) remoteaddress, AF_INET ); + + echotype = ICMP_ECHO; + salen = sizeof (struct sockaddr_in); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + iphsize = 0; + if ( setsockopt( sendsock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, + &ttl, sizeof ttl ) ) { + perror( "setsockopt IPV6_UNICAST_HOPS" ); + exit( EXIT_FAILURE); + } + echotype = ICMP6_ECHO_REQUEST; + salen = sizeof (struct sockaddr_storage); + break; +#endif + } - icmp->type = ICMP_ECHO; + icmp = (struct ICMPHeader *)(packet + iphsize); + icmp->type = echotype; icmp->code = 0; icmp->checksum = 0; icmp->id = getpid(); icmp->sequence = new_sequence(index); + icmp->checksum = checksum(icmp, abs(packetsize) - iphsize); - icmp->checksum = checksum(icmp, abs(packetsize) - sizeof(struct IPHeader)); - ip->check = checksum(ip, abs(packetsize)); + switch ( af ) { + case AF_INET: + ip->check = checksum(packet, abs(packetsize)); + break; + } gettimeofday(&sequence[icmp->sequence].time, NULL); + rv = sendto(sendsock, packet, abs(packetsize), 0, - (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); + remotesockaddr, salen); if (first && (rv < 0) && (errno == EINVAL)) { ip->len = abs (packetsize); rv = sendto(sendsock, packet, abs(packetsize), 0, - (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); + remotesockaddr, salen); if (rv >= 0) { fprintf (stderr, "You've got a broken (FreeBSD?) system\n"); BSDfix = 1; @@ -259,7 +315,7 @@ /* We got a return on something we sent out. Record the address and time. */ -void net_process_ping(int seq, uint32 addr, struct timeval now) +void net_process_ping(int seq, void * addr, struct timeval now) { int index; int totusec; @@ -280,19 +336,25 @@ (now.tv_usec - sequence[seq].time.tv_usec); /* impossible? if( totusec < 0 ) totusec = 0 */; - if (host[index].addr == 0) { - host[index].addr = addr; // should be out of if as addr can change - display_rawhost(index, host[index].addr); + if ( addrcmp( (void *) &(host[index].addr), + (void *) &unspec_addr, af ) == 0 ) { + // should be out of if as addr can change + addrcpy( (void *) &(host[index].addr), addr, af ); + display_rawhost(index, (void *) &(host[index].addr)); /* multi paths by Min */ - host[index].addrs[0] = addr; + addrcpy( (void *) &(host[index].addrs[0]), addr, af ); } else { for( i=0; isin_addr); + echoreplytype = ICMP_ECHOREPLY; + timeexceededtype = ICMP_TIME_EXCEEDED; + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + fromsockaddrsize = sizeof (struct sockaddr_storage); + fromaddress = (ip_t *) &(fsa6->sin6_addr); + echoreplytype = ICMP6_ECHO_REPLY; + timeexceededtype = ICMP6_TIME_EXCEEDED; + break; +#endif + } - fromaddrsize = sizeof(fromaddr); num = recvfrom(recvsock, packet, MAXPACKET, 0, - (struct sockaddr *)&fromaddr, &fromaddrsize); + fromsockaddr, &fromsockaddrsize); - if(num < sizeof(struct IPHeader) + sizeof(struct ICMPHeader)) - return; + switch ( af ) { + case AF_INET: + if((size_t) num < sizeof(struct IPHeader) + sizeof(struct ICMPHeader)) + return; + header = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + if(num < sizeof(struct ICMPHeader)) + return; - header = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); - if(header->type == ICMP_ECHOREPLY) { + header = (struct ICMPHeader *) packet; + break; +#endif + } + if (header->type == echoreplytype) { if(header->id != (uint16)getpid()) return; - net_process_ping(header->sequence, fromaddr.sin_addr.s_addr, now); - } else if(header->type == ICMP_TIME_EXCEEDED) { - if(num < sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + - sizeof(struct IPHeader) + sizeof(struct ICMPHeader)) - return; - - header = (struct ICMPHeader *)(packet + sizeof(struct IPHeader) + - sizeof(struct ICMPHeader) + sizeof(struct IPHeader)); - if(header->id != (uint16)getpid()) + net_process_ping (header->sequence, (void *) fromaddress, now); + } else if (header->type == timeexceededtype) { + switch ( af ) { + case AF_INET: + + if ((size_t) num < sizeof(struct IPHeader) + + sizeof(struct ICMPHeader) + + sizeof (struct IPHeader) + + sizeof (struct ICMPHeader)) + return; + header = (struct ICMPHeader *)(packet + sizeof (struct IPHeader) + + sizeof (struct ICMPHeader) + + sizeof (struct IPHeader)); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + if ( num < sizeof (struct ICMPHeader) + + sizeof (struct ip6_hdr) + sizeof (struct ICMPHeader) ) + return; + header = (struct ICMPHeader *) ( packet + + sizeof (struct ICMPHeader) + + sizeof (struct ip6_hdr) ); + break; +#endif + } + + if (header->id != (uint16)getpid()) return; - net_process_ping(header->sequence, fromaddr.sin_addr.s_addr, now); + net_process_ping(header->sequence, (void *)fromaddress, now); } } -int net_addr(int at) { - return ntohl(host[at].addr); +ip_t *net_addr(int at) +{ + return (ip_t *)&(host[at].addr); } -int net_addrs(int at, int i) { - return ntohl(host[at].addrs[i]); +ip_t *net_addrs(int at, int i) +{ + return (ip_t *)&(host[at].addrs[i]); } - int net_loss(int at) { if ((host[at].xmit - host[at].transit) == 0) @@ -484,7 +600,7 @@ /* end jitter */ -int net_max() +int net_max(void) { int at; int max; @@ -493,9 +609,11 @@ // replacedByMin // for(at = 0; at < MaxHost-2; at++) { for(at = 0; at < maxTTL-1; at++) { - if(host[at].addr == remoteaddress.sin_addr.s_addr) { + if ( addrcmp( (void *) &(host[at].addr), + (void *) remoteaddress, af ) == 0 ) { return at + 1; - } else if(host[at].addr != 0) { + } else if ( addrcmp( (void *) &(host[at].addr), + (void *) &unspec_addr, af ) != 0 ) { max = at + 2; } } @@ -505,7 +623,7 @@ /* add by Min (wonder its named net_min;-)) because of ttl stuff */ -int net_min () +int net_min (void) { return ( fstTTL - 1 ); } @@ -536,13 +654,13 @@ } -struct in_addr *net_localaddr (void) +char * net_localaddr (void) { - return &localaddr; + return localaddr; } -void net_end_transit() +void net_end_transit(void) { int at; @@ -551,7 +669,7 @@ } } -int net_send_batch() +int net_send_batch(void) { int n_unknown=0, i; @@ -571,7 +689,7 @@ net_send_query(batch_at); for (i=fstTTL-1;i MAX_UNKNOWN_HOSTS) || // or reach limit @@ -600,53 +720,89 @@ } -int net_preopen() +int net_preopen(void) { int trueopt = 1; - sendsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); - if (sendsock < 0) + sendsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); + if (sendsock4 < 0) + return -1; +#ifdef ENABLE_IPV6 + sendsock6 = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sendsock6 < 0) return -1; +#endif #ifdef IP_HDRINCL /* FreeBSD wants this to avoid sending out packets with protocol type RAW to the network. */ - if (setsockopt(sendsock, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt))) { + if (setsockopt(sendsock4, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt))) { perror("setsockopt(IP_HDRINCL,1)"); return -1; } -#endif +#endif /* IP_HDRINCL */ - recvsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); - if (recvsock < 0) + recvsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); + if (recvsock4 < 0) return -1; +#ifdef ENABLE_IPV6 + recvsock6 = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (recvsock6 < 0) + return -1; +#endif return 0; } -int net_open(int addr) +int net_open(struct hostent * host) { - struct sockaddr_in name; +#ifdef ENABLE_IPV6 + struct sockaddr_storage name_struct; +#else + struct sockaddr_in name_struct; +#endif + struct sockaddr * name = (struct sockaddr *) &name_struct; int len; net_reset(); - remoteaddress.sin_family = AF_INET; - remoteaddress.sin_addr.s_addr = addr; + remotesockaddr->sa_family = host->h_addrtype; + + switch ( host->h_addrtype ) { + case AF_INET: + sendsock = sendsock4; + recvsock = recvsock4; + addrcpy( (void *) &(rsa4->sin_addr), host->h_addr, AF_INET ); + sourceaddress = (ip_t *) &(ssa4->sin_addr); + remoteaddress = (ip_t *) &(rsa4->sin_addr); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + sendsock = sendsock6; + recvsock = recvsock6; + addrcpy( (void *) &(rsa6->sin6_addr), host->h_addr, AF_INET6 ); + sourceaddress = (ip_t *) &(ssa6->sin6_addr); + remoteaddress = (ip_t *) &(rsa6->sin6_addr); + break; +#endif + default: + fprintf( stderr, "net_open bad address type\n" ); + exit( EXIT_FAILURE ); + } - len = sizeof (name); - getsockname (recvsock, (struct sockaddr *)&name, &len); - localaddr = name.sin_addr; + len = sizeof name_struct; + getsockname (recvsock, name, &len); + sockaddrtop( name, localaddr, sizeof localaddr ); #if 0 - printf ("got localaddr: %x\n", *(int *)&localaddr); + printf ("got localaddr: %s\n", localaddr); #endif return 0; } -void net_reopen(int addr) +void net_reopen(struct hostent * addr) { int at; @@ -654,15 +810,28 @@ memset(&host[at], 0, sizeof(host[at])); } - remoteaddress.sin_family = AF_INET; - remoteaddress.sin_addr.s_addr = addr; + remotesockaddr->sa_family = addr->h_addrtype; + + switch ( addr->h_addrtype ) { + case AF_INET: + addrcpy( (void *) remoteaddress, addr->h_addr, AF_INET ); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + addrcpy( (void *) &(rsa6->sin6_addr), addr->h_addr, AF_INET6 ); + break; +#endif + default: + fprintf( stderr, "net_reopen bad address type\n" ); + exit( EXIT_FAILURE ); + } net_reset (); net_send_batch(); } -void net_reset() +void net_reset(void) { int at; int i; @@ -707,21 +876,31 @@ if (!InterfaceAddress) return 0; - sourceaddress.sin_family = AF_INET; - sourceaddress.sin_port = 0; - sourceaddress.sin_addr.s_addr = 0; + sourcesockaddr->sa_family = af; + switch ( af ) { + case AF_INET: + ssa4->sin_port = 0; + ssa4->sin_addr.s_addr = 0; if(sscanf(InterfaceAddress, "%u.%u.%u.%u%c", &i1, &i2, &i3, &i4, &dummy) != 4) { printf("mtr: bad interface address: %s\n", InterfaceAddress); exit(1); } - ((unsigned char*)&sourceaddress.sin_addr)[0] = i1; - ((unsigned char*)&sourceaddress.sin_addr)[1] = i2; - ((unsigned char*)&sourceaddress.sin_addr)[2] = i3; - ((unsigned char*)&sourceaddress.sin_addr)[3] = i4; + ((unsigned char*)&ssa4->sin_addr)[0] = i1; + ((unsigned char*)&ssa4->sin_addr)[1] = i2; + ((unsigned char*)&ssa4->sin_addr)[2] = i3; + ((unsigned char*)&ssa4->sin_addr)[3] = i4; + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + ssa6->sin6_port = 0; + inet_pton( af, InterfaceAddress, &(ssa6->sin6_addr) ); + break; +#endif + } - if(bind(sendsock, (struct sockaddr*)&sourceaddress, sizeof(sourceaddress)) == -1) { + if (bind(sendsock, sourcesockaddr, sizeof sourcesockaddr_struct) == -1) { perror("mtr: failed to bind to interface"); exit(1); } @@ -730,26 +909,26 @@ -void net_close() +void net_close(void) { close(sendsock); close(recvsock); } -int net_waitfd() +int net_waitfd(void) { return recvsock; } -int* net_saved_pings(int at) +int* net_saved_pings(int at) { return host[at].saved; } -void net_save_increment() +void net_save_increment(void) { int at; for (at = 0; at < MaxHost; at++) { @@ -760,7 +939,7 @@ } -void net_save_xmit(int at) +void net_save_xmit(int at) { if (host[at].saved[SAVED_PINGS-1] != -2) net_save_increment(); @@ -768,7 +947,7 @@ } -void net_save_return(int at, int seq, int ms) +void net_save_return(int at, int seq, int ms) { int idx; idx = seq - host[at].saved_seq_offset; @@ -776,4 +955,62 @@ return; } host[at].saved[idx] = ms; +} + +/* Similar to inet_ntop but uses a sockaddr as it's argument. */ +void sockaddrtop( struct sockaddr * saddr, char * strptr, size_t len ) { + struct sockaddr_in * sa4; +#ifdef ENABLE_IPV6 + struct sockaddr_in6 * sa6; +#endif + + switch ( saddr->sa_family ) { + case AF_INET: + sa4 = (struct sockaddr_in *) saddr; + strncpy( strptr, inet_ntoa( (struct in_addr) sa4->sin_addr ), len ); + return; +#ifdef ENABLE_IPV6 + case AF_INET6: + sa6 = (struct sockaddr_in6 *) saddr; + inet_ntop( sa6->sin6_family, &(sa6->sin6_addr), strptr, len ); + return; +#endif + default: + fprintf( stderr, "sockaddrtop unknown address type\n" ); + strptr[0] = '\0'; + return; + } +} + +/* Address comparison. */ +int addrcmp( char * a, char * b, int af ) { + int rc = -1; + + switch ( af ) { + case AF_INET: + rc = memcmp( a, b, sizeof (struct in_addr) ); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + rc = memcmp( a, b, sizeof (struct in6_addr) ); + break; +#endif + } + + return rc; +} + +/* Address copy. */ +void addrcpy( char * a, char * b, int af ) { + + switch ( af ) { + case AF_INET: + memcpy( a, b, sizeof (struct in_addr) ); + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + memcpy( a, b, sizeof (struct in6_addr) ); + break; +#endif + } } diff -ur mtr-0.67/net.h mtr-0.68/net.h --- mtr-0.67/net.h Thu Dec 9 17:11:40 2004 +++ mtr-0.68/net.h Tue Jan 11 09:25:48 2005 @@ -18,20 +18,32 @@ */ /* Prototypes for functions in net.c */ +#include +#include +#include +#include +#ifdef ENABLE_IPV6 +#include +#include +#endif -int net_preopen(); -int net_open(int address); -void net_reopen(int address); +int net_preopen(void); +int net_open(struct hostent *host); +void net_reopen(struct hostent *address); int net_set_interfaceaddress (char *InterfaceAddress); -void net_reset(); -void net_close(); -int net_waitfd(); -void net_process_return(); +void net_reset(void); +void net_close(void); +int net_waitfd(void); +void net_process_return(void); int net_max(void); int net_min(void); int net_last(int at); -int net_addr(int at); +#ifdef ENABLE_IPV6 +struct in6_addr * net_addr(int at); +#else +struct in_addr * net_addr(int at); +#endif int net_loss(int at); int net_drop(int at); int net_last(int at); @@ -44,11 +56,15 @@ int net_jworst(int at); int net_javg(int at); int net_jinta(int at); -int net_addrs(int at, int i); -struct in_addr *net_localaddr(void); +#ifdef ENABLE_IPV6 +struct in6_addr * net_addrs(int at, int i); +#else +struct in_addr * net_addrs(int at, int i); +#endif +char *net_localaddr(void); -int net_send_batch(); -void net_end_transit(); +int net_send_batch(void); +void net_end_transit(void); int calc_deltatime (float WaitTime); @@ -66,6 +82,10 @@ void net_save_return(int at, int seq, int ms); int net_duplicate(int at, int seq); +void sockaddrtop( struct sockaddr * saddr, char * strptr, size_t len ); +int addrcmp( char * a, char * b, int af ); +void addrcpy( char * a, char * b, int af ); + #define MAXPATH 8 #define MaxHost 256 #define MaxSequence 65536 @@ -104,3 +124,8 @@ extern unsigned char fld_active[]; extern char available_options[]; +#ifdef ENABLE_IPV6 +struct in6_addr unspec_addr; +#else +struct in_addr unspec_addr; +#endif diff -ur mtr-0.67/raw.c mtr-0.68/raw.c --- mtr-0.67/raw.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/raw.c Tue Jan 11 09:33:53 2005 @@ -19,30 +19,31 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include +#include #include #include #include +#include "mtr.h" #include "raw.h" #include "net.h" #include "dns.h" static int havename[MaxHost]; +extern int af; + #if 0 -static char *addr_to_str(int addr) +static char *addr_to_str(ip_t addr) { static char buf[20]; - sprintf (buf, "%d.%d.%d.%d", - (addr >> 0) & 0xff, - (addr >> 8) & 0xff, - (addr >> 16) & 0xff, - (addr >> 24) & 0xff); + sprintf (buf, "%s", strlongip( &addr )); return buf; } #endif @@ -63,17 +64,8 @@ } -void raw_rawhost (int host, int ip_addr) +void raw_rawhost (int host, ip_t * ip_addr) { - struct in_addr in; - - in.s_addr = ip_addr; - - printf ("h %d %s\n", - host, inet_ntoa(in)); + printf ("h %d %s\n", host, strlongip( ip_addr )); fflush (stdout); } - - - - diff -ur mtr-0.67/raw.h mtr-0.68/raw.h --- mtr-0.67/raw.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/raw.h Tue Jan 11 09:10:13 2005 @@ -21,4 +21,8 @@ /* Prototypes for raw.c */ void raw_rawping(int host, int msec); -void raw_rawhost(int host, int addr); +#ifdef ENABLE_IPV6 +void raw_rawhost(int host, struct in6_addr * addr); +#else +void raw_rawhost(int host, struct in_addr * addr); +#endif diff -ur mtr-0.67/report.c mtr-0.68/report.c --- mtr-0.67/report.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/report.c Tue Jan 11 09:37:39 2005 @@ -24,9 +24,12 @@ #include #include #include +#include +#include "mtr.h" #include "report.h" #include "net.h" +#include "dns.h" extern int dns; extern char LocalHostname[]; @@ -37,12 +40,18 @@ extern int bitpattern; extern int tos; extern int MaxPing; +extern int af; -void report_open() {} -void report_close() { - int i, j, at, max, addr; - int haddr; +void report_open(void) +{ +} + + +void report_close(void) +{ + int i, j, at, max; + ip_t *addr; char name[81]; char buf[1024]; char fmt[16]; @@ -65,18 +74,16 @@ for(; at < max; at++) { addr = net_addr(at); - if(addr == 0) { + if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) == 0 ) { sprintf(name, "???"); } else { - haddr = htonl(addr); - host = dns?gethostbyaddr((char *)&haddr, sizeof(int), AF_INET):NULL; + host = dns?gethostbyaddr( (void *) addr, sizeof(int), AF_INET):NULL; if (host != NULL) { strncpy(name, host->h_name, 80); name[80] = 0; } else { - sprintf(name, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff); + sprintf(name, "%s", strlongip( addr ) ); } } @@ -99,15 +106,29 @@ printf("%s\n",buf); } } -void txt_open() {} -void txt_close() { report_close(); } +void txt_open(void) +{ +} + + +void txt_close(void) +{ + report_close(); +} + + + +void xml_open(void) +{ +} + -void xml_open() {} -void xml_close() { - int i, j, at, max, addr; - int haddr; +void xml_close(void) +{ + int i, j, at, max; + ip_t *addr; char name[81]; struct hostent *host; @@ -130,18 +151,16 @@ for(; at < max; at++) { addr = net_addr(at); - if(addr == 0) { + if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) == 0 ) { sprintf(name, "???"); } else { - haddr = htonl(addr); - host = dns?gethostbyaddr((char *)&haddr, sizeof(int), AF_INET):NULL; + host = dns?gethostbyaddr( (void *) addr, sizeof(int), AF_INET):NULL; if (host != NULL) { strncpy(name, host->h_name, 80); name[80] = 0; } else { - sprintf(name, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff); + sprintf(name, "%s", strlongip( addr ) ); } } @@ -171,10 +190,16 @@ printf("\n"); } -void csv_open() {} -void csv_close() { - int i, j, at, max, addr; - int haddr; + +void csv_open(void) +{ +} + + +void csv_close(void) +{ + int i, j, at, max; + ip_t *addr; char name[81]; struct hostent *host; @@ -208,18 +233,16 @@ for(; at < max; at++) { addr = net_addr(at); - if(addr == 0) { + if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) == 0 ) { sprintf(name, "???"); } else { - haddr = htonl(addr); - host = dns?gethostbyaddr((char *)&haddr, sizeof(int), AF_INET):NULL; + host = dns?gethostbyaddr( (void *) addr, sizeof(int), AF_INET):NULL; if (host != NULL) { strncpy(name, host->h_name, 80); name[80] = 0; } else { - sprintf(name, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff); + sprintf(name, "%s", strlongip( addr ) ); } } diff -ur mtr-0.67/report.h mtr-0.68/report.h --- mtr-0.67/report.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/report.h Sun Jan 9 13:50:41 2005 @@ -19,11 +19,11 @@ /* Prototypes for report.h */ -void report_open(); -void report_close(); -void txt_open(); -void txt_close(); -void xml_open(); -void xml_close(); -void csv_open(); -void csv_close(); +void report_open(void); +void report_close(void); +void txt_open(void); +void txt_close(void); +void xml_open(void); +void xml_close(void); +void csv_open(void); +void csv_close(void); diff -ur mtr-0.67/select.c mtr-0.68/select.c --- mtr-0.67/select.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/select.c Tue Jan 11 09:34:03 2005 @@ -29,6 +29,7 @@ #include #include +#include "mtr.h" #include "display.h" #include "dns.h" #include "net.h" @@ -43,7 +44,7 @@ int display_offset = 0; -void select_loop() { +void select_loop(void) { fd_set readfd; int anyset = 0; int maxfd = 0; @@ -116,11 +117,13 @@ selecttime.tv_usec += 1000000; } - if ((selecttime.tv_sec > (time_t)dnsinterval) || - ((selecttime.tv_sec == (time_t)dnsinterval) && - (selecttime.tv_usec > ((time_t)(dnsinterval * 1000000) % 1000000)))) { - selecttime.tv_sec = (time_t)dnsinterval; - selecttime.tv_usec = (time_t)(dnsinterval * 1000000) % 1000000; + if (dns) { + if ((selecttime.tv_sec > (time_t)dnsinterval) || + ((selecttime.tv_sec == (time_t)dnsinterval) && + (selecttime.tv_usec > ((time_t)(dnsinterval * 1000000) % 1000000)))) { + selecttime.tv_sec = (time_t)dnsinterval; + selecttime.tv_usec = (time_t)(dnsinterval * 1000000) % 1000000; + } } rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime); diff -ur mtr-0.67/select.h mtr-0.68/select.h --- mtr-0.67/select.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/select.h Sun Jan 9 13:39:34 2005 @@ -17,4 +17,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -void select_loop(); +void select_loop(void); diff -ur mtr-0.67/split.c mtr-0.68/split.c --- mtr-0.67/split.c Thu Aug 26 09:56:53 2004 +++ mtr-0.68/split.c Tue Jan 11 09:34:07 2005 @@ -21,20 +21,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include #include +#include +#include "mtr.h" #include "display.h" #include "dns.h" #include "net.h" #include "split.h" - -#include - #ifdef NO_CURSES #include #include @@ -57,6 +57,7 @@ extern char *Hostname; extern int WaitTime; +extern int af; /* There is 256 hops max in the IP header (coded with a byte) */ #define MAX_LINE_COUNT 256 @@ -68,11 +69,12 @@ #define DEBUG 0 -void -split_redraw() { + +void split_redraw(void) +{ int max; int at; - int addr; + ip_t *addr; char *name; char newLine[MAX_LINE_SIZE]; int i; @@ -97,7 +99,7 @@ for(at = 0; at < max; at++) { addr = net_addr(at); - if(addr != 0) { + if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) { name = dns_lookup(addr); if(name != NULL) { /* May be we should test name's length */ @@ -107,9 +109,8 @@ net_best(at) /1000, net_avg(at)/1000, net_worst(at)/1000); } else { - sprintf(newLine, "%d.%d.%d.%d %d %d %d %d %d %d", - (addr >> 24) & 0xff, (addr >> 16) & 0xff, - (addr >> 8) & 0xff, addr & 0xff, + sprintf(newLine, "%s %d %d %d %d %d %d", + strlongip( addr ), net_loss(at), net_returned(at), net_xmit(at), net_best(at) /1000, net_avg(at)/1000, @@ -135,8 +136,9 @@ } } -void -split_open() { + +void split_open(void) +{ int i; #if DEBUG printf("split_open()\n"); @@ -147,15 +149,17 @@ } } -void -split_close() { + +void split_close(void) +{ #if DEBUG printf("split_close()\n"); #endif } -int -split_keyaction() { + +int split_keyaction(void) +{ #ifdef NO_CURSES fd_set readfds; struct timeval tv; diff -ur mtr-0.67/split.h mtr-0.68/split.h --- mtr-0.67/split.h Thu Aug 26 09:56:53 2004 +++ mtr-0.68/split.h Sun Jan 9 13:39:34 2005 @@ -20,7 +20,7 @@ */ /* Prototypes for split.c */ -void split_open(); -void split_close(); -void split_redraw(); -int split_keyaction(); +void split_open(void); +void split_close(void); +void split_redraw(void); +int split_keyaction(void); .