autoconfization of TOS patches

TOS
Stephane Bortzmeyer 24 years ago
parent efde8f513c
commit c8e5d35d93

@ -12,6 +12,8 @@ and beta-testing.
Christian Grimm for the ICP code. Christian Grimm for the ICP code.
Glen Turner <glen.turner@aarnet.edu.au> for the Type Of Service code.
The Pasteur Institute because the work was done when working on the The Pasteur Institute because the work was done when working on the
French national Web cache project, while being an employee of the French national Web cache project, while being an employee of the
Institute. Institute.

@ -6,6 +6,9 @@
/* Do we have T/TCP? */ /* Do we have T/TCP? */
#undef HAVE_TTCP #undef HAVE_TTCP
/* Do we have TOS? */
#undef HAVE_TOS
/* Is sys_errlist declared? */ /* Is sys_errlist declared? */
#undef DECL_SYS_ERRLIST #undef DECL_SYS_ERRLIST

@ -49,6 +49,9 @@
/* Do we have T/TCP? */ /* Do we have T/TCP? */
#undef HAVE_TTCP #undef HAVE_TTCP
/* Do we have TOS? */
#undef HAVE_TOS
/* Is sys_errlist declared? */ /* Is sys_errlist declared? */
#undef DECL_SYS_ERRLIST #undef DECL_SYS_ERRLIST

202
SRC/configure vendored

