diff -ur mtr-0.39/AUTHORS mtr-0.40/AUTHORS --- mtr-0.39/AUTHORS Wed Jun 9 20:10:06 1999 +++ mtr-0.40/AUTHORS Sat Aug 14 00:10:58 1999 @@ -23,6 +23,7 @@ Charles Levert (charles@comm.polymtl.ca), Bertrand Leconte (B.Leconte@mail.dotcom.fr), Anand Kumria, + Olav Kvittem (Olav.Kvittem@uninett.no), Adam Kramer (l3zqc@qcunix1.acc.qc.edu), Philip Kizer (pckizer@nostrum.com), Simon Kirby, diff -ur mtr-0.39/Makefile.in mtr-0.40/Makefile.in --- mtr-0.39/Makefile.in Wed Jun 9 20:06:29 1999 +++ mtr-0.40/Makefile.in Mon Jun 21 08:14:49 1999 @@ -113,8 +113,8 @@ NROFF = nroff DIST_COMMON = README AUTHORS COPYING INSTALL Makefile.am Makefile.in \ -NEWS TODO acconfig.h aclocal.m4 config.h.in configure.in install-sh \ -missing mkinstalldirs stamp-h.in +NEWS TODO acconfig.h aclocal.m4 config.h.in configure configure.in \ +install-sh missing mkinstalldirs stamp-h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) diff -ur mtr-0.39/NEWS mtr-0.40/NEWS --- mtr-0.39/NEWS Wed Jun 9 20:06:26 1999 +++ mtr-0.40/NEWS Sat Aug 14 00:12:16 1999 @@ -1,5 +1,13 @@ WHAT'S NEW? + v0.40 Fixed some problems with HPUX and SunOS. + Included Olav Kvittem's patch to do packetsize option. + Made the timekeeping in micro seconds. + + v0.39 Forgot the parentheses around the previous fix... :-( + + v0.38 fixed some dubious code in dns.c (noted by someone's lint) + v0.37 Added Bill Bogstad's "show the local host & time" patch. Added R. Sparks' show-last-ping patch, submitted by Philip Kizer. diff -ur mtr-0.39/TODO mtr-0.40/TODO --- mtr-0.39/TODO Wed Jun 9 20:06:27 1999 +++ mtr-0.40/TODO Sat Aug 14 00:16:09 1999 @@ -1,8 +1,33 @@ +Hi everyone, + +This is the "todo" file for mtr. I just realized that some people +might think that this is all in MY queue to implement. That is not +true: This is the "for everybody" todo list. Feel free to pick a +"project" and implement something off this list. + +Students: Feel free to take up one of these as a programming exercise +for one of your courses. + +Everybody: If you want to start on something, contact me first, so +that the effort isn't wasted by someone who finishes just a tad +earlier. I'll happily provide "coaching" to anyone who wants to +implement something on this list. That way we get the design of +these things the way I like them. This should result in a better +maintainable mtr. + +Oh, Feel free to provide suggestions for this list. + + +-- REW + +---------------------------------------------------------------------- + + - Stuff to implement: - Allow mtr to log the return packets, for later analysis. - Done: 0.25 . Todo: allow the userinterface(s) to work while + Done: 0.25 . Todo: allow the user interface(s) to work while still logging to a file. Write a "logfile displaying" mode to mtr. @@ -11,20 +36,6 @@ convert these measurements into one-way measurements, not just round-trip. - - Allow mtr to also send larger packets. - This will enable us to get a feel for the speed of the links - we're traversing. (Van Jacobson was working on this His tool - was slow, mtr will rock with this feature.... :-) - (Anybody have the statistics experience to tell me how - to do the data analysis?) - - - 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 - slowly (relative to the RTT time to the end host), it can probe - all hosts in the first "round". - -- DONE. - - allow "keyboard navigation" in the GTK version. @@ -62,6 +73,28 @@ - Allow a toggle between hostname/IP number display. (for example a click on the hostname could revert to ip number display in gtk version. - curses: "n" key toggles hostnames/ipnumbers? + curses: "n" key toggles hostnames/ipnumbers?) + + - Implement rfc2317 mechanism to do reverse lookups for networks that + have DNS delegations on non-octet boundaries. -- Daniel Bergstrom + (noa@melody.se) + +------------------------------------------------------------------------ +Things that shouldn't be on the TODO list because they're done. ;-) + + - Allow mtr to also send larger packets. + This will enable us to get a feel for the speed of the links + we're traversing. (Van Jacobson was working on this His tool + was slow, mtr will rock with this feature.... :-) + (Anybody have the statistics experience to tell me how + to do the data analysis?) + -- DONE. Thanks to Olav Kvittem ... + + - 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 + slowly (relative to the RTT time to the end host), it can probe + all hosts in the first "round". + -- DONE. diff -ur mtr-0.39/config.h.in mtr-0.40/config.h.in --- mtr-0.39/config.h.in Wed Jun 9 20:06:26 1999 +++ mtr-0.40/config.h.in Mon Jun 21 08:15:03 1999 @@ -31,15 +31,27 @@ /* The number of bytes in a unsigned short. */ #undef SIZEOF_UNSIGNED_SHORT +/* Define if you have the attron function. */ +#undef HAVE_ATTRON + +/* Define if you have the seteuid function. */ +#undef HAVE_SETEUID + /* Define if you have the header file. */ #undef HAVE_CURSES_H +/* Define if you have the header file. */ +#undef HAVE_CURSESX_H + /* Define if you have the header file. */ #undef HAVE_NCURSES_H /* Define if you have the header file. */ #undef HAVE_NCURSES_CURSES_H +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + /* Define if you have the header file. */ #undef HAVE_SYS_XTI_H @@ -57,6 +69,9 @@ /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET + +/* Define if you have the termcap library (-ltermcap). */ +#undef HAVE_LIBTERMCAP /* Find the proper type for 8 bits */ #if SIZEOF_UNSIGNED_CHAR == 1 diff -ur mtr-0.39/configure mtr-0.40/configure --- mtr-0.39/configure Wed Jun 9 20:06:30 1999 +++ mtr-0.40/configure Mon Jun 21 08:14:50 1999 @@ -700,7 +700,7 @@ PACKAGE=mtr -VERSION=0.39 +VERSION=0.40 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; } @@ -1173,13 +1173,64 @@ # - 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]]]) +# We don't refer to any symbols in termcap, but -lcurses on SunOS does. +# 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:1181: 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 +else + ac_save_LIBS="$LIBS" +LIBS="-ltermcap $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:1178: checking for initscr" >&5 +echo "configure:1229: 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:1257: \"$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 @@ -1220,7 +1271,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:1224: checking for initscr in -lncurses" >&5 +echo "configure:1275: 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 @@ -1228,7 +1279,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:1294: \"$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 @@ -1265,7 +1316,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:1269: checking for initscr in -lcurses" >&5 +echo "configure:1320: 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 @@ -1273,7 +1324,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:1339: \"$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 @@ -1309,6 +1360,51 @@ else echo "$ac_t""no" 1>&6 +echo $ac_n "checking for initscr in -lcursesX""... $ac_c" 1>&6 +echo "configure:1365: 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 +else + ac_save_LIBS="$LIBS" +LIBS="-lcursesX $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo cursesX | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 echo "configure: warning: Building without curses display support" 1>&2 cat >> confdefs.h <<\EOF #define NO_CURSES 1 @@ -1321,9 +1417,68 @@ fi +fi + + +for ac_func in attron +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1427: 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 < +/* 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 $ac_func(); + +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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1455: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1327: checking how to run the C preprocessor" >&5 +echo "configure:1482: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1338,13 +1493,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:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1503: \"$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 : @@ -1355,13 +1510,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:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1520: \"$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 : @@ -1372,13 +1527,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:1382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1537: \"$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 : @@ -1402,21 +1557,21 @@ fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in ncurses.h ncurses/curses.h curses.h +for ac_hdr in ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1410: checking for $ac_hdr" >&5 +echo "configure:1565: 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:1420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1575: \"$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* @@ -1446,17 +1601,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1450: checking for $ac_hdr" >&5 +echo "configure:1605: 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:1460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1615: \"$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* @@ -1484,7 +1639,7 @@ echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1488: checking for floor in -lm" >&5 +echo "configure:1643: 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 @@ -1492,7 +1647,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:1662: \"$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 @@ -1573,7 +1728,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:1577: checking for $ac_word" >&5 +echo "configure:1732: 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 @@ -1608,7 +1763,7 @@ min_gtk_version=1.0.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1612: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:1767: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -1631,7 +1786,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1697,7 +1852,7 @@ } EOF -if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1732,7 +1887,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -1742,7 +1897,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1901: \"$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" @@ -1787,12 +1942,12 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:1791: checking for socket" >&5 +echo "configure:1946: 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:1974: \"$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 @@ -1833,7 +1988,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1837: checking for socket in -lsocket" >&5 +echo "configure:1992: 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 @@ -1841,7 +1996,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:2011: \"$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 @@ -1884,12 +2039,12 @@ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1888: checking for gethostbyname" >&5 +echo "configure:2043: 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:2071: \"$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 @@ -1930,7 +2085,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1934: checking for gethostbyname in -lnsl" >&5 +echo "configure:2089: 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 @@ -1938,7 +2093,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:2108: \"$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 @@ -1981,12 +2136,12 @@ echo $ac_n "checking for res_init""... $ac_c" 1>&6 -echo "configure:1985: checking for res_init" >&5 +echo "configure:2140: 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:2168: \"$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 @@ -2027,7 +2182,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lbind""... $ac_c" 1>&6 -echo "configure:2031: checking for res_init in -lbind" >&5 +echo "configure:2186: 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 @@ -2035,7 +2190,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:2205: \"$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 @@ -2072,7 +2227,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6 -echo "configure:2076: checking for res_init in -lresolv" >&5 +echo "configure:2231: 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 @@ -2080,7 +2235,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:2250: \"$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 @@ -2124,13 +2279,70 @@ fi +for ac_func in seteuid +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2286: 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 < +/* 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 $ac_func(); + +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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2314: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +# 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:2129: checking for res_mkquery" >&5 +echo "configure:2341: 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:2369: \"$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 @@ -2171,7 +2383,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lbind""... $ac_c" 1>&6 -echo "configure:2175: checking for res_init in -lbind" >&5 +echo "configure:2387: 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 @@ -2179,7 +2391,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:2406: \"$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 @@ -2216,7 +2428,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6 -echo "configure:2220: checking for res_init in -lresolv" >&5 +echo "configure:2432: 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 @@ -2224,7 +2436,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:2451: \"$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 @@ -2269,12 +2481,12 @@ echo $ac_n "checking for herror""... $ac_c" 1>&6 -echo "configure:2273: checking for herror" >&5 +echo "configure:2485: 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:2513: \"$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 @@ -2321,12 +2533,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2325: checking for strerror" >&5 +echo "configure:2537: 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:2565: \"$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.39/configure.in mtr-0.40/configure.in --- mtr-0.39/configure.in Wed Jun 9 20:06:27 1999 +++ mtr-0.40/configure.in Mon Jun 21 08:14:43 1999 @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.39) +AM_INIT_AUTOMAKE(mtr, 0.40) AC_SUBST(GTK_OBJ) AC_SUBST(CURSES_OBJ) @@ -18,14 +18,23 @@ # - 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]]]) +# We don't refer to any symbols in termcap, but -lcurses on SunOS does. +# 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). +AC_CHECK_LIB(termcap, tgetent) + AC_CHECK_FUNC(initscr, , AC_CHECK_LIB(ncurses, initscr, , AC_CHECK_LIB(curses, initscr, , + AC_CHECK_LIB(cursesX, initscr, , AC_MSG_WARN(Building without curses display support) AC_DEFINE(NO_CURSES) - CURSES_OBJ=))) + CURSES_OBJ=)))) + +AC_CHECK_FUNCS(attron) -AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h) + +AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h) AC_CHECK_HEADERS(sys/xti.h) AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found)) @@ -45,6 +54,9 @@ AC_CHECK_FUNC(res_init, , AC_CHECK_LIB(bind, res_init, , AC_CHECK_LIB(resolv, res_init, , AC_MSG_ERROR(No resolver library found)))) + +AC_CHECK_FUNCS(seteuid) +# AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or setuid)) AC_CHECK_FUNC(res_mkquery, , AC_CHECK_LIB(bind, res_init, , diff -ur mtr-0.39/curses.c mtr-0.40/curses.c --- mtr-0.39/curses.c Wed Jun 9 20:06:27 1999 +++ mtr-0.40/curses.c Sat Aug 14 00:22:50 1999 @@ -29,10 +29,24 @@ # include #elif defined(HAVE_CURSES_H) # include +#elif defined(HAVE_CURSESX_H) +# include #else # error No curses header file available #endif +#if defined(HAVE_SYS_TYPES_H) +#include +#else +/* If a system doesn't have sys/types.h, lets hope that time_t is an int */ +#define time_t int +#endif + +#ifndef HAVE_ATTRON +#define attron(x) +#define attroff(x) +#endif + #ifndef getmaxyx # define getmaxyx(win,y,x) (y = (win)->_maxy + 1, x = (win)->_maxx + 1) #endif @@ -44,7 +58,7 @@ #endif #include -extern LocalHostname[]; +extern char LocalHostname[]; void pwcenter(char *str) { int maxx, maxy; @@ -66,9 +80,9 @@ return ActionQuit; if (c==12) return ActionClear; - if (c==19) + if ((c==19) || (tolower (c) == 'p')) return ActionPause; - if (c==17) + if ((c==17) || (c == ' ')) return ActionResume; if(tolower(c) == 'r') return ActionReset; @@ -103,10 +117,12 @@ getyx(stdscr, y, x); move(y, startstat); + /* net_xxx returns times in usecs. Just display millisecs */ printw(" %3d%% %4d %4d %4d %4d %4d %6d", net_percent(at), - net_returned(at), net_xmit(at), - net_last(at),net_best(at), net_avg(at), net_worst(at)); + net_returned(at), net_xmit(at), + net_last(at)/1000, net_best(at)/1000, + net_avg(at)/1000, net_worst(at)/1000); } else { @@ -234,12 +250,12 @@ rowstat = 5; - attron(A_BOLD); move(0, 0); + attron(A_BOLD); pwcenter("Matt's traceroute [v" VERSION "]"); - printw("\n"); attroff(A_BOLD); - printw(LocalHostname); + + mvprintw(1,0, LocalHostname); time(&t); mvprintw(1, maxx-25, ctime(&t)); @@ -255,7 +271,7 @@ mvprintw(rowstat - 1, 0, "Hostname"); if (display_mode == 0) { - startstat = maxx - 40; + startstat = maxx - 41; /* Modified by Brian Casey December 1997 bcasey@imagiware.com */ mvprintw(rowstat - 2, startstat, " Packets Pings"); @@ -283,7 +299,7 @@ attroff(A_BOLD); for (i = 0; i < 7; i++) { - printw(" %c:%d ms", block_map[i], scale[i]); + printw(" %c:%d ms", block_map[i], scale[i]/1000); } } diff -ur mtr-0.39/dns.c mtr-0.40/dns.c --- mtr-0.39/dns.c Wed Jun 9 20:09:20 1999 +++ mtr-0.40/dns.c Sun Jun 20 23:59:32 1999 @@ -92,8 +92,8 @@ struct resolve *previousip; struct resolve *nexthost; struct resolve *previoushost; + float expiretime; /* Fucking HPUX has a problem with "double" here. */ char *hostname; - double expiretime; ip_t ip; word id; byte state; diff -ur mtr-0.39/gtk.c mtr-0.40/gtk.c --- mtr-0.39/gtk.c Wed Jun 9 20:06:27 1999 +++ mtr-0.40/gtk.c Sat Aug 14 00:19:43 1999 @@ -300,9 +300,9 @@ gtk_set_field_num(List, row, 2, "%d", net_returned(row)); gtk_set_field_num(List, row, 3, "%d", net_xmit(row)); - gtk_set_field_num(List, row, 4, "%d", net_best(row)); - gtk_set_field_num(List, row, 5, "%d", net_avg(row)); - gtk_set_field_num(List, row, 6, "%d", net_worst(row)); + gtk_set_field_num(List, row, 4, "%d", net_best(row)/1000); + gtk_set_field_num(List, row, 5, "%d", net_avg(row)/1000); + gtk_set_field_num(List, row, 6, "%d", net_worst(row)/1000); } diff -ur mtr-0.39/mtr.8 mtr-0.40/mtr.8 --- mtr-0.39/mtr.8 Wed Jun 9 20:06:27 1999 +++ mtr-0.40/mtr.8 Fri Aug 13 23:46:57 1999 @@ -40,7 +40,10 @@ [\c .B \-\-interval\ SECONDS\c ] -.B HOSTNAME +[\c +.B \-\-psize\ BYTES | -p BYTES\c +] +.B HOSTNAME [PACKETSIZE] .SH DESCRIPTION @@ -116,6 +119,15 @@ .B -r option. +.TP +.B \-p\ BYTES +.TP +.B \-\-psize\ BYTES +.TP +.B PACKETSIZE +These options or a trailing PACKETSIZE on the commandline sets +the packet size used for probing. +It is in bytes inclusive IP and ICMP headers .TP .B \-t .TP Only in mtr-0.40: mtr.8.rej diff -ur mtr-0.39/mtr.c mtr-0.40/mtr.c --- mtr-0.39/mtr.c Wed Jun 9 20:06:26 1999 +++ mtr-0.40/mtr.c Sat Aug 14 00:05:25 1999 @@ -30,6 +30,12 @@ #include "report.h" #include "net.h" + +#ifndef HAVE_SETEUID +/* HPUX doesn't have seteuid, but setuid works fine in that case for us */ +#define seteuid setuid +#endif + int DisplayMode; int Interactive = 1; int PrintVersion = 0; @@ -39,6 +45,7 @@ char *Hostname = NULL; char LocalHostname[128]; int dns = 1; +int packetsize = 64; void parse_arg(int argc, char **argv) { int opt; @@ -50,6 +57,7 @@ { "curses", 0, 0, 't' }, { "gtk", 0, 0, 'g' }, { "interval", 1, 0, 'i' }, + { "psize", 1, 0, 'p' }, { "no-dns", 0, 0, 'n' }, { "split", 0, 0, 's' }, /* BL */ { "raw", 0, 0, 'l' }, @@ -58,7 +66,7 @@ opt = 0; while(1) { - opt = getopt_long(argc, argv, "hvrc:tklnsi:", long_options, NULL); + opt = getopt_long(argc, argv, "hvrc:tklnsi:p:", long_options, NULL); if(opt == -1) break; @@ -73,7 +81,10 @@ DisplayMode = DisplayReport; break; case 'c': - MaxPing = atoi(optarg); + MaxPing = atoi (optarg); + break; + case 'p': + packetsize = atoi (optarg); break; case 't': DisplayMode = DisplayCurses; @@ -91,7 +102,7 @@ dns = 0; break; case 'i': - WaitTime = atof(optarg); + WaitTime = atof (optarg); if (WaitTime <= 0.0) { fprintf (stderr, "mtr: wait time must be positive\n"); exit (1); @@ -131,6 +142,7 @@ parse_arg (argc, argv); optind = 0; } + int main(int argc, char **argv) { diff -ur mtr-0.39/net.c mtr-0.40/net.c --- mtr-0.39/net.c Wed Jun 9 20:06:27 1999 +++ mtr-0.40/net.c Sat Aug 14 00:21:12 1999 @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + 1999-08-13 ok Olav@okvittem.priv.no added -psize + */ #include @@ -75,12 +78,14 @@ #ifndef SOL_IP #define SOL_IP 0 #endif - + + + struct nethost { uint32 addr; int xmit; int returned; - int total; + long long total; int last; int best; int worst; @@ -113,7 +118,7 @@ static int batch_at = 0; - +extern int packetsize; static int numhosts = 10; /* return the number of microseconds to wait before sending the next @@ -167,13 +172,17 @@ /* Attempt to find the host at a particular number of hops away */ void net_send_query(int index) { - char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader)]; + /*ok char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader)];*/ + char packet[MAXPACKET]; struct IPHeader *ip; struct ICMPHeader *icmp; - int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader); + + /*ok int packetsize = sizeof(struct IPHeader) + sizeof(struct ICMPHeader) + datasize;*/ int rv; static int first=1; + if ( packetsize < MINPACKET ) packetsize = MINPACKET; + if ( packetsize > MAXPACKET ) packetsize = MAXPACKET; memset(packet, 0, packetsize); ip = (struct IPHeader *)packet; @@ -215,7 +224,7 @@ time. */ void net_process_ping(int seq, uint32 addr, struct timeval now) { int index; - int totmsec; + int totusec; if(seq < 0 || seq >= MaxSequence) return; @@ -226,28 +235,28 @@ index = sequence[seq].index; - totmsec = (now.tv_sec - sequence[seq].time.tv_sec) * 1000 + - ((now.tv_usec/1000) - (sequence[seq].time.tv_usec/1000)); + totusec = (now.tv_sec - sequence[seq].time.tv_sec ) * 1000000 + + (now.tv_usec - sequence[seq].time.tv_usec); 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; + host[index].best = host[index].worst = totusec; } - host[index].last = totmsec; - if(totmsec < host[index].best) - host[index].best = totmsec; - if(totmsec > host[index].worst) - host[index].worst = totmsec; + host[index].last = totusec; + if(totusec < host[index].best) + host[index].best = totusec; + if(totusec > host[index].worst) + host[index].worst = totusec; - host[index].total += totmsec; + host[index].total += totusec; host[index].returned++; host[index].transit = 0; - net_save_return(index, sequence[seq].saved_seq, totmsec); - display_rawping(index, totmsec); + net_save_return(index, sequence[seq].saved_seq, totusec); + display_rawping(index, totusec); } /* We know a packet has come in, because the main select loop has called us, diff -ur mtr-0.39/net.h mtr-0.40/net.h --- mtr-0.39/net.h Wed Jun 9 20:06:27 1999 +++ mtr-0.40/net.h Sat Aug 14 00:01:23 1999 @@ -51,3 +51,6 @@ #define MaxHost 256 #define MaxSequence 65536 + +#define MAXPACKET 4096 +#define MINPACKET 64 diff -ur mtr-0.39/report.c mtr-0.40/report.c --- mtr-0.39/report.c Wed Jun 9 20:06:27 1999 +++ mtr-0.40/report.c Sat Aug 14 00:19:59 1999 @@ -65,7 +65,7 @@ printf("%-40s%5d%%%6d%5d%6d%6d%6d\n", name, net_percent(at), net_returned(at), net_xmit(at), - net_best(at), net_avg(at), net_worst(at)); + net_best(at)/1000, net_avg(at)/1000, net_worst(at)/1000); } } diff -ur mtr-0.39/split.c mtr-0.40/split.c --- mtr-0.39/split.c Wed Jun 9 20:06:27 1999 +++ mtr-0.40/split.c Sat Aug 14 00:19:07 1999 @@ -34,6 +34,13 @@ #include +#ifdef NO_CURSES +#include +#include +#include +#else +/* Use the curses variant */ + #if defined(HAVE_NCURSES_H) # include #elif defined(HAVE_NCURSES_CURSES_H) @@ -44,6 +51,7 @@ # error No curses header file available #endif +#endif extern char *Hostname; @@ -93,16 +101,18 @@ if(name != NULL) { /* May be we should test name's length */ sprintf(newLine, "%s %d %d %d %d %d %d", name, - net_percent(at), - net_returned(at), net_xmit(at), - net_best(at), net_avg(at), net_worst(at)); + net_percent(at), + net_returned(at), net_xmit(at), + 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, - net_percent(at), - net_returned(at), net_xmit(at), - net_best(at), net_avg(at), net_worst(at)); + (addr >> 24) & 0xff, (addr >> 16) & 0xff, + (addr >> 8) & 0xff, addr & 0xff, + net_percent(at), + net_returned(at), net_xmit(at), + net_best(at) /1000, net_avg(at)/1000, + net_worst(at)/1000); } } else { sprintf(newLine, "???"); @@ -145,7 +155,23 @@ int split_keyaction() { +#ifdef NO_CURSES + fd_set readfds; + struct timeval tv; + char c; + + FD_ZERO (&readfds); + FD_SET (0, &readfds); + tv.tv_sec = 0; + tv.tv_usec = 0; + + if (select (1, &readfds, NULL, NULL, &tv) > 0) { + read (0, &c, 1); + } else + return 0; +#else char c = getch(); +#endif #if DEBUG printf("split_keyaction()\n"); .