diff -ur mtr-0.33/AUTHORS mtr-0.34/AUTHORS --- mtr-0.33/AUTHORS Sun Mar 7 22:24:54 1999 +++ mtr-0.34/AUTHORS Sat Apr 3 01:04:44 1999 @@ -24,6 +24,7 @@ Adam Kramer (l3zqc@qcunix1.acc.qc.edu), Simon Kirby, Christophe Kalt, + Steve Kann (stevek@spheara.horizonlive.com), Mircea Damian, Brian Casey, diff -ur mtr-0.33/Makefile.am mtr-0.34/Makefile.am --- mtr-0.33/Makefile.am Sun Mar 7 22:24:54 1999 +++ mtr-0.34/Makefile.am Sat Apr 3 10:30:17 1999 @@ -24,6 +24,7 @@ EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist distclean-local: cp Makefile.dist Makefile + rm -f *.orig DISTCLEANFILES = *~ diff -ur mtr-0.33/Makefile.in mtr-0.34/Makefile.in --- mtr-0.33/Makefile.in Tue Mar 9 19:59:39 1999 +++ mtr-0.34/Makefile.in Sat Apr 3 10:30:42 1999 @@ -460,6 +460,7 @@ chmod u+s $(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. diff -ur mtr-0.33/NEWS mtr-0.34/NEWS --- mtr-0.33/NEWS Tue Mar 9 20:22:55 1999 +++ mtr-0.34/NEWS Sat Apr 3 01:06:04 1999 @@ -1,5 +1,8 @@ WHAT'S NEW? + v0.34 Added Matt's nifty "use the icmp unreachables to do the timing" patch. + Added Steve Kann's pause/resume patch. + v0.33 Fixed the Linux glibc resolver problems. Fixed the off-by-one problem with -c option. diff -ur mtr-0.33/TODO mtr-0.34/TODO --- mtr-0.33/TODO Sun Mar 7 22:24:54 1999 +++ mtr-0.34/TODO Tue Mar 23 09:01:58 1999 @@ -17,11 +17,6 @@ (Anybody have the statistics experience to tell me how to do the data analysis?) - - Allow MTR to keep on getting the icmp host unreachables, and - work through that. Some hosts don't answer PINGs. - - Auto-switch to that strategy if "host is known, but 10/10 - pings got lost" - - The "don't probe all hosts at once" strategy can be improved a bit. It should not probe more than 10 unknown hosts, but the counter need not be reset at the start of the "round". This way if you probe diff -ur mtr-0.33/configure mtr-0.34/configure --- mtr-0.33/configure Tue Mar 9 19:59:41 1999 +++ mtr-0.34/configure Sat Mar 13 22:07:18 1999 @@ -700,7 +700,7 @@ PACKAGE=mtr -VERSION=0.33 +VERSION=0.34 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1169,13 +1169,17 @@ +# Some doc I found somewhere. :-) -- REW +# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:1174: checking for initscr" >&5 +echo "configure:1178: 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:1206: \"$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 @@ -1216,7 +1220,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:1220: checking for initscr in -lncurses" >&5 +echo "configure:1224: 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 @@ -1224,7 +1228,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:1243: \"$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 @@ -1261,7 +1265,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:1265: checking for initscr in -lcurses" >&5 +echo "configure:1269: 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 @@ -1269,7 +1273,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:1288: \"$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 @@ -1317,8 +1321,9 @@ fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1322: checking how to run the C preprocessor" >&5 +echo "configure:1327: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1333,13 +1338,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:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1348: \"$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 : @@ -1350,13 +1355,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:1360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1365: \"$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 : @@ -1367,13 +1372,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:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1382: \"$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 : @@ -1401,17 +1406,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1405: checking for $ac_hdr" >&5 +echo "configure:1410: 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:1415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1420: \"$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* @@ -1441,17 +1446,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1445: checking for $ac_hdr" >&5 +echo "configure:1450: 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:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1460: \"$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* @@ -1479,7 +1484,7 @@ echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1483: checking for floor in -lm" >&5 +echo "configure:1488: 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 @@ -1487,7 +1492,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:1507: \"$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 @@ -1568,7 +1573,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:1572: checking for $ac_word" >&5 +echo "configure:1577: 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 @@ -1603,7 +1608,7 @@ min_gtk_version=1.0.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1607: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:1612: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -1626,7 +1631,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1692,7 +1697,7 @@ } EOF -if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1727,7 +1732,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -1737,7 +1742,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1746: \"$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" @@ -1782,12 +1787,12 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:1786: checking for socket" >&5 +echo "configure:1791: 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:1819: \"$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 @@ -1828,7 +1833,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1832: checking for socket in -lsocket" >&5 +echo "configure:1837: 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 @@ -1836,7 +1841,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:1856: \"$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 @@ -1879,12 +1884,12 @@ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1883: checking for gethostbyname" >&5 +echo "configure:1888: 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:1916: \"$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 @@ -1925,7 +1930,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1929: checking for gethostbyname in -lnsl" >&5 +echo "configure:1934: 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 @@ -1933,7 +1938,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:1953: \"$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 @@ -1976,12 +1981,12 @@ echo $ac_n "checking for res_init""... $ac_c" 1>&6 -echo "configure:1980: checking for res_init" >&5 +echo "configure:1985: checking for res_init" >&5 if eval "test \"`echo '$''{'ac_cv_func_res_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_res_init=yes" else @@ -2022,7 +2027,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lbind""... $ac_c" 1>&6 -echo "configure:2026: checking for res_init in -lbind" >&5 +echo "configure:2031: checking for res_init in -lbind" >&5 ac_lib_var=`echo bind'_'res_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2030,7 +2035,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:2050: \"$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 @@ -2067,7 +2072,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6 -echo "configure:2071: checking for res_init in -lresolv" >&5 +echo "configure:2076: checking for res_init in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2075,7 +2080,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:2095: \"$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 @@ -2120,12 +2125,12 @@ echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6 -echo "configure:2124: checking for res_mkquery" >&5 +echo "configure:2129: 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:2157: \"$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 @@ -2166,7 +2171,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lbind""... $ac_c" 1>&6 -echo "configure:2170: checking for res_init in -lbind" >&5 +echo "configure:2175: checking for res_init in -lbind" >&5 ac_lib_var=`echo bind'_'res_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2174,7 +2179,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:2194: \"$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 @@ -2211,7 +2216,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6 -echo "configure:2215: checking for res_init in -lresolv" >&5 +echo "configure:2220: checking for res_init in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2219,7 +2224,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:2239: \"$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 @@ -2264,12 +2269,12 @@ echo $ac_n "checking for herror""... $ac_c" 1>&6 -echo "configure:2268: checking for herror" >&5 +echo "configure:2273: 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:2301: \"$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 @@ -2316,12 +2321,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2320: checking for strerror" >&5 +echo "configure:2325: 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:2353: \"$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 diff -ur mtr-0.33/configure.in mtr-0.34/configure.in --- mtr-0.33/configure.in Tue Mar 9 19:56:49 1999 +++ mtr-0.34/configure.in Sat Mar 13 22:07:07 1999 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.33) +AM_INIT_AUTOMAKE(mtr, 0.34) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) @@ -14,12 +14,17 @@ AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned long, 4) +# Some doc I found somewhere. :-) -- REW +# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) + AC_CHECK_FUNC(initscr, , AC_CHECK_LIB(ncurses, initscr, , AC_CHECK_LIB(curses, initscr, , AC_MSG_WARN(Building without curses display support) AC_DEFINE(NO_CURSES) CURSES_OBJ=))) + AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h) AC_CHECK_HEADERS(sys/xti.h) diff -ur mtr-0.33/curses.c mtr-0.34/curses.c --- mtr-0.33/curses.c Sun Mar 7 22:24:54 1999 +++ mtr-0.34/curses.c Sat Apr 3 01:03:37 1999 @@ -63,6 +63,10 @@ return ActionQuit; if (c==12) return ActionClear; + if (c==19) + return ActionPause; + if (c==17) + return ActionResume; if(tolower(c) == 'r') return ActionReset; if (tolower(c) == 'd') diff -ur mtr-0.33/display.c mtr-0.34/display.c --- mtr-0.33/display.c Sun Mar 7 22:24:54 1999 +++ mtr-0.34/display.c Sat Mar 13 21:48:37 1999 @@ -31,6 +31,7 @@ #define mtr_curses_close() #define mtr_curses_redraw() #define mtr_curses_keyaction() +#define mtr_curses_clear() #endif #ifdef NO_GTK @@ -39,6 +40,13 @@ #define gtk_redraw() #define gtk_keyaction() #define gtk_loop() +#endif + +#ifdef NO_SPLIT +#define split_open() +#define split_close() +#define split_redraw() +#define split_keyaction() 0 #endif void display_detect(int *argc, char ***argv) { diff -ur mtr-0.33/display.h mtr-0.34/display.h --- mtr-0.33/display.h Sun Mar 7 22:24:54 1999 +++ mtr-0.34/display.h Sat Apr 3 01:03:37 1999 @@ -17,7 +17,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear }; +enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear, + ActionPause, ActionResume }; enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw }; /* Prototypes for display.c */ diff -ur mtr-0.33/gtk.c mtr-0.34/gtk.c --- mtr-0.33/gtk.c Sun Mar 7 22:24:54 1999 +++ mtr-0.34/gtk.c Mon Mar 15 22:16:13 1999 @@ -258,6 +258,7 @@ GtkWidget *List; gtk_window_set_title(GTK_WINDOW(Window), "My traceroute [v" VERSION "]"); + gtk_window_set_wmclass(GTK_WINDOW(Window), "mtr", "Mtr"); gtk_widget_set_usize(Window, 540, 400); gtk_container_border_width(GTK_CONTAINER(Window), 10); VBox = gtk_vbox_new(FALSE, 10); diff -ur mtr-0.33/net.c mtr-0.34/net.c --- mtr-0.33/net.c Sun Mar 7 22:24:54 1999 +++ mtr-0.34/net.c Tue Mar 23 09:01:58 1999 @@ -78,16 +78,8 @@ #define SOL_IP 0 #endif -struct packetdata { - int index; - int ttl; - int sec; - int msec; - int seq; -}; - struct nethost { - int addr; + uint32 addr; int xmit; int returned; int total; @@ -97,7 +89,15 @@ int saved[SAVED_PINGS]; }; +struct sequence { + int index; + int transit; + int saved_seq; + struct timeval time; +}; + static struct nethost host[MaxHost]; +static struct sequence sequence[MaxSequence]; static struct timeval reset = { 0, 0 }; int sendsock; @@ -123,65 +123,31 @@ static int BSDfix = 0; -void net_send_ping(int index) { - char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader) - + sizeof(struct packetdata)]; - struct IPHeader *ip; - struct ICMPHeader *icmp; - struct packetdata *data; - int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata); - struct sockaddr_in addr; - struct timeval now; - - memset(&addr, 0, sizeof(struct sockaddr_in)); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = host[index].addr; - host[index].xmit++; +int new_sequence(int index) { + static int next_sequence = 0; + int seq; + + seq = next_sequence++; + if(next_sequence >= MaxSequence) + next_sequence = 0; + + sequence[seq].index = index; + sequence[seq].transit = 1; + sequence[seq].saved_seq = ++host[index].xmit; + memset(&sequence[seq].time, 0, sizeof(sequence[seq].time)); + host[index].transit = 1; net_save_xmit(index); - - memset(packet, 0, packetsize); - - ip = (struct IPHeader *)packet; - icmp = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); - data = (struct packetdata *)(packet + sizeof(struct IPHeader) + sizeof(struct ICMPHeader)); - - ip->version = 0x45; - ip->tos = 0; - ip->len = BSDfix? packetsize: htons (packetsize); - ip->id = 0; - ip->frag = 0; - ip->ttl = 127; - ip->protocol = IPPROTO_ICMP; - ip->saddr = 0; - ip->daddr = host[index].addr; - icmp->type = timestamp?ICMP_TSTAMP:ICMP_ECHO; - icmp->id = getpid(); - icmp->sequence = 0; - - data->ttl = 0; - data->index = index; - data->seq = host[index].xmit; - - gettimeofday(&now, NULL); - data->sec = now.tv_sec; - data->msec = now.tv_usec / 1000; - - icmp->checksum = checksum(icmp, packetsize - sizeof(struct IPHeader)); - ip->check = checksum(ip, packetsize); - - sendto(sendsock, packet, packetsize, 0, - (struct sockaddr *)&addr, sizeof(addr)); + return seq; } /* Attempt to find the host at a particular number of hops away */ -void net_send_query(int hops) { - char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata)]; +void net_send_query(int index) { + char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader)]; struct IPHeader *ip; struct ICMPHeader *icmp; - struct packetdata *data; - int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata); + int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader); int rv; static int first=1; @@ -189,33 +155,28 @@ ip = (struct IPHeader *)packet; icmp = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); - data = (struct packetdata *)(packet + sizeof(struct IPHeader) + sizeof(struct ICMPHeader)); ip->version = 0x45; ip->tos = 0; ip->len = BSDfix ? packetsize: htons (packetsize); ip->id = 0; ip->frag = 0; - ip->ttl = hops; + ip->ttl = index + 1; ip->protocol = IPPROTO_ICMP; ip->saddr = 0; ip->daddr = remoteaddress.sin_addr.s_addr; icmp->type = ICMP_ECHO; icmp->id = getpid(); - icmp->sequence = hops; - - data->ttl = hops; - data->index = -1; + icmp->sequence = new_sequence(index); icmp->checksum = checksum(icmp, packetsize - sizeof(struct IPHeader)); ip->check = checksum(ip, packetsize); - + gettimeofday(&sequence[icmp->sequence].time, NULL); rv = sendto(sendsock, packet, packetsize, 0, (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); if (first && (rv < 0) && (errno == EINVAL)) { - first = 0; ip->len = packetsize; rv = sendto(sendsock, packet, packetsize, 0, (struct sockaddr *)&remoteaddress, sizeof(remoteaddress)); @@ -224,54 +185,50 @@ BSDfix = 1; } } + first = 0; } -void net_process_ping(struct packetdata *data, struct sockaddr_in *addr) { - int at; - struct timeval now; +/* 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) { + int index; int totmsec; - if(data->index >= 0) { - gettimeofday(&now, NULL); - - if(data->sec < reset.tv_sec - || (data->sec == reset.tv_sec && (1000*data->msec) < reset.tv_usec)) - /* discard this data point, stats were reset after it was generated */ - return; - - if (net_duplicate(data->index, data->seq)) { - return; - } - - totmsec = (now.tv_sec - data->sec) * 1000 + - ((now.tv_usec/1000) - data->msec); + if(seq < 0 || seq >= MaxSequence) + return; - if(host[data->index].returned <= 0) { - host[data->index].best = host[data->index].worst = totmsec; - } + if(!sequence[seq].transit) + return; + sequence[seq].transit = 0; - if(totmsec < host[data->index].best) - host[data->index].best = totmsec; + index = sequence[seq].index; - if(totmsec > host[data->index].worst) - host[data->index].worst = totmsec; + totmsec = (now.tv_sec - sequence[seq].time.tv_sec) * 1000 + + ((now.tv_usec/1000) - (sequence[seq].time.tv_usec/1000)); - display_rawping (data->index, totmsec); + if(host[index].addr == 0) { + host[index].addr = addr; + display_rawhost(index, host[index].addr); + } + if(host[index].returned <= 0) { + host[index].best = host[index].worst = totmsec; + } + if(totmsec < host[index].best) + host[index].best = totmsec; + if(totmsec > host[index].worst) + host[index].worst = totmsec; - host[data->index].total += totmsec; - host[data->index].returned++; - host[data->index].transit = 0; - net_save_return(data->index, data->seq, totmsec); - } else { - at = data->ttl - 1; - if(at < 0 || at > MaxHost) - return; + host[index].total += totmsec; + host[index].returned++; + host[index].transit = 0; - host[at].addr = addr->sin_addr.s_addr; - display_rawhost (at, host[at].addr); - } + net_save_return(index, sequence[seq].saved_seq, totmsec); + display_rawping(index, totmsec); } +/* We know a packet has come in, because the main select loop has called us, + now we just need to read it, see if it is for us, and if it is a reply + to something we sent, then call net_process_ping() */ void net_process_return() { char packet[2048]; struct sockaddr_in fromaddr; @@ -279,12 +236,15 @@ int num; int at; struct ICMPHeader *header; + struct timeval now; + + gettimeofday(&now, NULL); fromaddrsize = sizeof(fromaddr); num = recvfrom(recvsock, packet, 2048, 0, (struct sockaddr *)&fromaddr, &fromaddrsize); - if(num < sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + sizeof(struct packetdata)) + if(num < sizeof(struct IPHeader) + sizeof(struct ICMPHeader)) return; header = (struct ICMPHeader *)(packet + sizeof(struct IPHeader)); @@ -292,9 +252,7 @@ if(header->id != getpid()) return; - net_process_ping((struct packetdata *)(packet + sizeof(struct IPHeader) + - sizeof(struct ICMPHeader)), - &fromaddr); + 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)) @@ -304,13 +262,8 @@ sizeof(struct ICMPHeader) + sizeof(struct IPHeader)); if(header->id != getpid()) return; - - at = header->sequence - 1; - if(at < 0 || at > MaxHost) - return; - host[at].addr = fromaddr.sin_addr.s_addr; - display_rawhost (at, net_addr(at)); + net_process_ping(header->sequence, fromaddr.sin_addr.s_addr, now); } } @@ -382,11 +335,7 @@ static int at; int n_unknown, i; - if(host[at].addr == 0) { - net_send_query(at + 1); - } else { - net_send_ping(at); - } + net_send_query(at); n_unknown = 0; @@ -463,7 +412,8 @@ int i; for(at = 0; at < MaxHost; at++) { - host[at].xmit = host[at].transit; + host[at].xmit = 0; + host[at].transit = 0; host[at].returned = 0; host[at].total = 0; host[at].best = 0; @@ -472,6 +422,11 @@ host[at].saved[i] = -2; /* unsent */ } } + + for(at = 0; at < MaxSequence; at++) { + sequence[at].transit = 0; + } + gettimeofday(&reset, NULL); } @@ -484,6 +439,7 @@ return recvsock; } + int* net_saved_pings(int at) { return host[at].saved; } @@ -493,28 +449,6 @@ memcpy(tmp, &host[at].saved[1], (SAVED_PINGS-1)*sizeof(int)); memcpy(host[at].saved, tmp, (SAVED_PINGS-1)*sizeof(int)); host[at].saved[SAVED_PINGS-1] = -1; -} - -int net_duplicate(int at, int seq) { - int idx; - idx = SAVED_PINGS - (host[at].xmit - seq) - 1; - if (idx < 0) { - /* long in the past - assume received */ - return 2; - } - if (idx >= SAVED_PINGS) { - /* ehhhh - back to the future? */ - return 3; - } - if (host[at].saved[idx] == -2) { - /* say what? must be an old ping */ - return 4; - } - if (host[at].saved[idx] != -1) { - /* it's a dup */ - return 5; - } - return 0; } void net_save_return(int at, int seq, int ms) { diff -ur mtr-0.33/net.h mtr-0.34/net.h --- mtr-0.33/net.h Sun Mar 7 22:24:54 1999 +++ mtr-0.34/net.h Tue Mar 23 09:01:58 1999 @@ -47,3 +47,4 @@ int net_duplicate(int at, int seq); #define MaxHost 256 +#define MaxSequence 65536 diff -ur mtr-0.33/select.c mtr-0.34/select.c --- mtr-0.33/select.c Tue Mar 9 20:21:21 1999 +++ mtr-0.34/select.c Sat Apr 3 01:03:37 1999 @@ -43,15 +43,15 @@ int action, maxfd; int dnsfd, netfd; int NumPing; + int paused; struct timeval lasttime, thistime, selecttime; float wt; - /* This starts at -1, because the first packet sent is not counted - as a ping. That confuses people. */ - NumPing = -1; + NumPing = 0; anyset = 0; gettimeofday(&lasttime, NULL); DeltaTime = WaitTime/10; + paused=0; while(1) { intervaltime.tv_sec = DeltaTime; @@ -76,7 +76,7 @@ if(netfd >= maxfd) maxfd = netfd + 1; - if(anyset) { + if(anyset || paused) { selecttime.tv_sec = 0; selecttime.tv_usec = 0; @@ -141,6 +141,12 @@ if (action == ActionClear) display_clear(); + + if (action == ActionPause) + paused=1; + + if (action == ActionResume) + paused=0; anyset = 1; } .