@ -17,6 +17,8 @@ ac_help="$ac_help
--enable-icp ICP (for testing Web proxies/caches) support" --enable-icp ICP (for testing Web proxies/caches) support"
ac_help="$ac_help ac_help="$ac_help
--enable-ttcp T/TCP (Transaction TCP) support" --enable-ttcp T/TCP (Transaction TCP) support"
ac_help="$ac_help
--enable-tos TOS (Type Of Service - and socket priority) support"
# Initialize some variables set by options. # Initialize some variables set by options.
# The variables have the same names as the options, with # The variables have the same names as the options, with
@ -558,7 +560,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:562: checking for a BSD compatible install" >&5 echo "configure:564: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -611,7 +613,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:615: checking whether build environment is sane" >&5 echo "configure:617: checking whether build environment is sane" >&5
# Just in case # Just in case
sleep 1 sleep 1
echo timestamp > conftestfile echo timestamp > conftestfile
@ -668,7 +670,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x," test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo "configure:674: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` 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 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -714,7 +716,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd` missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:718: checking for working aclocal" >&5 echo "configure:720: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh. # Redirect stdin to placate older versions of autoconf. Sigh.
@ -727,7 +729,7 @@ else
fi fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:731: checking for working autoconf" >&5 echo "configure:733: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh. # Redirect stdin to placate older versions of autoconf. Sigh.
@ -740,7 +742,7 @@ else
fi fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:744: checking for working automake" >&5 echo "configure:746: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh. # Redirect stdin to placate older versions of autoconf. Sigh.
@ -753,7 +755,7 @@ else
fi fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:757: checking for working autoheader" >&5 echo "configure:759: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh. # Redirect stdin to placate older versions of autoconf. Sigh.
@ -766,7 +768,7 @@ else
fi fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:770: checking for working makeinfo" >&5 echo "configure:772: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if # Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected. # an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh. # Redirect stdin to placate older versions of autoconf. Sigh.
@ -814,7 +816,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args. # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2 set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:818: checking for $ac_word" >&5 echo "configure:820: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -844,7 +846,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args. # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2 set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:848: checking for $ac_word" >&5 echo "configure:850: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -895,7 +897,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args. # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2 set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:899: checking for $ac_word" >&5 echo "configure:901: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -927,7 +929,7 @@ fi
fi fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:931: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 echo "configure:933: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -938,12 +940,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 942 "configure" #line 944 "configure"
#include "confdefs.h" #include "confdefs.h"
main(){return(0);} main(){return(0);}
EOF EOF
if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler. # If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then if (./conftest; exit) 2>/dev/null; then
@ -969,12 +971,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:973: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "configure:975: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:978: checking whether we are using GNU C" >&5 echo "configure:980: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -983,7 +985,7 @@ else
yes; yes;
#endif #endif
EOF EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:987: \"$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:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes ac_cv_prog_gcc=yes
else else
ac_cv_prog_gcc=no ac_cv_prog_gcc=no
@ -1002,7 +1004,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS" ac_save_CFLAGS="$CFLAGS"
CFLAGS= CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1006: checking whether ${CC-cc} accepts -g" >&5 echo "configure:1008: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -1048,7 +1050,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1052: checking for a BSD compatible install" >&5 echo "configure:1054: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -1103,7 +1105,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1107: checking how to run the C preprocessor" >&5 echo "configure:1109: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
@ -1118,13 +1120,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1122 "configure" #line 1124 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1135,13 +1137,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1139 "configure" #line 1141 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1152,13 +1154,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -nologo -E" CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1156 "configure" #line 1158 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1183,12 +1185,12 @@ fi
echo "$ac_t""$CPP" 1>&6 echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1187: checking for ANSI C header files" >&5 echo "configure:1189: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1192 "configure" #line 1194 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -1196,7 +1198,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -1213,7 +1215,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1217 "configure" #line 1219 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -1231,7 +1233,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1235 "configure" #line 1237 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -1252,7 +1254,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1256 "configure" #line 1258 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -1263,7 +1265,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:1267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
: :
else else
@ -1290,17 +1292,17 @@ for ac_hdr in sys/time.h unistd.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1294: checking for $ac_hdr" >&5 echo "configure:1296: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1299 "configure" #line 1301 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -1331,13 +1333,13 @@ for cf_name in sys_nerr sys_errlist
do do
echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6 echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6
echo "configure:1335: checking if external $cf_name is declared" >&5 echo "configure:1337: checking if external $cf_name is declared" >&5
if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1341 "configure" #line 1343 "configure"
#include "confdefs.h" #include "confdefs.h"
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
@ -1350,7 +1352,7 @@ int main() {
long x = (long) $cf_name long x = (long) $cf_name
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
eval 'cf_cv_dcl_'$cf_name'=yes' eval 'cf_cv_dcl_'$cf_name'=yes'
else else
@ -1380,13 +1382,13 @@ fi
# It's possible (for near-UNIX clones) that the data doesn't exist # It's possible (for near-UNIX clones) that the data doesn't exist
echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6 echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6
echo "configure:1384: checking if external $cf_name exists" >&5 echo "configure:1386: checking if external $cf_name exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1390 "configure" #line 1392 "configure"
#include "confdefs.h" #include "confdefs.h"
#undef $cf_name #undef $cf_name
@ -1396,7 +1398,7 @@ int main() {
$cf_name = 2 $cf_name = 2
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval 'cf_cv_have_'$cf_name'=yes' eval 'cf_cv_have_'$cf_name'=yes'
else else
@ -1429,12 +1431,12 @@ done
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1433: checking for working const" >&5 echo "configure:1435: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1438 "configure" #line 1440 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
@ -1483,7 +1485,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
@ -1504,12 +1506,12 @@ EOF
fi fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:1508: checking whether time.h and sys/time.h may both be included" >&5 echo "configure:1510: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1513 "configure" #line 1515 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
@ -1518,7 +1520,7 @@ int main() {
struct tm *tp; struct tm *tp;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_header_time=yes ac_cv_header_time=yes
else else
@ -1541,7 +1543,7 @@ fi
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:1545: checking for socket in -lsocket" >&5 echo "configure:1547: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -1549,7 +1551,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS" LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1553 "configure" #line 1555 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -1560,7 +1562,7 @@ int main() {
socket() socket()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -1577,9 +1579,9 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking if libsocket is mandatory""... $ac_c" 1>&6 echo $ac_n "checking if libsocket is mandatory""... $ac_c" 1>&6
echo "configure:1581: checking if libsocket is mandatory" >&5 echo "configure:1583: checking if libsocket is mandatory" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1583 "configure" #line 1585 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -1595,7 +1597,7 @@ int main() {
socket (AF_INET, SOCK_STREAM, 0) socket (AF_INET, SOCK_STREAM, 0)
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
else else
@ -1613,7 +1615,7 @@ fi
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1617: checking for gethostbyname in -lnsl" >&5 echo "configure:1619: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -1621,7 +1623,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS" LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1625 "configure" #line 1627 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -1632,7 +1634,7 @@ int main() {
gethostbyname() gethostbyname()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -1649,9 +1651,9 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking if libnsl is mandatory""... $ac_c" 1>&6 echo $ac_n "checking if libnsl is mandatory""... $ac_c" 1>&6
echo "configure:1653: checking if libnsl is mandatory" >&5 echo "configure:1655: checking if libnsl is mandatory" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1655 "configure" #line 1657 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -1660,7 +1662,7 @@ int main() {
gethostbyname(domain) gethostbyname(domain)
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
else else
@ -1677,12 +1679,12 @@ fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:1681: checking return type of signal handlers" >&5 echo "configure:1683: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1686 "configure" #line 1688 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
@ -1699,7 +1701,7 @@ int main() {
int i; int i;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_type_signal=void ac_cv_type_signal=void
else else
@ -1718,12 +1720,12 @@ EOF
echo $ac_n "checking for vprintf""... $ac_c" 1>&6 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:1722: checking for vprintf" >&5 echo "configure:1724: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1727 "configure" #line 1729 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */ which can conflict with char vprintf(); below. */
@ -1746,7 +1748,7 @@ vprintf();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_vprintf=yes" eval "ac_cv_func_vprintf=yes"
else else
@ -1770,12 +1772,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:1774: checking for _doprnt" >&5 echo "configure:1776: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1779 "configure" #line 1781 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */ which can conflict with char _doprnt(); below. */
@ -1798,7 +1800,7 @@ _doprnt();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func__doprnt=yes" eval "ac_cv_func__doprnt=yes"
else else
@ -1825,12 +1827,12 @@ fi
for ac_func in gettimeofday socket gethostbyname sigaction for ac_func in gettimeofday socket gethostbyname sigaction
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1829: checking for $ac_func" >&5 echo "configure:1831: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1834 "configure" #line 1836 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -1853,7 +1855,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -1880,9 +1882,9 @@ done
echo $ac_n "checking T/TCP""... $ac_c" 1>&6 echo $ac_n "checking T/TCP""... $ac_c" 1>&6
echo "configure:1884: checking T/TCP" >&5 echo "configure:1886: checking T/TCP" >&5
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1886 "configure" #line 1888 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -1891,7 +1893,7 @@ int main() {
int foobar = MSG_EOF; int foobar = MSG_EOF;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define TTCP 1 #define TTCP 1
@ -1929,6 +1931,56 @@ EOF
fi fi
echo $ac_n "checking Type Of Service""... $ac_c" 1>&6
echo "configure:1936: checking Type Of Service" >&5
cat > conftest.$ac_ext <<EOF
#line 1938 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
int foobar = SO_PRIORITY;
; return 0; }
EOF
if { (eval echo configure:1947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define TOS 1
EOF
ac_have_tos="yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_have_tos=no
fi
rm -f conftest*
echo "$ac_t""$ac_have_tos" 1>&6
# Check whether --enable-tos or --disable-tos was given.
if test "${enable_tos+set}" = set; then
enableval="$enable_tos"
if test "$enableval" = "yes"; then
if test $ac_have_tos = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_TOS 1
EOF
else
echo "configure: warning: No TOS support on this system, request ignored" 1>&2
fi
fi
else
if test $ac_have_tos = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_TOS 1
EOF
fi
fi
trap '' 1 2 15 trap '' 1 2 15
cat > confcache <<\EOF cat > confcache <<\EOF

@ -70,5 +70,30 @@ AC_ARG_ENABLE(ttcp,
AC_DEFINE(HAVE_TTCP) AC_DEFINE(HAVE_TTCP)
fi) fi)
dnl Type Of Service
AC_MSG_CHECKING([Type Of Service])
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>
],
[int foobar = SO_PRIORITY;],
[AC_DEFINE(TOS)
ac_have_tos="yes"],
ac_have_tos=no)
AC_MSG_RESULT($ac_have_tos)
AC_ARG_ENABLE(tos,
[--enable-tos TOS (Type Of Service - and socket priority) support],
[if test "$enableval" = "yes"; then
if test $ac_have_tos = "yes"; then
AC_DEFINE(HAVE_TOS)
else
AC_MSG_WARN([No TOS support on this system, request ignored])
fi
fi],
dnl Default: enable it if supported
if test $ac_have_tos = "yes"; then
AC_DEFINE(HAVE_TOS)
fi)
AC_OUTPUT(Makefile) AC_OUTPUT(Makefile)

@ -30,10 +30,10 @@ unsigned int successes, attempts = 0;
unsigned int size = DEFLINE; unsigned int size = DEFLINE;
unsigned int j = 0; unsigned int j = 0;
struct result struct result
{ {
unsigned short valid; unsigned short valid;
struct timeval timevalue; struct timeval timevalue;
}; };
struct result results[MAXNUMBER]; struct result results[MAXNUMBER];
struct timeval good_results[MAXNUMBER]; struct timeval good_results[MAXNUMBER];
extern int tvcmp (); extern int tvcmp ();
@ -104,7 +104,6 @@ main (argc, argv)
int tos_requested = 0; int tos_requested = 0;
char *arg_end; char *arg_end;
null_timeval.tv_sec = 0; null_timeval.tv_sec = 0;
null_timeval.tv_usec = 0; null_timeval.tv_usec = 0;
max_timeval.tv_sec = 1000000000; max_timeval.tv_sec = 1000000000;
@ -161,10 +160,8 @@ main (argc, argv)
fill = *optarg; fill = *optarg;
fill_requested = 1; fill_requested = 1;
break; break;
case 'p': case 'p':
priority = (int)strtol( optarg, priority = (int) strtol (optarg, &arg_end, 0);
&arg_end,
0);
if (arg_end == optarg || arg_end == '\0') if (arg_end == optarg || arg_end == '\0')
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
@ -177,16 +174,13 @@ main (argc, argv)
priority_requested = 1; priority_requested = 1;
} }
break; break;
case 'P': case 'P':
tos = (int)strtol( optarg, tos = (int) strtol (optarg, &arg_end, 0);
&arg_end,
0);
if (arg_end == optarg || arg_end == '\0') if (arg_end == optarg || arg_end == '\0')
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: IP type of service (-P) should be " "%s: IP type of service (-P) should be "
"numeric.\n", "numeric.\n", progname);
progname);
exit (1); exit (1);
} }
else else
@ -205,8 +199,7 @@ main (argc, argv)
} }
if (size <= 0) if (size <= 0)
{ {
(void) fprintf (stderr, (void) fprintf (stderr, "%s: illegal packet size.\n", progname);
"%s: illegal packet size.\n", progname);
exit (1); exit (1);
} }
size_requested = 1; size_requested = 1;
@ -216,8 +209,7 @@ main (argc, argv)
timeout_requested = 1; timeout_requested = 1;
if (size <= 0) if (size <= 0)
{ {
(void) fprintf (stderr, (void) fprintf (stderr, "%s: illegal timeout.\n", progname);
"%s: illegal timeout.\n", progname);
exit (1); exit (1);
} }
break; break;
@ -226,14 +218,15 @@ main (argc, argv)
if (number > MAXNUMBER) if (number > MAXNUMBER)
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: number of iterations too large, max is %d.\n", "%s: number of iterations too large, max is %d.\n",
progname, MAXNUMBER); progname, MAXNUMBER);
exit (1); exit (1);
} }
if (number <= 0) if (number <= 0)
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: illegal number of iterations.\n", progname); "%s: illegal number of iterations.\n",
progname);
exit (1); exit (1);
} }
break; break;
@ -255,7 +248,8 @@ main (argc, argv)
if (udp && ((port_to_use == USE_CHARGEN) || (port_to_use == USE_HTTP))) if (udp && ((port_to_use == USE_CHARGEN) || (port_to_use == USE_HTTP)))
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: I don't know how to use this port with UDP.\n", progname); "%s: I don't know how to use this port with UDP.\n",
progname);
exit (1); exit (1);
} }
/* /*
@ -271,7 +265,8 @@ main (argc, argv)
if (http && (fill_requested)) if (http && (fill_requested))
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: Filling incompatible with HTTP connections.\n", progname); "%s: Filling incompatible with HTTP connections.\n",
progname);
exit (1); exit (1);
} }
#ifndef USE_TTCP #ifndef USE_TTCP
@ -297,11 +292,21 @@ main (argc, argv)
"%s: Not compiled with ICP support.\n", progname); "%s: Not compiled with ICP support.\n", progname);
exit (1); exit (1);
} }
#endif
#ifndef USE_TOS
if (priority_requested || tos_requested)
{
(void) fprintf (stderr,
"%s: Not compiled with Type Of Service support.\n",
progname);
exit (1);
}
#endif #endif
if (http && size_requested) if (http && size_requested)
{ {
(void) fprintf (stderr, (void) fprintf (stderr,
"%s: HTTP and message size specification are incompatible.\n", progname); "%s: HTTP and message size specification are incompatible.\n",
progname);
exit (1); exit (1);
} }
if (udp && ttcp) if (udp && ttcp)
@ -352,8 +357,8 @@ main (argc, argv)
err_quit ("gethostbyname error for host: %s %s", err_quit ("gethostbyname error for host: %s %s",
server, sys_err_str ()); server, sys_err_str ());
} }
server_address = *(hostptr->h_addr_list); /* First item of the server_address = *(hostptr->h_addr_list); /* First item of the
* list */ * list */
/* /*
* addr = (u_long) *server_address; * addr = (u_long) *server_address;
*/ */
@ -368,7 +373,7 @@ main (argc, argv)
ptr = (struct in_addr *) malloc (sizeof (struct in_addr)); ptr = (struct in_addr *) malloc (sizeof (struct in_addr));
ptr->s_addr = addr; ptr->s_addr = addr;
} }
if (!http && !icp) /* Already find */ if (!http && !icp) /* Already find */
{ {
if (!udp) if (!udp)
{ {
@ -377,7 +382,7 @@ main (argc, argv)
err_quit ("tcp_open: unknown service: %s/tcp", port_name); err_quit ("tcp_open: unknown service: %s/tcp", port_name);
} }
} }
else else
{ {
if ((sp = getservbyname (port_name, "udp")) == NULL) if ((sp = getservbyname (port_name, "udp")) == NULL)
{ {
@ -456,21 +461,20 @@ main (argc, argv)
err_sys ("bind error"); err_sys ("bind error");
} }
} }
#ifdef USE_TOS
if (priority_requested) if (priority_requested)
{ {
if (verbose) if (verbose)
{ {
printf ("Setting socket priority to %d (0x%02x)\n", printf ("Setting socket priority to %d (0x%02x)\n",
priority, priority, (unsigned int) priority);
(unsigned int)priority);
} }
if (setsockopt(sockfd, if (setsockopt (sockfd,
SOL_SOCKET, SOL_SOCKET,
SO_PRIORITY, SO_PRIORITY,
(void *)&priority, (void *) &priority, (socklen_t) sizeof (priority)))
(socklen_t)sizeof(priority)))
{ {
err_sys("Failed setting socket priority"); err_sys ("Failed setting socket priority");
} }
} }
if (tos_requested) if (tos_requested)
@ -478,30 +482,30 @@ main (argc, argv)
if (verbose) if (verbose)
{ {
printf ("Setting IP type of service octet to %d (0x%02x)\n", printf ("Setting IP type of service octet to %d (0x%02x)\n",
tos, tos, (unsigned int) tos);
(unsigned int)tos);
} }
if (setsockopt(sockfd, if (setsockopt (sockfd,
SOL_IP, SOL_IP,
IP_TOS, IP_TOS, (void *) &tos, (socklen_t) sizeof (tos)))
(void *)&tos,
(socklen_t)sizeof(tos)))
{ {
err_sys("Failed setting IP type of service octet"); err_sys ("Failed setting IP type of service octet");
} }
} }
#endif
if (verbose) if (verbose)
{ {
if (tcp) if (tcp)
{ {
printf ("Trying to connect to internet address %s %s to transmit %u bytes...\n", printf
inet_ntoa (*ptr), (port == 0 ? "" : text_port), n); ("Trying to connect to internet address %s %s to transmit %u bytes...\n",
inet_ntoa (*ptr), (port == 0 ? "" : text_port), n);
} }
#ifdef ICP #ifdef ICP
if (icp) if (icp)
{ {
printf ("Trying to send an ICP packet of %u bytes to the internet address %s...\n", printf
length, inet_ntoa (*ptr)); ("Trying to send an ICP packet of %u bytes to the internet address %s...\n",
length, inet_ntoa (*ptr));
} }
#endif #endif
else else
@ -582,7 +586,8 @@ main (argc, argv)
if (ttcp) if (ttcp)
{ {
if (sendto (sockfd, sendline, n, MSG_EOF, if (sendto (sockfd, sendline, n, MSG_EOF,
(struct sockaddr *) &serv_addr, sizeof (serv_addr)) != n) (struct sockaddr *) &serv_addr,
sizeof (serv_addr)) != n)
err_sys ("sendto error on socket"); err_sys ("sendto error on socket");
if (verbose) if (verbose)
{ {
@ -594,16 +599,17 @@ main (argc, argv)
if (!udp) if (!udp)
{ {
/* Write something to the server */ /* Write something to the server */
if (writen (sockfd, sendline, n) != n) { if (writen (sockfd, sendline, n) != n)
if ((nr < 0 || nr != n) && timeout_flag) {
{ if ((nr < 0 || nr != n) && timeout_flag)
nr = n; {
printf ("Timeout while writing\n"); nr = n;
continue; printf ("Timeout while writing\n");
} continue;
else }
err_sys ("writen error on socket"); else
} err_sys ("writen error on socket");
}
} }
else else
{ {
@ -719,7 +725,8 @@ main (argc, argv)
if ((nr < 0 || nr != n) && timeout_flag) if ((nr < 0 || nr != n) && timeout_flag)
/* if ((nr < 0 || nr != n) && (errno == EINTR) && timeout_flag) */ /* if ((nr < 0 || nr != n) && (errno == EINTR) && timeout_flag) */
{ {
printf ("Timeout while reading (%d byte(s) read)\n", (nr == -1) ? 0 : nr); printf ("Timeout while reading (%d byte(s) read)\n",
(nr == -1) ? 0 : nr);
nr = n; nr = n;
#ifdef FLUSH_OUTPUT #ifdef FLUSH_OUTPUT
if (fflush ((FILE *) NULL) != 0) if (fflush ((FILE *) NULL) != 0)
@ -730,14 +737,16 @@ main (argc, argv)
continue; continue;
} }
if (nr < 0 || nr != n) if (nr < 0 || nr != n)
err_sys ("readline error: %d bytes read, %d bytes requested", nr, n); err_sys ("readline error: %d bytes read, %d bytes requested",
nr, n);
} }
else else
/* This is HTTP */ /* This is HTTP */
{ {
if ((nr < 0) && (errno == EINTR) && (timeout_flag)) if ((nr < 0) && (errno == EINTR) && (timeout_flag))
{ {
printf ("Timeout while reading (%d byte(s) read)\n", (nr == -1) ? 0 : nr); printf ("Timeout while reading (%d byte(s) read)\n",
(nr == -1) ? 0 : nr);
#ifdef FLUSH_OUTPUT #ifdef FLUSH_OUTPUT
if (fflush ((FILE *) NULL) != 0) if (fflush ((FILE *) NULL) != 0)
{ {
@ -841,12 +850,15 @@ printstats ()
printf ("Warning: %d message(s) lost (%d %%)\n", attempts - successes, printf ("Warning: %d message(s) lost (%d %%)\n", attempts - successes,
((attempts - successes) * 100) / attempts); ((attempts - successes) * 100) / attempts);
printf ("Minimum time: %d.%06d seconds (%.0f bytes per sec.)\n", printf ("Minimum time: %d.%06d seconds (%.0f bytes per sec.)\n",
(int) min.tv_sec, (int) min.tv_usec, (double) size / tv2double (min)); (int) min.tv_sec, (int) min.tv_usec,
(double) size / tv2double (min));
printf ("Maximum time: %d.%06d seconds (%.0f bytes per sec.)\n", printf ("Maximum time: %d.%06d seconds (%.0f bytes per sec.)\n",
(int) max.tv_sec, (int) max.tv_usec, (double) size / tv2double (max)); (int) max.tv_sec, (int) max.tv_usec,
(double) size / tv2double (max));
tvavg (&total, successes); tvavg (&total, successes);
printf ("Average time: %d.%06d seconds (%.0f bytes per sec.)\n", printf ("Average time: %d.%06d seconds (%.0f bytes per sec.)\n",
(int) total.tv_sec, (int) total.tv_usec, (double) size / tv2double (total)); (int) total.tv_sec, (int) total.tv_usec,
(double) size / tv2double (total));
/* The number of bytes/second, as printed above, is not really /* The number of bytes/second, as printed above, is not really
meaningful: size does not reflect the number of bytes exchanged. meaningful: size does not reflect the number of bytes exchanged.
With echo, N = 2*size, with discard, N = size, with http, N = size + (response)... */ With echo, N = 2*size, with discard, N = size, with http, N = size + (response)... */
@ -882,7 +894,8 @@ printstats ()
tvavg (&median, 2); tvavg (&median, 2);
} }
printf ("Median time: %d.%06d seconds (%.0f bytes per sec.)\n", printf ("Median time: %d.%06d seconds (%.0f bytes per sec.)\n",
(int) median.tv_sec, (int) median.tv_usec, (double) size / tv2double (median)); (int) median.tv_sec, (int) median.tv_usec,
(double) size / tv2double (median));
} }
} }

@ -63,6 +63,9 @@ extern int sys_nerr;
#ifdef HAVE_TTCP #ifdef HAVE_TTCP
#define USE_TTCP 1 #define USE_TTCP 1
#endif #endif
#ifdef HAVE_TOS
#define USE_TOS 1
#endif
struct timeval null_timeval; struct timeval null_timeval;
struct timeval max_timeval; struct timeval max_timeval;

Loading…
Cancel
Save