diff -ruN squid-2.6.STABLE13/ChangeLog squid-2.6.STABLE14/ChangeLog --- squid-2.6.STABLE13/ChangeLog Thu May 10 17:56:28 2007 +++ squid-2.6.STABLE14/ChangeLog Sun Jul 15 08:11:57 2007 @@ -1,3 +1,30 @@ +Changes to squid-2.6.STABLE14 (15 Jul 2007) + + - squid.conf.default cleanup to have options in their proper sections. + - documentation correction in the refresh_pattern ignore-auth option + - URI-escaping not uses the recommended upper-case hex codes + - refresh_pattern min-age 0 correted to really mean 0, and not 1 second + - Always use xisxxxx() Squid defined macros instead of ctype + functions. + - Kerberos SPNEGO/Negotiate helper for the negotiate scheme + - Database basic auth helper using Perl DBI to connect to most SQL DBs + - Solaris /dev/poll network I/O support + - configure fixes to make cross compilation somewhat easier + - Removed incorrect -a reference from http_port documentation + - Bug #1900: Double "squid -k shutdown" makes Squid restart again + - Bug #1968: Squid hangs occasionally when using DNS search paths + - Novell eDirectory digest auth helper (digest_edir_auth) + - Bug #1130: min-size option for cache_dir + - POP3 basic auth helper querying a POP3 server + - Cosmetic squid_ldap_auth fixes from Squid-3 + - Bug #1085: Add no-wrap to cache manager HTML tables + - Automatically restart if number of available filedescriptors becomes + alarmingly low, preventing a situation where Squid would otherwise + permanently stop processing requests. + - Bug #2010: snmp_core.cc:828: warning: array subscript is above + array bounds + - Deal better with forwarding loops + Changes to squid-2.6.STABLE13 (11 May 2007) - Make sure reply headers gets sent even if there is no body available diff -ruN squid-2.6.STABLE13/Makefile.in squid-2.6.STABLE14/Makefile.in --- squid-2.6.STABLE13/Makefile.in Sat Nov 4 16:19:44 2006 +++ squid-2.6.STABLE14/Makefile.in Fri Jun 22 18:14:34 2007 @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.51 2006/11/04 23:19:44 hno Exp $ +# $Id: Makefile.in,v 1.51.2.1 2007/06/23 00:14:34 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/RELEASENOTES.html squid-2.6.STABLE14/RELEASENOTES.html --- squid-2.6.STABLE13/RELEASENOTES.html Thu May 10 18:00:09 2007 +++ squid-2.6.STABLE14/RELEASENOTES.html Sun Jul 15 08:22:34 2007 @@ -2,12 +2,12 @@ - Squid 2.6.STABLE13 release notes + Squid 2.6.STABLE14 release notes -

Squid 2.6.STABLE13 release notes

+

Squid 2.6.STABLE14 release notes

-

Squid Developers

$Id: release-2.6.html,v 1.44.2.8 2007/05/10 23:56:29 hno Exp $ +

Squid Developers

$Id: release-2.6.html,v 1.44.2.9 2007/07/15 14:11:57 hno Exp $
This document contains the release notes for version 2.6 of Squid. Squid is a WWW Cache application developed by the Web Caching community. @@ -66,6 +66,9 @@

18. Key changes squid-2.6.STABLE12 to 2.6.STABLE13

+

+

19. Key changes squid-2.6.STABLE13 to 2.6.STABLE14

+

1. Key changes from squid 2.5

@@ -671,6 +674,37 @@
  • Ukrainan error messages
  • See also the list of squid-2.6.STABLE13 changes and the +ChangeLog file for details.
  • + +

    + +

    19. Key changes squid-2.6.STABLE13 to 2.6.STABLE14

    + +

    +

    +

    + + +

    +

    diff -ruN squid-2.6.STABLE13/acinclude.m4 squid-2.6.STABLE14/acinclude.m4 --- squid-2.6.STABLE13/acinclude.m4 Wed May 24 05:20:10 2006 +++ squid-2.6.STABLE14/acinclude.m4 Sat Jun 23 15:31:59 2007 @@ -8,15 +8,10 @@ dnl AC_CHECK_SIZEOF_SYSTYPE(TYPE [, CROSS-SIZE]) AC_DEFUN([AC_CHECK_SIZEOF_SYSTYPE], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([ +[ +AC_REQUIRE([AC_HEADER_STDC])dnl +AC_CHECK_SIZEOF($1, , +[ #include #if STDC_HEADERS #include @@ -31,29 +26,15 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof($1)); - return(0); -} -], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [Size of ] AC_TYPE_NAME) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl ]) +])dnl dnl AC_CHECK_SYSTYPE(TYPE, DEFAULT) AC_DEFUN([AC_CHECK_SYSTYPE], [AC_REQUIRE([AC_HEADER_STDC])dnl -AC_MSG_CHECKING(for $1) -AC_CACHE_VAL(ac_cv_type_$1, -[AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl -changequote([,]), [ +AC_CHECK_TYPE($1, , +[AC_DEFINE_UNQUOTED($1, $2, [Define to '$2' if not defined])], +[ /* What a mess.. many systems have added the (now standard) bit types * in their own ways, so we need to scan a wide variety of headers to * find them.. @@ -72,9 +53,5 @@ #if HAVE_SYS_BITYPES_H #include #endif -], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl -AC_MSG_RESULT($ac_cv_type_$1) -if test $ac_cv_type_$1 = no; then - AC_DEFINE($1, $2, [Have ] $2 [ datatype]) -fi ]) +])dnl diff -ruN squid-2.6.STABLE13/configure squid-2.6.STABLE14/configure --- squid-2.6.STABLE13/configure Thu May 10 17:59:36 2007 +++ squid-2.6.STABLE14/configure Sun Jul 15 08:21:59 2007 @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.416.2.10 . +# From configure.in Revision: 1.416.2.17 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for Squid Web Proxy 2.6.STABLE13. +# Generated by GNU Autoconf 2.59 for Squid Web Proxy 2.6.STABLE14. # # Report bugs to . # @@ -270,8 +270,8 @@ # Identity of this package. PACKAGE_NAME='Squid Web Proxy' PACKAGE_TARNAME='squid' -PACKAGE_VERSION='2.6.STABLE13' -PACKAGE_STRING='Squid Web Proxy 2.6.STABLE13' +PACKAGE_VERSION='2.6.STABLE14' +PACKAGE_STRING='Squid Web Proxy 2.6.STABLE14' PACKAGE_BUGREPORT='http://www.squid-cache.org/bugs/' ac_default_prefix=/usr/local/squid @@ -312,7 +312,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os PKGCONFIG CGIEXT ENABLE_WIN32SPECIFIC_TRUE ENABLE_WIN32SPECIFIC_FALSE ENABLE_MINGW32SPECIFIC_TRUE ENABLE_MINGW32SPECIFIC_FALSE WIN32_PSAPI CACHE_HTTP_PORT CACHE_ICP_PORT LIBDLMALLOC LIB_MALLOC STORE_OBJS STORE_LIBS STORE_MODULES NEED_DISKD_TRUE NEED_DISKD_FALSE USE_AIOPS_WIN32_TRUE USE_AIOPS_WIN32_FALSE NEED_COSSDUMP_TRUE NEED_COSSDUMP_FALSE REPL_POLICIES REPL_OBJS REPL_LIBS ENABLE_PINGER_TRUE ENABLE_PINGER_FALSE USE_DELAY_POOLS_TRUE USE_DELAY_POOLS_FALSE USE_SNMP_TRUE USE_SNMP_FALSE SNMPLIB makesnmplib ENABLE_HTCP_TRUE ENABLE_HTCP_FALSE ENABLE_SSL_TRUE ENABLE_SSL_FALSE NEED_OWN_MD5_TRUE NEED_OWN_MD5_FALSE SSLLIB ERR_DEFAULT_LANGUAGE ERR_LANGUAGES MAKE_LEAKFINDER_TRUE MAKE_LEAKFINDER_FALSE USE_DNSSERVER_TRUE USE_DNSSERVER_FALSE OPT_DEFAULT_HOSTS AUTH_MODULES AUTH_OBJS AUTH_LIBS BASIC_AUTH_HELPERS NTLM_AUTH_HELPERS DIGEST_AUTH_HELPERS NEGOTIATE_AUTH_HELPERS EXTERNAL_ACL_HELPERS CPP EGREP LIBSASL ENABLE_UNLINKD_TRUE ENABLE_UNLINKD_FALSE RANLIB ac_ct_RANLIB LN_S SH FALSE TRUE RM MV MKDIR LN PERL AR AR_R ALLOCA CRYPTLIB LIB_EPOLL LIB_LDAP LIB_LBER LIB_DB USE_POLL_TRUE USE_POLL_FALSE USE_EPOLL_TRUE USE_EPOLL_FALSE USE_SELECT_TRUE USE_SELECT_FALSE USE_SELECT_SIMPLE_TRUE USE_SELECT_SIMPLE_FALSE USE_SELECT_WIN32_TRUE USE_SELECT_WIN32_FALSE USE_KQUEUE_TRUE USE_KQUEUE_FALSE NEED_OWN_SNPRINTF_TRUE NEED_OWN_SNPRINTF_FALSE NEED_OWN_STRSEP_TRUE NEED_OWN_STRSEP_FALSE REGEXLIB LIBREGEX LIBOBJS XTRA_OBJS XTRA_LIBS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os PKGCONFIG CGIEXT ENABLE_WIN32SPECIFIC_TRUE ENABLE_WIN32SPECIFIC_FALSE ENABLE_MINGW32SPECIFIC_TRUE ENABLE_MINGW32SPECIFIC_FALSE WIN32_PSAPI CACHE_HTTP_PORT CACHE_ICP_PORT LIBDLMALLOC LIB_MALLOC STORE_OBJS STORE_LIBS STORE_MODULES NEED_DISKD_TRUE NEED_DISKD_FALSE USE_AIOPS_WIN32_TRUE USE_AIOPS_WIN32_FALSE NEED_COSSDUMP_TRUE NEED_COSSDUMP_FALSE REPL_POLICIES REPL_OBJS REPL_LIBS ENABLE_PINGER_TRUE ENABLE_PINGER_FALSE USE_DELAY_POOLS_TRUE USE_DELAY_POOLS_FALSE USE_SNMP_TRUE USE_SNMP_FALSE SNMPLIB makesnmplib ENABLE_HTCP_TRUE ENABLE_HTCP_FALSE ENABLE_SSL_TRUE ENABLE_SSL_FALSE NEED_OWN_MD5_TRUE NEED_OWN_MD5_FALSE SSLLIB ERR_DEFAULT_LANGUAGE ERR_LANGUAGES MAKE_LEAKFINDER_TRUE MAKE_LEAKFINDER_FALSE USE_DNSSERVER_TRUE USE_DNSSERVER_FALSE OPT_DEFAULT_HOSTS AUTH_MODULES AUTH_OBJS AUTH_LIBS BASIC_AUTH_HELPERS NTLM_AUTH_HELPERS DIGEST_AUTH_HELPERS NEGOTIATE_AUTH_HELPERS EXTERNAL_ACL_HELPERS CPP EGREP LIBSASL ENABLE_UNLINKD_TRUE ENABLE_UNLINKD_FALSE RANLIB ac_ct_RANLIB LN_S SH FALSE TRUE RM MV MKDIR LN PERL AR AR_R ALLOCA CRYPTLIB LIB_EPOLL LIB_LDAP LIB_LBER LIB_DB USE_POLL_TRUE USE_POLL_FALSE USE_EPOLL_TRUE USE_EPOLL_FALSE USE_SELECT_TRUE USE_SELECT_FALSE USE_SELECT_SIMPLE_TRUE USE_SELECT_SIMPLE_FALSE USE_SELECT_WIN32_TRUE USE_SELECT_WIN32_FALSE USE_KQUEUE_TRUE USE_KQUEUE_FALSE USE_DEVPOLL_TRUE USE_DEVPOLL_FALSE NEED_OWN_SNPRINTF_TRUE NEED_OWN_SNPRINTF_FALSE NEED_OWN_STRSEP_TRUE NEED_OWN_STRSEP_FALSE REGEXLIB LIBREGEX LIBOBJS XTRA_OBJS XTRA_LIBS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -781,7 +781,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Squid Web Proxy 2.6.STABLE13 to adapt to many kinds of systems. +\`configure' configures Squid Web Proxy 2.6.STABLE14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -847,7 +847,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Squid Web Proxy 2.6.STABLE13:";; + short | recursive ) echo "Configuration of Squid Web Proxy 2.6.STABLE14:";; esac cat <<\_ACEOF @@ -931,6 +931,7 @@ --enable-kqueue Force the use of kqueue even if automatic checks indicate kqueue may not be supported. --disable-kqueue Disable kqueue support. + --enable-devpoll Use Solaris /dev/poll instead of poll --disable-http-violations This allows you to remove code which is known to violate the HTTP protocol specification. @@ -1158,7 +1159,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Squid Web Proxy configure 2.6.STABLE13 +Squid Web Proxy configure 2.6.STABLE14 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1172,7 +1173,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Squid Web Proxy $as_me 2.6.STABLE13, which was +It was created by Squid Web Proxy $as_me 2.6.STABLE14, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1818,7 +1819,7 @@ # Define the identity of the package. PACKAGE='squid' - VERSION='2.6.STABLE13' + VERSION='2.6.STABLE14' cat >>confdefs.h <<_ACEOF @@ -4498,6 +4499,23 @@ fi; +# Check whether --enable-devpoll or --disable-devpoll was given. +if test "${enable_devpoll+set}" = set; then + enableval="$enable_devpoll" + + case "$enableval" in + yes) + echo "Forcing devpoll to be enabled" + SELECT_TYPE="devpoll" + ;; + no) + echo "Forcing devpoll to be disabled" + ;; + esac + +fi; + + HTTP_VIOLATIONS=1 # Check whether --enable-http-violations or --disable-http-violations was given. if test "${enable_http_violations+set}" = set; then @@ -10911,18 +10929,12 @@ _ACEOF -echo "$as_me:$LINENO: checking size of int8_t" >&5 -echo $ECHO_N "checking size of int8_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int8_t+set}" = set; then + +echo "$as_me:$LINENO: checking for int8_t" >&5 +echo $ECHO_N "checking for int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10944,59 +10956,66 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(int8_t)); - return(0); +if ((int8_t *) 0) + return 0; +if (sizeof (int8_t)) + return 0; + ; + return 0; } - _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_int8_t=`cat conftestval` + ac_cv_type_int8_t=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_int8_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +ac_cv_type_int8_t=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int8_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int8_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT8_T $ac_cv_sizeof_int8_t -_ACEOF - +echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_int8_t" >&6 -echo "$as_me:$LINENO: checking size of uint8_t" >&5 -echo $ECHO_N "checking size of uint8_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_uint8_t+set}" = set; then +echo "$as_me:$LINENO: checking size of int8_t" >&5 +echo $ECHO_N "checking size of int8_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_int8_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11017,59 +11036,43 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(uint8_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (int8_t))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_uint8_t=`cat conftestval` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sizeof_uint8_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint8_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uint8_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UINT8_T $ac_cv_sizeof_uint8_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of u_int8_t" >&5 -echo $ECHO_N "checking size of u_int8_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_u_int8_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11090,59 +11093,59 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(u_int8_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (int8_t))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_u_int8_t=`cat conftestval` + ac_hi=$ac_mid; break else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_u_int8_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int8_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_u_int8_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_U_INT8_T $ac_cv_sizeof_u_int8_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of int16_t" >&5 -echo $ECHO_N "checking size of int16_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11163,59 +11166,43 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(int16_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (int8_t))) < 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_int16_t=`cat conftestval` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sizeof_int16_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int16_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int16_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT16_T $ac_cv_sizeof_int16_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of uint16_t" >&5 -echo $ECHO_N "checking size of uint16_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_uint16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11236,58 +11223,66 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(uint16_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (int8_t))) >= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_uint16_t=`cat conftestval` + ac_lo=$ac_mid; break else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_uint16_t=0 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint16_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uint16_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UINT16_T $ac_cv_sizeof_uint16_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of u_int16_t" >&5 -echo $ECHO_N "checking size of u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_u_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11309,50 +11304,57 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(u_int16_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (int8_t))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_u_int16_t=`cat conftestval` + ac_hi=$ac_mid else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_u_int16_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_lo=`expr '(' $ac_mid ')' + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_u_int16_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_U_INT16_T $ac_cv_sizeof_u_int16_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of int32_t" >&5 -echo $ECHO_N "checking size of int32_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int8_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling @@ -11382,14 +11384,38 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +long longval () { return (long) (sizeof (int8_t)); } +unsigned long ulongval () { return (long) (sizeof (int8_t)); } +#include +#include +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(int32_t)); - return(0); -} + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int8_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int8_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int8_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -11402,38 +11428,41 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_int32_t=`cat conftestval` + ac_cv_sizeof_int8_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_sizeof_int32_t=0 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int32_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int32_t" >&6 - +rm -f conftest.val +else + ac_cv_sizeof_int8_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int8_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int8_t" >&6 cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT32_T $ac_cv_sizeof_int32_t +#define SIZEOF_INT8_T $ac_cv_sizeof_int8_t _ACEOF -echo "$as_me:$LINENO: checking size of uint32_t" >&5 -echo $ECHO_N "checking size of uint32_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_uint32_t+set}" = set; then + + +echo "$as_me:$LINENO: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11455,59 +11484,66 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(uint32_t)); - return(0); +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; + ; + return 0; } - _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_uint32_t=`cat conftestval` + ac_cv_type_uint8_t=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_uint32_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +ac_cv_type_uint8_t=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uint32_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UINT32_T $ac_cv_sizeof_uint32_t -_ACEOF - +echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 -echo "$as_me:$LINENO: checking size of u_int32_t" >&5 -echo $ECHO_N "checking size of u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_u_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking size of uint8_t" >&5 +echo $ECHO_N "checking size of uint8_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_uint8_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11528,59 +11564,43 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(u_int32_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (uint8_t))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_u_int32_t=`cat conftestval` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sizeof_u_int32_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_u_int32_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_U_INT32_T $ac_cv_sizeof_u_int32_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of int64_t" >&5 -echo $ECHO_N "checking size of int64_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11601,59 +11621,59 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(int64_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (uint8_t))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_int64_t=`cat conftestval` + ac_hi=$ac_mid; break else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_int64_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int64_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int64_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT64_T $ac_cv_sizeof_int64_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of uint64_t" >&5 -echo $ECHO_N "checking size of uint64_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11674,59 +11694,43 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(uint64_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (uint8_t))) < 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_uint64_t=`cat conftestval` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sizeof_uint64_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uint64_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UINT64_T $ac_cv_sizeof_uint64_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of u_int64_t" >&5 -echo $ECHO_N "checking size of u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_u_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11747,58 +11751,66 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(u_int64_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (uint8_t))) >= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_u_int64_t=`cat conftestval` + ac_lo=$ac_mid; break else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_u_int64_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_u_int64_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_U_INT64_T $ac_cv_sizeof_u_int64_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of __int64" >&5 -echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 -if test "${ac_cv_sizeof___int64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11820,52 +11832,64 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(__int64)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (uint8_t))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof___int64=`cat conftestval` + ac_hi=$ac_mid else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof___int64=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_lo=`expr '(' $ac_mid ')' + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 -echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 -_ACEOF - - - -if test "x$ac_cv_sizeof_char" = "x1"; then - echo "$as_me:$LINENO: checking for int8_t" >&5 -echo $ECHO_N "checking for int8_t... $ECHO_C" >&6 -if test "${ac_cv_type_int8_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uint8_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11874,11 +11898,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -11893,29 +11913,80 @@ #include #endif + +long longval () { return (long) (sizeof (uint8_t)); } +unsigned long ulongval () { return (long) (sizeof (uint8_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uint8_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uint8_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uint8_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int8_t=yes +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_uint8_t=`cat conftest.val` else - ac_cv_type_int8_t=no -fi -rm -f conftest* + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uint8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 -echo "${ECHO_T}$ac_cv_type_int8_t" >&6 -if test $ac_cv_type_int8_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define int8_t char +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uint8_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uint8_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINT8_T $ac_cv_sizeof_uint8_t _ACEOF -fi -fi -if test "x$ac_cv_sizeof_uint8_t" = "x1"; then - echo "$as_me:$LINENO: checking for u_int8_t" >&5 + + +echo "$as_me:$LINENO: checking for u_int8_t" >&5 echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11927,11 +11998,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -11946,44 +12013,72 @@ #include #endif + +int +main () +{ +if ((u_int8_t *) 0) + return 0; +if (sizeof (u_int8_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_u_int8_t=yes else - ac_cv_type_u_int8_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_u_int8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 -if test $ac_cv_type_u_int8_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define u_int8_t uint8_t -_ACEOF - -fi -elif test "x$ac_cv_sizeof_char" = "x1"; then - echo "$as_me:$LINENO: checking for u_int8_t" >&5 -echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int8_t+set}" = set; then +echo "$as_me:$LINENO: checking size of u_int8_t" >&5 +echo $ECHO_N "checking size of u_int8_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_u_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_u_int8_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -11998,45 +12093,49 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int8_t=yes -else - ac_cv_type_u_int8_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 -if test $ac_cv_type_u_int8_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int8_t))) >= 0)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define u_int8_t unsigned char -_ACEOF - -fi - -fi -if test "x$ac_cv_sizeof_u_int8_t" = "x1"; then - echo "$as_me:$LINENO: checking for uint8_t" >&5 -echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint8_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12051,44 +12150,65 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint8_t=yes -else - ac_cv_type_uint8_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 -if test $ac_cv_type_uint8_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int8_t))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define uint8_t u_int8_t + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -elif test "x$ac_cv_sizeof_char" = "x1"; then - echo "$as_me:$LINENO: checking for uint8_t" >&5 -echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint8_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12103,45 +12223,49 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint8_t=yes -else - ac_cv_type_uint8_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 -if test $ac_cv_type_uint8_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int8_t))) < 0)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define uint8_t unsigned char + ; + return 0; +} _ACEOF - -fi - -fi -if test "x$ac_cv_sizeof_short" = "x2"; then - echo "$as_me:$LINENO: checking for int16_t" >&5 -echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12156,32 +12280,65 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int16_t=yes -else - ac_cv_type_int16_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_int16_t" >&6 -if test $ac_cv_type_int16_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int8_t))) >= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define int16_t short + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -elif test "x$ac_cv_sizeof_int" = "x2"; then - echo "$as_me:$LINENO: checking for int16_t" >&5 -echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12189,11 +12346,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12208,32 +12361,63 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int16_t=yes -else - ac_cv_type_int16_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_int16_t" >&6 -if test $ac_cv_type_int16_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int8_t))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define int16_t int + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -fi -if test "x$ac_cv_sizeof_uint16_t" = "x2"; then - echo "$as_me:$LINENO: checking for u_int16_t" >&5 -echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_u_int8_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12242,11 +12426,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12261,82 +12441,82 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int16_t=yes -else - ac_cv_type_u_int16_t=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 -if test $ac_cv_type_u_int16_t = no; then -cat >>confdefs.h <<\_ACEOF -#define u_int16_t uint16_t -_ACEOF +long longval () { return (long) (sizeof (u_int8_t)); } +unsigned long ulongval () { return (long) (sizeof (u_int8_t)); } +#include +#include +int +main () +{ -fi + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (u_int8_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (u_int8_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (u_int8_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); -elif test "x$ac_cv_sizeof_short" = "x2"; then - echo "$as_me:$LINENO: checking for u_int16_t" >&5 -echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include -#if STDC_HEADERS -#include -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_SYS_BITYPES_H -#include -#endif +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_u_int8_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int16_t=yes +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int8_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int8_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val else - ac_cv_type_u_int16_t=no + ac_cv_sizeof_u_int8_t=0 fi -rm -f conftest* - fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 -if test $ac_cv_type_u_int16_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define u_int16_t unsigned short +echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int8_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_u_int8_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_U_INT8_T $ac_cv_sizeof_u_int8_t _ACEOF -fi -elif test "x$ac_cv_sizeof_int" = "x2"; then - echo "$as_me:$LINENO: checking for u_int16_t" >&5 -echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int16_t+set}" = set; then + + +echo "$as_me:$LINENO: checking for int16_t" >&5 +echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12346,11 +12526,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12365,45 +12541,72 @@ #include #endif + +int +main () +{ +if ((int16_t *) 0) + return 0; +if (sizeof (int16_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int16_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int16_t=yes else - ac_cv_type_u_int16_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_int16_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 -if test $ac_cv_type_u_int16_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define u_int16_t unsigned int -_ACEOF - +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_int16_t" >&6 -fi -if test "x$ac_cv_sizeof_u_int16_t" = "x2"; then - echo "$as_me:$LINENO: checking for uint16_t" >&5 -echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint16_t+set}" = set; then +echo "$as_me:$LINENO: checking size of int16_t" >&5 +echo $ECHO_N "checking size of int16_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_int16_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -12418,30 +12621,7040 @@ #include #endif + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int16_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int16_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int16_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int16_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (int16_t)); } +unsigned long ulongval () { return (long) (sizeof (int16_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int16_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int16_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int16_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int16_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int16_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int16_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int16_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT16_T $ac_cv_sizeof_int16_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 + +echo "$as_me:$LINENO: checking size of uint16_t" >&5 +echo $ECHO_N "checking size of uint16_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_uint16_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint16_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint16_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint16_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uint16_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (uint16_t)); } +unsigned long ulongval () { return (long) (sizeof (uint16_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uint16_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uint16_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uint16_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_uint16_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uint16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uint16_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uint16_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINT16_T $ac_cv_sizeof_uint16_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 + +echo "$as_me:$LINENO: checking size of u_int16_t" >&5 +echo $ECHO_N "checking size of u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_u_int16_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int16_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int16_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int16_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int16_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_u_int16_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (u_int16_t)); } +unsigned long ulongval () { return (long) (sizeof (u_int16_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (u_int16_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (u_int16_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (u_int16_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_u_int16_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int16_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int16_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_u_int16_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_u_int16_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_U_INT16_T $ac_cv_sizeof_u_int16_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for int32_t" >&5 +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int32_t *) 0) + return 0; +if (sizeof (int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int32_t" >&6 + +echo "$as_me:$LINENO: checking size of int32_t" >&5 +echo $ECHO_N "checking size of int32_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int32_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int32_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int32_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int32_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int32_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (int32_t)); } +unsigned long ulongval () { return (long) (sizeof (int32_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int32_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int32_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int32_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int32_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int32_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int32_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int32_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT32_T $ac_cv_sizeof_int32_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 + +echo "$as_me:$LINENO: checking size of uint32_t" >&5 +echo $ECHO_N "checking size of uint32_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_uint32_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint32_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint32_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint32_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uint32_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (uint32_t)); } +unsigned long ulongval () { return (long) (sizeof (uint32_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uint32_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uint32_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uint32_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_uint32_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uint32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uint32_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uint32_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINT32_T $ac_cv_sizeof_uint32_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 + +echo "$as_me:$LINENO: checking size of u_int32_t" >&5 +echo $ECHO_N "checking size of u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_u_int32_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int32_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int32_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int32_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int32_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_u_int32_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (u_int32_t)); } +unsigned long ulongval () { return (long) (sizeof (u_int32_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (u_int32_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (u_int32_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (u_int32_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_u_int32_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int32_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int32_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_u_int32_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_u_int32_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_U_INT32_T $ac_cv_sizeof_u_int32_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 + +echo "$as_me:$LINENO: checking size of int64_t" >&5 +echo $ECHO_N "checking size of int64_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int64_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int64_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (int64_t)); } +unsigned long ulongval () { return (long) (sizeof (int64_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int64_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int64_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int64_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int64_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int64_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT64_T $ac_cv_sizeof_int64_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 + +echo "$as_me:$LINENO: checking size of uint64_t" >&5 +echo $ECHO_N "checking size of uint64_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_uint64_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint64_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint64_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint64_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uint64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uint64_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (uint64_t)); } +unsigned long ulongval () { return (long) (sizeof (uint64_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uint64_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uint64_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uint64_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_uint64_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uint64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uint64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uint64_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uint64_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINT64_T $ac_cv_sizeof_uint64_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 + +echo "$as_me:$LINENO: checking size of u_int64_t" >&5 +echo $ECHO_N "checking size of u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_u_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_u_int64_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int64_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int64_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int64_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (u_int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_u_int64_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (u_int64_t)); } +unsigned long ulongval () { return (long) (sizeof (u_int64_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (u_int64_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (u_int64_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (u_int64_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_u_int64_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (u_int64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_u_int64_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_u_int64_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_U_INT64_T $ac_cv_sizeof_u_int64_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +if test "${ac_cv_type___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((__int64 *) 0) + return 0; +if (sizeof (__int64)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type___int64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6 + +echo "$as_me:$LINENO: checking size of __int64" >&5 +echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int64" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int64=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +long longval () { return (long) (sizeof (__int64)); } +unsigned long ulongval () { return (long) (sizeof (__int64)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int64))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof___int64=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int64=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + + + +if test "x$ac_cv_sizeof_char" = "x1"; then + echo "$as_me:$LINENO: checking for int8_t" >&5 +echo $ECHO_N "checking for int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_int8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int8_t *) 0) + return 0; +if (sizeof (int8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_int8_t" >&6 +if test $ac_cv_type_int8_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int8_t char +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_uint8_t" = "x1"; then + echo "$as_me:$LINENO: checking for u_int8_t" >&5 +echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int8_t *) 0) + return 0; +if (sizeof (u_int8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 +if test $ac_cv_type_u_int8_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int8_t uint8_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_char" = "x1"; then + echo "$as_me:$LINENO: checking for u_int8_t" >&5 +echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int8_t *) 0) + return 0; +if (sizeof (u_int8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 +if test $ac_cv_type_u_int8_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int8_t unsigned char +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_u_int8_t" = "x1"; then + echo "$as_me:$LINENO: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 +if test $ac_cv_type_uint8_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint8_t u_int8_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_char" = "x1"; then + echo "$as_me:$LINENO: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 +if test $ac_cv_type_uint8_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint8_t unsigned char +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_short" = "x2"; then + echo "$as_me:$LINENO: checking for int16_t" >&5 +echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int16_t *) 0) + return 0; +if (sizeof (int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_int16_t" >&6 +if test $ac_cv_type_int16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int16_t short +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_int" = "x2"; then + echo "$as_me:$LINENO: checking for int16_t" >&5 +echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int16_t *) 0) + return 0; +if (sizeof (int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_int16_t" >&6 +if test $ac_cv_type_int16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int16_t int +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_uint16_t" = "x2"; then + echo "$as_me:$LINENO: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int16_t uint16_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_short" = "x2"; then + echo "$as_me:$LINENO: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int16_t unsigned short +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_int" = "x2"; then + echo "$as_me:$LINENO: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int16_t unsigned int +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_u_int16_t" = "x2"; then + echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint16_t u_int16_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_short" = "x2"; then + echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint16_t unsigned short +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_int" = "x2"; then + echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint16_t unsigned int +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_int" = "x4"; then + echo "$as_me:$LINENO: checking for int32_t" >&5 +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int32_t *) 0) + return 0; +if (sizeof (int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int32_t" >&6 +if test $ac_cv_type_int32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int32_t int +_ACEOF + +fi + + +elif "x$ac_cv_sizeof_long" = "x4"; then + echo "$as_me:$LINENO: checking for int32_t" >&5 +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int32_t *) 0) + return 0; +if (sizeof (int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int32_t" >&6 +if test $ac_cv_type_int32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int32_t long +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_uint32_t" = "x4"; then + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int32_t uint32_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_int" = "x4"; then + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int32_t unsigned int _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint16_t=yes + +fi + + +elif test "x$ac_cv_sizeof_long" = "x4"; then + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define u_int32_t unsigned long +_ACEOF + +fi + + +fi +if test "x$ac_cv_sizeof_u_int32_t" = "x4"; then + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint32_t u_int32_t +_ACEOF + +fi + + +elif test "x$ac_cv_sizeof_int" = "x4"; then + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes else - ac_cv_type_uint16_t=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint32_t unsigned int +_ACEOF fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 -if test $ac_cv_type_uint16_t = no; then -cat >>confdefs.h <<\_ACEOF -#define uint16_t u_int16_t + +elif test "x$ac_cv_sizeof_long" = "x4"; then + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint32_t unsigned long _ACEOF fi -elif test "x$ac_cv_sizeof_short" = "x2"; then - echo "$as_me:$LINENO: checking for uint16_t" >&5 -echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint16_t+set}" = set; then + +fi +if test "x$ac_cv_sizeof_long" = "x8"; then + echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12470,30 +19683,154 @@ #include #endif + +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint16_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes else - ac_cv_type_uint16_t=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int64_t=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int64_t long +_ACEOF fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 -if test $ac_cv_type_uint16_t = no; then -cat >>confdefs.h <<\_ACEOF -#define uint16_t unsigned short + +elif test "x$ac_cv_sizeof_long_long" = "x8"; then + echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* What a mess.. many systems have added the (now standard) bit types + * in their own ways, so we need to scan a wide variety of headers to + * find them.. + */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif + + +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int64_t long long _ACEOF fi -elif test "x$ac_cv_sizeof_int" = "x2"; then - echo "$as_me:$LINENO: checking for uint16_t" >&5 -echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint16_t+set}" = set; then + +elif test "x$ac_cv_sizeof___int64" = "x8"; then + echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12522,31 +19859,67 @@ #include #endif + +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint16_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes else - ac_cv_type_uint16_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_int64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 -if test $ac_cv_type_uint16_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define uint16_t unsigned int +cat >>confdefs.h <<_ACEOF +#define int64_t __int64 _ACEOF fi + fi -if test "x$ac_cv_sizeof_int" = "x4"; then - echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int32_t+set}" = set; then +if test "x$ac_cv_sizeof_uint64_t" = "x8"; then + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12575,30 +19948,66 @@ #include #endif + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes else - ac_cv_type_int32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int32_t" >&6 -if test $ac_cv_type_int32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define int32_t int +cat >>confdefs.h <<_ACEOF +#define u_int64_t uint64_t _ACEOF fi -elif "x$ac_cv_sizeof_long" = "x4"; then - echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int32_t+set}" = set; then + +elif test "x$ac_cv_sizeof_long" = "x8"; then + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12627,31 +20036,66 @@ #include #endif + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes else - ac_cv_type_int32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int32_t" >&6 -if test $ac_cv_type_int32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define int32_t long +cat >>confdefs.h <<_ACEOF +#define u_int64_t unsigned long _ACEOF fi -fi -if test "x$ac_cv_sizeof_uint32_t" = "x4"; then - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int32_t+set}" = set; then + +elif test "x$ac_cv_sizeof_long_long" = "x8"; then + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12680,30 +20124,66 @@ #include #endif + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes else - ac_cv_type_u_int32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 -if test $ac_cv_type_u_int32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int32_t uint32_t +cat >>confdefs.h <<_ACEOF +#define u_int64_t unsigned long long _ACEOF fi -elif test "x$ac_cv_sizeof_int" = "x4"; then - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int32_t+set}" = set; then + +elif test "x$ac_cv_sizeof___int64" = "x8"; then + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12732,30 +20212,67 @@ #include #endif + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int64_t=yes else - ac_cv_type_u_int32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_u_int64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 -if test $ac_cv_type_u_int32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int32_t unsigned int +cat >>confdefs.h <<_ACEOF +#define u_int64_t unsigned __int64 _ACEOF fi -elif test "x$ac_cv_sizeof_long" = "x4"; then - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int32_t+set}" = set; then + +fi +if test "x$ac_cv_sizeof_u_int64_t" = "x8"; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12784,31 +20301,66 @@ #include #endif + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes else - ac_cv_type_u_int32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 -if test $ac_cv_type_u_int32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int32_t unsigned long +cat >>confdefs.h <<_ACEOF +#define uint64_t u_int64_t _ACEOF fi -fi -if test "x$ac_cv_sizeof_u_int32_t" = "x4"; then - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint32_t+set}" = set; then + +elif test "x$ac_cv_sizeof_long" = "x8"; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12837,30 +20389,66 @@ #include #endif + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes else - ac_cv_type_uint32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 -if test $ac_cv_type_uint32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define uint32_t u_int32_t +cat >>confdefs.h <<_ACEOF +#define uint64_t unsigned long _ACEOF fi -elif test "x$ac_cv_sizeof_int" = "x4"; then - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint32_t+set}" = set; then + +elif test "x$ac_cv_sizeof_long_long" = "x8"; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12889,30 +20477,66 @@ #include #endif + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes else - ac_cv_type_uint32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 -if test $ac_cv_type_uint32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define uint32_t unsigned int +cat >>confdefs.h <<_ACEOF +#define uint64_t unsigned long long _ACEOF fi -elif test "x$ac_cv_sizeof_long" = "x4"; then - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint32_t+set}" = set; then + +elif test "x$ac_cv_sizeof___int64" = "x8"; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12941,31 +20565,67 @@ #include #endif + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint32_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes else - ac_cv_type_uint32_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 -if test $ac_cv_type_uint32_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define uint32_t unsigned long +cat >>confdefs.h <<_ACEOF +#define uint64_t unsigned __int64 _ACEOF fi + fi -if test "x$ac_cv_sizeof_long" = "x8"; then - echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12994,30 +20654,65 @@ #include #endif + +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes else - ac_cv_type_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_pid_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6 -if test $ac_cv_type_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define int64_t long +cat >>confdefs.h <<_ACEOF +#define pid_t int _ACEOF fi -elif test "x$ac_cv_sizeof_long_long" = "x8"; then - echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13046,30 +20741,65 @@ #include #endif + +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes else - ac_cv_type_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6 -if test $ac_cv_type_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define int64_t long long +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF fi -elif test "x$ac_cv_sizeof___int64" = "x8"; then - echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 +if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13098,31 +20828,65 @@ #include #endif + +int +main () +{ +if ((ssize_t *) 0) + return 0; +if (sizeof (ssize_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ssize_t=yes else - ac_cv_type_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_ssize_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6 -if test $ac_cv_type_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 +if test $ac_cv_type_ssize_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define int64_t __int64 +cat >>confdefs.h <<_ACEOF +#define ssize_t int _ACEOF fi -fi -if test "x$ac_cv_sizeof_uint64_t" = "x8"; then - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13151,30 +20915,65 @@ #include #endif + +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes else - ac_cv_type_u_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int64_t uint64_t +cat >>confdefs.h <<_ACEOF +#define off_t int _ACEOF fi -elif test "x$ac_cv_sizeof_long" = "x8"; then - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 +if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13203,30 +21002,65 @@ #include #endif + +int +main () +{ +if ((mode_t *) 0) + return 0; +if (sizeof (mode_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_mode_t=yes else - ac_cv_type_u_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_mode_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6 +if test $ac_cv_type_mode_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int64_t unsigned long +cat >>confdefs.h <<_ACEOF +#define mode_t unsigned short _ACEOF fi -elif test "x$ac_cv_sizeof_long_long" = "x8"; then - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then + +echo "$as_me:$LINENO: checking for fd_mask" >&5 +echo $ECHO_N "checking for fd_mask... $ECHO_C" >&6 +if test "${ac_cv_type_fd_mask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13255,30 +21089,67 @@ #include #endif + +int +main () +{ +if ((fd_mask *) 0) + return 0; +if (sizeof (fd_mask)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_fd_mask=yes else - ac_cv_type_u_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_fd_mask=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = no; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_fd_mask" >&5 +echo "${ECHO_T}$ac_cv_type_fd_mask" >&6 +if test $ac_cv_type_fd_mask = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define u_int64_t unsigned long long +cat >>confdefs.h <<_ACEOF +#define fd_mask int _ACEOF fi -elif test "x$ac_cv_sizeof___int64" = "x8"; then - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then + + + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13288,11 +21159,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13307,45 +21174,72 @@ #include #endif + +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])u_int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_u_int64_t=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes else - ac_cv_type_u_int64_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define u_int64_t unsigned __int64 -_ACEOF - +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 -fi -if test "x$ac_cv_sizeof_u_int64_t" = "x8"; then - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then +echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_off_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13360,44 +21254,122 @@ #include #endif + +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint64_t=yes -else - ac_cv_type_uint64_t=no -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_BITYPES_H +#include +#endif -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = no; then -cat >>confdefs.h <<\_ACEOF -#define uint64_t u_int64_t +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -elif test "x$ac_cv_sizeof_long" = "x8"; then - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13412,44 +21384,49 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint64_t=yes -else - ac_cv_type_uint64_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define uint64_t unsigned long + ; + return 0; +} _ACEOF - -fi - -elif test "x$ac_cv_sizeof_long_long" = "x8"; then - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13464,32 +21441,65 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint64_t=yes -else - ac_cv_type_uint64_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define uint64_t unsigned long long + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -elif test "x$ac_cv_sizeof___int64" = "x8"; then - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13497,11 +21507,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13516,32 +21522,63 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])uint64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_uint64_t=yes -else - ac_cv_type_uint64_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define uint64_t unsigned __int64 + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -fi - -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_off_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13550,11 +21587,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13569,25 +21602,78 @@ #include #endif + +long longval () { return (long) (sizeof (off_t)); } +unsigned long ulongval () { return (long) (sizeof (off_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (off_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (off_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (off_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_pid_t=yes +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_off_t=`cat conftest.val` else - ac_cv_type_pid_t=no -fi -rm -f conftest* + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define pid_t int +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_off_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -fi + + echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 @@ -13601,11 +21687,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13620,43 +21702,72 @@ #include #endif + +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_size_t=yes else - ac_cv_type_size_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define size_t unsigned int -_ACEOF - -fi -echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 -if test "${ac_cv_type_ssize_t+set}" = set; then +echo "$as_me:$LINENO: checking size of size_t" >&5 +echo $ECHO_N "checking size of size_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_size_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13671,43 +21782,49 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_ssize_t=yes -else - ac_cv_type_ssize_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 -if test $ac_cv_type_ssize_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define ssize_t int + ; + return 0; +} _ACEOF - -fi - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13722,43 +21839,65 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_off_t=yes -else - ac_cv_type_off_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define off_t int + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 -if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13773,43 +21912,49 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_mode_t=yes -else - ac_cv_type_mode_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6 -if test $ac_cv_type_mode_t = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define mode_t unsigned short + ; + return 0; +} _ACEOF - -fi - -echo "$as_me:$LINENO: checking for fd_mask" >&5 -echo $ECHO_N "checking for fd_mask... $ECHO_C" >&6 -if test "${ac_cv_type_fd_mask+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* What a mess.. many systems have added the (now standard) bit types - * in their own ways, so we need to scan a wide variety of headers to - * find them.. - */ -#include +#include #if STDC_HEADERS #include #include @@ -13824,35 +21969,65 @@ #include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])fd_mask[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_fd_mask=yes -else - ac_cv_type_fd_mask=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_fd_mask" >&5 -echo "${ECHO_T}$ac_cv_type_fd_mask" >&6 -if test $ac_cv_type_fd_mask = no; then +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<\_ACEOF -#define fd_mask int + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - - -echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_sizeof_off_t=4 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13874,53 +22049,64 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(off_t)); - return(0); -} +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_off_t=`cat conftestval` + ac_hi=$ac_mid else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_sizeof_off_t=0 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +ac_lo=`expr '(' $ac_mid ')' + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t -_ACEOF - - -echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_size_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else if test "$cross_compiling" = yes; then - ac_cv_sizeof_size_t=4 + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13943,14 +22129,38 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() + + +long longval () { return (long) (sizeof (size_t)); } +unsigned long ulongval () { return (long) (sizeof (size_t)); } +#include +#include +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof(size_t)); - return(0); -} + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (size_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (size_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (size_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -13963,27 +22173,36 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_size_t=`cat conftestval` + ac_cv_sizeof_size_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_sizeof_size_t=0 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.val +else + ac_cv_sizeof_size_t=0 +fi +fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6 - cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 @@ -16447,6 +24666,17 @@ fi + +if test $SELECT_TYPE = devpoll; then + USE_DEVPOLL_TRUE= + USE_DEVPOLL_FALSE='#' +else + USE_DEVPOLL_TRUE='#' + USE_DEVPOLL_FALSE= +fi + + + echo "$as_me:$LINENO: checking if AF_UNIX dgram sockets support large packets" >&5 echo $ECHO_N "checking if AF_UNIX dgram sockets support large packets... $ECHO_C" >&6 if test "${ac_cv_af_unix_large_dgram+set}" = set; then @@ -17985,7 +26215,7 @@ - ac_config_files="$ac_config_files Makefile lib/Makefile scripts/Makefile scripts/RunCache src/Makefile src/fs/Makefile src/repl/Makefile src/auth/Makefile contrib/Makefile snmplib/Makefile icons/Makefile errors/Makefile doc/Makefile helpers/Makefile helpers/basic_auth/Makefile helpers/basic_auth/LDAP/Makefile helpers/basic_auth/MSNT/Makefile helpers/basic_auth/NCSA/Makefile helpers/basic_auth/PAM/Makefile helpers/basic_auth/SMB/Makefile helpers/basic_auth/YP/Makefile helpers/basic_auth/getpwnam/Makefile helpers/basic_auth/mswin_sspi/Makefile helpers/basic_auth/multi-domain-NTLM/Makefile helpers/basic_auth/SASL/Makefile helpers/digest_auth/Makefile helpers/digest_auth/password/Makefile helpers/digest_auth/ldap/Makefile helpers/ntlm_auth/Makefile helpers/ntlm_auth/fakeauth/Makefile helpers/ntlm_auth/mswin_sspi/Makefile helpers/ntlm_auth/no_check/Makefile helpers/ntlm_auth/SMB/Makefile helpers/ntlm_auth/SMB/smbval/Makefile helpers/negotiate_auth/Makefile helpers/negotiate_auth/mswin_sspi/Makefile helpers/external_acl/Makefile helpers/external_acl/ip_user/Makefile helpers/external_acl/ldap_group/Makefile helpers/external_acl/mswin_lm_group/Makefile helpers/external_acl/session/Makefile helpers/external_acl/unix_group/Makefile helpers/external_acl/wbinfo_group/Makefile tools/Makefile" + ac_config_files="$ac_config_files Makefile lib/Makefile scripts/Makefile scripts/RunCache src/Makefile src/fs/Makefile src/repl/Makefile src/auth/Makefile contrib/Makefile snmplib/Makefile icons/Makefile errors/Makefile doc/Makefile helpers/Makefile helpers/basic_auth/Makefile helpers/basic_auth/LDAP/Makefile helpers/basic_auth/MSNT/Makefile helpers/basic_auth/NCSA/Makefile helpers/basic_auth/PAM/Makefile helpers/basic_auth/SMB/Makefile helpers/basic_auth/YP/Makefile helpers/basic_auth/getpwnam/Makefile helpers/basic_auth/mswin_sspi/Makefile helpers/basic_auth/multi-domain-NTLM/Makefile helpers/basic_auth/SASL/Makefile helpers/basic_auth/POP3/Makefile helpers/basic_auth/DB/Makefile helpers/digest_auth/Makefile helpers/digest_auth/password/Makefile helpers/digest_auth/ldap/Makefile helpers/digest_auth/eDirectory/Makefile helpers/ntlm_auth/Makefile helpers/ntlm_auth/fakeauth/Makefile helpers/ntlm_auth/mswin_sspi/Makefile helpers/ntlm_auth/no_check/Makefile helpers/ntlm_auth/SMB/Makefile helpers/ntlm_auth/SMB/smbval/Makefile helpers/negotiate_auth/Makefile helpers/negotiate_auth/mswin_sspi/Makefile helpers/negotiate_auth/squid_kerb_auth/Makefile helpers/external_acl/Makefile helpers/external_acl/ip_user/Makefile helpers/external_acl/ldap_group/Makefile helpers/external_acl/mswin_lm_group/Makefile helpers/external_acl/session/Makefile helpers/external_acl/unix_group/Makefile helpers/external_acl/wbinfo_group/Makefile tools/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -18315,6 +26545,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${USE_DEVPOLL_TRUE}" && test -z "${USE_DEVPOLL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_DEVPOLL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_DEVPOLL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${NEED_OWN_SNPRINTF_TRUE}" && test -z "${NEED_OWN_SNPRINTF_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NEED_OWN_SNPRINTF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -18614,7 +26851,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by Squid Web Proxy $as_me 2.6.STABLE13, which was +This file was extended by Squid Web Proxy $as_me 2.6.STABLE14, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18677,7 +26914,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Squid Web Proxy config.status 2.6.STABLE13 +Squid Web Proxy config.status 2.6.STABLE14 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -18812,9 +27049,12 @@ "helpers/basic_auth/mswin_sspi/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/basic_auth/mswin_sspi/Makefile" ;; "helpers/basic_auth/multi-domain-NTLM/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/basic_auth/multi-domain-NTLM/Makefile" ;; "helpers/basic_auth/SASL/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/basic_auth/SASL/Makefile" ;; + "helpers/basic_auth/POP3/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/basic_auth/POP3/Makefile" ;; + "helpers/basic_auth/DB/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/basic_auth/DB/Makefile" ;; "helpers/digest_auth/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/digest_auth/Makefile" ;; "helpers/digest_auth/password/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/digest_auth/password/Makefile" ;; "helpers/digest_auth/ldap/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/digest_auth/ldap/Makefile" ;; + "helpers/digest_auth/eDirectory/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/digest_auth/eDirectory/Makefile" ;; "helpers/ntlm_auth/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/ntlm_auth/Makefile" ;; "helpers/ntlm_auth/fakeauth/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/ntlm_auth/fakeauth/Makefile" ;; "helpers/ntlm_auth/mswin_sspi/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/ntlm_auth/mswin_sspi/Makefile" ;; @@ -18823,6 +27063,7 @@ "helpers/ntlm_auth/SMB/smbval/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/ntlm_auth/SMB/smbval/Makefile" ;; "helpers/negotiate_auth/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/negotiate_auth/Makefile" ;; "helpers/negotiate_auth/mswin_sspi/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/negotiate_auth/mswin_sspi/Makefile" ;; + "helpers/negotiate_auth/squid_kerb_auth/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/negotiate_auth/squid_kerb_auth/Makefile" ;; "helpers/external_acl/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/external_acl/Makefile" ;; "helpers/external_acl/ip_user/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/external_acl/ip_user/Makefile" ;; "helpers/external_acl/ldap_group/Makefile" ) CONFIG_FILES="$CONFIG_FILES helpers/external_acl/ldap_group/Makefile" ;; @@ -19056,6 +27297,8 @@ s,@USE_SELECT_WIN32_FALSE@,$USE_SELECT_WIN32_FALSE,;t t s,@USE_KQUEUE_TRUE@,$USE_KQUEUE_TRUE,;t t s,@USE_KQUEUE_FALSE@,$USE_KQUEUE_FALSE,;t t +s,@USE_DEVPOLL_TRUE@,$USE_DEVPOLL_TRUE,;t t +s,@USE_DEVPOLL_FALSE@,$USE_DEVPOLL_FALSE,;t t s,@NEED_OWN_SNPRINTF_TRUE@,$NEED_OWN_SNPRINTF_TRUE,;t t s,@NEED_OWN_SNPRINTF_FALSE@,$NEED_OWN_SNPRINTF_FALSE,;t t s,@NEED_OWN_STRSEP_TRUE@,$NEED_OWN_STRSEP_TRUE,;t t diff -ruN squid-2.6.STABLE13/configure.in squid-2.6.STABLE14/configure.in --- squid-2.6.STABLE13/configure.in Thu May 10 17:59:36 2007 +++ squid-2.6.STABLE14/configure.in Sun Jul 15 08:21:59 2007 @@ -1,16 +1,16 @@ dnl dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.416.2.10 2007/05/10 23:56:28 hno Exp $ +dnl $Id: configure.in,v 1.416.2.17 2007/07/15 14:11:57 hno Exp $ dnl dnl dnl -AC_INIT(Squid Web Proxy, 2.6.STABLE13, http://www.squid-cache.org/bugs/, squid) +AC_INIT(Squid Web Proxy, 2.6.STABLE14, http://www.squid-cache.org/bugs/, squid) AC_PREREQ(2.52) AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE -AC_REVISION($Revision: 1.416.2.10 $)dnl +AC_REVISION($Revision: 1.416.2.17 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -927,6 +927,22 @@ esac ]) +dnl Enable devpoll +AC_ARG_ENABLE(devpoll, +[ --enable-devpoll Use Solaris /dev/poll instead of poll], +[ + case "$enableval" in + yes) + echo "Forcing devpoll to be enabled" + SELECT_TYPE="devpoll" + ;; + no) + echo "Forcing devpoll to be disabled" + ;; + esac +]) + + dnl Disable HTTP violations HTTP_VIOLATIONS=1 AC_ARG_ENABLE(http-violations, @@ -2428,6 +2444,8 @@ AM_CONDITIONAL([USE_SELECT_SIMPLE], [test $SELECT_TYPE = select_simple]) AM_CONDITIONAL([USE_SELECT_WIN32], [test $SELECT_TYPE = select_win32]) AM_CONDITIONAL([USE_KQUEUE], [test $SELECT_TYPE = kqueue]) +AM_CONDITIONAL([USE_DEVPOLL], [test $SELECT_TYPE = devpoll]) + dnl Hmm.. some OS:es (i.e. FreeBSD) can't handle large AF_UNIX dgram packets. dnl Verify that at least 16K is supported, if not fall back on using @@ -3172,9 +3190,12 @@ helpers/basic_auth/mswin_sspi/Makefile \ helpers/basic_auth/multi-domain-NTLM/Makefile \ helpers/basic_auth/SASL/Makefile \ + helpers/basic_auth/POP3/Makefile \ + helpers/basic_auth/DB/Makefile \ helpers/digest_auth/Makefile \ helpers/digest_auth/password/Makefile \ helpers/digest_auth/ldap/Makefile \ + helpers/digest_auth/eDirectory/Makefile \ helpers/ntlm_auth/Makefile \ helpers/ntlm_auth/fakeauth/Makefile \ helpers/ntlm_auth/mswin_sspi/Makefile \ @@ -3183,6 +3204,7 @@ helpers/ntlm_auth/SMB/smbval/Makefile \ helpers/negotiate_auth/Makefile \ helpers/negotiate_auth/mswin_sspi/Makefile \ + helpers/negotiate_auth/squid_kerb_auth/Makefile \ helpers/external_acl/Makefile \ helpers/external_acl/ip_user/Makefile \ helpers/external_acl/ldap_group/Makefile \ diff -ruN squid-2.6.STABLE13/contrib/Makefile.in squid-2.6.STABLE14/contrib/Makefile.in --- squid-2.6.STABLE13/contrib/Makefile.in Sat Nov 4 16:19:44 2006 +++ squid-2.6.STABLE14/contrib/Makefile.in Fri Jun 22 18:14:35 2007 @@ -171,6 +171,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/doc/Makefile.in squid-2.6.STABLE14/doc/Makefile.in --- squid-2.6.STABLE13/doc/Makefile.in Sat Nov 4 16:19:45 2006 +++ squid-2.6.STABLE14/doc/Makefile.in Fri Jun 22 18:14:36 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.32 2006/11/04 23:19:45 hno Exp $ +# $Id: Makefile.in,v 1.32.2.1 2007/06/23 00:14:36 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -178,6 +178,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/errors/Makefile.in squid-2.6.STABLE14/errors/Makefile.in --- squid-2.6.STABLE13/errors/Makefile.in Sat Nov 4 16:19:47 2006 +++ squid-2.6.STABLE14/errors/Makefile.in Fri Jun 22 18:14:40 2007 @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.48 2006/11/04 23:19:47 hno Exp $ +# $Id: Makefile.in,v 1.48.2.1 2007/06/23 00:14:40 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -170,6 +170,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/Makefile.in squid-2.6.STABLE14/helpers/Makefile.in --- squid-2.6.STABLE13/helpers/Makefile.in Sat Nov 4 16:19:48 2006 +++ squid-2.6.STABLE14/helpers/Makefile.in Fri Jun 22 18:14:41 2007 @@ -175,6 +175,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/DB/Makefile.am squid-2.6.STABLE14/helpers/basic_auth/DB/Makefile.am --- squid-2.6.STABLE13/helpers/basic_auth/DB/Makefile.am Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/DB/Makefile.am Sat Jun 23 15:30:26 2007 @@ -0,0 +1,20 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.am,v 1.1.2.2 2007/06/23 21:30:26 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +libexec_SCRIPTS = squid_db_auth +CLEANFILES = squid_db_auth +do_subst = sed -e 's,[@]PERL[@],$(PERL),g' +man_MANS = squid_db_auth.8 +EXTRA_DIST = passwd.sql \ + squid_db_auth.in + +squid_db_auth.8: squid_db_auth + pod2man squid_db_auth squid_db_auth.8 + +squid_db_auth: squid_db_auth.in + $(do_subst) < $(srcdir)/squid_db_auth.in >squid_db_auth diff -ruN squid-2.6.STABLE13/helpers/basic_auth/DB/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/DB/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/DB/Makefile.in Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/DB/Makefile.in Sat Jun 23 15:51:52 2007 @@ -0,0 +1,481 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.in,v 1.1.2.4 2007/06/23 21:51:52 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = helpers/basic_auth/DB +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/autoconf.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man8dir)" +libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(libexec_SCRIPTS) +SOURCES = +DIST_SOURCES = +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AR_R = @AR_R@ +AUTH_LIBS = @AUTH_LIBS@ +AUTH_MODULES = @AUTH_MODULES@ +AUTH_OBJS = @AUTH_OBJS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@ +CACHE_HTTP_PORT = @CACHE_HTTP_PORT@ +CACHE_ICP_PORT = @CACHE_ICP_PORT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGIEXT = @CGIEXT@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPTLIB = @CRYPTLIB@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@ +ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@ +ENABLE_MINGW32SPECIFIC_FALSE = @ENABLE_MINGW32SPECIFIC_FALSE@ +ENABLE_MINGW32SPECIFIC_TRUE = @ENABLE_MINGW32SPECIFIC_TRUE@ +ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@ +ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@ +ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@ +ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@ +ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@ +ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@ +ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@ +ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@ +ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@ +ERR_LANGUAGES = @ERR_LANGUAGES@ +EXEEXT = @EXEEXT@ +EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@ +FALSE = @FALSE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDLMALLOC = @LIBDLMALLOC@ +LIBOBJS = @LIBOBJS@ +LIBREGEX = @LIBREGEX@ +LIBS = @LIBS@ +LIBSASL = @LIBSASL@ +LIB_DB = @LIB_DB@ +LIB_EPOLL = @LIB_EPOLL@ +LIB_LBER = @LIB_LBER@ +LIB_LDAP = @LIB_LDAP@ +LIB_MALLOC = @LIB_MALLOC@ +LN = @LN@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@ +MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@ +MKDIR = @MKDIR@ +MV = @MV@ +NEED_COSSDUMP_FALSE = @NEED_COSSDUMP_FALSE@ +NEED_COSSDUMP_TRUE = @NEED_COSSDUMP_TRUE@ +NEED_DISKD_FALSE = @NEED_DISKD_FALSE@ +NEED_DISKD_TRUE = @NEED_DISKD_TRUE@ +NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@ +NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@ +NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@ +NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@ +NEED_OWN_STRSEP_FALSE = @NEED_OWN_STRSEP_FALSE@ +NEED_OWN_STRSEP_TRUE = @NEED_OWN_STRSEP_TRUE@ +NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH_HELPERS@ +NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@ +OBJEXT = @OBJEXT@ +OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGCONFIG = @PKGCONFIG@ +RANLIB = @RANLIB@ +REGEXLIB = @REGEXLIB@ +REPL_LIBS = @REPL_LIBS@ +REPL_OBJS = @REPL_OBJS@ +REPL_POLICIES = @REPL_POLICIES@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SH = @SH@ +SHELL = @SHELL@ +SNMPLIB = @SNMPLIB@ +SSLLIB = @SSLLIB@ +STORE_LIBS = @STORE_LIBS@ +STORE_MODULES = @STORE_MODULES@ +STORE_OBJS = @STORE_OBJS@ +STRIP = @STRIP@ +TRUE = @TRUE@ +USE_AIOPS_WIN32_FALSE = @USE_AIOPS_WIN32_FALSE@ +USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ +USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ +USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ +USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ +USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ +USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ +USE_EPOLL_TRUE = @USE_EPOLL_TRUE@ +USE_KQUEUE_FALSE = @USE_KQUEUE_FALSE@ +USE_KQUEUE_TRUE = @USE_KQUEUE_TRUE@ +USE_POLL_FALSE = @USE_POLL_FALSE@ +USE_POLL_TRUE = @USE_POLL_TRUE@ +USE_SELECT_FALSE = @USE_SELECT_FALSE@ +USE_SELECT_SIMPLE_FALSE = @USE_SELECT_SIMPLE_FALSE@ +USE_SELECT_SIMPLE_TRUE = @USE_SELECT_SIMPLE_TRUE@ +USE_SELECT_TRUE = @USE_SELECT_TRUE@ +USE_SELECT_WIN32_FALSE = @USE_SELECT_WIN32_FALSE@ +USE_SELECT_WIN32_TRUE = @USE_SELECT_WIN32_TRUE@ +USE_SNMP_FALSE = @USE_SNMP_FALSE@ +USE_SNMP_TRUE = @USE_SNMP_TRUE@ +VERSION = @VERSION@ +WIN32_PSAPI = @WIN32_PSAPI@ +XTRA_LIBS = @XTRA_LIBS@ +XTRA_OBJS = @XTRA_OBJS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +makesnmplib = @makesnmplib@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +libexec_SCRIPTS = squid_db_auth +CLEANFILES = squid_db_auth +do_subst = sed -e 's,[@]PERL[@],$(PERL),g' +man_MANS = squid_db_auth.8 +EXTRA_DIST = passwd.sql \ + squid_db_auth.in + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/basic_auth/DB/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign helpers/basic_auth/DB/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libexecSCRIPTS: $(libexec_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + done +uninstall-info-am: +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ + done +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-exec-am: install-libexecSCRIPTS + +install-info: install-info-am + +install-man: install-man8 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS uninstall-man + +uninstall-man: uninstall-man8 + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libexecSCRIPTS install-man install-man8 install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-libexecSCRIPTS uninstall-man uninstall-man8 + + +squid_db_auth.8: squid_db_auth + pod2man squid_db_auth squid_db_auth.8 + +squid_db_auth: squid_db_auth.in + $(do_subst) < $(srcdir)/squid_db_auth.in >squid_db_auth +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -ruN squid-2.6.STABLE13/helpers/basic_auth/DB/passwd.sql squid-2.6.STABLE14/helpers/basic_auth/DB/passwd.sql --- squid-2.6.STABLE13/helpers/basic_auth/DB/passwd.sql Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/DB/passwd.sql Sat Jun 2 18:51:16 2007 @@ -0,0 +1,8 @@ +CREATE TABLE `passwd` ( + `user` varchar(32) NOT NULL default '', + `password` varchar(35) NOT NULL default '', + `enabled` tinyint(1) NOT NULL default '1', + `fullname` varchar(60) default NULL, + `comment` varchar(60) default NULL, + PRIMARY KEY (`user`) +); diff -ruN squid-2.6.STABLE13/helpers/basic_auth/DB/squid_db_auth.in squid-2.6.STABLE14/helpers/basic_auth/DB/squid_db_auth.in --- squid-2.6.STABLE13/helpers/basic_auth/DB/squid_db_auth.in Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/DB/squid_db_auth.in Sat Jun 23 15:30:26 2007 @@ -0,0 +1,125 @@ +#!@PERL@ +use strict; +use DBI; +use Getopt::Long; +use Pod::Usage; + +=pod + +=head1 NAME + +db_auth.pl - Database auth helper for Squid + +=cut + +my $dsn = "DBI:mysql:database=squid"; +my $db_user = undef; +my $db_passwd = undef; +my $db_table = "passwd"; +my $db_usercol = "user"; +my $db_passwdcol = "password"; +my $db_cond = "enabled = 1"; +my $plaintext = 0; + +=pod + +=head1 SYNOPSIS + +db_auth.pl [options] + +=head1 DESCRIPTOIN + +This program verifies username & password to a database + +=over 8 + +=item B<--dsn> + +Database DSN. Default "DBI:mysql:database=squid" + +=item B<--user> + +Database User + +=item B<--password> + +Database password + +=item B<--table> + +Database table. Default "passwd". + +=item B<--usercol> + +Username column. Default "user". + +=item B<--passwdcol> + +Password column. Default "password". + +=item B<--cond> + +Condition, defaults to enabled=1. Specify 1 or "" for no condition + +=item B<--plaintext> + +Database contains plain-text passwords + +=back + +=cut + +GetOptions( + 'dsn=s' => \$dsn, + 'user=s' => \$db_user, + 'password=s' => \$db_passwd, + 'table=s' => \$db_table, + 'usercol=s' => \$db_usercol, + 'passwdcol=s' => \$db_passwdcol, + 'cond=s' => \$db_cond, + 'plaintext' => \$plaintext, + ); + +my $dbh = DBI->connect($dsn, $db_user, $db_passwd) || die ("Could not connect to $dsn\n"); + +my ($sth) = $dbh->prepare("SELECT $db_passwdcol FROM $db_table WHERE $db_usercol = ?" . ($db_cond ne "" ? " AND $db_cond" : "")) || die; + +my $status; + +sub check_password($$) +{ + my ($password, $key) = @_; + + return 1 if crypt($password, $key) eq $key; + + return 1 if $plaintext && $password eq $key; + + return 0; +} +while (<>) { + my ($user, $password) = split; + $status = "ERR"; + $user =~ s/%(..)/pack("H*", $1)/ge; + $password =~ s/%(..)/pack("H*", $1)/ge; + + $status = "ERR internal error"; + $sth->execute($user) || next; + $status = "ERR unknown login"; + my ($row) = $sth->fetchrow_arrayref() || next; + $status = "ERR login failure"; + next if (!check_password($password, @$row[0])); + $status = "OK"; +} continue { + print $status . "\n"; +} + +=pod + +=head1 COPYRIGHT + +Copyright (C) 2007 Henrik Nordstrom +This program is free software. You may redistribute copies of it under the +terms of the GNU General Public License version 2, or (at youropinion) any +later version. + +=cut diff -ruN squid-2.6.STABLE13/helpers/basic_auth/LDAP/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/LDAP/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/LDAP/Makefile.in Sat Nov 4 16:19:49 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/LDAP/Makefile.in Fri Jun 22 18:14:44 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.40 2006/11/04 23:19:49 hno Exp $ +# $Id: Makefile.in,v 1.40.2.1 2007/06/23 00:14:44 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -197,6 +197,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/LDAP/squid_ldap_auth.c squid-2.6.STABLE14/helpers/basic_auth/LDAP/squid_ldap_auth.c --- squid-2.6.STABLE13/helpers/basic_auth/LDAP/squid_ldap_auth.c Fri Sep 1 12:26:25 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/LDAP/squid_ldap_auth.c Mon Jun 25 17:37:59 2007 @@ -32,13 +32,13 @@ * Changes: * 2005-01-07: Henrik Nordstrom * - Added some sanity checks on login names to avoid - * users bypassing equality checks by exploring the - * overly helpful match capabilities of LDAP + * users bypassing equality checks by exploring the + * overly helpful match capabilities of LDAP * 2004-07-17: Henrik Nordstrom * - Corrected non-persistent mode to only issue one - * ldap_bind per connection. + * ldap_bind per connection. * - -U option to compare the users password rather - * than binding. + * than binding. * 2004-03-01: Henrik Nordstrom * - corrected building of search filters to escape * unsafe input @@ -100,7 +100,9 @@ #define LDAPAPI __cdecl #endif #ifdef LDAP_VERSION3 -#define LDAP_OPT_SUCCESS LDAP_SUCCESS +#ifndef LDAP_OPT_X_TLS +#define LDAP_OPT_X_TLS 0x6000 +#endif /* Some tricks to allow dynamic bind with ldap_start_tls_s entry point at * run time. */ @@ -318,12 +320,12 @@ const unsigned char *p = (const unsigned char *) user; /* Leading whitespace? */ - if (isspace(p[0])) + if (xisspace(p[0])) return 0; while (p[0] && p[1]) { - if (isspace(p[0])) { + if (xisspace(p[0])) { /* More than one consequitive space? */ - if (isspace(p[1])) + if (xisspace(p[1])) return 0; /* or odd space type character used? */ if (p[0] != ' ') @@ -332,7 +334,7 @@ p++; } /* Trailing whitespace? */ - if (isspace(p[0])) + if (xisspace(p[0])) return 0; return 1; } @@ -547,7 +549,7 @@ fprintf(stderr, "\tIf you need to bind as a user to perform searches then use the\n\t-D binddn -w bindpasswd or -D binddn -W secretfile options\n\n"); exit(1); } -/* On windows ldap_start_tls_s is available starting from Windows XP, +/* On Windows ldap_start_tls_s is available starting from Windows XP, * so we need to bind at run-time with the function entry point */ #ifdef _SQUID_MSWIN_ @@ -639,7 +641,6 @@ char dn[256]; int ret = 0; LDAP *bind_ld = NULL; - int rc; if (!*password) { /* LDAP can't bind with a blank password. Seen as "anonymous" @@ -657,6 +658,7 @@ char *searchattr[] = {LDAP_NO_ATTRS, NULL}; char *userdn; + int rc; LDAP *search_ld = persistent_ld; if (!search_ld) diff -ruN squid-2.6.STABLE13/helpers/basic_auth/MSNT/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/MSNT/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/MSNT/Makefile.in Sat Nov 4 16:19:50 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/MSNT/Makefile.in Fri Jun 22 18:14:44 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.43 2006/11/04 23:19:50 hno Exp $ +# $Id: Makefile.in,v 1.43.2.1 2007/06/23 00:14:44 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -206,6 +206,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/Makefile.am squid-2.6.STABLE14/helpers/basic_auth/Makefile.am --- squid-2.6.STABLE13/helpers/basic_auth/Makefile.am Sat May 27 02:58:28 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/Makefile.am Mon Jun 25 17:37:09 2007 @@ -1,7 +1,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.am,v 1.6 2006/05/27 08:58:28 serassio Exp $ +# $Id: Makefile.am,v 1.6.2.2 2007/06/25 23:37:09 hno Exp $ # -DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL mswin_sspi +DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL mswin_sspi POP3 DB SUBDIRS = @BASIC_AUTH_HELPERS@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/Makefile.in Sat Nov 4 16:19:48 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/Makefile.in Mon Jun 25 18:14:18 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.39 2006/11/04 23:19:48 hno Exp $ +# $Id: Makefile.in,v 1.39.2.3 2007/06/26 00:14:18 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ @@ -238,7 +240,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL mswin_sspi +DIST_SUBDIRS = getpwnam LDAP MSNT multi-domain-NTLM NCSA PAM SMB YP SASL mswin_sspi POP3 DB SUBDIRS = @BASIC_AUTH_HELPERS@ all: all-recursive diff -ruN squid-2.6.STABLE13/helpers/basic_auth/NCSA/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/NCSA/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/NCSA/Makefile.in Sat Nov 4 16:19:50 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/NCSA/Makefile.in Fri Jun 22 18:14:44 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.40 2006/11/04 23:19:50 hno Exp $ +# $Id: Makefile.in,v 1.40.2.1 2007/06/23 00:14:44 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -197,6 +197,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/PAM/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/PAM/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/PAM/Makefile.in Sat Nov 4 16:19:50 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/PAM/Makefile.in Fri Jun 22 18:14:44 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid PAM authentication helper # -# $Id: Makefile.in,v 1.39 2006/11/04 23:19:50 hno Exp $ +# $Id: Makefile.in,v 1.39.2.1 2007/06/23 00:14:44 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -196,6 +196,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/POP3/Makefile.am squid-2.6.STABLE14/helpers/basic_auth/POP3/Makefile.am --- squid-2.6.STABLE13/helpers/basic_auth/POP3/Makefile.am Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/POP3/Makefile.am Mon Jun 25 17:37:11 2007 @@ -0,0 +1,13 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.am,v 1.1.2.1 2007/06/25 23:37:11 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +libexec_SCRIPTS = \ + pop3.pl + +EXTRA_DIST = \ + pop3.pl diff -ruN squid-2.6.STABLE13/helpers/basic_auth/POP3/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/POP3/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/POP3/Makefile.in Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/POP3/Makefile.in Mon Jun 25 18:14:19 2007 @@ -0,0 +1,423 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.in,v 1.1.2.2 2007/06/26 00:14:19 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = helpers/basic_auth/POP3 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/autoconf.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libexecdir)" +libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(libexec_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AR_R = @AR_R@ +AUTH_LIBS = @AUTH_LIBS@ +AUTH_MODULES = @AUTH_MODULES@ +AUTH_OBJS = @AUTH_OBJS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@ +CACHE_HTTP_PORT = @CACHE_HTTP_PORT@ +CACHE_ICP_PORT = @CACHE_ICP_PORT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGIEXT = @CGIEXT@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPTLIB = @CRYPTLIB@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@ +ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@ +ENABLE_MINGW32SPECIFIC_FALSE = @ENABLE_MINGW32SPECIFIC_FALSE@ +ENABLE_MINGW32SPECIFIC_TRUE = @ENABLE_MINGW32SPECIFIC_TRUE@ +ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@ +ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@ +ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@ +ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@ +ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@ +ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@ +ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@ +ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@ +ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@ +ERR_LANGUAGES = @ERR_LANGUAGES@ +EXEEXT = @EXEEXT@ +EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@ +FALSE = @FALSE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDLMALLOC = @LIBDLMALLOC@ +LIBOBJS = @LIBOBJS@ +LIBREGEX = @LIBREGEX@ +LIBS = @LIBS@ +LIBSASL = @LIBSASL@ +LIB_DB = @LIB_DB@ +LIB_EPOLL = @LIB_EPOLL@ +LIB_LBER = @LIB_LBER@ +LIB_LDAP = @LIB_LDAP@ +LIB_MALLOC = @LIB_MALLOC@ +LN = @LN@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@ +MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@ +MKDIR = @MKDIR@ +MV = @MV@ +NEED_COSSDUMP_FALSE = @NEED_COSSDUMP_FALSE@ +NEED_COSSDUMP_TRUE = @NEED_COSSDUMP_TRUE@ +NEED_DISKD_FALSE = @NEED_DISKD_FALSE@ +NEED_DISKD_TRUE = @NEED_DISKD_TRUE@ +NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@ +NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@ +NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@ +NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@ +NEED_OWN_STRSEP_FALSE = @NEED_OWN_STRSEP_FALSE@ +NEED_OWN_STRSEP_TRUE = @NEED_OWN_STRSEP_TRUE@ +NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH_HELPERS@ +NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@ +OBJEXT = @OBJEXT@ +OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGCONFIG = @PKGCONFIG@ +RANLIB = @RANLIB@ +REGEXLIB = @REGEXLIB@ +REPL_LIBS = @REPL_LIBS@ +REPL_OBJS = @REPL_OBJS@ +REPL_POLICIES = @REPL_POLICIES@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SH = @SH@ +SHELL = @SHELL@ +SNMPLIB = @SNMPLIB@ +SSLLIB = @SSLLIB@ +STORE_LIBS = @STORE_LIBS@ +STORE_MODULES = @STORE_MODULES@ +STORE_OBJS = @STORE_OBJS@ +STRIP = @STRIP@ +TRUE = @TRUE@ +USE_AIOPS_WIN32_FALSE = @USE_AIOPS_WIN32_FALSE@ +USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ +USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ +USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ +USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ +USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ +USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ +USE_EPOLL_TRUE = @USE_EPOLL_TRUE@ +USE_KQUEUE_FALSE = @USE_KQUEUE_FALSE@ +USE_KQUEUE_TRUE = @USE_KQUEUE_TRUE@ +USE_POLL_FALSE = @USE_POLL_FALSE@ +USE_POLL_TRUE = @USE_POLL_TRUE@ +USE_SELECT_FALSE = @USE_SELECT_FALSE@ +USE_SELECT_SIMPLE_FALSE = @USE_SELECT_SIMPLE_FALSE@ +USE_SELECT_SIMPLE_TRUE = @USE_SELECT_SIMPLE_TRUE@ +USE_SELECT_TRUE = @USE_SELECT_TRUE@ +USE_SELECT_WIN32_FALSE = @USE_SELECT_WIN32_FALSE@ +USE_SELECT_WIN32_TRUE = @USE_SELECT_WIN32_TRUE@ +USE_SNMP_FALSE = @USE_SNMP_FALSE@ +USE_SNMP_TRUE = @USE_SNMP_TRUE@ +VERSION = @VERSION@ +WIN32_PSAPI = @WIN32_PSAPI@ +XTRA_LIBS = @XTRA_LIBS@ +XTRA_OBJS = @XTRA_OBJS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +makesnmplib = @makesnmplib@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +libexec_SCRIPTS = \ + pop3.pl + +EXTRA_DIST = \ + pop3.pl + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/basic_auth/POP3/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign helpers/basic_auth/POP3/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libexecSCRIPTS: $(libexec_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + done +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libexecSCRIPTS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libexecSCRIPTS install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-libexecSCRIPTS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -ruN squid-2.6.STABLE13/helpers/basic_auth/POP3/pop3.pl squid-2.6.STABLE14/helpers/basic_auth/POP3/pop3.pl --- squid-2.6.STABLE13/helpers/basic_auth/POP3/pop3.pl Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/basic_auth/POP3/pop3.pl Mon Jun 25 17:37:11 2007 @@ -0,0 +1,54 @@ +#!/usr/bin/perl +# +# POP3 authenticator for Squid +# Copyright (C) 2006 Henrik Nordstrom +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111, USA. +# +# Change log: +# 2006-12-10 henrik Initial revision +# + + +use Net::POP3; +$|=1; + +if ( @ARGV != 1 ) { + print STDERR "Usage: $0 popserver\n"; + exit 1 +} + +$server = shift @ARGV; + +while(<>) { + my ($username, $password) = split(/\s+/); + $username =~ s/%([0-9a-f][0-9a-f])/pack("H2",$1)/gie; + $password =~ s/%([0-9a-f][0-9a-f])/pack("H2",$1)/gie; + + $pop = Net::POP3->new($server); + if (!$pop) { + print "ERR Server not responding\n"; + next; + } + + # Here apop could be used instead for MD5 support + if ($pop->login($username, $password)) { + print "OK\n"; + } else { + print "ERR\n"; + } + $pop->quit; + undef $pop; +} diff -ruN squid-2.6.STABLE13/helpers/basic_auth/SASL/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/SASL/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/SASL/Makefile.in Sat Nov 4 16:19:51 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/SASL/Makefile.in Fri Jun 22 18:14:45 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid SASL authentication helper # -# $Id: Makefile.in,v 1.36 2006/11/04 23:19:51 hno Exp $ +# $Id: Makefile.in,v 1.36.2.1 2007/06/23 00:14:45 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/SMB/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/SMB/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/SMB/Makefile.in Sat Nov 4 16:19:52 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/SMB/Makefile.in Fri Jun 22 18:14:46 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.39 2006/11/04 23:19:52 hno Exp $ +# $Id: Makefile.in,v 1.39.2.1 2007/06/23 00:14:46 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -202,6 +202,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/YP/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/YP/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/YP/Makefile.in Sat Nov 4 16:19:52 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/YP/Makefile.in Fri Jun 22 18:14:46 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.40 2006/11/04 23:19:52 hno Exp $ +# $Id: Makefile.in,v 1.40.2.1 2007/06/23 00:14:46 hno Exp $ # # @@ -192,6 +192,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/getpwnam/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/getpwnam/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/getpwnam/Makefile.in Sat Nov 4 16:19:53 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/getpwnam/Makefile.in Fri Jun 22 18:14:46 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.38 2006/11/04 23:19:53 hno Exp $ +# $Id: Makefile.in,v 1.38.2.1 2007/06/23 00:14:46 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -194,6 +194,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/mswin_sspi/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/mswin_sspi/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/mswin_sspi/Makefile.in Sat Nov 4 16:19:53 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/mswin_sspi/Makefile.in Fri Jun 22 18:14:46 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.12 2006/11/04 23:19:53 hno Exp $ +# $Id: Makefile.in,v 1.12.2.1 2007/06/23 00:14:46 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/basic_auth/multi-domain-NTLM/Makefile.in squid-2.6.STABLE14/helpers/basic_auth/multi-domain-NTLM/Makefile.in --- squid-2.6.STABLE13/helpers/basic_auth/multi-domain-NTLM/Makefile.in Sat Nov 4 16:19:53 2006 +++ squid-2.6.STABLE14/helpers/basic_auth/multi-domain-NTLM/Makefile.in Fri Jun 22 18:14:47 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.36 2006/11/04 23:19:53 hno Exp $ +# $Id: Makefile.in,v 1.36.2.1 2007/06/23 00:14:47 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -178,6 +178,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/digest_auth/Makefile.am squid-2.6.STABLE14/helpers/digest_auth/Makefile.am --- squid-2.6.STABLE13/helpers/digest_auth/Makefile.am Mon May 15 19:21:29 2006 +++ squid-2.6.STABLE14/helpers/digest_auth/Makefile.am Sat Jun 23 15:48:49 2007 @@ -1,7 +1,7 @@ # Makefile for digest auth helpers in the Squid Object Cache server # -# $Id: Makefile.am,v 1.2 2006/05/16 01:21:29 hno Exp $ +# $Id: Makefile.am,v 1.2.2.1 2007/06/23 21:48:49 hno Exp $ # -DIST_SUBDIRS = password ldap +DIST_SUBDIRS = password ldap eDirectory SUBDIRS = @DIGEST_AUTH_HELPERS@ diff -ruN squid-2.6.STABLE13/helpers/digest_auth/Makefile.in squid-2.6.STABLE14/helpers/digest_auth/Makefile.in --- squid-2.6.STABLE13/helpers/digest_auth/Makefile.in Sat Nov 4 16:19:54 2006 +++ squid-2.6.STABLE14/helpers/digest_auth/Makefile.in Sat Jun 23 15:51:54 2007 @@ -16,7 +16,7 @@ # Makefile for digest auth helpers in the Squid Object Cache server # -# $Id: Makefile.in,v 1.36 2006/11/04 23:19:54 hno Exp $ +# $Id: Makefile.in,v 1.36.2.2 2007/06/23 21:51:54 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ @@ -238,7 +240,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -DIST_SUBDIRS = password ldap +DIST_SUBDIRS = password ldap eDirectory SUBDIRS = @DIGEST_AUTH_HELPERS@ all: all-recursive diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/Makefile.am squid-2.6.STABLE14/helpers/digest_auth/eDirectory/Makefile.am --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/Makefile.am Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/Makefile.am Sat Jun 23 15:48:49 2007 @@ -0,0 +1,19 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.am,v 1.1.2.1 2007/06/23 21:48:49 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +libexec_PROGRAMS = digest_edir_auth +digest_edir_auth_SOURCES = digest_pw_auth.c \ + digest_common.h \ + ldap_backend.c \ + ldap_backend.h \ + edir_ldapext.c \ + edir_ldapext.h +INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/ + +LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) $(CRYPTLIB) $(XTRA_LIBS) $(SSLLIB) diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/Makefile.in squid-2.6.STABLE14/helpers/digest_auth/eDirectory/Makefile.in --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/Makefile.in Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/Makefile.in Sat Jun 23 15:48:49 2007 @@ -0,0 +1,525 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.in,v 1.1.2.1 2007/06/23 21:48:49 hno Exp $ +# +# Uncomment and customize the following to suit your needs: +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +libexec_PROGRAMS = digest_edir_auth$(EXEEXT) +subdir = helpers/digest_auth/eDirectory +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/autoconf.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libexecdir)" +libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(libexec_PROGRAMS) +am_digest_edir_auth_OBJECTS = digest_pw_auth.$(OBJEXT) \ + ldap_backend.$(OBJEXT) edir_ldapext.$(OBJEXT) +digest_edir_auth_OBJECTS = $(am_digest_edir_auth_OBJECTS) +digest_edir_auth_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +digest_edir_auth_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(digest_edir_auth_SOURCES) +DIST_SOURCES = $(digest_edir_auth_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AR_R = @AR_R@ +AUTH_LIBS = @AUTH_LIBS@ +AUTH_MODULES = @AUTH_MODULES@ +AUTH_OBJS = @AUTH_OBJS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@ +CACHE_HTTP_PORT = @CACHE_HTTP_PORT@ +CACHE_ICP_PORT = @CACHE_ICP_PORT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGIEXT = @CGIEXT@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPTLIB = @CRYPTLIB@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@ +ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@ +ENABLE_MINGW32SPECIFIC_FALSE = @ENABLE_MINGW32SPECIFIC_FALSE@ +ENABLE_MINGW32SPECIFIC_TRUE = @ENABLE_MINGW32SPECIFIC_TRUE@ +ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@ +ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@ +ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@ +ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@ +ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@ +ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@ +ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@ +ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@ +ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@ +ERR_LANGUAGES = @ERR_LANGUAGES@ +EXEEXT = @EXEEXT@ +EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@ +FALSE = @FALSE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDLMALLOC = @LIBDLMALLOC@ +LIBOBJS = @LIBOBJS@ +LIBREGEX = @LIBREGEX@ +LIBS = @LIBS@ +LIBSASL = @LIBSASL@ +LIB_DB = @LIB_DB@ +LIB_EPOLL = @LIB_EPOLL@ +LIB_LBER = @LIB_LBER@ +LIB_LDAP = @LIB_LDAP@ +LIB_MALLOC = @LIB_MALLOC@ +LN = @LN@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@ +MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@ +MKDIR = @MKDIR@ +MV = @MV@ +NEED_COSSDUMP_FALSE = @NEED_COSSDUMP_FALSE@ +NEED_COSSDUMP_TRUE = @NEED_COSSDUMP_TRUE@ +NEED_DISKD_FALSE = @NEED_DISKD_FALSE@ +NEED_DISKD_TRUE = @NEED_DISKD_TRUE@ +NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@ +NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@ +NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@ +NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@ +NEED_OWN_STRSEP_FALSE = @NEED_OWN_STRSEP_FALSE@ +NEED_OWN_STRSEP_TRUE = @NEED_OWN_STRSEP_TRUE@ +NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH_HELPERS@ +NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@ +OBJEXT = @OBJEXT@ +OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGCONFIG = @PKGCONFIG@ +RANLIB = @RANLIB@ +REGEXLIB = @REGEXLIB@ +REPL_LIBS = @REPL_LIBS@ +REPL_OBJS = @REPL_OBJS@ +REPL_POLICIES = @REPL_POLICIES@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SH = @SH@ +SHELL = @SHELL@ +SNMPLIB = @SNMPLIB@ +SSLLIB = @SSLLIB@ +STORE_LIBS = @STORE_LIBS@ +STORE_MODULES = @STORE_MODULES@ +STORE_OBJS = @STORE_OBJS@ +STRIP = @STRIP@ +TRUE = @TRUE@ +USE_AIOPS_WIN32_FALSE = @USE_AIOPS_WIN32_FALSE@ +USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ +USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ +USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ +USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ +USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ +USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ +USE_EPOLL_TRUE = @USE_EPOLL_TRUE@ +USE_KQUEUE_FALSE = @USE_KQUEUE_FALSE@ +USE_KQUEUE_TRUE = @USE_KQUEUE_TRUE@ +USE_POLL_FALSE = @USE_POLL_FALSE@ +USE_POLL_TRUE = @USE_POLL_TRUE@ +USE_SELECT_FALSE = @USE_SELECT_FALSE@ +USE_SELECT_SIMPLE_FALSE = @USE_SELECT_SIMPLE_FALSE@ +USE_SELECT_SIMPLE_TRUE = @USE_SELECT_SIMPLE_TRUE@ +USE_SELECT_TRUE = @USE_SELECT_TRUE@ +USE_SELECT_WIN32_FALSE = @USE_SELECT_WIN32_FALSE@ +USE_SELECT_WIN32_TRUE = @USE_SELECT_WIN32_TRUE@ +USE_SNMP_FALSE = @USE_SNMP_FALSE@ +USE_SNMP_TRUE = @USE_SNMP_TRUE@ +VERSION = @VERSION@ +WIN32_PSAPI = @WIN32_PSAPI@ +XTRA_LIBS = @XTRA_LIBS@ +XTRA_OBJS = @XTRA_OBJS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +makesnmplib = @makesnmplib@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +digest_edir_auth_SOURCES = digest_pw_auth.c \ + digest_common.h \ + ldap_backend.c \ + ldap_backend.h \ + edir_ldapext.c \ + edir_ldapext.h + +INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/ + +LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) $(CRYPTLIB) $(XTRA_LIBS) $(SSLLIB) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/digest_auth/eDirectory/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign helpers/digest_auth/eDirectory/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + done + +clean-libexecPROGRAMS: + -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) +digest_edir_auth$(EXEEXT): $(digest_edir_auth_OBJECTS) $(digest_edir_auth_DEPENDENCIES) + @rm -f digest_edir_auth$(EXEEXT) + $(LINK) $(digest_edir_auth_LDFLAGS) $(digest_edir_auth_OBJECTS) $(digest_edir_auth_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digest_pw_auth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edir_ldapext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap_backend.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libexecPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libexecPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libexecPROGRAMS install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libexecPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/digest_common.h squid-2.6.STABLE14/helpers/digest_auth/eDirectory/digest_common.h --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/digest_common.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/digest_common.h Sat Jun 23 15:48:49 2007 @@ -0,0 +1,57 @@ +/* + * digest_common.h + * + * AUTHOR: Robert Collins. + * + * Digest helper API details. + * + * Copyright (c) 2003 Robert Collins + */ + +#ifndef _SQUID_DIGEST_COMMON_H_ +#define _SQUID_DIGEST_COMMON_H_ + +#include "config.h" +#if HAVE_STDIO_H +#include +#endif +#if HAVE_STDLIB_H +#include +#endif +#if HAVE_UNISTD_H +#include +#endif +#if HAVE_STRING_H +#include +#endif +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_SYS_STAT_H +#include +#endif +#if HAVE_CRYPT_H +#include +#endif + +#include "util.h" +#include "hash.h" +#include "rfc2617.h" + +typedef struct _request_data { + char *user; + char *realm; + char *password; + HASHHEX HHA1; + int parsed; + int error; +} RequestData; + +/* to use a backend, include your backend.h file + * and define thusly: + * #define ProcessArguments(A, B) MyHandleArguments(A,B) + * #define GetHHA1(A) MyGetHHA1(A) + */ +typedef void HandleArguments(int, char **); +typedef void HHA1Creator(RequestData *); +#endif /* _SQUID_DIGEST_COMMON_H_ */ diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/digest_pw_auth.c squid-2.6.STABLE14/helpers/digest_auth/eDirectory/digest_pw_auth.c --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/digest_pw_auth.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/digest_pw_auth.c Sat Jun 23 15:48:49 2007 @@ -0,0 +1,102 @@ +/* + * digest_pw_auth.c + * + * AUTHOR: Robert Collins. Based on ncsa_auth.c by Arjan de Vet + * + * LDAP backend extension by Flavio Pescuma, MARA Systems AB + * + * Example digest authentication program for Squid, based on the original + * proxy_auth code from client_side.c, written by + * Jon Thackray . + * + * - comment lines are possible and should start with a '#'; + * - empty or blank lines are possible; + * - file format is username:password + * + * To build a directory integrated backend, you need to be able to + * calculate the HA1 returned to squid. To avoid storing a plaintext + * password you can calculate MD5(username:realm:password) when the + * user changes their password, and store the tuple username:realm:HA1. + * then find the matching username:realm when squid asks for the + * HA1. + * + * This implementation could be improved by using such a triple for + * the file format. However storing such a triple does little to + * improve security: If compromised the username:realm:HA1 combination + * is "plaintext equivalent" - for the purposes of digest authentication + * they allow the user access. Password syncronisation is not tackled + * by digest - just preventing on the wire compromise. + * + * Copyright (c) 2003 Robert Collins + */ + +#include "digest_common.h" +#include "ldap_backend.h" +#define PROGRAM_NAME "digest_ldap_auth" + + +void +GetHHA1(RequestData * requestData) +{ + LDAPHHA1(requestData); +} + +static void +ParseBuffer(char *buf, RequestData * requestData) +{ + char *p; + requestData->parsed = 0; + if ((p = strchr(buf, '\n')) != NULL) + *p = '\0'; /* strip \n */ + if ((requestData->user = strtok(buf, "\"")) == NULL) + return; + if ((requestData->realm = strtok(NULL, "\"")) == NULL) + return; + if ((requestData->realm = strtok(NULL, "\"")) == NULL) + return; + requestData->parsed = -1; +} + +static void +OutputHHA1(RequestData * requestData) +{ + requestData->error = 0; + GetHHA1(requestData); + if (requestData->error) { + printf("ERR No such user\n"); + return; + } + printf("%s\n", requestData->HHA1); +} + +static void +DoOneRequest(char *buf) +{ + RequestData requestData; + ParseBuffer(buf, &requestData); + if (!requestData.parsed) { + printf("ERR\n"); + return; + } + OutputHHA1(&requestData); +} + +void +ProcessArguments(int argc, char **argv) +{ + int i; + i = LDAPArguments(argc, argv); + if (i) + exit(i); +} + +int +main(int argc, char **argv) +{ + char buf[256]; + setbuf(stdout, NULL); + ProcessArguments(argc, argv); + while (fgets(buf, 256, stdin) != NULL) + DoOneRequest(buf); + exit(0); +} diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/edir_ldapext.c squid-2.6.STABLE14/helpers/digest_auth/eDirectory/edir_ldapext.c --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/edir_ldapext.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/edir_ldapext.c Sat Jun 23 15:48:49 2007 @@ -0,0 +1,363 @@ +/* + * Copyright (C) 2002-2004 Novell, Inc. + * + * edir_ldapext.c LDAP extension for reading eDirectory universal password + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, contact Novell, Inc. + * + * To contact Novell about this file by physical or electronic mail, you may + * find current contact information at www.novell.com. + */ + +#include +#include +#include +#include +/* NMAS error codes */ +#define NMAS_E_BASE (-1600) + +#define NMAS_SUCCESS 0 +#define NMAS_E_SUCCESS NMAS_SUCCESS /* Alias */ +#define NMAS_OK NMAS_SUCCESS /* Alias */ + +#define NMAS_E_FRAG_FAILURE (NMAS_E_BASE-31) /* -1631 0xFFFFF9A1 */ +#define NMAS_E_BUFFER_OVERFLOW (NMAS_E_BASE-33) /* -1633 0xFFFFF99F */ +#define NMAS_E_SYSTEM_RESOURCES (NMAS_E_BASE-34) /* -1634 0xFFFFF99E */ +#define NMAS_E_INSUFFICIENT_MEMORY (NMAS_E_BASE-35) /* -1635 0xFFFFF99D */ +#define NMAS_E_NOT_SUPPORTED (NMAS_E_BASE-36) /* -1636 0xFFFFF99C */ +#define NMAS_E_INVALID_PARAMETER (NMAS_E_BASE-43) /* -1643 0xFFFFF995 */ +#define NMAS_E_INVALID_VERSION (NMAS_E_BASE-52) /* -1652 0xFFFFF98C */ + +/* OID of LDAP extenstion calls to read Universal Password */ +#define NMASLDAP_GET_PASSWORD_REQUEST "2.16.840.1.113719.1.39.42.100.13" +#define NMASLDAP_GET_PASSWORD_RESPONSE "2.16.840.1.113719.1.39.42.100.14" + +#define NMAS_LDAP_EXT_VERSION 1 + + + +/* ------------------------------------------------------------------------ + * berEncodePasswordData + * ============================== + * RequestBer contents: + * clientVersion INTEGER + * targetObjectDN OCTET STRING + * password1 OCTET STRING + * password2 OCTET STRING + * + * Description: + * This function takes the request BER value and input data items + * and BER encodes the data into the BER value + * + * ------------------------------------------------------------------------ */ +int berEncodePasswordData( + struct berval **requestBV, + char *objectDN, + char *password, + char *password2) +{ + int err = 0, rc=0; + BerElement *requestBer = NULL; + + char * utf8ObjPtr = NULL; + int utf8ObjSize = 0; + char * utf8PwdPtr = NULL; + int utf8PwdSize = 0; + char * utf8Pwd2Ptr = NULL; + int utf8Pwd2Size = 0; + + + utf8ObjSize = strlen(objectDN)+1; + utf8ObjPtr = objectDN; + + if (password != NULL) + { + utf8PwdSize = strlen(password)+1; + utf8PwdPtr = password; + } + + if (password2 != NULL) + { + utf8Pwd2Size = strlen(password2)+1; + utf8Pwd2Ptr = password2; + } + + /* Allocate a BerElement for the request parameters.*/ + if((requestBer = ber_alloc()) == NULL) + { + err = NMAS_E_FRAG_FAILURE; + goto Cleanup; + } + + if (password != NULL && password2 != NULL) + { + /* BER encode the NMAS Version, the objectDN, and the password */ + rc = ber_printf(requestBer, "{iooo}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize, utf8PwdPtr, utf8PwdSize, utf8Pwd2Ptr, utf8Pwd2Size); + } + else if (password != NULL) + { + /* BER encode the NMAS Version, the objectDN, and the password */ + rc = ber_printf(requestBer, "{ioo}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize, utf8PwdPtr, utf8PwdSize); + } + else + { + /* BER encode the NMAS Version and the objectDN */ + rc = ber_printf(requestBer, "{io}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize); + } + + if (rc < 0) + { + err = NMAS_E_FRAG_FAILURE; + goto Cleanup; + } + else + { + err = 0; + } + + /* + * Convert the BER we just built to a berval that we'll send with the extended request. + */ + if(ber_flatten(requestBer, requestBV) == LBER_ERROR) + { + err = NMAS_E_FRAG_FAILURE; + goto Cleanup; + } + +Cleanup: + + if(requestBer) + { + ber_free(requestBer, 1); + } + + return err; +} /* End of berEncodePasswordData */ + +/* ------------------------------------------------------------------------ + * berDecodeLoginData() + * ============================== + * ResponseBer contents: + * serverVersion INTEGER + * error INTEGER + * data OCTET STRING + * + * Description: + * This function takes the reply BER Value and decodes the + * NMAS server version and return code and if a non null retData + * buffer was supplied, tries to decode the the return data and length + * + * ------------------------------------------------------------------------ */ +int berDecodeLoginData( + struct berval *replyBV, + int *serverVersion, + size_t *retDataLen, + void *retData ) +{ + int rc=0, err = 0; + BerElement *replyBer = NULL; + char *retOctStr = NULL; + size_t retOctStrLen = 0; + + if((replyBer = ber_init(replyBV)) == NULL) + { + err = NMAS_E_SYSTEM_RESOURCES; + goto Cleanup; + } + + if(retData) + { + retOctStrLen = *retDataLen + 1; + retOctStr = (char *)malloc(retOctStrLen); + if(!retOctStr) + { + err = NMAS_E_SYSTEM_RESOURCES; + goto Cleanup; + } + + if( (rc = ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen)) != -1) + { + if (*retDataLen >= retOctStrLen) + { + memcpy(retData, retOctStr, retOctStrLen); + } + else if (!err) + { + err = NMAS_E_BUFFER_OVERFLOW; + } + + *retDataLen = retOctStrLen; + } + else if (!err) + { + err = NMAS_E_FRAG_FAILURE; + } + } + else + { + if( (rc = ber_scanf(replyBer, "{ii}", serverVersion, &err)) == -1) + { + if (!err) + { + err = NMAS_E_FRAG_FAILURE; + } + } + } + +Cleanup: + + if(replyBer) + { + ber_free(replyBer, 1); + } + + if (retOctStr != NULL) + { + memset(retOctStr, 0, retOctStrLen); + free(retOctStr); + } + + return err; +} /* End of berDecodeLoginData */ + +/* ----------------------------------------------------------------------- + * nmasldap_get_password() + * ============================== + * + * Description: + * This API attempts to get the universal password + * + * ------------------------------------------------------------------------ */ +int nmasldap_get_password( + LDAP *ld, + char *objectDN, + size_t *pwdSize, // in bytes + char *pwd ) +{ + int err = 0; + + struct berval *requestBV = NULL; + char *replyOID = NULL; + struct berval *replyBV = NULL; + int serverVersion; + char *pwdBuf; + size_t pwdBufLen, bufferLen; + +#ifdef NOT_N_PLAT_NLM + int currentThreadGroupID; +#endif + + /* Validate char parameters. */ + if(objectDN == NULL || (strlen(objectDN) == 0) || pwdSize == NULL || ld == NULL) + { + return NMAS_E_INVALID_PARAMETER; + } + + bufferLen = pwdBufLen = *pwdSize; + pwdBuf = (char *)malloc(pwdBufLen+2); + if(pwdBuf == NULL) + { + return NMAS_E_INSUFFICIENT_MEMORY; + } + +#ifdef NOT_N_PLAT_NLM + currentThreadGroupID = SetThreadGroupID(nmasLDAPThreadGroupID); +#endif + + err = berEncodePasswordData(&requestBV, objectDN, NULL, NULL); + if(err) + { + goto Cleanup; + } + + /* Call the ldap_extended_operation (synchronously) */ + if((err = ldap_extended_operation_s(ld, NMASLDAP_GET_PASSWORD_REQUEST, requestBV, NULL, NULL, &replyOID, &replyBV))) + { + goto Cleanup; + } + + /* Make sure there is a return OID */ + if(!replyOID) + { + err = NMAS_E_NOT_SUPPORTED; + goto Cleanup; + } + + /* Is this what we were expecting to get back. */ + if(strcmp(replyOID, NMASLDAP_GET_PASSWORD_RESPONSE)) + { + err = NMAS_E_NOT_SUPPORTED; + goto Cleanup; + } + + /* Do we have a good returned berval? */ + if(!replyBV) + { + /* + * No; returned berval means we experienced a rather drastic error. + * Return operations error. + */ + err = NMAS_E_SYSTEM_RESOURCES; + goto Cleanup; + } + + err = berDecodeLoginData(replyBV, &serverVersion, &pwdBufLen, pwdBuf); + + if(serverVersion != NMAS_LDAP_EXT_VERSION) + { + err = NMAS_E_INVALID_VERSION; + goto Cleanup; + } + + if (!err && pwdBufLen != 0) + { + if (*pwdSize >= pwdBufLen+1 && pwd != NULL) + { + memcpy(pwd, pwdBuf, pwdBufLen); + pwd[pwdBufLen] = 0; /* add null termination */ + } + *pwdSize = pwdBufLen; /* does not include null termination */ + } + +Cleanup: + + if(replyBV) + { + ber_bvfree(replyBV); + } + + /* Free the return OID string if one was returned. */ + if(replyOID) + { + ldap_memfree(replyOID); + } + + /* Free memory allocated while building the request ber and berval. */ + if(requestBV) + { + ber_bvfree(requestBV); + } + + if (pwdBuf != NULL) + { + memset(pwdBuf, 0, bufferLen); + free(pwdBuf); + } + +#ifdef NOT_N_PLAT_NLM + SetThreadGroupID(currentThreadGroupID); +#endif + + /* Return the appropriate error/success code. */ + return err; +} /* end of nmasldap_get_password */ diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/edir_ldapext.h squid-2.6.STABLE14/helpers/digest_auth/eDirectory/edir_ldapext.h --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/edir_ldapext.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/edir_ldapext.h Sat Jun 23 15:48:49 2007 @@ -0,0 +1,16 @@ +/* + * edir_ldapext.h + * + * AUTHOR: Guy Antony Halse + * + * stubs for FreeRadius's edir_ldapext.h + * + */ +#include + +#define UNIVERSAL_PASS_LEN 256 +#define NMAS_SUCCESS 0 + +extern int berEncodePasswordData(struct berval **requestBV, char *objectDN, char *password, char *password2); +extern int berDecodeLoginData(struct berval *replyBV, int *serverVersion, size_t *retDataLen, void *retData); +extern int nmasldap_get_password(LDAP *ld, char *objectDN, size_t *pwdSize, char *pwd); diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/ldap_backend.c squid-2.6.STABLE14/helpers/digest_auth/eDirectory/ldap_backend.c --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/ldap_backend.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/ldap_backend.c Sat Jun 23 15:48:49 2007 @@ -0,0 +1,702 @@ +/* + * + * + * + * ldap_backend.c + * AUTHOR: Flavio Pescuma, MARA Systems AB + */ + +#define LDAP_DEPRECATED 1 + +#include +#include +#include +#include +#include "ldap_backend.h" +#include "edir_ldapext.h" + +#ifdef _SQUID_MSWIN_ /* Native Windows port and MinGW */ + +#define snprintf _snprintf +#include +#include +#ifndef LDAPAPI +#define LDAPAPI __cdecl +#endif +#ifdef LDAP_VERSION3 +#ifndef LDAP_OPT_X_TLS +#define LDAP_OPT_X_TLS 0x6000 +#endif +/* Some tricks to allow dynamic bind with ldap_start_tls_s entry point at + * run time. + */ +#undef ldap_start_tls_s +#if LDAP_UNICODE +#define LDAP_START_TLS_S "ldap_start_tls_sW" +typedef WINLDAPAPI ULONG(LDAPAPI * PFldap_start_tls_s) (IN PLDAP, OUT PULONG, OUT LDAPMessage **, IN PLDAPControlW *, IN PLDAPControlW *); +#else +#define LDAP_START_TLS_S "ldap_start_tls_sA" +typedef WINLDAPAPI ULONG(LDAPAPI * PFldap_start_tls_s) (IN PLDAP, OUT PULONG, OUT LDAPMessage **, IN PLDAPControlA *, IN PLDAPControlA *); +#endif /* LDAP_UNICODE */ +PFldap_start_tls_s Win32_ldap_start_tls_s; +#define ldap_start_tls_s(l,s,c) Win32_ldap_start_tls_s(l,NULL,NULL,s,c) +#endif /* LDAP_VERSION3 */ + +#else + +#include +#include + +#endif +#define PROGRAM_NAME "digest_pw_auth(LDAP_backend)" + +/* Globals */ + +static LDAP *ld = NULL; +static char *passattr = NULL; +static char *ldapServer = NULL; +static char *userbasedn = NULL; +static char *userdnattr = NULL; +static char *usersearchfilter = NULL; +static char *binddn = NULL; +static char *bindpasswd = NULL; +static char *delimiter = ":"; +static int encrpass = 0; +static int searchscope = LDAP_SCOPE_SUBTREE; +static int persistent = 0; +static int noreferrals = 0; +static int debug = 0; +static int port = LDAP_PORT; +static int strip_nt_domain = 0; +static int edir_universal_passwd = 0; +static int aliasderef = LDAP_DEREF_NEVER; +#if defined(NETSCAPE_SSL) +static char *sslpath = NULL; +static int sslinit = 0; +#endif +static int connect_timeout = 0; +static int timelimit = LDAP_NO_LIMIT; + +#ifdef LDAP_VERSION3 +/* Added for TLS support and version 3 */ +static int use_tls = 0; +static int version = -1; +#endif + +static void ldapconnect(void); +static int readSecret(char *filename); + +/* Yuck.. we need to glue to different versions of the API */ + +#if defined(LDAP_API_VERSION) && LDAP_API_VERSION > 1823 +static void +squid_ldap_set_aliasderef(int deref) +{ + ldap_set_option(ld, LDAP_OPT_DEREF, &deref); +} +static void +squid_ldap_set_referrals(int referrals) +{ + int *value = referrals ? LDAP_OPT_ON : LDAP_OPT_OFF; + ldap_set_option(ld, LDAP_OPT_REFERRALS, value); +} +static void +squid_ldap_set_timelimit(int timelimit) +{ + ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit); +} +static void +squid_ldap_set_connect_timeout(int timelimit) +{ +#if defined(LDAP_OPT_NETWORK_TIMEOUT) + struct timeval tv; + tv.tv_sec = timelimit; + tv.tv_usec = 0; + ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); +#elif defined(LDAP_X_OPT_CONNECT_TIMEOUT) + timelimit *= 1000; + ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timelimit); +#endif +} + +#else +static int +squid_ldap_errno(LDAP * ld) +{ + return ld->ld_errno; +} +static void +squid_ldap_set_aliasderef(int deref) +{ + ld->ld_deref = deref; +} +static void +squid_ldap_set_referrals(int referrals) +{ + if (referrals) + ld->ld_options |= ~LDAP_OPT_REFERRALS; + else + ld->ld_options &= ~LDAP_OPT_REFERRALS; +} +static void +squid_ldap_set_timelimit(int timelimit) +{ + ld->ld_timelimit = timelimit; +} +static void +squid_ldap_set_connect_timeout(int timelimit) +{ + fprintf(stderr, "Connect timeouts not supported in your LDAP library\n"); +} +static void +squid_ldap_memfree(char *p) +{ + free(p); +} + +#endif + +#ifdef LDAP_API_FEATURE_X_OPENLDAP +#if LDAP_VENDOR_VERSION > 194 +#define HAS_URI_SUPPORT 1 +#endif +#endif + +static int +ldap_escape_value(char *escaped, int size, const char *src) +{ + int n = 0; + while (size > 4 && *src) { + switch (*src) { + case '*': + case '(': + case ')': + case '\\': + n += 3; + size -= 3; + if (size > 0) { + *escaped++ = '\\'; + snprintf(escaped, 3, "%02x", (int) *src++); + escaped += 2; + } + break; + default: + *escaped++ = *src++; + n++; + size--; + } + } + *escaped = '\0'; + return n; +} + +static char * +getpassword(char *login, char *realm) +{ + LDAPMessage *res = NULL; + LDAPMessage *entry; + char **values = NULL; + char **value = NULL; + char *password = NULL; + int retry = 0; + char filter[8192]; + char searchbase[8192]; + char *universal_password = NULL; + size_t universal_password_len = UNIVERSAL_PASS_LEN; + int nmas_res = 0; + int rc = -1; + if (ld) { + if (usersearchfilter) { + char escaped_login[1024]; + snprintf(searchbase, sizeof(searchbase), "%s", userbasedn); + ldap_escape_value(escaped_login, sizeof(escaped_login), login); + snprintf(filter, sizeof(filter), usersearchfilter, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login); + + retrysrch: + if (debug) + fprintf(stderr, "user filter '%s', searchbase '%s'\n", filter, searchbase); + + rc = ldap_search_s(ld, searchbase, searchscope, filter, NULL, 0, &res); + if (rc != LDAP_SUCCESS) { + if (noreferrals && rc == LDAP_PARTIAL_RESULTS) { + /* Everything is fine. This is expected when referrals + * are disabled. + */ + rc = LDAP_SUCCESS; + } else { + fprintf(stderr, PROGRAM_NAME " WARNING, LDAP search error '%s'\n", ldap_err2string(rc)); +#if defined(NETSCAPE_SSL) + if (sslpath && ((rc == LDAP_SERVER_DOWN) || (rc == LDAP_CONNECT_ERROR))) { + int sslerr = PORT_GetError(); + fprintf(stderr, PROGRAM_NAME ": WARNING, SSL error %d (%s)\n", sslerr, ldapssl_err2string(sslerr)); + } +#endif + fprintf(stderr, PROGRAM_NAME " WARNING, LDAP search error, trying to recover'%s'\n", ldap_err2string(rc)); + ldap_msgfree(res); + /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ + if (!retry) { + retry++; + ldap_unbind(ld); + ld = NULL; + ldapconnect(); + goto retrysrch; + } + return NULL; + + } + } + } else if (userdnattr) { + sprintf(searchbase, "%s=%s, %s", userdnattr, login, userbasedn); + + retrydnattr: + if (debug) + fprintf(stderr, "searchbase '%s'\n", searchbase); + rc = ldap_search_s(ld, searchbase, searchscope, NULL, NULL, 0, &res); + } + if (rc == LDAP_SUCCESS) { + entry = ldap_first_entry(ld, res); + if (entry) { + if (debug) + printf("ldap dn: %s\n", ldap_get_dn(ld, entry)); + if (edir_universal_passwd) { + + /* allocate some memory for the universal password returned by NMAS */ + universal_password = malloc(universal_password_len); + memset(universal_password, 0, universal_password_len); + values = malloc(sizeof(char *)); + + /* actually talk to NMAS to get a password */ + nmas_res = nmasldap_get_password(ld, ldap_get_dn(ld, entry), &universal_password_len, universal_password); + if (nmas_res == NMAS_SUCCESS && universal_password) { + if (debug) + printf("NMAS returned value %s\n", universal_password); + values[0] = universal_password; + } else { + if (debug) + printf("Error reading Universal Password: %d = %s\n", nmas_res, ldap_err2string(nmas_res)); + } + } else { + values = ldap_get_values(ld, entry, passattr); + } + } else { + ldap_msgfree(res); + return NULL; + } + if (!values) { + if (debug) + printf("No attribute value found\n"); + if (edir_universal_passwd) + free(universal_password); + ldap_msgfree(res); + return NULL; + } + value = values; + while (*value) { + if (encrpass) { + if (strcmp(strtok(*value, delimiter), realm) == 0) { + password = strtok(NULL, delimiter); + break; + } + } else { + password = *value; + break; + } + value++; + } + if (debug) + printf("password: %s\n", password); + if (password) + password = strdup(password); + if (edir_universal_passwd) { + free(values); + free(universal_password); + } else { + ldap_value_free(values); + } + ldap_msgfree(res); + return password; + } else { + fprintf(stderr, PROGRAM_NAME " WARNING, LDAP error '%s'\n", ldap_err2string(rc)); + /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ + if (!retry) { + retry++; + ldap_unbind(ld); + ld = NULL; + ldapconnect(); + goto retrydnattr; + } + return NULL; + } + } + return NULL; +} + + + +static void +ldapconnect(void) +{ + int rc; + +/* On Windows ldap_start_tls_s is available starting from Windows XP, + * so we need to bind at run-time with the function entry point + */ +#ifdef _SQUID_MSWIN_ + if (use_tls) { + + HMODULE WLDAP32Handle; + + WLDAP32Handle = GetModuleHandle("wldap32"); + if ((Win32_ldap_start_tls_s = (PFldap_start_tls_s) GetProcAddress(WLDAP32Handle, LDAP_START_TLS_S)) == NULL) { + fprintf(stderr, PROGRAM_NAME ": ERROR: TLS (-Z) not supported on this platform.\n"); + exit(1); + } + } +#endif + + if (ld == NULL) { +#if HAS_URI_SUPPORT + if (strstr(ldapServer, "://") != NULL) { + rc = ldap_initialize(&ld, ldapServer); + if (rc != LDAP_SUCCESS) { + fprintf(stderr, "\nUnable to connect to LDAPURI:%s\n", ldapServer); + } + } else +#endif +#if NETSCAPE_SSL + if (sslpath) { + if (!sslinit && (ldapssl_client_init(sslpath, NULL) != LDAP_SUCCESS)) { + fprintf(stderr, "\nUnable to initialise SSL with cert path %s\n", + sslpath); + exit(1); + } else { + sslinit++; + } + if ((ld = ldapssl_init(ldapServer, port, 1)) == NULL) { + fprintf(stderr, "\nUnable to connect to SSL LDAP server: %s port:%d\n", + ldapServer, port); + exit(1); + } + } else +#endif + if ((ld = ldap_init(ldapServer, port)) == NULL) { + fprintf(stderr, "\nUnable to connect to LDAP server:%s port:%d\n", ldapServer, port); + } + if (connect_timeout) + squid_ldap_set_connect_timeout(connect_timeout); + +#ifdef LDAP_VERSION3 + if (version == -1) { + version = LDAP_VERSION2; + } + if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) + != LDAP_SUCCESS) { + fprintf(stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", + version); + ldap_unbind(ld); + ld = NULL; + } + if (use_tls) { +#ifdef LDAP_OPT_X_TLS + if ((version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) == LDAP_SUCCESS)) { + fprintf(stderr, "Could not Activate TLS connection\n"); + ldap_unbind(ld); + ld = NULL; + } +#else + fprintf(stderr, "TLS not supported with your LDAP library\n"); + ldap_unbind(ld); + ld = NULL; +#endif + } +#endif + squid_ldap_set_timelimit(timelimit); + squid_ldap_set_referrals(!noreferrals); + squid_ldap_set_aliasderef(aliasderef); + if (binddn && bindpasswd && *binddn && *bindpasswd) { + rc = ldap_simple_bind_s(ld, binddn, bindpasswd); + if (rc != LDAP_SUCCESS) { + fprintf(stderr, PROGRAM_NAME " WARNING, could not bind to binddn '%s'\n", ldap_err2string(rc)); + ldap_unbind(ld); + ld = NULL; + } + } + if (debug) + fprintf(stderr, "Connected OK\n"); + } +} +int +LDAPArguments(int argc, char **argv) +{ + setbuf(stdout, NULL); + + while (argc > 1 && argv[1][0] == '-') { + char *value = ""; + char option = argv[1][1]; + switch (option) { + case 'P': + case 'R': + case 'z': + case 'Z': + case 'g': + case 'e': + case 'S': + case 'n': + case 'd': + break; + default: + if (strlen(argv[1]) > 2) { + value = argv[1] + 2; + } else if (argc > 2) { + value = argv[2]; + argv++; + argc--; + } else + value = ""; + break; + } + argv++; + argc--; + switch (option) { + case 'H': +#if !HAS_URI_SUPPORT + fprintf(stderr, "ERROR: Your LDAP library does not have URI support\n"); + return 1; +#endif + /* Fall thru to -h */ + case 'h': + if (ldapServer) { + int len = strlen(ldapServer) + 1 + strlen(value) + 1; + char *newhost = malloc(len); + snprintf(newhost, len, "%s %s", ldapServer, value); + free(ldapServer); + ldapServer = newhost; + } else { + ldapServer = strdup(value); + } + break; + case 'A': + passattr = value; + break; + case 'e': + encrpass = 1; + break; + case 'l': + delimiter = value; + break; + case 'b': + userbasedn = value; + break; + case 'F': + usersearchfilter = value; + break; + case 'u': + userdnattr = value; + break; + case 's': + if (strcmp(value, "base") == 0) + searchscope = LDAP_SCOPE_BASE; + else if (strcmp(value, "one") == 0) + searchscope = LDAP_SCOPE_ONELEVEL; + else if (strcmp(value, "sub") == 0) + searchscope = LDAP_SCOPE_SUBTREE; + else { + fprintf(stderr, PROGRAM_NAME " ERROR: Unknown search scope '%s'\n", value); + return 1; + } + break; + case 'S': +#if defined(NETSCAPE_SSL) + sslpath = value; + if (port == LDAP_PORT) + port = LDAPS_PORT; +#else + fprintf(stderr, PROGRAM_NAME " ERROR: -E unsupported with this LDAP library\n"); + return 1; +#endif + break; + case 'c': + connect_timeout = atoi(value); + break; + case 't': + timelimit = atoi(value); + break; + case 'a': + if (strcmp(value, "never") == 0) + aliasderef = LDAP_DEREF_NEVER; + else if (strcmp(value, "always") == 0) + aliasderef = LDAP_DEREF_ALWAYS; + else if (strcmp(value, "search") == 0) + aliasderef = LDAP_DEREF_SEARCHING; + else if (strcmp(value, "find") == 0) + aliasderef = LDAP_DEREF_FINDING; + else { + fprintf(stderr, PROGRAM_NAME " ERROR: Unknown alias dereference method '%s'\n", value); + return 1; + } + break; + case 'D': + binddn = value; + break; + case 'w': + bindpasswd = value; + break; + case 'W': + readSecret(value); + break; + case 'P': + persistent = !persistent; + break; + case 'p': + port = atoi(value); + break; + case 'R': + noreferrals = !noreferrals; + break; +#ifdef LDAP_VERSION3 + case 'v': + switch (atoi(value)) { + case 2: + version = LDAP_VERSION2; + break; + case 3: + version = LDAP_VERSION3; + break; + default: + fprintf(stderr, "Protocol version should be 2 or 3\n"); + return 1; + } + break; + case 'Z': + if (version == LDAP_VERSION2) { + fprintf(stderr, "TLS (-Z) is incompatible with version %d\n", + version); + return 1; + } + version = LDAP_VERSION3; + use_tls = 1; + break; +#endif + case 'd': + debug = 1; + break; + case 'E': + strip_nt_domain = 1; + break; + case 'n': + edir_universal_passwd = 1; + break; + default: + fprintf(stderr, PROGRAM_NAME " ERROR: Unknown command line option '%c'\n", option); + return 1; + } + } + + while (argc > 1) { + char *value = argv[1]; + if (ldapServer) { + int len = strlen(ldapServer) + 1 + strlen(value) + 1; + char *newhost = malloc(len); + snprintf(newhost, len, "%s %s", ldapServer, value); + free(ldapServer); + ldapServer = newhost; + } else { + ldapServer = strdup(value); + } + argc--; + argv++; + } + + if (!ldapServer) + ldapServer = "localhost"; + + if (!userbasedn || !((passattr != NULL) || (edir_universal_passwd && usersearchfilter && version == LDAP_VERSION3 && use_tls))) { + fprintf(stderr, "Usage: " PROGRAM_NAME " -b basedn -f filter [options] ldap_server_name\n\n"); + fprintf(stderr, "\t-A password attribute(REQUIRED)\t\tUser attribute that contains the password\n"); + fprintf(stderr, "\t-l password realm delimiter(REQUIRED)\tCharater(s) that devides the password attribute\n\t\t\t\t\t\tin realm and password tokens, default ':' realm:password\n"); + fprintf(stderr, "\t-b basedn (REQUIRED)\t\t\tbase dn under where to search for users\n"); + fprintf(stderr, "\t-e Encrypted passwords(REQUIRED)\tPassword are stored encrypted using HHA1\n"); + fprintf(stderr, "\t-F filter\t\t\t\tuser search filter pattern. %%s = login\n"); + fprintf(stderr, "\t-u attribute\t\t\t\tattribute to use in combination with the basedn to create the user DN\n"); + fprintf(stderr, "\t-s base|one|sub\t\t\t\tsearch scope\n"); + fprintf(stderr, "\t-D binddn\t\t\t\tDN to bind as to perform searches\n"); + fprintf(stderr, "\t-w bindpasswd\t\t\t\tpassword for binddn\n"); + fprintf(stderr, "\t-W secretfile\t\t\t\tread password for binddn from file secretfile\n"); +#if HAS_URI_SUPPORT + fprintf(stderr, "\t-H URI\t\t\t\t\tLDAPURI (defaults to ldap://localhost)\n"); +#endif + fprintf(stderr, "\t-h server\t\t\t\tLDAP server (defaults to localhost)\n"); + fprintf(stderr, "\t-p port\t\t\t\t\tLDAP server port (defaults to %d)\n", LDAP_PORT); + fprintf(stderr, "\t-P\t\t\t\t\tpersistent LDAP connection\n"); +#if defined(NETSCAPE_SSL) + fprintf(stderr, "\t-E sslcertpath\t\t\t\tenable LDAP over SSL\n"); +#endif + fprintf(stderr, "\t-c timeout\t\t\t\tconnect timeout\n"); + fprintf(stderr, "\t-t timelimit\t\t\t\tsearch time limit\n"); + fprintf(stderr, "\t-R\t\t\t\t\tdo not follow referrals\n"); + fprintf(stderr, "\t-a never|always|search|find\t\twhen to dereference aliases\n"); +#ifdef LDAP_VERSION3 + fprintf(stderr, "\t-v 2|3\t\t\t\t\tLDAP version\n"); + fprintf(stderr, "\t-Z\t\t\t\t\tTLS encrypt the LDAP connection, requires\n\t\t\t\tLDAP version 3\n"); +#endif + fprintf(stderr, "\t-S\t\t\t\t\tStrip NT domain from usernames\n"); + fprintf(stderr, "\t-n\t\t\t\t\tGet an eDirectory Universal Password from Novell NMAS\n\t\t\t\t\t\t(requires bind credentials, version 3, TLS, and a search filter)\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "\tIf you need to bind as a user to perform searches then use the\n\t-D binddn -w bindpasswd or -D binddn -W secretfile options\n\n"); + return -1; + } + return 0; +} +static int +readSecret(char *filename) +{ + char buf[BUFSIZ]; + char *e = 0; + FILE *f; + + if (!(f = fopen(filename, "r"))) { + fprintf(stderr, PROGRAM_NAME " ERROR: Can not read secret file %s\n", filename); + return 1; + } + if (!fgets(buf, sizeof(buf) - 1, f)) { + fprintf(stderr, PROGRAM_NAME " ERROR: Secret file %s is empty\n", filename); + fclose(f); + return 1; + } + /* strip whitespaces on end */ + if ((e = strrchr(buf, '\n'))) + *e = 0; + if ((e = strrchr(buf, '\r'))) + *e = 0; + + bindpasswd = (char *) calloc(sizeof(char), strlen(buf) + 1); + if (bindpasswd) { + strcpy(bindpasswd, buf); + } else { + fprintf(stderr, PROGRAM_NAME " ERROR: can not allocate memory\n"); + } + + fclose(f); + + return 0; +} + +void +LDAPHHA1(RequestData * requestData) +{ + char *password = ""; + ldapconnect(); + password = getpassword(requestData->user, requestData->realm); + if (password != NULL) { + if (encrpass) + xstrncpy(requestData->HHA1, password, sizeof(requestData->HHA1)); + else { + HASH HA1; + DigestCalcHA1("md5", requestData->user, requestData->realm, password, NULL, NULL, HA1, requestData->HHA1); + } + free(password); + } else { + requestData->error = -1; + } + +} diff -ruN squid-2.6.STABLE13/helpers/digest_auth/eDirectory/ldap_backend.h squid-2.6.STABLE14/helpers/digest_auth/eDirectory/ldap_backend.h --- squid-2.6.STABLE13/helpers/digest_auth/eDirectory/ldap_backend.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/digest_auth/eDirectory/ldap_backend.h Sat Jun 23 15:48:49 2007 @@ -0,0 +1,9 @@ +/* + * text_backend.h + * + * AUTHOR: Flavio Pescuma. + * + */ +#include "digest_common.h" +extern int LDAPArguments(int argc, char **argv); +extern void LDAPHHA1(RequestData * requestData); diff -ruN squid-2.6.STABLE13/helpers/digest_auth/ldap/Makefile.in squid-2.6.STABLE14/helpers/digest_auth/ldap/Makefile.in --- squid-2.6.STABLE13/helpers/digest_auth/ldap/Makefile.in Sat Nov 4 16:19:54 2006 +++ squid-2.6.STABLE14/helpers/digest_auth/ldap/Makefile.in Fri Jun 22 18:14:48 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.17 2006/11/04 23:19:54 hno Exp $ +# $Id: Makefile.in,v 1.17.2.1 2007/06/23 00:14:48 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -196,6 +196,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/digest_auth/password/Makefile.in squid-2.6.STABLE14/helpers/digest_auth/password/Makefile.in --- squid-2.6.STABLE13/helpers/digest_auth/password/Makefile.in Sat Nov 4 16:19:55 2006 +++ squid-2.6.STABLE14/helpers/digest_auth/password/Makefile.in Fri Jun 22 18:14:48 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.38 2006/11/04 23:19:55 hno Exp $ +# $Id: Makefile.in,v 1.38.2.1 2007/06/23 00:14:48 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -195,6 +195,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/Makefile.in squid-2.6.STABLE14/helpers/external_acl/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/Makefile.in Sat Nov 4 16:19:55 2006 +++ squid-2.6.STABLE14/helpers/external_acl/Makefile.in Fri Jun 22 18:14:49 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.26 2006/11/04 23:19:55 hno Exp $ +# $Id: Makefile.in,v 1.26.2.1 2007/06/23 00:14:49 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/ip_user/Makefile.in squid-2.6.STABLE14/helpers/external_acl/ip_user/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/ip_user/Makefile.in Sat Nov 4 16:19:55 2006 +++ squid-2.6.STABLE14/helpers/external_acl/ip_user/Makefile.in Fri Jun 22 18:14:49 2007 @@ -17,7 +17,7 @@ # # Makefile for the ip_user external_acl helper by Rodrigo Campos # -# $Id: Makefile.in,v 1.25 2006/11/04 23:19:55 hno Exp $ +# $Id: Makefile.in,v 1.25.2.1 2007/06/23 00:14:49 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/ldap_group/Makefile.in squid-2.6.STABLE14/helpers/external_acl/ldap_group/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/ldap_group/Makefile.in Sat Nov 4 16:19:56 2006 +++ squid-2.6.STABLE14/helpers/external_acl/ldap_group/Makefile.in Fri Jun 22 18:14:50 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.26 2006/11/04 23:19:56 hno Exp $ +# $Id: Makefile.in,v 1.26.2.1 2007/06/23 00:14:50 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -198,6 +198,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/mswin_lm_group/Makefile.in squid-2.6.STABLE14/helpers/external_acl/mswin_lm_group/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/mswin_lm_group/Makefile.in Sat Nov 4 16:19:56 2006 +++ squid-2.6.STABLE14/helpers/external_acl/mswin_lm_group/Makefile.in Fri Jun 22 18:14:50 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.11 2006/11/04 23:19:56 hno Exp $ +# $Id: Makefile.in,v 1.11.2.1 2007/06/23 00:14:50 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/session/Makefile.in squid-2.6.STABLE14/helpers/external_acl/session/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/session/Makefile.in Sat Nov 4 16:19:57 2006 +++ squid-2.6.STABLE14/helpers/external_acl/session/Makefile.in Fri Jun 22 18:14:51 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.12 2006/11/04 23:19:57 hno Exp $ +# $Id: Makefile.in,v 1.12.2.1 2007/06/23 00:14:51 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -196,6 +196,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/unix_group/Makefile.in squid-2.6.STABLE14/helpers/external_acl/unix_group/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/unix_group/Makefile.in Sat Nov 4 16:19:58 2006 +++ squid-2.6.STABLE14/helpers/external_acl/unix_group/Makefile.in Fri Jun 22 18:14:51 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.25 2006/11/04 23:19:58 hno Exp $ +# $Id: Makefile.in,v 1.25.2.1 2007/06/23 00:14:51 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -195,6 +195,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/external_acl/wbinfo_group/Makefile.in squid-2.6.STABLE14/helpers/external_acl/wbinfo_group/Makefile.in --- squid-2.6.STABLE13/helpers/external_acl/wbinfo_group/Makefile.in Sat Nov 4 16:19:58 2006 +++ squid-2.6.STABLE14/helpers/external_acl/wbinfo_group/Makefile.in Fri Jun 22 18:14:51 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid LDAP authentication helper # -# $Id: Makefile.in,v 1.24 2006/11/04 23:19:58 hno Exp $ +# $Id: Makefile.in,v 1.24.2.1 2007/06/23 00:14:51 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -178,6 +178,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/Makefile.am squid-2.6.STABLE14/helpers/negotiate_auth/Makefile.am --- squid-2.6.STABLE13/helpers/negotiate_auth/Makefile.am Sat May 27 02:58:29 2006 +++ squid-2.6.STABLE14/helpers/negotiate_auth/Makefile.am Sat Jun 2 18:47:36 2007 @@ -1,7 +1,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.am,v 1.2 2006/05/27 08:58:29 serassio Exp $ +# $Id: Makefile.am,v 1.2.2.1 2007/06/03 00:47:36 hno Exp $ # -DIST_SUBDIRS = mswin_sspi +DIST_SUBDIRS = mswin_sspi squid_kerb_auth SUBDIRS = @NEGOTIATE_AUTH_HELPERS@ diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/Makefile.in squid-2.6.STABLE14/helpers/negotiate_auth/Makefile.in --- squid-2.6.STABLE13/helpers/negotiate_auth/Makefile.in Sat Nov 4 16:19:58 2006 +++ squid-2.6.STABLE14/helpers/negotiate_auth/Makefile.in Fri Jun 22 18:14:52 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.13 2006/11/04 23:19:58 hno Exp $ +# $Id: Makefile.in,v 1.13.2.2 2007/06/23 00:14:52 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ @@ -238,7 +240,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -DIST_SUBDIRS = mswin_sspi +DIST_SUBDIRS = mswin_sspi squid_kerb_auth SUBDIRS = @NEGOTIATE_AUTH_HELPERS@ all: all-recursive diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/Makefile.in squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/Makefile.in --- squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/Makefile.in Sat Nov 4 16:19:59 2006 +++ squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/Makefile.in Fri Jun 22 18:14:52 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.11 2006/11/04 23:19:59 hno Exp $ +# $Id: Makefile.in,v 1.11.2.1 2007/06/23 00:14:52 hno Exp $ # srcdir = @srcdir@ @@ -192,6 +192,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c --- squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c Sat May 27 02:58:30 2006 +++ squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c Sat Jun 2 18:40:28 2007 @@ -53,7 +53,7 @@ ((unsigned int) p - (unsigned int) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c --- squid-2.6.STABLE13/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c Sat May 27 02:58:30 2006 +++ squid-2.6.STABLE14/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c Sat Jun 2 18:40:28 2007 @@ -60,7 +60,7 @@ { char *p = string, c; while ((c = *p)) { - *p = toupper(c); + *p = xtoupper(c); p++; } } @@ -71,7 +71,7 @@ { char *p = string, c; while ((c = *p)) { - *p = tolower(c); + *p = xtolower(c); p++; } } diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/COPYING squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/COPYING --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/COPYING Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/COPYING Sat Jun 2 18:47:38 2007 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/Makefile.am squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/Makefile.am --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/Makefile.am Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/Makefile.am Sat Jun 2 18:47:38 2007 @@ -0,0 +1,27 @@ +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.am,v 1.1.2.1 2007/06/03 00:47:38 hno Exp $ +# + +libexec_PROGRAMS = squid_kerb_auth + +SPNEGO = spnegohelp/derparse.c spnegohelp/derparse.h spnegohelp/Makefile spnegohelp/spnego.c spnegohelp/spnego.h spnegohelp/spnegohelp.c spnegohelp/spnegohelp.h spnegohelp/spnegoparse.c spnegohelp/spnegoparse.h +SOURCE = squid_kerb_auth.c base64.c base64.h +EXTRA_DIST = readme.txt do.sh + +squid_kerb_auth_SOURCES = $(SOURCE) $(SPNEGO) + +CPPFLAGS = $(KERBINC) -I$(srcdir)/spnegohelp -I. +#-I$(top_srcdir)/include -I$(top_srcdir)/src +LDADD = $(KERBLIBS) +#-L$(top_builddir)/lib -lmiscutil $(XTRA_LIBS) + +# HEIMDAL +#KERBINC = -DHEIMDAL -I/usr/include/heimdal +#KERBLIBS = -lgssapi -lkrb5 -lcom_err -lasn1 -lroken + +# MIT +KERBINC = +KERBLIBS = -lgssapi_krb5 -lkrb5 -lcom_err + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/Makefile.in squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/Makefile.in --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/Makefile.in Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/Makefile.in Fri Jun 22 18:14:52 2007 @@ -0,0 +1,586 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Squid Object Cache server +# +# $Id: Makefile.in,v 1.2.2.3 2007/06/23 00:14:52 hno Exp $ +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +libexec_PROGRAMS = squid_kerb_auth$(EXEEXT) +subdir = helpers/negotiate_auth/squid_kerb_auth +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/autoconf.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(libexecdir)" +libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(libexec_PROGRAMS) +am__objects_1 = squid_kerb_auth.$(OBJEXT) base64.$(OBJEXT) +am__objects_2 = derparse.$(OBJEXT) spnego.$(OBJEXT) \ + spnegohelp.$(OBJEXT) spnegoparse.$(OBJEXT) +am_squid_kerb_auth_OBJECTS = $(am__objects_1) $(am__objects_2) +squid_kerb_auth_OBJECTS = $(am_squid_kerb_auth_OBJECTS) +squid_kerb_auth_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +squid_kerb_auth_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(squid_kerb_auth_SOURCES) +DIST_SOURCES = $(squid_kerb_auth_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AR_R = @AR_R@ +AUTH_LIBS = @AUTH_LIBS@ +AUTH_MODULES = @AUTH_MODULES@ +AUTH_OBJS = @AUTH_OBJS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@ +CACHE_HTTP_PORT = @CACHE_HTTP_PORT@ +CACHE_ICP_PORT = @CACHE_ICP_PORT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGIEXT = @CGIEXT@ +CPP = @CPP@ +CPPFLAGS = $(KERBINC) -I$(srcdir)/spnegohelp -I. +CRYPTLIB = @CRYPTLIB@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@ +ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@ +ENABLE_MINGW32SPECIFIC_FALSE = @ENABLE_MINGW32SPECIFIC_FALSE@ +ENABLE_MINGW32SPECIFIC_TRUE = @ENABLE_MINGW32SPECIFIC_TRUE@ +ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@ +ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@ +ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@ +ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@ +ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@ +ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@ +ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@ +ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@ +ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@ +ERR_LANGUAGES = @ERR_LANGUAGES@ +EXEEXT = @EXEEXT@ +EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@ +FALSE = @FALSE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDLMALLOC = @LIBDLMALLOC@ +LIBOBJS = @LIBOBJS@ +LIBREGEX = @LIBREGEX@ +LIBS = @LIBS@ +LIBSASL = @LIBSASL@ +LIB_DB = @LIB_DB@ +LIB_EPOLL = @LIB_EPOLL@ +LIB_LBER = @LIB_LBER@ +LIB_LDAP = @LIB_LDAP@ +LIB_MALLOC = @LIB_MALLOC@ +LN = @LN@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@ +MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@ +MKDIR = @MKDIR@ +MV = @MV@ +NEED_COSSDUMP_FALSE = @NEED_COSSDUMP_FALSE@ +NEED_COSSDUMP_TRUE = @NEED_COSSDUMP_TRUE@ +NEED_DISKD_FALSE = @NEED_DISKD_FALSE@ +NEED_DISKD_TRUE = @NEED_DISKD_TRUE@ +NEED_OWN_MD5_FALSE = @NEED_OWN_MD5_FALSE@ +NEED_OWN_MD5_TRUE = @NEED_OWN_MD5_TRUE@ +NEED_OWN_SNPRINTF_FALSE = @NEED_OWN_SNPRINTF_FALSE@ +NEED_OWN_SNPRINTF_TRUE = @NEED_OWN_SNPRINTF_TRUE@ +NEED_OWN_STRSEP_FALSE = @NEED_OWN_STRSEP_FALSE@ +NEED_OWN_STRSEP_TRUE = @NEED_OWN_STRSEP_TRUE@ +NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH_HELPERS@ +NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@ +OBJEXT = @OBJEXT@ +OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKGCONFIG = @PKGCONFIG@ +RANLIB = @RANLIB@ +REGEXLIB = @REGEXLIB@ +REPL_LIBS = @REPL_LIBS@ +REPL_OBJS = @REPL_OBJS@ +REPL_POLICIES = @REPL_POLICIES@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SH = @SH@ +SHELL = @SHELL@ +SNMPLIB = @SNMPLIB@ +SSLLIB = @SSLLIB@ +STORE_LIBS = @STORE_LIBS@ +STORE_MODULES = @STORE_MODULES@ +STORE_OBJS = @STORE_OBJS@ +STRIP = @STRIP@ +TRUE = @TRUE@ +USE_AIOPS_WIN32_FALSE = @USE_AIOPS_WIN32_FALSE@ +USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ +USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ +USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ +USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ +USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ +USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ +USE_EPOLL_TRUE = @USE_EPOLL_TRUE@ +USE_KQUEUE_FALSE = @USE_KQUEUE_FALSE@ +USE_KQUEUE_TRUE = @USE_KQUEUE_TRUE@ +USE_POLL_FALSE = @USE_POLL_FALSE@ +USE_POLL_TRUE = @USE_POLL_TRUE@ +USE_SELECT_FALSE = @USE_SELECT_FALSE@ +USE_SELECT_SIMPLE_FALSE = @USE_SELECT_SIMPLE_FALSE@ +USE_SELECT_SIMPLE_TRUE = @USE_SELECT_SIMPLE_TRUE@ +USE_SELECT_TRUE = @USE_SELECT_TRUE@ +USE_SELECT_WIN32_FALSE = @USE_SELECT_WIN32_FALSE@ +USE_SELECT_WIN32_TRUE = @USE_SELECT_WIN32_TRUE@ +USE_SNMP_FALSE = @USE_SNMP_FALSE@ +USE_SNMP_TRUE = @USE_SNMP_TRUE@ +VERSION = @VERSION@ +WIN32_PSAPI = @WIN32_PSAPI@ +XTRA_LIBS = @XTRA_LIBS@ +XTRA_OBJS = @XTRA_OBJS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +makesnmplib = @makesnmplib@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SPNEGO = spnegohelp/derparse.c spnegohelp/derparse.h spnegohelp/Makefile spnegohelp/spnego.c spnegohelp/spnego.h spnegohelp/spnegohelp.c spnegohelp/spnegohelp.h spnegohelp/spnegoparse.c spnegohelp/spnegoparse.h +SOURCE = squid_kerb_auth.c base64.c base64.h +EXTRA_DIST = readme.txt do.sh +squid_kerb_auth_SOURCES = $(SOURCE) $(SPNEGO) +#-I$(top_srcdir)/include -I$(top_srcdir)/src +LDADD = $(KERBLIBS) +#-L$(top_builddir)/lib -lmiscutil $(XTRA_LIBS) + +# HEIMDAL +#KERBINC = -DHEIMDAL -I/usr/include/heimdal +#KERBLIBS = -lgssapi -lkrb5 -lcom_err -lasn1 -lroken + +# MIT +KERBINC = +KERBLIBS = -lgssapi_krb5 -lkrb5 -lcom_err +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign helpers/negotiate_auth/squid_kerb_auth/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign helpers/negotiate_auth/squid_kerb_auth/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + done + +clean-libexecPROGRAMS: + -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) +squid_kerb_auth$(EXEEXT): $(squid_kerb_auth_OBJECTS) $(squid_kerb_auth_DEPENDENCIES) + @rm -f squid_kerb_auth$(EXEEXT) + $(LINK) $(squid_kerb_auth_LDFLAGS) $(squid_kerb_auth_OBJECTS) $(squid_kerb_auth_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/derparse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spnego.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spnegohelp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spnegoparse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/squid_kerb_auth.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +derparse.o: spnegohelp/derparse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT derparse.o -MD -MP -MF "$(DEPDIR)/derparse.Tpo" -c -o derparse.o `test -f 'spnegohelp/derparse.c' || echo '$(srcdir)/'`spnegohelp/derparse.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/derparse.Tpo" "$(DEPDIR)/derparse.Po"; else rm -f "$(DEPDIR)/derparse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/derparse.c' object='derparse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o derparse.o `test -f 'spnegohelp/derparse.c' || echo '$(srcdir)/'`spnegohelp/derparse.c + +derparse.obj: spnegohelp/derparse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT derparse.obj -MD -MP -MF "$(DEPDIR)/derparse.Tpo" -c -o derparse.obj `if test -f 'spnegohelp/derparse.c'; then $(CYGPATH_W) 'spnegohelp/derparse.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/derparse.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/derparse.Tpo" "$(DEPDIR)/derparse.Po"; else rm -f "$(DEPDIR)/derparse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/derparse.c' object='derparse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o derparse.obj `if test -f 'spnegohelp/derparse.c'; then $(CYGPATH_W) 'spnegohelp/derparse.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/derparse.c'; fi` + +spnego.o: spnegohelp/spnego.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnego.o -MD -MP -MF "$(DEPDIR)/spnego.Tpo" -c -o spnego.o `test -f 'spnegohelp/spnego.c' || echo '$(srcdir)/'`spnegohelp/spnego.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnego.Tpo" "$(DEPDIR)/spnego.Po"; else rm -f "$(DEPDIR)/spnego.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnego.c' object='spnego.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnego.o `test -f 'spnegohelp/spnego.c' || echo '$(srcdir)/'`spnegohelp/spnego.c + +spnego.obj: spnegohelp/spnego.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnego.obj -MD -MP -MF "$(DEPDIR)/spnego.Tpo" -c -o spnego.obj `if test -f 'spnegohelp/spnego.c'; then $(CYGPATH_W) 'spnegohelp/spnego.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnego.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnego.Tpo" "$(DEPDIR)/spnego.Po"; else rm -f "$(DEPDIR)/spnego.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnego.c' object='spnego.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnego.obj `if test -f 'spnegohelp/spnego.c'; then $(CYGPATH_W) 'spnegohelp/spnego.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnego.c'; fi` + +spnegohelp.o: spnegohelp/spnegohelp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnegohelp.o -MD -MP -MF "$(DEPDIR)/spnegohelp.Tpo" -c -o spnegohelp.o `test -f 'spnegohelp/spnegohelp.c' || echo '$(srcdir)/'`spnegohelp/spnegohelp.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnegohelp.Tpo" "$(DEPDIR)/spnegohelp.Po"; else rm -f "$(DEPDIR)/spnegohelp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnegohelp.c' object='spnegohelp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnegohelp.o `test -f 'spnegohelp/spnegohelp.c' || echo '$(srcdir)/'`spnegohelp/spnegohelp.c + +spnegohelp.obj: spnegohelp/spnegohelp.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnegohelp.obj -MD -MP -MF "$(DEPDIR)/spnegohelp.Tpo" -c -o spnegohelp.obj `if test -f 'spnegohelp/spnegohelp.c'; then $(CYGPATH_W) 'spnegohelp/spnegohelp.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnegohelp.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnegohelp.Tpo" "$(DEPDIR)/spnegohelp.Po"; else rm -f "$(DEPDIR)/spnegohelp.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnegohelp.c' object='spnegohelp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnegohelp.obj `if test -f 'spnegohelp/spnegohelp.c'; then $(CYGPATH_W) 'spnegohelp/spnegohelp.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnegohelp.c'; fi` + +spnegoparse.o: spnegohelp/spnegoparse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnegoparse.o -MD -MP -MF "$(DEPDIR)/spnegoparse.Tpo" -c -o spnegoparse.o `test -f 'spnegohelp/spnegoparse.c' || echo '$(srcdir)/'`spnegohelp/spnegoparse.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnegoparse.Tpo" "$(DEPDIR)/spnegoparse.Po"; else rm -f "$(DEPDIR)/spnegoparse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnegoparse.c' object='spnegoparse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnegoparse.o `test -f 'spnegohelp/spnegoparse.c' || echo '$(srcdir)/'`spnegohelp/spnegoparse.c + +spnegoparse.obj: spnegohelp/spnegoparse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spnegoparse.obj -MD -MP -MF "$(DEPDIR)/spnegoparse.Tpo" -c -o spnegoparse.obj `if test -f 'spnegohelp/spnegoparse.c'; then $(CYGPATH_W) 'spnegohelp/spnegoparse.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnegoparse.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/spnegoparse.Tpo" "$(DEPDIR)/spnegoparse.Po"; else rm -f "$(DEPDIR)/spnegoparse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='spnegohelp/spnegoparse.c' object='spnegoparse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spnegoparse.obj `if test -f 'spnegohelp/spnegoparse.c'; then $(CYGPATH_W) 'spnegohelp/spnegoparse.c'; else $(CYGPATH_W) '$(srcdir)/spnegohelp/spnegoparse.c'; fi` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libexecPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libexecPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libexecPROGRAMS install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libexecPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/base64.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/base64.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/base64.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/base64.c Sat Jun 2 18:47:38 2007 @@ -0,0 +1,152 @@ +/* + * Markus Moeller has modified the following code from Squid + */ + +#include +#include +#include +#include "base64.h" + + +static void base64_init(void); + +static int base64_initialized = 0; +#define BASE64_VALUE_SZ 256 +int base64_value[BASE64_VALUE_SZ]; +const char base64_code[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + +static void +base64_init(void) +{ + int i; + + for (i = 0; i < BASE64_VALUE_SZ; i++) + base64_value[i] = -1; + + for (i = 0; i < 64; i++) + base64_value[(int) base64_code[i]] = i; + base64_value['='] = 0; + + base64_initialized = 1; +} + +void base64_decode(char* result, const char *data, int result_size) +{ + int j; + int c; + long val; + if (!data) + return; + if (!base64_initialized) + base64_init(); + val = c = 0; + + for (j = 0; *data ;data++) { + unsigned int k = ((unsigned char) *data) % BASE64_VALUE_SZ; + if (base64_value[k] < 0) + continue; + val <<= 6; + val += base64_value[k]; + if (++c < 4) + continue; + /* One quantum of four encoding characters/24 bit */ + if (j >= result_size) + break; + result[j++] = val >> 16; /* High 8 bits */ + if (j >= result_size) + break; + result[j++] = (val >> 8) & 0xff; /* Mid 8 bits */ + if (j >= result_size) + break; + result[j++] = val & 0xff; /* Low 8 bits */ + val = c = 0; + } + return; +} + +/* adopted from http://ftp.sunet.se/pub2/gnu/vm/base64-encode.c with adjustments */ +void base64_encode(char* result, const char *data, int result_size, int data_size) +{ + int bits = 0; + int char_count = 0; + int out_cnt = 0; + + if (!data) + return; + + if (!base64_initialized) + base64_init(); + + while (data_size--) { + int c = (unsigned char) *data++; + bits += c; + char_count++; + if (char_count == 3) { + if (out_cnt >= result_size) + break; + result[out_cnt++] = base64_code[bits >> 18]; + if (out_cnt >= result_size) + break; + result[out_cnt++] = base64_code[(bits >> 12) & 0x3f]; + if (out_cnt >= result_size) + break; + result[out_cnt++] = base64_code[(bits >> 6) & 0x3f]; + if (out_cnt >= result_size) + break; + result[out_cnt++] = base64_code[bits & 0x3f]; + bits = 0; + char_count = 0; + } else { + bits <<= 8; + } + } + if (char_count != 0) { + bits <<= 16 - (8 * char_count); + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = base64_code[bits >> 18]; + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = base64_code[(bits >> 12) & 0x3f]; + if (char_count == 1) { + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = '='; + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = '='; + } else { + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = base64_code[(bits >> 6) & 0x3f]; + if (out_cnt >= result_size) + goto end; + result[out_cnt++] = '='; + } + } +end: + if (out_cnt >= result_size) { + result[result_size-1] = '\0'; /* terminate */ + } else { + result[out_cnt] = '\0'; /* terminate */ + } + return; +} + +int base64_encode_len(int len) +{ + return ((len+2)/3*4)+1; +} + +int base64_decode_len(const char *data) +{ + int i,j; + + j=0; + for (i=strlen(data)-1;i>=0;i--) { + if (data[i] == '=') j++; + if (data[i] != '=') break; + } + return strlen(data)/4*3-j; +} diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/base64.h squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/base64.h --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/base64.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/base64.h Sat Jun 2 18:47:38 2007 @@ -0,0 +1,9 @@ +/* + * Markus Moeller has modified the following code from Squid + */ + +void base64_decode(char* result, const char *data, int result_size); +void base64_encode(char* result, const char *data, int result_size, int data_size); + +int base64_encode_len(int len); +int base64_decode_len(const char *data); diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/do.sh squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/do.sh --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/do.sh Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/do.sh Sun Jun 24 16:29:14 2007 @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Linux: +# -D__LITTLE_ENDIAN__ +# Solaris: +# -D__BIG_ENDIAN__ +# +CC=gcc +#CFLAGS="-Wall -Wextra -Werror -Wcomment -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wshadow -O2" +CFLAGS="-Wall -Werror -Wcomment -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -O2" +if [ "$1" = "HEIMDAL" ]; then + DEFINE="-DHEIMDAL -D__LITTLE_ENDIAN__" + INCLUDE="-I/usr/include/heimdal -Ispnegohelp" + LIBS="-lgssapi -lkrb5 -lcom_err -lasn1 -lroken" +else +if [ "$1" = "SOLARIS" ]; then +#MIT + CC=cc + CFLAGS="" + DEFINE="-D__BIG_ENDIAN__ -DSOLARIS_11" + INCLUDE="-Ispnegohelp -Iinclude -Iinclude/kerberosv5" + LIBS="-R/usr/lib/gss -L/usr/lib/gss -lgss /usr/lib/gss/mech_krb5.so -lsocket" +else +#MIT + DEFINE="-D__LITTLE_ENDIAN__" + INCLUDE=-Ispnegohelp + LIBS="-lgssapi_krb5 -lkrb5 -lcom_err" +fi +fi +SPNEGO="spnegohelp/derparse.c spnegohelp/spnego.c spnegohelp/spnegohelp.c spnegohelp/spnegoparse.c" +SOURCE="squid_kerb_auth.c base64.c" +$CC -g $CFLAGS -o squid_kerb_auth $DEFINE $INCLUDE $SOURCE $SPNEGO $LIBS diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/readme.txt squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/readme.txt --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/readme.txt Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/readme.txt Mon Jun 25 17:34:57 2007 @@ -0,0 +1,92 @@ +-------------------------------------------------------------------------------- +readme.txt is the squid_kerb_auth read-me file. + +Author: Markus Moeller (markus_moeller at compuserve.com) + +Copyright (C) 2007 Markus Moeller. All rights reserved. +-------------------------------------------------------------------------------- + +squid_kerb_auth Read Me + +Markus Moeller +May 12, 2007 + +1 Introduction + +squid_kerb_auth is a reference implementation that supports authentication via +the Negotiate RFC 4559 for proxies. It decodes RFC 2478 SPNEGO GSS-API tokens +from IE7 either through helper functions or via SPNEGO supporting Kerberos libraries +and RFC 1964 Kerberos tokens from Firefox on Linux. Currently, squid_kerb_auth + supports Squid 2.6 on Linux. + +squid_auth_kerb requires either MIT or Heimdal Kerberos libraries and header files. + +2 Building and Installation + +# Linux: +# -D__LITTLE_ENDIAN__ +# Solaris: +# -D__BIG_ENDIAN__ +# +#DEFINE_SPNEGO=-DHAVE_SPNEGO +#HEIMDAL +# DEFINE="-DHEIMDAL $DEFINE_SPNEGO -D__LITTLE_ENDIAN__" +# INCLUDE=-I/usr/include/heimdal -Ispnegohelp +# LIBS="-lgssapi -lkrb5 -lcom_err -lasn1 -lroken" +#MIT + DEFINE="$DEFINE_SPNEGO -D__LITTLE_ENDIAN__" + INCLUDE=-Ispnegohelp + LIBS="-lgssapi_krb5 -lkrb5 -lcom_err" +# +SPNEGO="spnegohelp/derparse.c spnegohelp/spnego.c spnegohelp/spnegohelp.c spnegohelp/spnegoparse.c" +SOURCE="squid_kerb_auth.c base64.c" +gcc -o squid_kerb_auth $DEFINE $INCLUDE $SOURCE $SPNEGO $LIBS + +Copy the helper squid_kerb_auth to an apropriate directory. + +3 Configuration + +a) Configure IE or Firefox to point to the squid proxy by using the fqdn. IE and Firefox will use the +fqdn to query for a HTTP/fqdn Kerberos service principal. + +b) Create a keytab which contains the HTTP/fqdn Kerberos service principal and place it into a directory +where the squid run user can read the keytab. + +c) Add the following line to squid.conf + +auth_param negotiate program /usr/sbin/squid_kerb_auth +auth_param negotiate children 10 +auth_param negotiate keep_alive on + +d) Modify squid startup file + +Add the following lines to the squid startup script to point squid to a keytab file which +contains the HTTP/fqdn service principal for the default Kerberos domain. The fqdn must be +the proxy name set in IE or firefox. You can not use an IP address. + +KRB5_KTNAME=/etc/squid/HTTP.keytab +export KRB5_KTNAME + +If you use a different Kerberos domain than the machine itself is in you can point squid to +the seperate Kerberos config file by setting the following environmnet variable in the startup +script. + +KRB5_CONFIG=/etc/krb-squid5.conf +export KRB5_CONFIG + +4 Miscellaneous + +The -i options creates informational messages whereas -d creates full debug output + +The -i options creates informational messages whereas -d creates full debug output + +If squid_kerb_auth doesn't determine for some reason the right service principal you can provide +it with -s HTTP/fqdn. + +If you serve multiple Kerberos realms add a HTTP/fqdn@REALM service principal per realm to the +HTTP.keytab file and use the -s GSS_C_NO_NAME option with squid_kerb_auth. + + + + + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/Makefile squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/Makefile --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/Makefile Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/Makefile Sat Jun 2 18:47:39 2007 @@ -0,0 +1,51 @@ +# +# Linux: +# -D__LITTLE_ENDIAN__ +# Solaris: +# -D__BIG_ENDIAN__ +# + +CFLAGS = -fpic + +LIB = libspnegohelp.a +SLIB = libspnegohelp.so + +OBJS = derparse.o spnego.o spnegohelp.o spnegoparse.o + +all: + make `uname` + +debug: + make CFLAGS="$(CFLAGS) -DDEBUG" `uname` + +SunOS: + make CFLAGS="$(CFLAGS) -D__BIG_ENDIAN__" libs + +AIX: + make CFLAGS="$(CFLAGS) -D__BIG_ENDIAN__" libs + +Linux: + make CFLAGS="$(CFLAGS) -D__LITTLE_ENDIAN__" libs + +libs: $(LIB) $(SLIB) + +$(LIB): $(OBJS) + ar -r $(LIB) $(OBJS) + +$(SLIB): $(OBJS) + gcc --shared -o $(SLIB) $(OBJS) + +derparse.o: derparse.c derparse.h spnego.h Makefile + gcc -c $(CFLAGS) derparse.c -o $@ + +spnego.o: spnego.c derparse.h spnego.h spnegoparse.h Makefile + gcc -c $(CFLAGS) spnego.c -o $@ + +spnegoparse.o: spnegoparse.c derparse.h spnego.h spnegoparse.h Makefile + gcc -c $(CFLAGS) spnegoparse.c -o $@ + +spnegohelp.o: spnegohelp.c spnego.h spnegohelp.h Makefile + gcc -c $(CFLAGS) spnegohelp.c -o $@ + +clean: + rm $(OBJS) $(LIB) $(SLIB) diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.c Sat Jun 2 18:47:39 2007 @@ -0,0 +1,732 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + + +///////////////////////////////////////////////////////////// +// +// DERPARSE.C +// +// SPNEGO Token Handler Source File +// +// Contains implementation of ASN.1 DER read/write functions +// as defined in DERPARSE.H. +// +///////////////////////////////////////////////////////////// + +#include +#include +#include +#include "spnego.h" +#include "derparse.h" + +// +// The GSS Mechanism OID enumeration values (SPNEGO_MECH_OID) control which offset in +// the array below, that a mechanism can be found. +// +MECH_OID g_stcMechOIDList [] = +{ + { (unsigned char*) "\x06\x09\x2a\x86\x48\x82\xf7\x12\x01\x02\x02", 11, 9, spnego_mech_oid_Kerberos_V5_Legacy }, // 1.2.840.48018.1.2.2 + { (unsigned char*) "\x06\x09\x2a\x86\x48\x86\xf7\x12\x01\x02\x02", 11, 9, spnego_mech_oid_Kerberos_V5 }, // 1.2.840.113554.1.2.2 + { (unsigned char*) "\x06\x06\x2b\x06\x01\x05\x05\x02", 8, 6, spnego_mech_oid_Spnego }, // 1.3.6.1.1.5.5.2 + { (unsigned char*) "", 0, 0, spnego_mech_oid_NotUsed } // Placeholder +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerGetLength +// +// Parameters: +// [in] pbLengthData - DER Length Data +// [in] nBoundaryLength - Length that value must not exceed. +// [out] pnLength - Filled out with length value +// [out] pnNumLengthBytes - Filled out with number of bytes +// consumed by DER length. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Interprets the data at pbLengthData as a DER length. The length must +// fit within the bounds of nBoundary length. We do not currently +// process lengths that take more than 4 bytes. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerGetLength( unsigned char* pbLengthData, long nBoundaryLength, long* pnLength, + long* pnNumLengthBytes ) +{ + int nReturn = SPNEGO_E_INVALID_LENGTH; + int nNumLengthBytes = 0; + + // First check if the extended length bit is set + + if ( *pbLengthData & LEN_XTND ) + { + // Lower 7 bits contain the number of trailing bytes that describe the length + nNumLengthBytes = *pbLengthData & LEN_MASK; + + // Check that the number of bytes we are about to read is within our boundary + // constraints + + if ( nNumLengthBytes <= nBoundaryLength - 1 ) + { + + // For now, our handler won't deal with lengths greater than 4 bytes + if ( nNumLengthBytes >= 1 && nNumLengthBytes <= 4 ) + { + // 0 out the initial length + *pnLength = 0L; + + // Bump by 1 byte + pbLengthData++; + + #ifdef __LITTLE_ENDIAN__ + + // There may be a cleaner way to do this, but for now, this seems to be + // an easy way to do the transformation + switch ( nNumLengthBytes ) + { + case 1: + { + *( ( (unsigned char*) pnLength ) ) = *pbLengthData; + break; + } + + case 2: + { + *( ( (unsigned char*) pnLength ) ) = *(pbLengthData + 1); + *( ( (unsigned char*) pnLength ) + 1 ) = *(pbLengthData); + + break; + } + + case 3: + { + *( ( (unsigned char*) pnLength ) ) = *(pbLengthData + 2); + *( ( (unsigned char*) pnLength ) + 2 ) = *(pbLengthData + 1); + *( ( (unsigned char*) pnLength ) + 3 ) = *(pbLengthData); + break; + } + + case 4: + { + *( ( (unsigned char*) pnLength ) ) = *(pbLengthData + 3); + *( ( (unsigned char*) pnLength ) + 1 ) = *(pbLengthData + 2); + *( ( (unsigned char*) pnLength ) + 2 ) = *(pbLengthData + 1); + *( ( (unsigned char*) pnLength ) + 3 ) = *(pbLengthData); + break; + } + + } // SWITCH ( nNumLengthBytes ) + + #else + // We are Big-Endian, so the length can be copied in from the source + // as is. Ensure that we adjust for the number of bytes we actually + // copy. + + memcpy( ( (unsigned char *) pnLength ) + ( 4 - nNumLengthBytes ), + pbLengthData, nNumLengthBytes ); + #endif + + // Account for the initial length byte + *pnNumLengthBytes = nNumLengthBytes + 1; + nReturn = SPNEGO_E_SUCCESS; + + } // IF Valid Length + + } // IF num bytes to read is within the boundary length + + } // IF xtended length + else + { + + // Extended bit is not set, so the length is in the value and the one + // byte describes the length + *pnLength = *pbLengthData & LEN_MASK; + *pnNumLengthBytes = 1; + nReturn = SPNEGO_E_SUCCESS; + + } + LOG(("ASNDerGetLength returned %d\n",nReturn)); + return nReturn; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCheckToken +// +// Parameters: +// [in] pbTokenData - Token Data +// [in] nToken - Token identifier to check for +// [in] nLengthWithToken - Expected token length (with data) +// [in] nBoundaryLength - Length that value must not exceed. +// [out] pnLength - Filled out with data length +// [out] pnTokenLength - Filled out with number of bytes +// consumed by token identifier and length. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Checks the data pointed to by pbTokenData for the specified token +// identifier and the length that immediately follows. If +// nLengthWithToken is > 0, the calculated length must match. The +// length must also not exceed the specified boundary length . +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerCheckToken( unsigned char* pbTokenData, unsigned char nToken, + long nLengthWithToken, long nBoundaryLength, + long* pnLength, long* pnTokenLength ) +{ + + int nReturn = SPNEGO_E_INVALID_LENGTH; + long nNumLengthBytes = 0L; + + // Make sure that we've at least got 2 bytes of room to work with + + if ( nBoundaryLength >= 2 ) + { + // The first byte of the token data MUST match the specified token + if ( *pbTokenData == nToken ) + { + // Next byte indicates the length + pbTokenData++; + + // Get the length described by the token + if ( ( nReturn = ASNDerGetLength( pbTokenData, nBoundaryLength, pnLength, + &nNumLengthBytes ) ) == SPNEGO_E_SUCCESS ) + { + // Verify that the length is LESS THAN the boundary length + // (this should prevent us walking out of our buffer) + if ( ( nBoundaryLength - ( nNumLengthBytes + 1 ) < *pnLength ) ) + { + + nReturn = SPNEGO_E_INVALID_LENGTH; + + } + + // If we were passed a length to check, do so now + if ( nLengthWithToken > 0L ) + { + + // Check that the expected length matches + if ( ( nLengthWithToken - ( nNumLengthBytes + 1 ) ) != *pnLength ) + { + + nReturn = SPNEGO_E_INVALID_LENGTH; + + } + + } // IF need to validate length + + if ( SPNEGO_E_SUCCESS == nReturn ) + { + *pnTokenLength = nNumLengthBytes + 1; + } + + } // IF ASNDerGetLength + + } // IF token matches + else + { + nReturn = SPNEGO_E_TOKEN_NOT_FOUND; + } + + } // IF Boundary Length is at least 2 bytes + + LOG(("ASNDerCheckToken returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCheckOID +// +// Parameters: +// [in] pbTokenData - Token Data +// [in] nMechOID - OID we are looking for +// [in] nBoundaryLength - Length that value must not exceed. +// [out] pnTokenLength - Filled out with number of bytes +// consumed by token and data. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Checks the data pointed to by pbTokenData for the specified OID. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerCheckOID( unsigned char* pbTokenData, SPNEGO_MECH_OID nMechOID, long nBoundaryLength, + long* pnTokenLength ) +{ + int nReturn = 0L; + long nLength = 0L; + + // Verify that we have an OID token + if ( ( nReturn = ASNDerCheckToken( pbTokenData, OID, 0L, nBoundaryLength, + &nLength, pnTokenLength ) ) == SPNEGO_E_SUCCESS ) + { + // Add the data length to the Token Length + *pnTokenLength += nLength; + + // Token Lengths plus the actual length must match the length in our OID list element. + // If it doesn't, we're done + if ( *pnTokenLength == g_stcMechOIDList[nMechOID].iLen ) + { + // Memcompare the token and the expected field + if ( memcmp( pbTokenData, g_stcMechOIDList[nMechOID].ucOid, *pnTokenLength ) != 0 ) + { + LOG(("ASNDerCheckOID memcmp failed\n")); + nReturn = SPNEGO_E_UNEXPECTED_OID; + } + } + else + { + LOG(("ASNDerCheckOID token length failed\n")); + nReturn = SPNEGO_E_UNEXPECTED_OID; + } + + } // IF OID Token CHecks + + LOG(("ASNDerCheckOID returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCalcNumLengthBytes +// +// Parameters: +// [in] nLength - Length to calculate length bytes for. +// +// Returns: +// int Number of bytes necessary to represent length +// +// Comments : +// Helper function to calculate the number of length bytes necessary to +// represent a length value. For our purposes, a 32-bit value should be +// enough to describea length. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerCalcNumLengthBytes( long nLength ) +{ + if ( nLength <= 0x7F ) + { + // A single byte will be sufficient for describing this length. + // The byte will simply contain the length + return 1; + } + else if ( nLength <= 0xFF ) + { + // Two bytes are necessary, one to say how many following bytes + // describe the length, and one to give the length + return 2; + } + else if ( nLength <= 0xFFFF ) + { + // Three bytes are necessary, one to say how many following bytes + // describe the length, and two to give the length + return 3; + } + else if ( nLength <= 0xFFFFFF ) + { + // Four bytes are necessary, one to say how many following bytes + // describe the length, and three to give the length + return 4; + } + else + { + // Five bytes are necessary, one to say how many following bytes + // describe the length, and four to give the length + return 5; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCalcTokenLength +// +// Parameters: +// [in] nLength - Length to calculate length bytes for. +// [in] nDataLength - Actual Data length value. +// +// Returns: +// long Number of bytes necessary to represent a token, length and data +// +// Comments : +// Helper function to calculate a token and value size, based on a +// supplied length value, and any binary data that will need to be +// written out. +// +//////////////////////////////////////////////////////////////////////////// + +long ASNDerCalcTokenLength( long nLength, long nDataLength ) +{ + // Add a byte to the length size to account for a single byte to + // hold the token type. + long nTotalLength = ASNDerCalcNumLengthBytes( nLength ) + 1; + + return nTotalLength + nDataLength; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCalcElementLength +// +// Parameters: +// [in] nDataLength - Length of data. +// [out] pnInternalLength - Filled out with length of element +// without sequence info. +// +// Returns: +// long Number of bytes necessary to represent an element +// +// Comments : +// Helper function to calculate an element length. An element consists +// of a sequence token, a type token and then the data. +// +//////////////////////////////////////////////////////////////////////////// + +long ASNDerCalcElementLength( long nDataLength, long* pnInternalLength ) +{ + // First the type token and the actual data + long nTotalLength = ASNDerCalcTokenLength( nDataLength, nDataLength ); + + // Internal length is the length without the element sequence token + if ( NULL != pnInternalLength ) + { + *pnInternalLength = nTotalLength; + } + + // Next add in the element's sequence token (remember that its + // length is the total length of the type token and data) + nTotalLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + return nTotalLength; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerCalcMechListLength +// +// Parameters: +// [in] mechoid - Mech OID to put in list. +// [out] pnInternalLength - Filled out with length of element +// without the primary sequence token. +// +// Returns: +// long Number of bytes necessary to represent a mechList +// +// Comments : +// Helper function to calculate a MechList length. A mechlist consists +// of a NegTokenInit sequence token, a sequence token for the MechList +// and finally a list of OIDs. In our case, we only really have one +// OID. +// +//////////////////////////////////////////////////////////////////////////// + +long ASNDerCalcMechListLength( SPNEGO_MECH_OID mechoid, long* pnInternalLength ) +{ + // First the OID + long nTotalLength = g_stcMechOIDList[mechoid].iLen; + + // Next add in a sequence token + nTotalLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Internal length is the length without the element sequence token + if ( NULL != pnInternalLength ) + { + *pnInternalLength = nTotalLength; + } + + // Finally add in the element's sequence token + nTotalLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + return nTotalLength; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerWriteLength +// +// Parameters: +// [out] pbData - Buffer to write into. +// [in] nLength - Length to write out. +// +// Returns: +// int Number of bytes written out +// +// Comments : +// Helper function to write out a length value following DER rules . +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerWriteLength( unsigned char* pbData, long nLength ) +{ + int nNumBytesRequired = ASNDerCalcNumLengthBytes( nLength ); + int nNumLengthBytes = nNumBytesRequired - 1; + + + if ( nNumBytesRequired > 1 ) + { + + // Write out the number of bytes following which will be used + *pbData = (unsigned char ) ( LEN_XTND | nNumLengthBytes ); + + // Point to where we'll actually write the length + pbData++; + +#ifdef __LITTLE_ENDIAN__ + + // There may be a cleaner way to do this, but for now, this seems to be + // an easy way to do the transformation + switch ( nNumLengthBytes ) + { + case 1: + { + // Cast the length to a single byte, since we know that it + // is 0x7F or less (or we wouldn't only need a single byte). + + *pbData = (unsigned char) nLength; + break; + } + + case 2: + { + *pbData = *( ( (unsigned char*) &nLength ) + 1 ); + *( pbData + 1) = *( ( (unsigned char*) &nLength ) ); + break; + } + + case 3: + { + *pbData = *( ( (unsigned char*) &nLength ) + 3 ); + *( pbData + 1) = *( ( (unsigned char*) &nLength ) + 2 ); + *( pbData + 2) = *( ( (unsigned char*) &nLength ) ); + break; + } + + case 4: + { + *pbData = *( ( (unsigned char*) &nLength ) + 3 ); + *( pbData + 1) = *( ( (unsigned char*) &nLength ) + 2 ); + *( pbData + 2) = *( ( (unsigned char*) &nLength ) + 1 ); + *( pbData + 3) = *( ( (unsigned char*) &nLength ) ); + break; + } + + } // SWITCH ( nNumLengthBytes ) + +#else + // We are Big-Endian, so the length can be copied in from the source + // as is. Ensure that we adjust for the number of bytes we actually + // copy. + + memcpy( pbData, + ( (unsigned char *) &nLength ) + ( 4 - nNumLengthBytes ), nNumLengthBytes ); +#endif + + } // IF > 1 byte for length + else + { + // Cast the length to a single byte, since we know that it + // is 0x7F or less (or we wouldn't only need a single byte). + + *pbData = (unsigned char) nLength; + } + + return nNumBytesRequired; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerWriteToken +// +// Parameters: +// [out] pbData - Buffer to write into. +// [in] ucType - Token Type +// [in] pbTokenValue - Actual Value +// [in] nLength - Length of Data. +// +// Returns: +// int Number of bytes written out +// +// Comments : +// Helper function to write out a token and any associated data. If +// pbTokenValue is non-NULL, then it is written out in addition to the +// token identifier and the length bytes. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerWriteToken( unsigned char* pbData, unsigned char ucType, + unsigned char* pbTokenValue, long nLength ) +{ + int nTotalBytesWrittenOut = 0L; + int nNumLengthBytesWritten = 0L; + + // Write out the type + *pbData = ucType; + + // Wrote 1 byte, and move data pointer + nTotalBytesWrittenOut++; + pbData++; + + // Now write out the length and adjust the number of bytes written out + nNumLengthBytesWritten = ASNDerWriteLength( pbData, nLength ); + + nTotalBytesWrittenOut += nNumLengthBytesWritten; + pbData += nNumLengthBytesWritten; + + // Write out the token value if we got one. The assumption is that the + // nLength value indicates how many bytes are in pbTokenValue. + + if ( NULL != pbTokenValue ) + { + memcpy( pbData, pbTokenValue, nLength ); + nTotalBytesWrittenOut += nLength; + } + + return nTotalBytesWrittenOut; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerWriteOID +// +// Parameters: +// [out] pbData - Buffer to write into. +// [in] eMechOID - OID to write out. +// +// Returns: +// int Number of bytes written out +// +// Comments : +// Helper function to write out an OID. For these we have the raw bytes +// listed in a global structure. The caller simply indicates which OID +// should be written and we will splat out the data. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerWriteOID( unsigned char* pbData, SPNEGO_MECH_OID eMechOID ) +{ + + memcpy( pbData, g_stcMechOIDList[eMechOID].ucOid, g_stcMechOIDList[eMechOID].iLen ); + + return g_stcMechOIDList[eMechOID].iLen; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerWriteMechList +// +// Parameters: +// [out] pbData - Buffer to write into. +// [in] eMechOID - OID to put in MechList. +// +// Returns: +// int Number of bytes written out +// +// Comments : +// Helper function to write out a MechList. A MechList consists of the +// Init Token Sequence, a sequence token and then the list of OIDs. In +// our case the OID is from a global array of known OIDs. +// +//////////////////////////////////////////////////////////////////////////// + +long ASNDerWriteMechList( unsigned char* pbData, SPNEGO_MECH_OID mechoid ) +{ + // First get the length + long nInternalLength = 0L; + long nMechListLength = ASNDerCalcMechListLength( mechoid, &nInternalLength ); + long nTempLength = 0L; + + nTempLength = ASNDerWriteToken( pbData, SPNEGO_NEGINIT_ELEMENT_MECHTYPES, + NULL, nInternalLength ); + + // Adjust the data pointer + pbData += nTempLength; + + // Now write the Sequence token and the OID (the OID is a BLOB in the global + // structure. + + nTempLength = ASNDerWriteToken( pbData, SPNEGO_CONSTRUCTED_SEQUENCE, + g_stcMechOIDList[mechoid].ucOid, + g_stcMechOIDList[mechoid].iLen ); + + return nMechListLength; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ASNDerWriteElement +// +// Parameters: +// [out] pbData - Buffer to write into. +// [in] ucElementSequence - Sequence Token +// [in] ucType - Token Type +// [in] pbTokenValue - Actual Value +// [in] nLength - Length of Data. +// +// Returns: +// int Number of bytes written out +// +// Comments : +// Helper function to write out a SPNEGO Token element. An element +// consists of a sequence token, a type token and the associated data. +// +//////////////////////////////////////////////////////////////////////////// + +int ASNDerWriteElement( unsigned char* pbData, unsigned char ucElementSequence, + unsigned char ucType, unsigned char* pbTokenValue, long nLength ) +{ + // First get the length + long nInternalLength = 0L; + long nElementLength = ASNDerCalcElementLength( nLength, &nInternalLength ); + long nTempLength = 0L; + + // Write out the sequence byte and the length of the type and data + nTempLength = ASNDerWriteToken( pbData, ucElementSequence, NULL, nInternalLength ); + + // Adjust the data pointer + pbData += nTempLength; + + // Now write the type and the data. + nTempLength = ASNDerWriteToken( pbData, ucType, pbTokenValue, nLength ); + + return nElementLength; +} + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.h squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.h --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.h Sat Jun 2 18:47:39 2007 @@ -0,0 +1,207 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + +///////////////////////////////////////////////////////////// +// +// DERPARSE.H +// +// SPNEGO Token Handler Header File +// +// Contains the definitions required to properly parse the +// SPNEGO DER encoding. +// +///////////////////////////////////////////////////////////// + +#ifndef __DERPARSE_H__ +#define __DERPARSE_H__ + +// C++ Specific +#if defined(__cplusplus) +extern "C" +{ +#endif + +/* Identifier Types */ +#define IDENTIFIER_MASK 0xC0 // Bits 7 and 8 +#define IDENTIFIER_UNIVERSAL 0x00 // 00 = universal +#define IDENTIFIER_APPLICATION 0x40 // 01 = application +#define IDENTIFIER_CONTEXT_SPECIFIC 0x80 // 10 = context specific +#define IDENTIFIER_PRIVATE 0xC0 // 11 = Private + +/* Encoding type */ + +#define FORM_MASK 0x20 /* Bit 6 */ +#define PRIMITIVE 0x00 /* 0 = primitive */ +#define CONSTRUCTED 0x20 /* 1 = constructed */ + +/* Universal tags */ + +#define TAG_MASK 0x1F /* Bits 5 - 1 */ +#define BOOLEAN 0x01 /* 1: TRUE or FALSE */ +#define INTEGER 0x02 /* 2: Arbitrary precision integer */ +#define BITSTRING 0x03 /* 2: Sequence of bits */ +#define OCTETSTRING 0x04 /* 4: Sequence of bytes */ +#define NULLTAG 0x05 /* 5: NULL */ +#define OID 0x06 /* 6: Object Identifier (numeric sequence) */ +#define OBJDESCRIPTOR 0x07 /* 7: Object Descriptor (human readable) */ +#define EXTERNAL 0x08 /* 8: External / Instance Of */ +#define REAL 0x09 /* 9: Real (Mantissa * Base^Exponent) */ +#define ENUMERATED 0x0A /* 10: Enumerated */ +#define EMBEDDED_PDV 0x0B /* 11: Embedded Presentation Data Value */ +#define SEQUENCE 0x10 /* 16: Constructed Sequence / Sequence Of */ +#define SET 0x11 /* 17: Constructed Set / Set Of */ +#define NUMERICSTR 0x12 /* 18: Numeric String (digits only) */ +#define PRINTABLESTR 0x13 /* 19: Printable String */ +#define T61STR 0x14 /* 20: T61 String (Teletex) */ +#define VIDEOTEXSTR 0x15 /* 21: Videotex String */ +#define IA5STR 0x16 /* 22: IA5 String */ +#define UTCTIME 0x17 /* 23: UTC Time */ +#define GENERALIZEDTIME 0x18 /* 24: Generalized Time */ +#define GRAPHICSTR 0x19 /* 25: Graphic String */ +#define VISIBLESTR 0x1A /* 26: Visible String (ISO 646) */ +#define GENERALSTR 0x1B /* 27: General String */ +#define UNIVERSALSTR 0x1C /* 28: Universal String */ +#define BMPSTR 0x1E /* 30: Basic Multilingual Plane String */ + +/* Length encoding */ + +#define LEN_XTND 0x80 /* Indefinite or long form */ +#define LEN_MASK 0x7f /* Bits 7 - 1 */ + +// +// SPNEGO Token Parsing Constants +// + + +// Fixed Length of NegTokenInit ReqFlags field +#define SPNEGO_NEGINIT_MAXLEN_REQFLAGS 2 + +// Difference in bits for ReqFlags token +#define SPNEGO_NEGINIT_REQFLAGS_BITDIFF 1 + +// Fixed Length of NegTokenTarg NegResult field +#define SPNEGO_NEGTARG_MAXLEN_NEGRESULT 1 + +// Application Specific Construct - Always at the start of a NegTokenInit +#define SPNEGO_NEGINIT_APP_CONSTRUCT ( IDENTIFIER_APPLICATION | CONSTRUCTED ) // 0x60 + +// Constructed Sequence token - after the actual token identifier token +#define SPNEGO_CONSTRUCTED_SEQUENCE ( SEQUENCE | CONSTRUCTED ) + +// MechList Type Identifier +#define SPNEGO_MECHLIST_TYPE ( SEQUENCE | CONSTRUCTED | OID ) + +// +// NegTokenInit - Token Identifier and Elements +// + +// NegTokenInit - 0xa0 +#define SPNEGO_NEGINIT_TOKEN_IDENTIFIER ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_TOKEN_INIT ) + +// Structure elements for NegTokenInit +#define SPNEGO_NEGINIT_MECHTYPES 0x0 // MechTypes is element 0 +#define SPNEGO_NEGINIT_REQFLAGS 0x1 // ReqFlags is element 1 +#define SPNEGO_NEGINIT_MECHTOKEN 0x2 // MechToken is element 2 +#define SPNEGO_NEGINIT_MECHLISTMIC 0x3 // MechListMIC is element 3 + +// MechTypes element is 0xa0 +#define SPNEGO_NEGINIT_ELEMENT_MECHTYPES ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGINIT_MECHTYPES ) + +// ReqFlags element is 0xa1 +#define SPNEGO_NEGINIT_ELEMENT_REQFLAGS ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGINIT_REQFLAGS ) + +// MechToken element is 0xa2 +#define SPNEGO_NEGINIT_ELEMENT_MECHTOKEN ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGINIT_MECHTOKEN ) + +// MechListMIC element is 0xa3 +#define SPNEGO_NEGINIT_ELEMENT_MECHLISTMIC ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGINIT_MECHLISTMIC ) + +// +// NegTokenTarg - Token Identifier and Elements +// + +// NegTokenTarg - 0xa1 +#define SPNEGO_NEGTARG_TOKEN_IDENTIFIER ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_TOKEN_TARG ) + +// Structure elements for NegTokenTarg +#define SPNEGO_NEGTARG_NEGRESULT 0x0 // NegResult is element 0 +#define SPNEGO_NEGTARG_SUPPORTEDMECH 0x1 // SupportedMech is element 1 +#define SPNEGO_NEGTARG_RESPONSETOKEN 0x2 // ResponseToken is element 2 +#define SPNEGO_NEGTARG_MECHLISTMIC 0x3 // MechListMIC is element 3 + +// NegResult element is 0xa0 +#define SPNEGO_NEGTARG_ELEMENT_NEGRESULT ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGTARG_NEGRESULT ) + +// SupportedMech element is 0xa1 +#define SPNEGO_NEGTARG_ELEMENT_SUPPORTEDMECH ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGTARG_SUPPORTEDMECH ) + +// ResponseToken element is 0xa2 +#define SPNEGO_NEGTARG_ELEMENT_RESPONSETOKEN ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGTARG_RESPONSETOKEN ) + +// MechListMIC element is 0xa3 +#define SPNEGO_NEGTARG_ELEMENT_MECHLISTMIC ( IDENTIFIER_CONTEXT_SPECIFIC | CONSTRUCTED | \ + SPNEGO_NEGTARG_MECHLISTMIC ) + +// +// Defines a GSS Mechanism OID. We keep a single static array +// of these which we'll use for validation/searches/parsing. +// + +typedef struct _mechOID +{ + unsigned char* ucOid; // Byte representation of OID + int iLen; // Length of the OID, length and identifier + int iActualDataLen; // Length of the actual OID + SPNEGO_MECH_OID eMechanismOID; // Which OID is this? +} MECH_OID; + + +// +// ASN Der functions +// + +int ASNDerGetLength( unsigned char* pbLengthData, long nBoundaryLength, long* pnLength, + long* pnNumLengthBytes ); +int ASNDerCheckToken( unsigned char* pbTokenData, unsigned char nToken, + long nCheckLength, long nBoundaryLength, long* pnLength, + long* pnTokenLength ); +int ASNDerCheckOID( unsigned char* pbTokenData, SPNEGO_MECH_OID nMechOID, long nBoundaryLength, + long* pnTokenLength ); +int ASNDerCalcNumLengthBytes( long nLength ); +long ASNDerCalcTokenLength( long nLength, long nDataLength ); +long ASNDerCalcElementLength( long nDataLength, long* pnInternalLength ); +long ASNDerCalcMechListLength( SPNEGO_MECH_OID mechoid, long* pnInternalLength ); +int ASNDerWriteLength( unsigned char* pbData, long nLength ); +int ASNDerWriteToken( unsigned char* pbData, unsigned char ucType, + unsigned char* pbTokenValue, long nLength ); +int ASNDerWriteOID( unsigned char* pbData, SPNEGO_MECH_OID eMechOID ); +long ASNDerWriteMechList( unsigned char* pbData, SPNEGO_MECH_OID mechoid ); +int ASNDerWriteElement( unsigned char* pbData, unsigned char ucElementSequence, + unsigned char ucType, unsigned char* pbTokenValue, long nLength ); + + + // C++ Specific +#if defined(__cplusplus) +} +#endif + +#endif + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.c Sat Jun 2 18:47:39 2007 @@ -0,0 +1,806 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + +///////////////////////////////////////////////////////////// +// +// SPNEGO.C +// +// SPNEGO Token Handler Source File +// +// Contains implementation of SPNEGO Token Handling API +// as defined in SPNEGO.H. +// +///////////////////////////////////////////////////////////// + +#include +#include +#include +#include "spnego.h" +#include "derparse.h" +#include "spnegoparse.h" + +// +// Defined in DERPARSE.C +// + +extern MECH_OID g_stcMechOIDList []; + + +/**********************************************************************/ +/** **/ +/** **/ +/** **/ +/** **/ +/** SPNEGO Token Handler API implementation **/ +/** **/ +/** **/ +/** **/ +/** **/ +/**********************************************************************/ + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoInitFromBinary +// +// Parameters: +// [in] pbTokenData - Binary Token Data +// [in] ulLength - Length of binary Token Data +// [out] phSpnegoToken - SPNEGO_TOKEN_HANDLE pointer +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Initializes a SPNEGO_TOKEN_HANDLE from the supplied +// binary data. Data is copied locally. Returned data structure +// must be freed by calling spnegoFreeData(). +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoInitFromBinary( unsigned char* pbTokenData, unsigned long ulLength, SPNEGO_TOKEN_HANDLE* phSpnegoToken ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN** ppSpnegoToken = (SPNEGO_TOKEN**) phSpnegoToken; + + // Pass off to a handler function that allows tighter control over how the token structure + // is handled. In this case, we want the token data copied and we want the associated buffer + // freed. + nReturn = InitTokenFromBinary( SPNEGO_TOKEN_INTERNAL_COPYDATA, + SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA, pbTokenData, + ulLength, ppSpnegoToken ); + + LOG(("spnegoInitFromBinary returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoCreateNegTokenInit +// +// Parameters: +// [in] MechType - MechType to specify in MechTypeList element +// [in] ucContextFlags - Context Flags element value +// [in] pbMechToken - Pointer to binary MechToken Data +// [in] ulMechTokenLen - Length of MechToken Data +// [in] pbMechListMIC - Pointer to binary MechListMIC Data +// [in] ulMechListMICLen - Length of MechListMIC Data +// [out] phSpnegoToken - SPNEGO_TOKEN_HANDLE pointer +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Initializes a SPNEGO_TOKEN_HANDLE for a NegTokenInit type +// from the supplied parameters. ucContextFlags may be 0 or must be +// a valid flag combination. MechToken data can be NULL - if not, it +// must correspond to the MechType. MechListMIC can also be NULL. +// Returned data structure must be freed by calling spnegoFreeData(). +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoCreateNegTokenInit( SPNEGO_MECH_OID MechType, + unsigned char ucContextFlags, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, SPNEGO_TOKEN_HANDLE* phSpnegoToken ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + long nTokenLength = 0L; + long nInternalTokenLength = 0L; + unsigned char* pbTokenData = NULL; + SPNEGO_TOKEN** ppSpnegoToken = (SPNEGO_TOKEN**) phSpnegoToken; + + if ( NULL != ppSpnegoToken && + IsValidMechOid( MechType ) && + IsValidContextFlags( ucContextFlags ) ) + { + // Get the actual token size + + if ( ( nReturn = CalculateMinSpnegoInitTokenSize( ulMechTokenLen, ulMechListMICLen, + MechType, ( ucContextFlags != 0L ), + &nTokenLength, &nInternalTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Allocate a buffer to hold the data. + pbTokenData = calloc( 1, nTokenLength ); + + if ( NULL != pbTokenData ) + { + + // Now write the token + if ( ( nReturn = CreateSpnegoInitToken( MechType, + ucContextFlags, pbMechToken, + ulMechTokenLen, pbMechListMIC, + ulMechListMICLen, pbTokenData, + nTokenLength, nInternalTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + + // This will copy our allocated pointer, and ensure that the sructure cleans + // up the data later + nReturn = InitTokenFromBinary( SPNEGO_TOKEN_INTERNAL_COPYPTR, + SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA, + pbTokenData, nTokenLength, ppSpnegoToken ); + + } + + // Cleanup on failure + if ( SPNEGO_E_SUCCESS != nReturn ) + { + free( pbTokenData ); + } + + } // IF alloc succeeded + else + { + nReturn = SPNEGO_E_OUT_OF_MEMORY; + } + + } // If calculated token size + + } // IF Valid Parameters + + LOG(("spnegoCreateNegTokenInit returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoCreateNegTokenTarg +// +// Parameters: +// [in] MechType - MechType to specify in supported MechType element +// [in] spnegoNegResult - NegResult value +// [in] pbMechToken - Pointer to response MechToken Data +// [in] ulMechTokenLen - Length of MechToken Data +// [in] pbMechListMIC - Pointer to binary MechListMIC Data +// [in] ulMechListMICLen - Length of MechListMIC Data +// [out] phSpnegoToken - SPNEGO_TOKEN_HANDLE pointer +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Initializes a SPNEGO_TOKEN_HANDLE for a NegTokenTarg type +// from the supplied parameters. MechToken data can be NULL - if not, +// it must correspond to the MechType. MechListMIC can also be NULL. +// Returned data structure must be freed by calling spnegoFreeData(). +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoCreateNegTokenTarg( SPNEGO_MECH_OID MechType, + SPNEGO_NEGRESULT spnegoNegResult, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, SPNEGO_TOKEN_HANDLE* phSpnegoToken ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + long nTokenLength = 0L; + long nInternalTokenLength = 0L; + unsigned char* pbTokenData = NULL; + SPNEGO_TOKEN** ppSpnegoToken = (SPNEGO_TOKEN**) phSpnegoToken; + + // + // spnego_mech_oid_NotUsed and spnego_negresult_NotUsed + // are okay here, however a valid MechOid is required + // if spnego_negresult_success or spnego_negresult_incomplete + // is specified. + // + + if ( NULL != ppSpnegoToken && + + ( IsValidMechOid( MechType ) || + spnego_mech_oid_NotUsed == MechType ) && + + ( IsValidNegResult( spnegoNegResult ) || + spnego_negresult_NotUsed == spnegoNegResult ) && + + !( !IsValidMechOid( MechType ) && + ( spnego_negresult_success == spnegoNegResult || + spnego_negresult_incomplete == spnegoNegResult ) ) ) + { + + // Get the actual token size + + if ( ( nReturn = CalculateMinSpnegoTargTokenSize( MechType, spnegoNegResult, ulMechTokenLen, + ulMechListMICLen, &nTokenLength, + &nInternalTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Allocate a buffer to hold the data. + pbTokenData = calloc( 1, nTokenLength ); + + if ( NULL != pbTokenData ) + { + + // Now write the token + if ( ( nReturn = CreateSpnegoTargToken( MechType, + spnegoNegResult, pbMechToken, + ulMechTokenLen, pbMechListMIC, + ulMechListMICLen, pbTokenData, + nTokenLength, nInternalTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + + // This will copy our allocated pointer, and ensure that the sructure cleans + // up the data later + nReturn = InitTokenFromBinary( SPNEGO_TOKEN_INTERNAL_COPYPTR, + SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA, + pbTokenData, nTokenLength, ppSpnegoToken ); + + } + + // Cleanup on failure + if ( SPNEGO_E_SUCCESS != nReturn ) + { + free( pbTokenData ); + } + + } // IF alloc succeeded + else + { + nReturn = SPNEGO_E_OUT_OF_MEMORY; + } + + } // If calculated token size + + } // IF Valid Parameters + + LOG(("spnegoCreateNegTokenTarg returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoTokenGetBinary +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pbTokenData - Buffer to copy token into +// [in/out] pulDataLen - Length of pbTokenData buffer, filled out +// with actual size used upon function return. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Copies binary SPNEGO token data from hSpnegoToken into the user +// supplied buffer. If pbTokenData is NULL, or the value in pulDataLen +// is too small, the function will return SPNEGO_E_BUFFER_TOO_SMALL and +// fill out pulDataLen with the minimum required buffer size. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoTokenGetBinary( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbTokenData, + unsigned long * pulDataLen ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters - pbTokenData is optional + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pulDataLen ) + { + + // Check for Buffer too small conditions + if ( NULL == pbTokenData || + pSpnegoToken->ulBinaryDataLen > *pulDataLen ) + { + *pulDataLen = pSpnegoToken->ulBinaryDataLen; + nReturn = SPNEGO_E_BUFFER_TOO_SMALL; + } + else + { + memcpy( pbTokenData, pSpnegoToken->pbBinaryData, pSpnegoToken->ulBinaryDataLen ); + *pulDataLen = pSpnegoToken->ulBinaryDataLen; + nReturn = SPNEGO_E_SUCCESS; + } + + } // IF parameters OK + + LOG(("spnegoTokenGetBinary returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoFreeData +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// +// Returns: +// void +// +// Comments : +// Frees up resources consumed by hSpnegoToken. The supplied data +// pointer is invalidated by this function. +// +//////////////////////////////////////////////////////////////////////////// + +void spnegoFreeData( SPNEGO_TOKEN_HANDLE hSpnegoToken ) +{ + FreeSpnegoToken( (SPNEGO_TOKEN*) hSpnegoToken); + return; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoGetTokenType +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] piTokenType - Filled out with token type value. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// The function will analyze hSpnegoToken and return the appropriate +// type in piTokenType. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetTokenType( SPNEGO_TOKEN_HANDLE hSpnegoToken, int * piTokenType ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != piTokenType && + pSpnegoToken) + { + + // Check that the type in the structure makes sense + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType || + SPNEGO_TOKEN_TARG == pSpnegoToken->ucTokenType ) + { + *piTokenType = pSpnegoToken->ucTokenType; + nReturn = SPNEGO_E_SUCCESS; + } + + } // IF parameters OK + + LOG(("spnegoGetTokenType returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoIsMechTypeAvailable +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [in] MechOID - MechOID to search MechTypeList for +// [out] piMechTypeIndex - Filled out with index in MechTypeList +// element if MechOID is found. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken must reference a token of type NegTokenInit. The +// function will search the MechTypeList element for an OID corresponding +// to the specified MechOID. If one is found, the index (0 based) will +// be passed into the piMechTypeIndex parameter. +// +//////////////////////////////////////////////////////////////////////////// + +// Returns the Initial Mech Type in the MechList element in the NegInitToken. +int spnegoIsMechTypeAvailable( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_MECH_OID MechOID, int * piMechTypeIndex ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != piMechTypeIndex && + IsValidMechOid( MechOID ) && + SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + + // Check if MechList is available + if ( pSpnegoToken->aElementArray[SPNEGO_INIT_MECHTYPES_ELEMENT].iElementPresent + == SPNEGO_TOKEN_ELEMENT_AVAILABLE ) + { + // Locate the MechOID in the list element + nReturn = FindMechOIDInMechList( + &pSpnegoToken->aElementArray[SPNEGO_INIT_MECHTYPES_ELEMENT], + MechOID, piMechTypeIndex ); + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoIsMechTypeAvailable returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoGetContextFlags +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pucContextFlags - Filled out with ContextFlags value. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken must reference a token of type NegTokenInit. The +// function will copy data from the ContextFlags element into the +// location pucContextFlags points to. Note that the function will +// fail if the actual ContextFlags data appears invalid. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetContextFlags( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pucContextFlags ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pucContextFlags && + SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + + // Check if ContextFlags is available + if ( pSpnegoToken->aElementArray[SPNEGO_INIT_REQFLAGS_ELEMENT].iElementPresent + == SPNEGO_TOKEN_ELEMENT_AVAILABLE ) + { + // The length should be two, the value should show a 1 bit difference in the difference byte, and + // the value must be valid + if ( pSpnegoToken->aElementArray[SPNEGO_INIT_REQFLAGS_ELEMENT].nDatalength == SPNEGO_NEGINIT_MAXLEN_REQFLAGS && + pSpnegoToken->aElementArray[SPNEGO_INIT_REQFLAGS_ELEMENT].pbData[0] == SPNEGO_NEGINIT_REQFLAGS_BITDIFF && + IsValidContextFlags( pSpnegoToken->aElementArray[SPNEGO_INIT_REQFLAGS_ELEMENT].pbData[1] ) ) + { + *pucContextFlags = pSpnegoToken->aElementArray[SPNEGO_INIT_REQFLAGS_ELEMENT].pbData[1]; + nReturn = SPNEGO_E_SUCCESS; + } + else + { + nReturn = SPNEGO_E_INVALID_ELEMENT; + } + + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoGetContextFlags returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoGetNegotiationResult +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pnegResult - Filled out with NegResult value. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken must reference a token of type NegTokenTarg. The +// function will copy data from the NegResult element into the +// location pointed to by pnegResult. Note that the function will +// fail if the actual NegResult data appears invalid. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetNegotiationResult( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_NEGRESULT* pnegResult ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pnegResult && + SPNEGO_TOKEN_TARG == pSpnegoToken->ucTokenType ) + { + + // Check if NegResult is available + if ( pSpnegoToken->aElementArray[SPNEGO_TARG_NEGRESULT_ELEMENT].iElementPresent + == SPNEGO_TOKEN_ELEMENT_AVAILABLE ) + { + // Must be 1 byte long and a valid value + if ( pSpnegoToken->aElementArray[SPNEGO_TARG_NEGRESULT_ELEMENT].nDatalength == SPNEGO_NEGTARG_MAXLEN_NEGRESULT && + IsValidNegResult( *pSpnegoToken->aElementArray[SPNEGO_TARG_NEGRESULT_ELEMENT].pbData ) ) + { + *pnegResult = *pSpnegoToken->aElementArray[SPNEGO_TARG_NEGRESULT_ELEMENT].pbData; + nReturn = SPNEGO_E_SUCCESS; + } + else + { + nReturn = SPNEGO_E_INVALID_ELEMENT; + } + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoGetNegotiationResult returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoGetSupportedMechType +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pMechOID - Filled out with Supported MechType value. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken must reference a token of type NegTokenTarg. The +// function will check the Supported MechType element, and if it +// corresponds to a supported MechType ( spnego_mech_oid_Kerberos_V5_Legacy +// or spnego_mech_oid_Kerberos_V5 ), will set the location pointed +// to by pMechOID equal to the appropriate value. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetSupportedMechType( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_MECH_OID* pMechOID ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + int nCtr = 0L; + long nLength = 0L; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pMechOID && + SPNEGO_TOKEN_TARG == pSpnegoToken->ucTokenType ) + { + + // Check if MechList is available + if ( pSpnegoToken->aElementArray[SPNEGO_TARG_SUPPMECH_ELEMENT].iElementPresent + == SPNEGO_TOKEN_ELEMENT_AVAILABLE ) + { + + for ( nCtr = 0; + nReturn != SPNEGO_E_SUCCESS && + g_stcMechOIDList[nCtr].eMechanismOID != spnego_mech_oid_NotUsed; + nCtr++ ) + { + + if ( ( nReturn = ASNDerCheckOID( + pSpnegoToken->aElementArray[SPNEGO_TARG_SUPPMECH_ELEMENT].pbData, + nCtr, + pSpnegoToken->aElementArray[SPNEGO_TARG_SUPPMECH_ELEMENT].nDatalength, + &nLength ) ) == SPNEGO_E_SUCCESS ) + { + *pMechOID = nCtr; + } + + } // For enum MechOIDs + + + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoGetSupportedMechType returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoTokenGetMechToken +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pbTokenData - Buffer to copy MechToken into +// [in/out] pulDataLen - Length of pbTokenData buffer, filled out +// with actual size used upon function return. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken can point to either NegTokenInit or a NegTokenTarg token. +// The function will copy the MechToken (the initial MechToken if +// NegTokenInit, the response MechToken if NegTokenTarg) from the +// underlying token into the buffer pointed to by pbTokenData. If +// pbTokenData is NULL, or the value in pulDataLen is too small, the +// function will return SPNEGO_E_BUFFER_TOO_SMALL and fill out pulDataLen +// with the minimum required buffer size. The token can then be passed +// to a GSS-API function for processing. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetMechToken( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbTokenData, unsigned long* pulDataLen ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + SPNEGO_ELEMENT* pSpnegoElement = NULL; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pulDataLen ) + { + + // Point at the proper Element + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + pSpnegoElement = &pSpnegoToken->aElementArray[SPNEGO_INIT_MECHTOKEN_ELEMENT]; + } + else + { + pSpnegoElement = &pSpnegoToken->aElementArray[SPNEGO_TARG_RESPTOKEN_ELEMENT]; + } + + // Check if MechType is available + if ( SPNEGO_TOKEN_ELEMENT_AVAILABLE == pSpnegoElement->iElementPresent ) + { + // Check for Buffer too small conditions + if ( NULL == pbTokenData || + pSpnegoElement->nDatalength > *pulDataLen ) + { + *pulDataLen = pSpnegoElement->nDatalength; + nReturn = SPNEGO_E_BUFFER_TOO_SMALL; + } + else + { + // Copy Memory + memcpy( pbTokenData, pSpnegoElement->pbData, pSpnegoElement->nDatalength ); + *pulDataLen = pSpnegoElement->nDatalength; + nReturn = SPNEGO_E_SUCCESS; + } + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoGetMechToken returned %d\n",nReturn)); + return nReturn;; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// spnegoTokenGetMechListMIC +// +// Parameters: +// [in] hSpnegoToken - Initialized SPNEGO_TOKEN_HANDLE +// [out] pbTokenData - Buffer to copy MechListMIC data into +// [in/out] pulDataLen - Length of pbTokenData buffer, filled out +// with actual size used upon function return. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// hSpnegoToken can point to either NegTokenInit or a NegTokenTarg token. +// The function will copy the MechListMIC data from the underlying token +// into the buffer pointed to by pbTokenData. If pbTokenData is NULL, +// or the value in pulDataLen is too small, the function will return +// SPNEGO_E_BUFFER_TOO_SMALL and fill out pulDataLen with the minimum +// required buffer size. +// +//////////////////////////////////////////////////////////////////////////// + +int spnegoGetMechListMIC( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbMICData, unsigned long* pulDataLen ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) hSpnegoToken; + SPNEGO_ELEMENT* pSpnegoElement = NULL; + + // Check parameters + if ( IsValidSpnegoToken( pSpnegoToken ) && + NULL != pulDataLen ) + { + + // Point at the proper Element + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + pSpnegoElement = &pSpnegoToken->aElementArray[SPNEGO_INIT_MECHLISTMIC_ELEMENT]; + } + else + { + pSpnegoElement = &pSpnegoToken->aElementArray[SPNEGO_TARG_MECHLISTMIC_ELEMENT]; + } + + // Check if MechType is available + if ( SPNEGO_TOKEN_ELEMENT_AVAILABLE == pSpnegoElement->iElementPresent ) + { + // Check for Buffer too small conditions + if ( NULL == pbMICData || + pSpnegoElement->nDatalength > *pulDataLen ) + { + *pulDataLen = pSpnegoElement->nDatalength; + nReturn = SPNEGO_E_BUFFER_TOO_SMALL; + } + else + { + // Copy Memory + memcpy( pbMICData, pSpnegoElement->pbData, pSpnegoElement->nDatalength ); + *pulDataLen = pSpnegoElement->nDatalength; + nReturn = SPNEGO_E_SUCCESS; + } + } + else + { + nReturn = SPNEGO_E_ELEMENT_UNAVAILABLE; + } + + } // IF parameters OK + + LOG(("spnegoGetMechListMIC returned %d\n",nReturn)); + return nReturn;; +} + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.h squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.h --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.h Sat Jun 2 18:47:39 2007 @@ -0,0 +1,247 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + +///////////////////////////////////////////////////////////// +// +// SPNEGO.H +// +// SPNEGO Token Handler Header File +// +// Contains the definitions required to interpret and create +// SPNEGO tokens so that Kerberos GSS tokens can be +// Unpackaged/packaged. +// +///////////////////////////////////////////////////////////// + +#ifndef __SPNEGO_H__ +#define __SPNEGO_H__ + +// C++ Specific +#if defined(__cplusplus) +extern "C" +{ +#endif + +// Type Definitions + +// +// Users of SPNEGO Token Handler API will request +// these as well as free them, +// +typedef void* SPNEGO_TOKEN_HANDLE; + +// +// Defines the element types that are found +// in each of the tokens. +// + +typedef enum spnego_element_type +{ + spnego_element_min, // Lower bound + + // Init token elements + spnego_init_mechtypes, + spnego_init_reqFlags, + spnego_init_mechToken, + spnego_init_mechListMIC, + + // Targ token elements + spnego_targ_negResult, + spnego_targ_supportedMech, + spnego_targ_responseToken, + spnego_targ_mechListMIC, + + spnego_element_max // Upper bound + +} SPNEGO_ELEMENT_TYPE; + +// +// Token Element Availability. Elements in both +// token types are optional. Since there are only +// 4 elements in each Token, we will allocate space +// to hold the information, but we need a way to +// indicate whether or not an element is available +// + +#define SPNEGO_TOKEN_ELEMENT_UNAVAILABLE 0 +#define SPNEGO_TOKEN_ELEMENT_AVAILABLE 1 + +// +// Token type values. SPNEGO has 2 token types: +// NegTokenInit and NegTokenTarg +// + +#define SPNEGO_TOKEN_INIT 0 +#define SPNEGO_TOKEN_TARG 1 + +// +// GSS Mechanism OID enumeration. We only really handle +// 3 different OIDs. These are stored in an array structure +// defined in the parsing code. +// + +typedef enum spnego_mech_oid +{ + // Init token elements + spnego_mech_oid_Kerberos_V5_Legacy, // Really V5, but OID off by 1 bit + spnego_mech_oid_Kerberos_V5, + spnego_mech_oid_Spnego, + spnego_mech_oid_NotUsed = -1 + +} SPNEGO_MECH_OID; + +// +// Defines the negResult values. +// + +typedef enum spnego_negResult +{ + spnego_negresult_success, + spnego_negresult_incomplete, + spnego_negresult_rejected, + spnego_negresult_NotUsed = -1 +} SPNEGO_NEGRESULT; + +// +// Context Flags in NegTokenInit +// + +// +// ContextFlags values MUST be zero or a combination +// of the below +// + +#define SPNEGO_NEGINIT_CONTEXT_DELEG_FLAG 0x80 +#define SPNEGO_NEGINIT_CONTEXT_MUTUAL_FLAG 0x40 +#define SPNEGO_NEGINIT_CONTEXT_REPLAY_FLAG 0x20 +#define SPNEGO_NEGINIT_CONTEXT_SEQUENCE_FLAG 0x10 +#define SPNEGO_NEGINIT_CONTEXT_ANON_FLAG 0x8 +#define SPNEGO_NEGINIT_CONTEXT_CONF_FLAG 0x4 +#define SPNEGO_NEGINIT_CONTEXT_INTEG_FLAG 0x2 + +// +// Mask to retrieve valid values. +// + +#define SPNEGO_NEGINIT_CONTEXT_MASK 0xFE // Logical combination of above flags + +// +// SPNEGO API return codes. +// + +// API function was successful +#define SPNEGO_E_SUCCESS 0 + +// The supplied Token was invalid +#define SPNEGO_E_INVALID_TOKEN -1 + +// An invalid length was encountered +#define SPNEGO_E_INVALID_LENGTH -2 + +// The Token Parse failed +#define SPNEGO_E_PARSE_FAILED -3 + +// The requested value was not found +#define SPNEGO_E_NOT_FOUND -4 + +// The requested element is not available +#define SPNEGO_E_ELEMENT_UNAVAILABLE -5 + +// Out of Memory +#define SPNEGO_E_OUT_OF_MEMORY -6 + +// Not Implemented +#define SPNEGO_E_NOT_IMPLEMENTED -7 + +// Invalid Parameter +#define SPNEGO_E_INVALID_PARAMETER -8 + +// Token Handler encountered an unexpected OID +#define SPNEGO_E_UNEXPECTED_OID -9 + +// The requested token was not found +#define SPNEGO_E_TOKEN_NOT_FOUND -10 + +// An unexpected type was encountered in the encoding +#define SPNEGO_E_UNEXPECTED_TYPE -11 + +// The buffer was too small +#define SPNEGO_E_BUFFER_TOO_SMALL -12 + +// A Token Element was invalid (e.g. improper length or value) +#define SPNEGO_E_INVALID_ELEMENT -13 + +/* Miscelaneous API Functions */ + +// Frees opaque data +void spnegoFreeData( SPNEGO_TOKEN_HANDLE hSpnegoToken ); + +// Initializes SPNEGO_TOKEN structure from DER encoded binary data +int spnegoInitFromBinary( unsigned char* pbTokenData, unsigned long ulLength, SPNEGO_TOKEN_HANDLE* phSpnegoToken ); + +// Initializes SPNEGO_TOKEN structure for a NegTokenInit type using the +// supplied parameters +int spnegoCreateNegTokenInit( SPNEGO_MECH_OID MechType, + unsigned char ucContextFlags, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechTokenMIC, + unsigned long ulMechTokenMIC, SPNEGO_TOKEN_HANDLE* phSpnegoToken ); + +// Initializes SPNEGO_TOKEN structure for a NegTokenTarg type using the +// supplied parameters +int spnegoCreateNegTokenTarg( SPNEGO_MECH_OID MechType, + SPNEGO_NEGRESULT spnegoNegResult, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, SPNEGO_TOKEN_HANDLE* phSpnegoToken ); + +// Copies binary representation of SPNEGO Data into user supplied buffer +int spnegoTokenGetBinary( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbTokenData, + unsigned long * pulDataLen ); + +// Returns SPNEGO Token Type +int spnegoGetTokenType( SPNEGO_TOKEN_HANDLE hSpnegoToken, int * piTokenType ); + +/* Reading an Init Token */ + +// Returns the Initial Mech Type in the MechList element in the NegInitToken. +int spnegoIsMechTypeAvailable( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_MECH_OID MechOID, int * piMechTypeIndex ); + +// Returns the value from the context flags element in the NegInitToken as an unsigned long +int spnegoGetContextFlags( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pucContextFlags ); + +/* Reading a Response Token */ + +// Returns the value from the negResult element (Status code of GSS call - 0,1,2) +int spnegoGetNegotiationResult( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_NEGRESULT* pnegResult ); + +// Returns the Supported Mech Type from the NegTokenTarg. +int spnegoGetSupportedMechType( SPNEGO_TOKEN_HANDLE hSpnegoToken, SPNEGO_MECH_OID* pMechOID ); + +/* Reading either Token Type */ + +// Returns the actual Mechanism data from the token (this is what is passed into GSS-API functions +int spnegoGetMechToken( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbTokenData, unsigned long* pulDataLen ); + +// Returns the Message Integrity BLOB in the token +int spnegoGetMechListMIC( SPNEGO_TOKEN_HANDLE hSpnegoToken, unsigned char* pbMICData, unsigned long* pulDataLen ); + +// C++ Specific +#if defined(__cplusplus) +} +#endif +#ifdef DEBUG +#include + #define PRERR(...) fprintf(stderr, __VA_ARGS__) + #define LOG(x) PRERR x +#else + #define LOG(x) +#endif +#endif diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c Sun Jun 24 16:29:14 2007 @@ -0,0 +1,263 @@ +/* ----------------------------------------------------------------------------- + * spnegohelp.c defines RFC 2478 SPNEGO GSS-API mechanism APIs. + * + * Author: Frank Balluffi + * + * Copyright (C) 2002-2003 All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * ----------------------------------------------------------------------------- + */ + +#include "spnegohelp.h" +#include "spnego.h" + +#include + +int makeNegTokenTarg (const unsigned char * kerberosToken, + size_t kerberosTokenLength, + const unsigned char ** negTokenTarg, + size_t * negTokenTargLength) +{ + SPNEGO_TOKEN_HANDLE hSpnegoToken = NULL; + int rc1 = 1; + int rc2 = SPNEGO_E_SUCCESS; + + /* Check arguments. */ + + if (!kerberosToken || + !negTokenTarg || + !negTokenTargLength) + return 10; + + /* Does IIS reply with 1.2.840.48018.1.2.2 or 1.2.840.113554.1.2.2? */ + + /* Does IIS always reply with accept_completed? */ + + /* IIS does not include a MIC. */ + + rc2 = spnegoCreateNegTokenTarg (spnego_mech_oid_Kerberos_V5_Legacy, + spnego_negresult_success, + (unsigned char *) kerberosToken, + kerberosTokenLength, + NULL, + 0, + &hSpnegoToken); + + if (rc2 != SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+100; + goto cleanup; + } + + /* Get NegTokenTarg length. */ + + rc2 = spnegoTokenGetBinary (hSpnegoToken, + NULL, + (unsigned long*) negTokenTargLength); + + if (rc2 != SPNEGO_E_BUFFER_TOO_SMALL) + { + rc1 = abs(rc2)+200; + goto cleanup; + } + + *negTokenTarg = malloc (*negTokenTargLength); + + if (!*negTokenTarg) + { + rc1 = abs(rc2)+300; + goto cleanup; + } + + /* Get NegTokenTarg data. */ + + rc2 = spnegoTokenGetBinary (hSpnegoToken, + (unsigned char *) *negTokenTarg, + (unsigned long*) negTokenTargLength); + + + if (rc2 != SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+400; + goto error; + } + + rc1 = 0; + + goto cleanup; + +error: + + if (*negTokenTarg) + { + free ((unsigned char *) *negTokenTarg); + *negTokenTarg = NULL; + *negTokenTargLength = 0; + } + +cleanup: + + if (hSpnegoToken) + spnegoFreeData (hSpnegoToken); + + LOG(("makeNegTokenTarg returned %d\n",rc1)); + return rc1; +} + +int parseNegTokenInit (const unsigned char * negTokenInit, + size_t negTokenInitLength, + const unsigned char ** kerberosToken, + size_t * kerberosTokenLength) +{ + SPNEGO_TOKEN_HANDLE hSpnegoToken = NULL; + int pindex = -1; + int rc1 = 1; + int rc2 = SPNEGO_E_SUCCESS; + unsigned char reqFlags = 0; + int tokenType = 0; + + /* Check arguments. */ + + if (!negTokenInit || + !kerberosToken || + !kerberosTokenLength) + return 10; + + /* Decode SPNEGO token. */ + + rc2 = spnegoInitFromBinary ((unsigned char *) negTokenInit, + negTokenInitLength, + &hSpnegoToken); + + if (rc2 != SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+100; + goto cleanup; + } + + /* Check for negTokenInit choice. */ + + rc2 = spnegoGetTokenType (hSpnegoToken, + &tokenType); + + if (rc2 != SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+200; + goto cleanup; + } + + if (tokenType != SPNEGO_TOKEN_INIT) + { + rc1 = abs(rc2)+300; + goto cleanup; + } + + /* + Check that first mechType is 1.2.840.113554.1.2.2 or 1.2.840.48018.1.2.2. + */ + + /* + IE seems to reply with 1.2.840.48018.1.2.2 and then 1.2.840.113554.1.2.2. + */ + + rc2 = spnegoIsMechTypeAvailable (hSpnegoToken, + spnego_mech_oid_Kerberos_V5_Legacy, + &pindex); + + if (rc2 != SPNEGO_E_SUCCESS || + pindex != 0) + { + rc2 = spnegoIsMechTypeAvailable (hSpnegoToken, + spnego_mech_oid_Kerberos_V5, + &pindex); + + if (rc2 != SPNEGO_E_SUCCESS || + pindex != 0) + { + rc1 = abs(rc2)+400; + goto cleanup; + } + } + + /* Check for no reqFlags. */ + + /* Does IE ever send reqFlags? */ + + rc2 = spnegoGetContextFlags (hSpnegoToken, + &reqFlags); + + if (rc2 == SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+500; + goto cleanup; + } + + /* Get mechanism token length. */ + + rc2 = spnegoGetMechToken (hSpnegoToken, + NULL, + (unsigned long*) kerberosTokenLength); + + if (rc2 != SPNEGO_E_BUFFER_TOO_SMALL) + { + rc1 = abs(rc2)+600; + goto cleanup; + } + + *kerberosToken = malloc (*kerberosTokenLength); + + if (!*kerberosToken) + { + rc1 = abs(rc2)+700; + goto cleanup; + } + + /* Get mechanism token data. */ + + rc2 = spnegoGetMechToken (hSpnegoToken, + (unsigned char *) *kerberosToken, + (unsigned long*) kerberosTokenLength); + + if (rc2 != SPNEGO_E_SUCCESS) + { + rc1 = abs(rc2)+800; + goto error; + } + + /* According to Microsoft, IE does not send a MIC. */ + + rc1 = 0; + + goto cleanup; + +error: + + if (*kerberosToken) + { + free ((unsigned char *) *kerberosToken); + *kerberosToken = NULL; + *kerberosTokenLength = 0; + } + +cleanup: + + if (hSpnegoToken) + spnegoFreeData (hSpnegoToken); + + LOG(("parseNegTokenInit returned %d\n",rc1)); + return rc1; +} diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h Sat Jun 2 18:47:39 2007 @@ -0,0 +1,58 @@ +/* ----------------------------------------------------------------------------- + * spnegohelp.c declares RFC 2478 SPNEGO GSS-API mechanism APIs. + * + * Author: Frank Balluffi + * + * Copyright (C) 2002-2003. All rights reserved. + * ----------------------------------------------------------------------------- + */ + +#ifndef SPNEGOHELP_H +#define SPNEGOHELP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* ----------------------------------------------------------------------------- + * makeNegTokenTarg makes an RFC 2478 SPNEGO NegTokenTarg (token) from an + * RFC 1964 Kerberos GSS-API token. + * + * If makeNegTokenTarg is successful, call free (*negTokenTarg) to free the + * memory allocated by parseNegTokenInit. + * + * Returns 0 if successful, 1 otherwise. + * ----------------------------------------------------------------------------- + */ + +int makeNegTokenTarg (const unsigned char * kerberosToken, + size_t kerberosTokenLength, + const unsigned char ** negTokenTarg, + size_t * negTokenTargLength); + +/* ----------------------------------------------------------------------------- + * parseNegTokenInit parses an RFC 2478 SPNEGO NegTokenInit (token) to extract + * an RFC 1964 Kerberos GSS-API token. + * + * If the NegTokenInit does cotain a Kerberos GSS-API token, parseNegTokenInit + * returns an error. + * + * If parseNegTokenInit is successful, call free (*kerberosToken) to + * free the memory allocated by parseNegTokenInit. + * + * Returns 0 if successful, 1 otherwise. + * ----------------------------------------------------------------------------- + */ + +int parseNegTokenInit (const unsigned char * negTokenInit, + size_t negTokenInitLength, + const unsigned char ** kerberosToken, + size_t * kerberosTokenLength); + +#ifdef __cplusplus +} +#endif + +#endif /* SPNEGOHELP_H */ diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.c Sat Jun 2 18:47:39 2007 @@ -0,0 +1,1880 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + +///////////////////////////////////////////////////////////// +// +// SPNEGOPARSE.C +// +// SPNEGO Token Handler Source File +// +// Contains implementation of SPNEGO Token parsing functions. +// +///////////////////////////////////////////////////////////// + +#include +#include +#include +#include "spnego.h" +#include "derparse.h" +#include "spnegoparse.h" + +// +// Defined in DERPARSE.C +// + +extern MECH_OID g_stcMechOIDList []; + +/**********************************************************************/ +/** **/ +/** **/ +/** **/ +/** **/ +/** Local SPNEGO Helper definitions **/ +/** **/ +/** **/ +/** **/ +/** **/ +/**********************************************************************/ + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// CalculateMinSpnegoInitTokenSize +// +// Parameters: +// [in] nMechTokenLength - Length of the MechToken Element +// [in] nMechListMICLength - Length of the MechListMIC Element +// [in] mechOID - OID for MechList +// [in] nReqFlagsAvailable - Is ContextFlags element available +// [out] pnTokenSize - Filled out with total size of token +// [out] pnInternalTokenLength - Filled out with length minus length +// for initial token. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Calculates the required length for a SPNEGO NegTokenInit token based +// on the supplied variable length values and which elements are present. +// Note that because the lengths can be represented by an arbitrary +// number of bytes in DER encodings, we actually calculate the lengths +// backwards, so we always know how many bytes we will potentially be +// writing out. +// +//////////////////////////////////////////////////////////////////////////// + +int CalculateMinSpnegoInitTokenSize( long nMechTokenLength, + long nMechListMICLength, SPNEGO_MECH_OID mechOid, + int nReqFlagsAvailable, long* pnTokenSize, + long* pnInternalTokenLength ) +{ + int nReturn = SPNEGO_E_INVALID_LENGTH; + + // Start at 0. + long nTotalLength = 0; + long nTempLength= 0L; + + // We will calculate this by walking the token backwards + + // Start with MIC Element + if ( nMechListMICLength > 0L ) + { + nTempLength = ASNDerCalcElementLength( nMechListMICLength, NULL ); + + // Check for rollover error + if ( nTempLength < nMechListMICLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength += nTempLength; + } + + // Next is the MechToken + if ( nMechTokenLength > 0L ) + { + nTempLength += ASNDerCalcElementLength( nMechTokenLength, NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + } + + // Next is the ReqFlags + if ( nReqFlagsAvailable ) + { + nTempLength += ASNDerCalcElementLength( SPNEGO_NEGINIT_MAXLEN_REQFLAGS, NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + } + + // Next is the MechList - This is REQUIRED + nTempLength += ASNDerCalcMechListLength( mechOid, NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + + // Following four fields are the basic header tokens + + // Sequence Token + nTempLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + + // Neg Token Identifier Token + nTempLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + + // SPNEGO OID Token + nTempLength += g_stcMechOIDList[spnego_mech_oid_Spnego].iLen; + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + nTotalLength = nTempLength; + + // App Constructed Token + nTempLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenInitLength; + } + + // The internal length doesn't include the number of bytes + // for the initial token + *pnInternalTokenLength = nTotalLength; + nTotalLength = nTempLength; + + // We're done + *pnTokenSize = nTotalLength; + nReturn = SPNEGO_E_SUCCESS; + +xEndTokenInitLength: + + LOG(("CalculateMinSpnegoInitTokenSize returned %d\n",nReturn)); + return nReturn; + +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// CreateSpnegoInitToken +// +// Parameters: +// [in] MechType - OID in MechList +// [in] ucContextFlags - ContextFlags value +// [in] pbMechToken - Mech Token Binary Data +// [in] ulMechTokenLen - Length of Mech Token +// [in] pbMechListMIC - MechListMIC Binary Data +// [in] ulMechListMICn - Length of MechListMIC +// [out] pbTokenData - Buffer to write token into. +// [in] nTokenLength - Length of pbTokenData buffer +// [in] nInternalTokenLength - Length of full token without leading +// token bytes. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Uses DER to fill out pbTokenData with a SPNEGO NegTokenInit Token +// Note that because the lengths can be represented by an arbitrary +// number of bytes in DER encodings, we actually calculate the lengths +// backwards, so we always know how many bytes we will potentially be +// writing out. +// +//////////////////////////////////////////////////////////////////////////// + +int CreateSpnegoInitToken( SPNEGO_MECH_OID MechType, + unsigned char ucContextFlags, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, unsigned char* pbTokenData, + long nTokenLength, long nInternalTokenLength ) +{ + int nReturn = SPNEGO_E_INVALID_LENGTH; + + // Start at 0. + long nTempLength= 0L; + long nTotalBytesWritten = 0L; + long nInternalLength = 0L; + + unsigned char* pbWriteTokenData = pbTokenData + nTokenLength; + + // Temporary buffer to hold the REQ Flags as BIT String Data + unsigned char abTempReqFlags[SPNEGO_NEGINIT_MAXLEN_REQFLAGS]; + + + // We will write the token out backwards to properly handle the cases + // where the length bytes become adjustable + + // Start with MIC Element + if ( ulMechListMICLen > 0L ) + { + nTempLength = ASNDerCalcElementLength( ulMechListMICLen, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGINIT_ELEMENT_MECHLISTMIC, + OCTETSTRING, pbMechListMIC, ulMechListMICLen ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + } // IF MechListMIC is present + + // Next is the MechToken + if ( ulMechTokenLen > 0L ) + { + nTempLength = ASNDerCalcElementLength( ulMechTokenLen, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGINIT_ELEMENT_MECHTOKEN, + OCTETSTRING, pbMechToken, ulMechTokenLen ); + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + } // IF MechToken Length is present + + // Next is the ReqFlags + if ( ucContextFlags > 0L ) + { + + nTempLength = ASNDerCalcElementLength( SPNEGO_NEGINIT_MAXLEN_REQFLAGS, &nInternalLength ); + + // We need a byte that indicates how many bits difference between the number + // of bits used in final octet (we only have one) and the max (8) + + abTempReqFlags[0] = SPNEGO_NEGINIT_REQFLAGS_BITDIFF; + abTempReqFlags[1] = ucContextFlags; + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGINIT_ELEMENT_REQFLAGS, + BITSTRING, abTempReqFlags, SPNEGO_NEGINIT_MAXLEN_REQFLAGS ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + } // IF ContextFlags + + // Next is the MechList - This is REQUIRED + nTempLength = ASNDerCalcMechListLength( MechType, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteMechList( pbWriteTokenData, MechType ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + // The next tokens we're writing out reflect the total number of bytes + // we have actually written out. + + // Sequence Token + nTempLength = ASNDerCalcTokenLength( nTotalBytesWritten, 0L ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_CONSTRUCTED_SEQUENCE, + NULL, nTotalBytesWritten ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + // Neg Init Token Identifier Token + nTempLength = ASNDerCalcTokenLength( nTotalBytesWritten, 0L ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_NEGINIT_TOKEN_IDENTIFIER, + NULL, nTotalBytesWritten ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + // SPNEGO OID Token + nTempLength = g_stcMechOIDList[spnego_mech_oid_Spnego].iLen; + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteOID( pbWriteTokenData, spnego_mech_oid_Spnego ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenInit; + } + + // App Constructed Token + nTempLength = ASNDerCalcTokenLength( nTotalBytesWritten, 0L ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_NEGINIT_APP_CONSTRUCT, + NULL, nTotalBytesWritten ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + + // Don't adjust the internal token length here, it doesn't account + // the initial bytes written out (we really don't need to keep + // a running count here, but for debugging, it helps to be able + // to see the total number of bytes written out as well as the + // number of bytes left to write). + + if ( nTotalBytesWritten == nTokenLength && nInternalTokenLength == 0 && + pbWriteTokenData == pbTokenData ) + { + nReturn = SPNEGO_E_SUCCESS; + } + +xEndWriteNegTokenInit: + + LOG(("CreateSpnegoInitToken returned %d\n",nReturn)); + return nReturn; + +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// CalculateMinSpnegoTargTokenSize +// +// Parameters: +// [in] MechType - Supported MechType +// [in] spnegoNegResult - Neg Result +// [in] nMechTokenLength - Length of the MechToken Element +// [in] nMechListMICLength - Length of the MechListMIC Element +// [out] pnTokenSize - Filled out with total size of token +// [out] pnInternalTokenLength - Filled out with length minus length +// for initial token. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Calculates the required length for a SPNEGO NegTokenTarg token based +// on the supplied variable length values and which elements are present. +// Note that because the lengths can be represented by an arbitrary +// number of bytes in DER encodings, we actually calculate the lengths +// backwards, so we always know how many bytes we will potentially be +// writing out. +// +//////////////////////////////////////////////////////////////////////////// + +int CalculateMinSpnegoTargTokenSize( SPNEGO_MECH_OID MechType, + SPNEGO_NEGRESULT spnegoNegResult, long nMechTokenLen, + long nMechListMICLen, long* pnTokenSize, + long* pnInternalTokenLength ) +{ + int nReturn = SPNEGO_E_INVALID_LENGTH; + + // Start at 0. + long nTotalLength = 0; + long nTempLength= 0L; + + // We will calculate this by walking the token backwards + + // Start with MIC Element + if ( nMechListMICLen > 0L ) + { + nTempLength = ASNDerCalcElementLength( nMechListMICLen, NULL ); + + // Check for rollover error + if ( nTempLength < nMechListMICLen ) + { + goto xEndTokenTargLength; + } + + nTotalLength += nTempLength; + } + + // Next is the MechToken + if ( nMechTokenLen > 0L ) + { + nTempLength += ASNDerCalcElementLength( nMechTokenLen, NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenTargLength; + } + + nTotalLength = nTempLength; + } + + // Supported MechType + if ( spnego_mech_oid_NotUsed != MechType ) + { + // Supported MechOID element - we use the token function since + // we already know the size of the OID token and value + nTempLength += ASNDerCalcElementLength( g_stcMechOIDList[MechType].iActualDataLen, + NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenTargLength; + } + + nTotalLength = nTempLength; + + } // IF MechType is available + + // NegResult Element + if ( spnego_negresult_NotUsed != spnegoNegResult ) + { + nTempLength += ASNDerCalcElementLength( SPNEGO_NEGTARG_MAXLEN_NEGRESULT, NULL ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenTargLength; + } + + nTotalLength = nTempLength; + + } // IF negResult is available + + // Following two fields are the basic header tokens + + // Sequence Token + nTempLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenTargLength; + } + + nTotalLength = nTempLength; + + // Neg Token Identifier Token + nTempLength += ASNDerCalcTokenLength( nTotalLength, 0L ); + + // Check for rollover error + if ( nTempLength < nTotalLength ) + { + goto xEndTokenTargLength; + } + + // The internal length doesn't include the number of bytes + // for the initial token + *pnInternalTokenLength = nTotalLength; + nTotalLength = nTempLength; + + // We're done + *pnTokenSize = nTotalLength; + nReturn = SPNEGO_E_SUCCESS; + +xEndTokenTargLength: + + LOG(("CalculateMinSpnegoTargTokenSize returned %d\n",nReturn)); + return nReturn; + +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// CreateSpnegoTargToken +// +// Parameters: +// [in] MechType - Supported MechType +// [in] eNegResult - NegResult value +// [in] pbMechToken - Mech Token Binary Data +// [in] ulMechTokenLen - Length of Mech Token +// [in] pbMechListMIC - MechListMIC Binary Data +// [in] ulMechListMICn - Length of MechListMIC +// [out] pbTokenData - Buffer to write token into. +// [in] nTokenLength - Length of pbTokenData buffer +// [in] nInternalTokenLength - Length of full token without leading +// token bytes. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Uses DER to fill out pbTokenData with a SPNEGO NegTokenTarg Token +// Note that because the lengths can be represented by an arbitrary +// number of bytes in DER encodings, we actually calculate the lengths +// backwards, so we always know how many bytes we will potentially be +// writing out. +// +//////////////////////////////////////////////////////////////////////////// + +int CreateSpnegoTargToken( SPNEGO_MECH_OID MechType, + SPNEGO_NEGRESULT eNegResult, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, unsigned char* pbTokenData, + long nTokenLength, long nInternalTokenLength ) +{ + int nReturn = SPNEGO_E_INVALID_LENGTH; + + // Start at 0. + long nTempLength= 0L; + long nTotalBytesWritten = 0L; + long nInternalLength = 0L; + + unsigned char ucTemp = 0; + + // We will write the token out backwards to properly handle the cases + // where the length bytes become adjustable, so the write location + // is initialized to point *just* past the end of the buffer. + + unsigned char* pbWriteTokenData = pbTokenData + nTokenLength; + + + // Start with MIC Element + if ( ulMechListMICLen > 0L ) + { + nTempLength = ASNDerCalcElementLength( ulMechListMICLen, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGTARG_ELEMENT_MECHLISTMIC, + OCTETSTRING, pbMechListMIC, ulMechListMICLen ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenTarg; + } + + } // IF MechListMIC is present + + // Next is the MechToken + if ( ulMechTokenLen > 0L ) + { + nTempLength = ASNDerCalcElementLength( ulMechTokenLen, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGTARG_ELEMENT_RESPONSETOKEN, + OCTETSTRING, pbMechToken, ulMechTokenLen ); + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenTarg; + } + + } // IF MechToken Length is present + + // Supported Mech Type + if ( spnego_mech_oid_NotUsed != MechType ) + { + + nTempLength = ASNDerCalcElementLength( g_stcMechOIDList[MechType].iActualDataLen, + &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_NEGTARG_ELEMENT_SUPPORTEDMECH, + g_stcMechOIDList[MechType].ucOid, + g_stcMechOIDList[MechType].iLen ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenTarg; + } + + } // IF MechType is present + + // Neg Result + // NegResult Element + if ( spnego_negresult_NotUsed != eNegResult ) + { + ucTemp = (unsigned char) eNegResult; + + nTempLength = ASNDerCalcElementLength( SPNEGO_NEGTARG_MAXLEN_NEGRESULT, &nInternalLength ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteElement( pbWriteTokenData, SPNEGO_NEGTARG_ELEMENT_NEGRESULT, + ENUMERATED, &ucTemp, SPNEGO_NEGTARG_MAXLEN_NEGRESULT ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenTarg; + } + + } // If eNegResult is available + + // The next tokens we're writing out reflect the total number of bytes + // we have actually written out. + + // Sequence Token + nTempLength = ASNDerCalcTokenLength( nTotalBytesWritten, 0L ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_CONSTRUCTED_SEQUENCE, + NULL, nTotalBytesWritten ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + nInternalTokenLength -= nTempLength; + + if ( nTotalBytesWritten > nTokenLength || nInternalTokenLength < 0 ) + { + goto xEndWriteNegTokenTarg; + } + + // Neg Targ Token Identifier Token + nTempLength = ASNDerCalcTokenLength( nTotalBytesWritten, 0L ); + + // Decrease the pbWriteTokenData, now we know the length and + // write it out. + pbWriteTokenData -= nTempLength; + nTempLength = ASNDerWriteToken( pbWriteTokenData, SPNEGO_NEGTARG_TOKEN_IDENTIFIER, + NULL, nTotalBytesWritten ); + + // Adjust Values and sanity check + nTotalBytesWritten += nTempLength; + + // Don't adjust the internal token length here, it doesn't account + // the initial bytes written out (we really don't need to keep + // a running count here, but for debugging, it helps to be able + // to see the total number of bytes written out as well as the + // number of bytes left to write). + + if ( nTotalBytesWritten == nTokenLength && nInternalTokenLength == 0 && + pbWriteTokenData == pbTokenData ) + { + nReturn = SPNEGO_E_SUCCESS; + } + + +xEndWriteNegTokenTarg: + + LOG(("CreateSpnegoTargToken returned %d\n",nReturn)); + return nReturn; + + +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// AllocEmptySpnegoToken +// +// Parameters: +// [in] ucCopyData - Flag to copy data or pointer. +// [in] ulFlags - Flags for SPNEGO_TOKEN data member. +// [in] pbTokenData - Binary token data. +// [in] ulTokenSize - Size of pbTokenData. +// +// Returns: +// SPNEGO_TOKEN* Success - Pointer to initialized SPNEGO_TOKEN struct +// Failure - NULL +// +// Comments : +// Allocates a SPNEGO_TOKEN data structure and initializes it. Based on +// the value of ucCopyData, if non-zero, we copy the data into a buffer +// we allocate in this function, otherwise, we copy the data pointer +// direcly. +// +//////////////////////////////////////////////////////////////////////////// + +SPNEGO_TOKEN* AllocEmptySpnegoToken( unsigned char ucCopyData, unsigned long ulFlags, + unsigned char * pbTokenData, unsigned long ulTokenSize ) +{ + SPNEGO_TOKEN* pSpnegoToken = (SPNEGO_TOKEN*) calloc( 1, sizeof(SPNEGO_TOKEN) ); + + if ( NULL != pSpnegoToken ) + { + // Set the token size + pSpnegoToken->nStructSize = SPNEGO_TOKEN_SIZE; + + // Initialize the element array + InitSpnegoTokenElementArray( pSpnegoToken ); + + // Assign the flags value + pSpnegoToken->ulFlags = ulFlags; + + // + // IF ucCopyData is TRUE, we will allocate a buffer and copy data into it. + // Otherwise, we will just copy the pointer and the length. This is so we + // can cut out additional allocations for performance reasons + // + + if ( SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA == ucCopyData ) + { + // Alloc the internal buffer. Cleanup on failure. + pSpnegoToken->pbBinaryData = (unsigned char*) calloc( ulTokenSize, sizeof(unsigned char) ); + + if ( NULL != pSpnegoToken->pbBinaryData ) + { + // We must ALWAYS free this buffer + pSpnegoToken->ulFlags |= SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA; + + // Copy the data locally + memcpy( pSpnegoToken->pbBinaryData, pbTokenData, ulTokenSize ); + pSpnegoToken->ulBinaryDataLen = ulTokenSize; + } + else + { + free( pSpnegoToken ); + pSpnegoToken = NULL; + } + + } // IF ucCopyData + else + { + // Copy the pointer and the length directly - ulFlags will control whether or not + // we are allowed to free the value + + pSpnegoToken->pbBinaryData = pbTokenData; + pSpnegoToken->ulBinaryDataLen = ulTokenSize; + } + + } + + return pSpnegoToken; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// FreeSpnegoToken +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN to free. +// +// Returns: +// void +// +// Comments : +// If non-NULL, interprets pSpnegoToken, freeing any internal allocations +// and finally the actual structure. +// +//////////////////////////////////////////////////////////////////////////// + +void FreeSpnegoToken( SPNEGO_TOKEN* pSpnegoToken ) +{ + if ( NULL != pSpnegoToken ) + { + + // Cleanup internal allocation per the flags + if ( pSpnegoToken->ulFlags & SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA && + NULL != pSpnegoToken->pbBinaryData ) + { + free( pSpnegoToken->pbBinaryData ); + pSpnegoToken->pbBinaryData = NULL; + } + + free ( pSpnegoToken ); + } +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitSpnegoTokenElementArray +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN structure. +// +// Returns: +// void +// +// Comments : +// Initializes the element array data member of a SPNEGO_TOKEN data +// structure. +// +//////////////////////////////////////////////////////////////////////////// + +void InitSpnegoTokenElementArray( SPNEGO_TOKEN* pSpnegoToken ) +{ + int nCtr; + + // Set the number of elemnts + pSpnegoToken->nNumElements = MAX_NUM_TOKEN_ELEMENTS; + + // + // Initially, all elements are unavailable + // + + for ( nCtr = 0; nCtr < MAX_NUM_TOKEN_ELEMENTS; nCtr++ ) + { + // Set the element size as well + pSpnegoToken->aElementArray[ nCtr ].nStructSize = SPNEGO_ELEMENT_SIZE; + pSpnegoToken->aElementArray[ nCtr ].iElementPresent = SPNEGO_TOKEN_ELEMENT_UNAVAILABLE; + } + +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitSpnegoTokenType +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN structure. +// [out] pnTokenLength - Filled out with total token length +// [out] pnRemainingTokenLength - Filled out with remaining length +// after header is parsed +// [out] ppbFirstElement - Filled out with pointer to first +// element after header info. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Walks the underlying binary data for a SPNEGO_TOKEN data structure +// and determines the type of the underlying token based on token header +// information. +// +//////////////////////////////////////////////////////////////////////////// + +int InitSpnegoTokenType( SPNEGO_TOKEN* pSpnegoToken, long* pnTokenLength, + long* pnRemainingTokenLength, unsigned char** ppbFirstElement ) +{ + int nReturn = SPNEGO_E_INVALID_TOKEN; + long nActualTokenLength = 0L; + long nBoundaryLength = pSpnegoToken->ulBinaryDataLen; + unsigned char* pbTokenData = pSpnegoToken->pbBinaryData; + + // + // First byte MUST be either an APP_CONSTRUCT or the NEGTARG_TOKEN_TARG + // + + if ( SPNEGO_NEGINIT_APP_CONSTRUCT == *pbTokenData ) + { + // Validate the above token - this will tell us the actual length of the token + // per the encoding (minus the actual token bytes) + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_NEGINIT_APP_CONSTRUCT, 0L, nBoundaryLength, + pnTokenLength, &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Initialize the remaining token length value. This will be used + // to tell the caller how much token there is left once we've parsed + // the header (they could calculate it from the other values, but this + // is a bit friendlier) + *pnRemainingTokenLength = *pnTokenLength; + + // Make adjustments to next token + pbTokenData += nActualTokenLength; + nBoundaryLength -= nActualTokenLength; + + // The next token should be an OID + if ( ( nReturn = ASNDerCheckOID( pbTokenData, spnego_mech_oid_Spnego, nBoundaryLength, + &nActualTokenLength ) ) == SPNEGO_E_SUCCESS ) + { + // Make adjustments to next token + pbTokenData += nActualTokenLength; + nBoundaryLength -= nActualTokenLength; + *pnRemainingTokenLength -= nActualTokenLength; + + // The next token should specify the NegTokenInit + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_NEGINIT_TOKEN_IDENTIFIER, + *pnRemainingTokenLength, nBoundaryLength, pnTokenLength, + &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Make adjustments to next token + pbTokenData += nActualTokenLength; + nBoundaryLength -= nActualTokenLength; + *pnRemainingTokenLength -= nActualTokenLength; + + // The next token should specify the start of a sequence + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_CONSTRUCTED_SEQUENCE, + *pnRemainingTokenLength, nBoundaryLength, pnTokenLength, + &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // NegTokenInit header is now checked out! + + // Make adjustments to next token + *pnRemainingTokenLength -= nActualTokenLength; + + // Store pointer to first element + *ppbFirstElement = pbTokenData + nActualTokenLength; + pSpnegoToken->ucTokenType = SPNEGO_TOKEN_INIT; + } // IF Check Sequence Token + + } // IF Check NegTokenInit token + + + } // IF Check for SPNEGO OID + + + } // IF check app construct token + + } + else if ( SPNEGO_NEGTARG_TOKEN_IDENTIFIER == *pbTokenData ) + { + + // The next token should specify the NegTokenInit + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_NEGTARG_TOKEN_IDENTIFIER, + *pnRemainingTokenLength, nBoundaryLength, pnTokenLength, + &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Initialize the remaining token length value. This will be used + // to tell the caller how much token there is left once we've parsed + // the header (they could calculate it from the other values, but this + // is a bit friendlier) + *pnRemainingTokenLength = *pnTokenLength; + + // Make adjustments to next token + pbTokenData += nActualTokenLength; + nBoundaryLength -= nActualTokenLength; + + // The next token should specify the start of a sequence + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_CONSTRUCTED_SEQUENCE, + *pnRemainingTokenLength, nBoundaryLength, pnTokenLength, + &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // NegTokenInit header is now checked out! + + // Make adjustments to next token + *pnRemainingTokenLength -= nActualTokenLength; + + // Store pointer to first element + *ppbFirstElement = pbTokenData + nActualTokenLength; + pSpnegoToken->ucTokenType = SPNEGO_TOKEN_TARG; + } // IF Check Sequence Token + + } // IF Check NegTokenInit token + + } // ELSE IF it's a NegTokenTarg + + LOG(("InitSpnegoTokenType returned %d\n",nReturn)); + return nReturn; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// GetSpnegoInitTokenMechList +// +// Parameters: +// [in] pbTokenData - Points to binary MechList element +// in NegTokenInit. +// [in] nMechListLength - Length of the MechList +// [out] pSpnegoElement - Filled out with MechList Element +// data. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Checks that pbTokenData is pointing at something that at least +// *looks* like a MechList and then fills out the supplied +// SPNEGO_ELEMENT structure. +// +//////////////////////////////////////////////////////////////////////////// + +int GetSpnegoInitTokenMechList( unsigned char* pbTokenData, int nMechListLength, + SPNEGO_ELEMENT* pSpnegoElement ) +{ + int nReturn = SPNEGO_E_INVALID_TOKEN; + long nLength = 0L; + long nActualTokenLength = 0L; + + // Actual MechList is prepended by a Constructed Sequence Token + if ( ( nReturn = ASNDerCheckToken( pbTokenData, SPNEGO_CONSTRUCTED_SEQUENCE, + nMechListLength, nMechListLength, + &nLength, &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Adjust for this token + nMechListLength -= nActualTokenLength; + pbTokenData += nActualTokenLength; + + // Perform simple validation of the actual MechList (i.e. ensure that + // the OIDs in the MechList are reasonable). + + if ( ( nReturn = ValidateMechList( pbTokenData, nLength ) ) == SPNEGO_E_SUCCESS ) + { + // Initialize the element now + pSpnegoElement->eElementType = spnego_init_mechtypes; + pSpnegoElement->iElementPresent = SPNEGO_TOKEN_ELEMENT_AVAILABLE; + pSpnegoElement->type = SPNEGO_MECHLIST_TYPE; + pSpnegoElement->nDatalength = nLength; + pSpnegoElement->pbData = pbTokenData; + } + + } // IF Check Token + + LOG(("GetSpnegoInitTokenMechList returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitSpnegoTokenElementFromBasicType +// +// Parameters: +// [in] pbTokenData - Points to binary element data in +// a SPNEGO token. +// [in] nElementLength - Length of the element +// [in] ucExpectedType - Expected DER type. +// [in] spnegoElementType - Which element is this? +// [out] pSpnegoElement - Filled out with element data. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Checks that pbTokenData is pointing at the specified DER type. If so, +// then we verify that lengths are proper and then fill out the +// SPNEGO_ELEMENT data structure. +// +//////////////////////////////////////////////////////////////////////////// + +int InitSpnegoTokenElementFromBasicType( unsigned char* pbTokenData, int nElementLength, + unsigned char ucExpectedType, + SPNEGO_ELEMENT_TYPE spnegoElementType, + SPNEGO_ELEMENT* pSpnegoElement ) +{ + int nReturn = SPNEGO_E_UNEXPECTED_TYPE; + long nLength = 0L; + long nActualTokenLength = 0L; + + // The type BYTE must match our token data or something is badly wrong + if ( *pbTokenData == ucExpectedType ) + { + + // Check that we are pointing at the specified type + if ( ( nReturn = ASNDerCheckToken( pbTokenData, ucExpectedType, + nElementLength, nElementLength, + &nLength, &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Adjust for this token + nElementLength -= nActualTokenLength; + pbTokenData += nActualTokenLength; + + // Initialize the element now + pSpnegoElement->eElementType = spnegoElementType; + pSpnegoElement->iElementPresent = SPNEGO_TOKEN_ELEMENT_AVAILABLE; + pSpnegoElement->type = ucExpectedType; + pSpnegoElement->nDatalength = nLength; + pSpnegoElement->pbData = pbTokenData; + } + + } // IF type makes sense + + LOG(("InitSpnegoTokenElementFromBasicType returned %d\n",nReturn)); + return nReturn; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitSpnegoTokenElementFromOID +// +// Parameters: +// [in] pbTokenData - Points to binary element data in +// a SPNEGO token. +// [in] nElementLength - Length of the element +// [in] spnegoElementType - Which element is this? +// [out] pSpnegoElement - Filled out with element data. +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Initializes a SpnegoElement from an OID - normally, this would have +// used the Basic Type function above, but since we do binary compares +// on the OIDs against the DER information as well as the OID, we need +// to account for that. +// +//////////////////////////////////////////////////////////////////////////// + +int InitSpnegoTokenElementFromOID( unsigned char* pbTokenData, int nElementLength, + SPNEGO_ELEMENT_TYPE spnegoElementType, + SPNEGO_ELEMENT* pSpnegoElement ) +{ + int nReturn = SPNEGO_E_UNEXPECTED_TYPE; + long nLength = 0L; + long nActualTokenLength = 0L; + + // The type BYTE must match our token data or something is badly wrong + if ( *pbTokenData == OID ) + { + + // Check that we are pointing at an OID type + if ( ( nReturn = ASNDerCheckToken( pbTokenData, OID, + nElementLength, nElementLength, + &nLength, &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + // Don't adjust any values for this function + + // Initialize the element now + pSpnegoElement->eElementType = spnegoElementType; + pSpnegoElement->iElementPresent = SPNEGO_TOKEN_ELEMENT_AVAILABLE; + pSpnegoElement->type = OID; + pSpnegoElement->nDatalength = nElementLength; + pSpnegoElement->pbData = pbTokenData; + } + + } // IF type makes sense + + LOG(("InitSpnegoTokenElementFromBasicType returned %d\n",nReturn)); + return nReturn; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitSpnegoTokenElements +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN struct +// [in] pbTokenData - Points to initial binary element +// data in a SPNEGO token. +// [in] nRemainingTokenLength - Length remaining past header +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Interprets the data at pbTokenData based on the TokenType in +// pSpnegoToken. Since some elements are optional (technically all are +// but the token becomes quite useless if this is so), we check if +// an element exists before filling out the element in the array. +// +//////////////////////////////////////////////////////////////////////////// + +int InitSpnegoTokenElements( SPNEGO_TOKEN* pSpnegoToken, unsigned char* pbTokenData, + long nRemainingTokenLength ) +{ + // + // The following arrays contain the token identifiers for the elements + // comprising the actual token. All values are optional, and there are + // no defaults. + // + + static unsigned char abNegTokenInitElements[] = + { SPNEGO_NEGINIT_ELEMENT_MECHTYPES, SPNEGO_NEGINIT_ELEMENT_REQFLAGS, + SPNEGO_NEGINIT_ELEMENT_MECHTOKEN, SPNEGO_NEGINIT_ELEMENT_MECHLISTMIC }; + + static unsigned char abNegTokenTargElements[] = + { SPNEGO_NEGTARG_ELEMENT_NEGRESULT, SPNEGO_NEGTARG_ELEMENT_SUPPORTEDMECH, + SPNEGO_NEGTARG_ELEMENT_RESPONSETOKEN, SPNEGO_NEGTARG_ELEMENT_MECHLISTMIC }; + + int nReturn = SPNEGO_E_SUCCESS; + int nCtr = 0L; + long nElementLength = 0L; + long nActualTokenLength = 0L; + unsigned char* pbElements = NULL; + + // Point to the correct array + switch( pSpnegoToken->ucTokenType ) + { + case SPNEGO_TOKEN_INIT: + { + pbElements = abNegTokenInitElements; + } + break; + + case SPNEGO_TOKEN_TARG: + { + pbElements = abNegTokenTargElements; + } + break; + + } // SWITCH tokentype + + // + // Enumerate the element arrays and look for the tokens at our current location + // + + for ( nCtr = 0L; + SPNEGO_E_SUCCESS == nReturn && + nCtr < MAX_NUM_TOKEN_ELEMENTS && + nRemainingTokenLength > 0L; + nCtr++ ) + { + + // Check if the token exists + if ( ( nReturn = ASNDerCheckToken( pbTokenData, pbElements[nCtr], + 0L, nRemainingTokenLength, + &nElementLength, &nActualTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + + // Token data should skip over the sequence token and then + // call the appropriate function to initialize the element + pbTokenData += nActualTokenLength; + + // Lengths in the elements should NOT go beyond the element + // length + + // Different tokens mean different elements + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + + // Handle each element as appropriate + switch( pbElements[nCtr] ) + { + + case SPNEGO_NEGINIT_ELEMENT_MECHTYPES: + { + // + // This is a Mech List that specifies which OIDs the + // originator of the Init Token supports. + // + + nReturn = GetSpnegoInitTokenMechList( pbTokenData, nElementLength, + &pSpnegoToken->aElementArray[nCtr] ); + + } + break; + + case SPNEGO_NEGINIT_ELEMENT_REQFLAGS: + { + // + // This is a BITSTRING which specifies the flags that the receiver + // pass to the gss_accept_sec_context() function. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + BITSTRING, spnego_init_reqFlags, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + case SPNEGO_NEGINIT_ELEMENT_MECHTOKEN: + { + // + // This is an OCTETSTRING which contains a GSSAPI token corresponding + // to the first OID in the MechList. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + OCTETSTRING, spnego_init_mechToken, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + case SPNEGO_NEGINIT_ELEMENT_MECHLISTMIC: + { + // + // This is an OCTETSTRING which contains a message integrity BLOB. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + OCTETSTRING, spnego_init_mechListMIC, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + } // SWITCH Element + } + else + { + + switch( pbElements[nCtr] ) + { + + case SPNEGO_NEGTARG_ELEMENT_NEGRESULT: + { + // + // This is an ENUMERATION which specifies result of the last GSS + // token negotiation call. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + ENUMERATED, spnego_targ_negResult, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + case SPNEGO_NEGTARG_ELEMENT_SUPPORTEDMECH: + { + // + // This is an OID which specifies a supported mechanism. + // + + nReturn = InitSpnegoTokenElementFromOID( pbTokenData, nElementLength, + spnego_targ_mechListMIC, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + case SPNEGO_NEGTARG_ELEMENT_RESPONSETOKEN: + { + // + // This is an OCTETSTRING which specifies results of the last GSS + // token negotiation call. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + OCTETSTRING, spnego_targ_responseToken, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + case SPNEGO_NEGTARG_ELEMENT_MECHLISTMIC: + { + // + // This is an OCTETSTRING which specifies a message integrity BLOB. + // + + nReturn = InitSpnegoTokenElementFromBasicType( pbTokenData, nElementLength, + OCTETSTRING, spnego_targ_mechListMIC, + &pSpnegoToken->aElementArray[nCtr] ); + } + break; + + } // SWITCH Element + + } // ELSE !NegTokenInit + + // Account for the entire token and following data + nRemainingTokenLength -= ( nActualTokenLength + nElementLength ); + + // Token data should skip past the element length now + pbTokenData += nElementLength; + + } // IF Token found + else if ( SPNEGO_E_TOKEN_NOT_FOUND == nReturn ) + { + // For now, this is a benign error (remember, all elements are optional, so + // if we don't find one, it's okay). + + nReturn = SPNEGO_E_SUCCESS; + } + + } // FOR enum elements + + // + // We should always run down to 0 remaining bytes in the token. If not, we've got + // a bad token. + // + + if ( SPNEGO_E_SUCCESS == nReturn && nRemainingTokenLength != 0L ) + { + nReturn = SPNEGO_E_INVALID_TOKEN; + } + + LOG(("InitSpnegoTokenElements returned %d\n",nReturn)); + return nReturn; +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// FindMechOIDInMechList +// +// Parameters: +// [in] pSpnegoElement - SPNEGO_ELEMENT for MechList +// [in] MechOID - OID we're looking for. +// [out] piMechTypeIndex - Index in the list where OID was +// found +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Walks the MechList for MechOID. When it is found, the index in the +// list is written to piMechTypeIndex. +// +//////////////////////////////////////////////////////////////////////////// + +int FindMechOIDInMechList( SPNEGO_ELEMENT* pSpnegoElement, SPNEGO_MECH_OID MechOID, + int * piMechTypeIndex ) +{ + int nReturn = SPNEGO_E_NOT_FOUND; + int nCtr = 0; + long nLength = 0L; + long nBoundaryLength = pSpnegoElement->nDatalength; + unsigned char* pbMechListData = pSpnegoElement->pbData; + + while( SPNEGO_E_SUCCESS != nReturn && nBoundaryLength > 0L ) + { + + // Use the helper function to check the OID + if ( ( nReturn = ASNDerCheckOID( pbMechListData, MechOID, nBoundaryLength, &nLength ) ) + == SPNEGO_E_SUCCESS ) + { + *piMechTypeIndex = nCtr; + } + + // Adjust for the current OID + pbMechListData += nLength; + nBoundaryLength -= nLength; + nCtr++; + + } // WHILE enuming OIDs + + LOG(("FindMechOIDInMechList returned %d\n",nReturn)); + return nReturn; + +} + + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// ValidateMechList +// +// Parameters: +// [in] pbMechListData - Pointer to binary MechList data +// [in] nBoundaryLength - Length we must not exceed +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Checks the data at pbMechListData to see if it looks like a MechList. +// As part of this, we walk the list and ensure that none of the OIDs +// have a length that takes us outside of nBoundaryLength. +// +//////////////////////////////////////////////////////////////////////////// + +int ValidateMechList( unsigned char* pbMechListData, long nBoundaryLength ) +{ + int nReturn = SPNEGO_E_SUCCESS; + long nLength = 0L; + long nTokenLength = 0L; + + while( SPNEGO_E_SUCCESS == nReturn && nBoundaryLength > 0L ) + { + // Verify that we have something that at least *looks* like an OID - in other + // words it has an OID identifier and specifies a length that doesn't go beyond + // the size of the list. + nReturn = ASNDerCheckToken( pbMechListData, OID, 0L, nBoundaryLength, + &nLength, &nTokenLength ); + + // Adjust for the current OID + pbMechListData += ( nLength + nTokenLength ); + nBoundaryLength -= ( nLength + nTokenLength ); + + } // WHILE enuming OIDs + + LOG(("ValidateMechList returned %d\n",nReturn)); + return nReturn; + +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// IsValidMechOid +// +// Parameters: +// [in] mechOid - mechOID id enumeration +// +// Returns: +// int Success - 1 +// Failure - 0 +// +// Comments : +// Checks for a valid mechOid value. +// +//////////////////////////////////////////////////////////////////////////// + +int IsValidMechOid( SPNEGO_MECH_OID mechOid ) +{ + LOG(("IsValidMechOid returned %d\n",mechOid >= spnego_mech_oid_Kerberos_V5_Legacy && + mechOid <= spnego_mech_oid_Spnego)); + return ( mechOid >= spnego_mech_oid_Kerberos_V5_Legacy && + mechOid <= spnego_mech_oid_Spnego ); +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// IsValidContextFlags +// +// Parameters: +// [in] ucContextFlags - ContextFlags value +// +// Returns: +// int Success - 1 +// Failure - 0 +// +// Comments : +// Checks for a valid ContextFlags value. +// +//////////////////////////////////////////////////////////////////////////// + +int IsValidContextFlags( unsigned char ucContextFlags ) +{ + // Mask out our valid bits. If there is anything leftover, this + // is not a valid value for Context Flags + LOG(("IsValidContextFlags returned %d\n",(( ucContextFlags & ~SPNEGO_NEGINIT_CONTEXT_MASK ) == 0))); + return ( ( ucContextFlags & ~SPNEGO_NEGINIT_CONTEXT_MASK ) == 0 ); +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// IsValidNegResult +// +// Parameters: +// [in] negResult - NegResult value +// +// Returns: +// int Success - 1 +// Failure - 0 +// +// Comments : +// Checks for a valid NegResult value. +// +//////////////////////////////////////////////////////////////////////////// + +int IsValidNegResult( SPNEGO_NEGRESULT negResult ) +{ + LOG(("IsValidNegResult returned %d\n",negResult >= spnego_negresult_success && + negResult <= spnego_negresult_rejected )); + return ( negResult >= spnego_negresult_success && + negResult <= spnego_negresult_rejected ); +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// IsValidSpnegoToken +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN data structure +// +// Returns: +// int Success - 1 +// Failure - 0 +// +// Comments : +// Performs simple heuristic on location pointed to by pSpnegoToken. +// +//////////////////////////////////////////////////////////////////////////// + +int IsValidSpnegoToken( SPNEGO_TOKEN* pSpnegoToken ) +{ + int nReturn = 0; + + // Parameter should be non-NULL + if ( NULL != pSpnegoToken ) + { + // Length should be at least the size defined in the header + if ( pSpnegoToken->nStructSize >= SPNEGO_TOKEN_SIZE ) + { + // Number of elements should be >= our maximum - if it's greater, that's + // okay, since we'll only be accessing the elements up to MAX_NUM_TOKEN_ELEMENTS + if ( pSpnegoToken->nNumElements >= MAX_NUM_TOKEN_ELEMENTS ) + { + // Check for proper token type + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType || + SPNEGO_TOKEN_TARG == pSpnegoToken->ucTokenType ) + { + nReturn = 1; + } + } + + } // IF struct size makes sense + + } // IF non-NULL spnego Token + + LOG(("IsValidSpnegoToken returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// IsValidSpnegoElement +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN data structure +// [in] spnegoElement - spnegoElement Type from enumeration +// +// Returns: +// int Success - 1 +// Failure - 0 +// +// Comments : +// Checks that spnegoElement has a valid value and is appropriate for +// the SPNEGO token encapsulated by pSpnegoToken. +// +//////////////////////////////////////////////////////////////////////////// + +int IsValidSpnegoElement( SPNEGO_TOKEN* pSpnegoToken,SPNEGO_ELEMENT_TYPE spnegoElement ) +{ + int nReturn = 0; + + // Check boundaries + if ( spnegoElement > spnego_element_min && + spnegoElement < spnego_element_max ) + { + + // Check for appropriateness to token type + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + nReturn = ( spnegoElement >= spnego_init_mechtypes && + spnegoElement <= spnego_init_mechListMIC ); + } + else + { + nReturn = ( spnegoElement >= spnego_targ_negResult && + spnegoElement <= spnego_targ_mechListMIC ); + } + + } // IF boundary conditions are met + + LOG(("IsValidSpnegoElement returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// CalculateElementArrayIndex +// +// Parameters: +// [in] pSpnegoToken - Points to SPNEGO_TOKEN data structure +// [in] spnegoElement - spnegoElement Type from enumeration +// +// Returns: +// int index in the SPNEGO_TOKEN element array that the element can +// can be found +// +// Comments : +// Based on the Token Type, calculates the index in the element array +// at which the specified element can be found. +// +//////////////////////////////////////////////////////////////////////////// + +int CalculateElementArrayIndex( SPNEGO_TOKEN* pSpnegoToken,SPNEGO_ELEMENT_TYPE spnegoElement ) +{ + int nReturn = 0; + + // Offset is difference between value and initial element identifier + // (these differ based on ucTokenType) + + if ( SPNEGO_TOKEN_INIT == pSpnegoToken->ucTokenType ) + { + nReturn = spnegoElement - spnego_init_mechtypes; + } + else + { + nReturn = spnegoElement - spnego_targ_negResult; + } + + LOG(("CalculateElementArrayIndex returned %d\n",nReturn)); + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// +// Function: +// InitTokenFromBinary +// +// Parameters: +// [in] ucCopyData - Flag indicating if data should be copied +// [in] ulFlags - Flags value for structure +// [in] pnTokenData - Binary Token Data +// [in] ulLength - Length of the data +// [out] ppSpnegoToken - Pointer to call allocated SPNEGO Token +// data structure +// +// Returns: +// int Success - SPNEGO_E_SUCCESS +// Failure - SPNEGO API Error code +// +// Comments : +// Allocates a SPNEGO_TOKEN data structure and fills it out as +// appropriate based in the flags passed into the function. +// +//////////////////////////////////////////////////////////////////////////// + + +// Initializes SPNEGO_TOKEN structure from DER encoded binary data +int InitTokenFromBinary( unsigned char ucCopyData, unsigned long ulFlags, + unsigned char* pbTokenData, unsigned long ulLength, + SPNEGO_TOKEN** ppSpnegoToken ) +{ + int nReturn = SPNEGO_E_INVALID_PARAMETER; + SPNEGO_TOKEN* pSpnegoToken = NULL; + unsigned char* pbFirstElement = NULL; + long nTokenLength = 0L; + long nRemainingTokenLength = 0L; + + // Basic Parameter Validation + + if ( NULL != pbTokenData && + NULL != ppSpnegoToken && + 0L != ulLength ) + { + + // + // Allocate the empty token, then initialize the data structure. + // + + pSpnegoToken = AllocEmptySpnegoToken( ucCopyData, ulFlags, pbTokenData, ulLength ); + + if ( NULL != pSpnegoToken ) + { + + // Copy the binary data locally + + + // Initialize the token type + if ( ( nReturn = InitSpnegoTokenType( pSpnegoToken, &nTokenLength, + &nRemainingTokenLength, &pbFirstElement ) ) + == SPNEGO_E_SUCCESS ) + { + + // Initialize the element array + if ( ( nReturn = InitSpnegoTokenElements( pSpnegoToken, pbFirstElement, + nRemainingTokenLength ) ) + == SPNEGO_E_SUCCESS ) + { + *ppSpnegoToken = pSpnegoToken; + } + + } // IF Init Token Type + + // Cleanup on error condition + if ( SPNEGO_E_SUCCESS != nReturn ) + { + spnegoFreeData( pSpnegoToken ); + } + + } + else + { + nReturn = SPNEGO_E_OUT_OF_MEMORY; + } + + } // IF Valid parameters + + + LOG(("InitTokenFromBinary returned %d\n",nReturn)); + return nReturn; +} diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.h squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.h --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.h Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.h Sat Jun 2 18:47:39 2007 @@ -0,0 +1,169 @@ +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" +// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +// OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY +// AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// +// Date - 10/08/2002 +// Author - Sanj Surati + +///////////////////////////////////////////////////////////// +// +// SPNEGOPARSE.H +// +// SPNEGO Token Parser Header File +// +// Contains the definitions required to properly parse a +// SPNEGO token using ASN.1 DER helpers. +// +///////////////////////////////////////////////////////////// + +#ifndef __SPNEGOPARSE_H__ +#define __SPNEGOPARSE_H__ + +// C++ Specific +#if defined(__cplusplus) +extern "C" +{ +#endif + +// Indicates if we copy data when creating a SPNEGO_TOKEN structure or not +#define SPNEGO_TOKEN_INTERNAL_COPYPTR 0 +#define SPNEGO_TOKEN_INTERNAL_COPYDATA 0x1 + +// Internal flag dictates whether or not we will free the binary data when +// the SPNEG_TOKEN structure is destroyed +#define SPNEGO_TOKEN_INTERNAL_FLAGS_FREEDATA 0x1 + + // +// Each SPNEGO Token Type can be broken down into a +// maximum of 4 separate elements. +// + +#define MAX_NUM_TOKEN_ELEMENTS 4 + +// +// Element offsets in the array +// + +// INIT elements +#define SPNEGO_INIT_MECHTYPES_ELEMENT 0 +#define SPNEGO_INIT_REQFLAGS_ELEMENT 1 +#define SPNEGO_INIT_MECHTOKEN_ELEMENT 2 +#define SPNEGO_INIT_MECHLISTMIC_ELEMENT 3 + +// Response elements +#define SPNEGO_TARG_NEGRESULT_ELEMENT 0 +#define SPNEGO_TARG_SUPPMECH_ELEMENT 1 +#define SPNEGO_TARG_RESPTOKEN_ELEMENT 2 +#define SPNEGO_TARG_MECHLISTMIC_ELEMENT 3 + +// +// Defines an individual SPNEGO Token Element. +// + +typedef struct SpnegoElement +{ + size_t nStructSize; // Size of the element structure + int iElementPresent; // Is the field present? Must be either + // SPNEGO_TOKEN_ELEMENT_UNAVAILABLE or + // SPNEGO_TOKEN_ELEMENT_AVAILABLE + + SPNEGO_ELEMENT_TYPE eElementType; // The Element Type + + unsigned char type; // Data Type + + unsigned char* pbData; // Points to actual Data + + unsigned long nDatalength; // Actual Data Length + +} SPNEGO_ELEMENT; + +// Structure size in case we later choose to extend the structure +#define SPNEGO_ELEMENT_SIZE sizeof(SPNEGO_ELEMENT) + +// +// Packages a SPNEGO Token Encoding. There are two types of +// encodings: NegTokenInit and NegTokenTarg. Each encoding can +// contain up to four distinct, optional elements. +// + +typedef struct SpnegoToken +{ + size_t nStructSize; // Size of the Token structure + unsigned long ulFlags; // Internal Structure Flags - Reserved! + int ucTokenType; // Token Type - Must be + // SPNEGO_TOKEN_INIT or + // SPNEGO_TOKEN_TARG + + unsigned char* pbBinaryData; // Points to binary token data + + unsigned long ulBinaryDataLen; // Length of the actual binary data + int nNumElements; // Number of elements + SPNEGO_ELEMENT aElementArray [MAX_NUM_TOKEN_ELEMENTS]; // Holds the elements for the token +} SPNEGO_TOKEN; + +// Structure size in case we later choose to extend the structure +#define SPNEGO_TOKEN_SIZE sizeof(SPNEGO_TOKEN) + +// +// Function definitions +// + +SPNEGO_TOKEN* AllocEmptySpnegoToken( unsigned char ucCopyData, unsigned long ulFlags, + unsigned char * pbTokenData, unsigned long ulTokenSize ); +void FreeSpnegoToken( SPNEGO_TOKEN* pSpnegoToken ); +void InitSpnegoTokenElementArray( SPNEGO_TOKEN* pSpnegoToken ); +int InitSpnegoTokenType( SPNEGO_TOKEN* pSpnegoToken, long* pnTokenLength, + long* pnRemainingTokenLength, unsigned char** ppbFirstElement ); +int InitSpnegoTokenElements( SPNEGO_TOKEN* pSpnegoToken, unsigned char* pbTokenData, + long nRemainingTokenLength ); +int GetSpnegoInitTokenMechList( unsigned char* pbTokenData, int nMechListLength, + SPNEGO_ELEMENT* pSpnegoElement ); +int InitSpnegoTokenElementFromBasicType( unsigned char* pbTokenData, int nElementLength, + unsigned char ucExpectedType, + SPNEGO_ELEMENT_TYPE spnegoElementType, + SPNEGO_ELEMENT* pSpnegoElement ); +int InitSpnegoTokenElementFromOID( unsigned char* pbTokenData, int nElementLength, + SPNEGO_ELEMENT_TYPE spnegoElementType, + SPNEGO_ELEMENT* pSpnegoElement ); +int FindMechOIDInMechList( SPNEGO_ELEMENT* pSpnegoElement, SPNEGO_MECH_OID MechOID, + int * piMechTypeIndex ); +int ValidateMechList( unsigned char* pbMechListData, long nBoundaryLength ); +int CalculateMinSpnegoInitTokenSize( long nMechTokenLength, long nMechListMICLength, + SPNEGO_MECH_OID mechOid, int nReqFlagsAvailable, + long* plTokenSize, long* plInternalLength ); +int CalculateMinSpnegoTargTokenSize( SPNEGO_MECH_OID MechType, SPNEGO_NEGRESULT spnegoNegResult, + long nMechTokenLen, + long nMechTokenMIC, long* pnTokenSize, + long* pnInternalTokenLength ); +int CreateSpnegoInitToken( SPNEGO_MECH_OID MechType, + unsigned char ucContextFlags, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, unsigned char* pbTokenData, + long nTokenLength, long nInternalTokenLength ); +int CreateSpnegoTargToken( SPNEGO_MECH_OID MechType, + SPNEGO_NEGRESULT eNegResult, unsigned char* pbMechToken, + unsigned long ulMechTokenLen, unsigned char* pbMechListMIC, + unsigned long ulMechListMICLen, unsigned char* pbTokenData, + long nTokenLength, long nInternalTokenLength ); +int IsValidMechOid( SPNEGO_MECH_OID mechOid ); +int IsValidContextFlags( unsigned char ucContextFlags ); +int IsValidNegResult( SPNEGO_NEGRESULT negResult ); +int IsValidSpnegoToken( SPNEGO_TOKEN* pSpnegoToken ); +int IsValidSpnegoElement( SPNEGO_TOKEN* pSpnegoToken,SPNEGO_ELEMENT_TYPE spnegoElement ); +int CalculateElementArrayIndex( SPNEGO_TOKEN* pSpnegoToken,SPNEGO_ELEMENT_TYPE spnegoElement ); +int InitTokenFromBinary( unsigned char ucCopyData, unsigned long ulFlags, + unsigned char* pbTokenData, unsigned long ulLength, + SPNEGO_TOKEN** ppSpnegoToken ); + + // C++ Specific +#if defined(__cplusplus) +} +#endif + +#endif + diff -ruN squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c --- squid-2.6.STABLE13/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c Sun Jun 24 16:29:14 2007 @@ -0,0 +1,515 @@ +/* + * ----------------------------------------------------------------------------- + * + * Author: Markus Moeller (markus_moeller at compuserve.com) + * + * Copyright (C) 2007 Markus Moeller. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * ----------------------------------------------------------------------------- + */ +/* + * Hosted at http://sourceforge.net/projects/squidkerbauth + */ +#include +#include +#include +#include +#include +#include +#include + +#include "base64.h" +#ifndef HAVE_SPNEGO +#include "spnegohelp.h" +#endif + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN HOST_NAME_MAX +#endif + +#define PROGRAM "squid_kerb_auth" + +#ifdef HEIMDAL +#include +#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE +#else +#include +#ifndef SOLARIS_11 +#include +#else +#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE +#endif +#endif + +#include +int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char* function, int debug, int loging); +char *gethost_name(void); +static const char *LogTime(void); + +static const unsigned char ntlmProtocol [] = {'N', 'T', 'L', 'M', 'S', 'S', 'P', 0}; + +static const char *LogTime() +{ + struct tm *tm; + struct timeval now; + static time_t last_t = 0; + static char buf[128]; + + gettimeofday(&now, NULL); + if (now.tv_sec != last_t) { + tm = localtime(&now.tv_sec); + strftime(buf, 127, "%Y/%m/%d %H:%M:%S", tm); + last_t = now.tv_sec; + } + return buf; +} + +char *gethost_name(void) { + char hostname[MAXHOSTNAMELEN]; + struct addrinfo *hres=NULL, *hres_list; + int rc,count; + + rc = gethostname(hostname,MAXHOSTNAMELEN); + if (rc) + { + fprintf(stderr, "%s| %s: error while resolving hostname '%s'\n", LogTime(), PROGRAM, hostname); + return NULL; + } + rc = getaddrinfo(hostname,NULL,NULL,&hres); + if (rc != 0) { + fprintf(stderr, "%s| %s: error while resolving hostname with getaddrinfo: %s\n", LogTime(), PROGRAM, gai_strerror(rc)); + return NULL; + } + hres_list=hres; + count=0; + while (hres_list) { + count++; + hres_list=hres_list->ai_next; + } + rc = getnameinfo (hres->ai_addr, hres->ai_addrlen,hostname, sizeof (hostname), NULL, 0, 0); + if (rc != 0) { + fprintf(stderr, "%s| %s: error while resolving ip address with getnameinfo: %s\n", LogTime(), PROGRAM, gai_strerror(rc)); + freeaddrinfo(hres); + return NULL ; + } + + freeaddrinfo(hres); + hostname[MAXHOSTNAMELEN]='\0'; + return(strdup(hostname)); +} + +int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char* function, int debug, int loging) { + if (GSS_ERROR(major_status)) { + OM_uint32 maj_stat,min_stat; + OM_uint32 msg_ctx = 0; + gss_buffer_desc status_string; + char buf[1024]; + size_t len; + + len = 0; + msg_ctx = 0; + while (!msg_ctx) { + /* convert major status code (GSS-API error) to text */ + maj_stat = gss_display_status(&min_stat, major_status, + GSS_C_GSS_CODE, + GSS_C_NULL_OID, + &msg_ctx, &status_string); + if (maj_stat == GSS_S_COMPLETE) { + if (sizeof(buf) > len + status_string.length + 1) { + sprintf(buf+len, "%s", (char*) status_string.value); + len += status_string.length; + } + gss_release_buffer(&min_stat, &status_string); + break; + } + gss_release_buffer(&min_stat, &status_string); + } + if (sizeof(buf) > len + 2) { + sprintf(buf+len, "%s", ". "); + len += 2; + } + msg_ctx = 0; + while (!msg_ctx) { + /* convert minor status code (underlying routine error) to text */ + maj_stat = gss_display_status(&min_stat, minor_status, + GSS_C_MECH_CODE, + GSS_C_NULL_OID, + &msg_ctx, &status_string); + if (maj_stat == GSS_S_COMPLETE) { + if (sizeof(buf) > len + status_string.length ) { + sprintf(buf+len, "%s", (char*) status_string.value); + len += status_string.length; + } + gss_release_buffer(&min_stat, &status_string); + break; + } + gss_release_buffer(&min_stat, &status_string); + } + if (debug) + fprintf(stderr, "%s| %s: %s failed: %s\n", LogTime(), PROGRAM, function, buf); + fprintf(stdout, "NA %s failed: %s\n",function, buf); + if (loging) + fprintf(stderr, "%s| %s: User not authenticated\n", LogTime(), PROGRAM); + return(1); + } + return(0); +} + + + +int main(int argc, char * const argv[]) +{ + char buf[6400]; + char *c; + int length=0; + static int err=0; + int opt, rc, debug=0, loging=0; + OM_uint32 ret_flags=0, spnego_flag=0; + char *service_name=(char *)"HTTP",*host_name=NULL; + char *token = NULL; + char *service_principal = NULL; + OM_uint32 major_status, minor_status; + gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; + gss_name_t client_name = GSS_C_NO_NAME; + gss_name_t server_name = GSS_C_NO_NAME; + gss_cred_id_t server_creds = GSS_C_NO_CREDENTIAL; + gss_cred_id_t delegated_cred = GSS_C_NO_CREDENTIAL; + gss_buffer_desc service = GSS_C_EMPTY_BUFFER; + gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; + gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; + const unsigned char *kerberosToken = NULL; + size_t kerberosTokenLength = 0; + const unsigned char *spnegoToken = NULL ; + size_t spnegoTokenLength = 0; + + setbuf(stdout,NULL); + setbuf(stdin,NULL); + + while (-1 != (opt = getopt(argc, argv, "dis:h"))) { + switch (opt) { + case 'd': + debug = 1; + break; + case 'i': + loging = 1; + break; + case 's': + service_principal = strdup(optarg); + break; + case 'h': + fprintf(stdout, "Usage: \n"); + fprintf(stdout, "squid_kerb_auth -d [-s SPN]\n"); + fprintf(stdout, "SPN = service principal name\n"); + fprintf(stdout, "Can be set to GSS_C_NO_NAME to allow any entry from keytab\n"); + fprintf(stdout, "default SPN is HTTP/fqdn@DEFAULT_REALM\n"); + break; + default: + fprintf(stderr, "%s| %s: unknown option: -%c.\n", LogTime(), PROGRAM, opt); + } + } + + if (service_principal && strcasecmp(service_principal,"GSS_C_NO_NAME") ) { + service.value = service_principal; + service.length = strlen((char *)service.value); + } else { + host_name=gethost_name(); + if ( !host_name ) { + fprintf(stderr, "%s| %s: Local hostname could not be determined. Please specify the service principal\n", LogTime(), PROGRAM); + exit(-1); + } + service.value = malloc(strlen(service_name)+strlen(host_name)+2); + snprintf(service.value,strlen(service_name)+strlen(host_name)+2,"%s@%s",service_name,host_name); + service.length = strlen((char *)service.value); + } + + while (1) { + if (fgets(buf, sizeof(buf)-1, stdin) == NULL) { + if (ferror(stdin)) { + if (debug) + fprintf(stderr, "%s| %s: fgets() failed! dying..... errno=%d (%s)\n", LogTime(), PROGRAM, ferror(stdin), + strerror(ferror(stdin))); + + exit(1); /* BIIG buffer */ + } + exit(0); + } + + c=memchr(buf,'\n',sizeof(buf)-1); + if (c) { + *c = '\0'; + length = c-buf; + } else { + err = 1; + } + if (err) { + if (debug) + fprintf(stderr, "%s| %s: Oversized message\n", LogTime(), PROGRAM); + fprintf(stdout, "NA Oversized message\n"); + err = 0; + continue; + } + + if (debug) + fprintf(stderr, "%s| %s: Got '%s' from squid (length: %d).\n", LogTime(), PROGRAM, buf?buf:"NULL",length); + + if (buf[0] == '\0') { + if (debug) + fprintf(stderr, "%s| %s: Invalid request\n", LogTime(), PROGRAM); + fprintf(stdout, "NA Invalid request\n"); + continue; + } + + if (strlen(buf) < 2) { + if (debug) + fprintf(stderr, "%s| %s: Invalid request [%s]\n", LogTime(), PROGRAM, buf); + fprintf(stdout, "NA Invalid request\n"); + continue; + } + + if ( !strncmp(buf, "QQ", 2) ) { + gss_release_buffer(&minor_status, &input_token); + gss_release_buffer(&minor_status, &output_token); + gss_release_buffer(&minor_status, &service); + gss_release_cred(&minor_status, &server_creds); + gss_release_cred(&minor_status, &delegated_cred); + gss_release_name(&minor_status, &server_name); + gss_release_name(&minor_status, &client_name); + gss_delete_sec_context(&minor_status, &gss_context, NULL); + if (kerberosToken) { + /* Allocated by parseNegTokenInit, but no matching free function exists.. */ + if (!spnego_flag) + free((char *)kerberosToken); + kerberosToken=NULL; + } + if (spnego_flag) { + /* Allocated by makeNegTokenTarg, but no matching free function exists.. */ + if (spnegoToken) + free((char *)spnegoToken); + spnegoToken=NULL; + } + if (token) { + free(token); + token=NULL; + } + if (host_name) { + free(host_name); + host_name=NULL; + } + exit(0); + } + + if ( !strncmp(buf, "YR", 2) && !strncmp(buf, "KK", 2) ) { + if (debug) + fprintf(stderr, "%s| %s: Invalid request [%s]\n", LogTime(), PROGRAM, buf); + fprintf(stdout, "NA Invalid request\n"); + continue; + } + if ( !strncmp(buf, "YR", 2) ){ + if (gss_context != GSS_C_NO_CONTEXT ) + gss_delete_sec_context(&minor_status, &gss_context, NULL); + gss_context = GSS_C_NO_CONTEXT; + } + + if (strlen(buf) <= 3) { + if (debug) + fprintf(stderr, "%s| %s: Invalid negotiate request [%s]\n", LogTime(), PROGRAM, buf); + fprintf(stdout, "NA Invalid negotiate request\n"); + continue; + } + + input_token.length = base64_decode_len(buf+3); + input_token.value = malloc(input_token.length); + + base64_decode(input_token.value,buf+3,input_token.length); + + +#ifndef HAVE_SPNEGO + if (( rc=parseNegTokenInit (input_token.value, + input_token.length, + &kerberosToken, + &kerberosTokenLength))!=0 ){ + if (debug) + fprintf(stderr, "%s| %s: parseNegTokenInit failed with rc=%d\n", LogTime(), PROGRAM, rc); + + /* if between 100 and 200 it might be a GSSAPI token and not a SPNEGO token */ + if ( rc < 100 || rc > 199 ) { + if (debug) + fprintf(stderr, "%s| %s: Invalid GSS-SPNEGO query [%s]\n", LogTime(), PROGRAM, buf); + fprintf(stdout, "NA Invalid GSS-SPNEGO query\n"); + goto cleanup; + } + if ((input_token.length >= sizeof ntlmProtocol + 1) && + (!memcmp (input_token.value, ntlmProtocol, sizeof ntlmProtocol))) { + if (debug) + fprintf(stderr, "%s| %s: received type %d NTLM token\n", LogTime(), PROGRAM, (int) *((unsigned char *)input_token.value + sizeof ntlmProtocol)); + fprintf(stdout, "NA received type %d NTLM token\n",(int) *((unsigned char *)input_token.value + sizeof ntlmProtocol)); + goto cleanup; + } + spnego_flag=0; + } else { + gss_release_buffer(&minor_status, &input_token); + input_token.length=kerberosTokenLength; + input_token.value=(void *)kerberosToken; + spnego_flag=1; + } +#else + if ((input_token.length >= sizeof ntlmProtocol + 1) && + (!memcmp (input_token.value, ntlmProtocol, sizeof ntlmProtocol))) { + if (debug) + fprintf(stderr, "%s| %s: received type %d NTLM token\n", LogTime(), PROGRAM, (int) *((unsigned char *)input_token.value + sizeof ntlmProtocol)); + fprintf(stdout, "NA received type %d NTLM token\n",(int) *((unsigned char *)input_token.value + sizeof ntlmProtocol)); + goto cleanup; + } +#endif + + if ( service_principal ) { + if ( strcasecmp(service_principal,"GSS_C_NO_NAME") ){ + major_status = gss_import_name(&minor_status, &service, + (gss_OID) GSS_C_NULL_OID, &server_name); + + } else { + server_name = GSS_C_NO_NAME; + major_status = GSS_S_COMPLETE; + } + } else { + major_status = gss_import_name(&minor_status, &service, + gss_nt_service_name, &server_name); + } + + if ( check_gss_err(major_status,minor_status,"gss_import_name()",debug,loging) ) + goto cleanup; + + major_status = gss_acquire_cred(&minor_status, server_name, GSS_C_INDEFINITE, + GSS_C_NO_OID_SET, GSS_C_ACCEPT, &server_creds, + NULL, NULL); + if (check_gss_err(major_status,minor_status,"gss_acquire_cred()",debug,loging) ) + goto cleanup; + + major_status = gss_accept_sec_context(&minor_status, + &gss_context, + server_creds, + &input_token, + GSS_C_NO_CHANNEL_BINDINGS, + &client_name, + NULL, + &output_token, + &ret_flags, + NULL, + &delegated_cred); + + + if (output_token.length) { +#ifndef HAVE_SPNEGO + if (spnego_flag) { + if ((rc=makeNegTokenTarg (output_token.value, + output_token.length, + &spnegoToken, + &spnegoTokenLength))!=0 ) { + if (debug) + fprintf(stderr, "%s| %s: makeNegTokenTarg failed with rc=%d\n", LogTime(), PROGRAM, rc); + fprintf(stdout, "NA makeNegTokenTarg failed with rc=%d\n",rc); + goto cleanup; + } + } else { + spnegoToken = output_token.value; + spnegoTokenLength = output_token.length; + } +#else + spnegoToken = output_token.value; + spnegoTokenLength = output_token.length; +#endif + token = malloc(base64_encode_len(spnegoTokenLength)); + if (token == NULL) { + if (debug) + fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), PROGRAM); + fprintf(stdout, "NA Not enough memory\n"); + goto cleanup; + } + + base64_encode(token,(const char *)spnegoToken,base64_encode_len(spnegoTokenLength),spnegoTokenLength); + + if (check_gss_err(major_status,minor_status,"gss_accept_sec_context()",debug,loging) ) + goto cleanup; + if (major_status & GSS_S_CONTINUE_NEEDED) { + if (debug) + fprintf(stderr, "%s| %s: continuation needed\n", LogTime(), PROGRAM); + fprintf(stdout, "TT %s\n",token); + goto cleanup; + } + gss_release_buffer(&minor_status, &output_token); + major_status = gss_display_name(&minor_status, client_name, &output_token, + NULL); + + if (check_gss_err(major_status,minor_status,"gss_display_name()",debug,loging) ) + goto cleanup; + fprintf(stdout, "AF %s %s\n",token,(char *)output_token.value); + if (debug) + fprintf(stderr, "%s| %s: AF %s %s\n", LogTime(), PROGRAM, token,(char *)output_token.value); + if (loging) + fprintf(stderr, "%s| %s: User %s authenticated\n", LogTime(), PROGRAM, (char *)output_token.value); + goto cleanup; + } else { + if (check_gss_err(major_status,minor_status,"gss_accept_sec_context()",debug,loging) ) + goto cleanup; + if (major_status & GSS_S_CONTINUE_NEEDED) { + if (debug) + fprintf(stderr, "%s| %s: continuation needed\n", LogTime(), PROGRAM); + fprintf(stdout, "NA No token to return to continue\n"); + goto cleanup; + } + gss_release_buffer(&minor_status, &output_token); + major_status = gss_display_name(&minor_status, client_name, &output_token, + NULL); + + if (check_gss_err(major_status,minor_status,"gss_display_name()",debug,loging) ) + goto cleanup; + /* + * Return dummy token AA. May need an extra return tag then AF + */ + fprintf(stdout, "AF %s %s\n","AA==",(char *)output_token.value); + if (debug) + fprintf(stderr, "%s| %s: AF %s %s\n", LogTime(), PROGRAM, "AA==", (char *)output_token.value); + if (loging) + fprintf(stderr, "%s| %s: User %s authenticated\n", LogTime(), PROGRAM, (char *)output_token.value); + +cleanup: + gss_release_buffer(&minor_status, &input_token); + gss_release_buffer(&minor_status, &output_token); + gss_release_cred(&minor_status, &server_creds); + gss_release_cred(&minor_status, &delegated_cred); + gss_release_name(&minor_status, &server_name); + gss_release_name(&minor_status, &client_name); + if (kerberosToken) { + /* Allocated by parseNegTokenInit, but no matching free function exists.. */ + if (!spnego_flag) + free((char *)kerberosToken); + kerberosToken=NULL; + } + if (spnego_flag) { + /* Allocated by makeNegTokenTarg, but no matching free function exists.. */ + if (spnegoToken) + free((char *)spnegoToken); + spnegoToken=NULL; + } + if (token) { + free(token); + token=NULL; + } + continue; + } + } +} diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/Makefile.in Sat Nov 4 16:19:59 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/Makefile.in Fri Jun 22 18:14:53 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.39 2006/11/04 23:19:59 hno Exp $ +# $Id: Makefile.in,v 1.39.2.1 2007/06/23 00:14:53 hno Exp $ # srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/SMB/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/SMB/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/SMB/Makefile.in Sat Nov 4 16:19:59 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/SMB/Makefile.in Fri Jun 22 18:14:53 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.38 2006/11/04 23:19:59 hno Exp $ +# $Id: Makefile.in,v 1.38.2.1 2007/06/23 00:14:53 hno Exp $ # srcdir = @srcdir@ @@ -199,6 +199,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/SMB/smbval/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/SMB/smbval/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/SMB/smbval/Makefile.in Sat Nov 4 16:20:00 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/SMB/smbval/Makefile.in Fri Jun 22 18:14:54 2007 @@ -187,6 +187,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/fakeauth/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/fakeauth/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/fakeauth/Makefile.in Sat Nov 4 16:20:00 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/fakeauth/Makefile.in Fri Jun 22 18:14:54 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.37 2006/11/04 23:20:00 hno Exp $ +# $Id: Makefile.in,v 1.37.2.1 2007/06/23 00:14:54 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -194,6 +194,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/fakeauth/fakeauth_auth.c squid-2.6.STABLE14/helpers/ntlm_auth/fakeauth/fakeauth_auth.c --- squid-2.6.STABLE13/helpers/ntlm_auth/fakeauth/fakeauth_auth.c Tue Aug 29 09:44:49 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/fakeauth/fakeauth_auth.c Sat Jun 2 18:40:30 2007 @@ -91,7 +91,7 @@ (unsigned int) (p - (unsigned char *) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/Makefile.in Sat Nov 4 16:20:01 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/Makefile.in Fri Jun 22 18:14:54 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.11 2006/11/04 23:20:01 hno Exp $ +# $Id: Makefile.in,v 1.11.2.1 2007/06/23 00:14:54 hno Exp $ # srcdir = @srcdir@ @@ -191,6 +191,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/libntlmssp.c squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/libntlmssp.c --- squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/libntlmssp.c Sun Sep 17 03:23:52 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/libntlmssp.c Sat Jun 2 18:40:30 2007 @@ -361,7 +361,7 @@ ((unsigned int) p - (unsigned int) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c --- squid-2.6.STABLE13/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c Sat May 27 02:58:30 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c Sat Jun 2 18:40:30 2007 @@ -87,7 +87,7 @@ { char *p = string, c; while ((c = *p)) { - *p = toupper(c); + *p = xtoupper(c); p++; } } @@ -98,7 +98,7 @@ { char *p = string, c; while ((c = *p)) { - *p = tolower(c); + *p = xtolower(c); p++; } } diff -ruN squid-2.6.STABLE13/helpers/ntlm_auth/no_check/Makefile.in squid-2.6.STABLE14/helpers/ntlm_auth/no_check/Makefile.in --- squid-2.6.STABLE13/helpers/ntlm_auth/no_check/Makefile.in Sat Nov 4 16:20:01 2006 +++ squid-2.6.STABLE14/helpers/ntlm_auth/no_check/Makefile.in Fri Jun 22 18:14:55 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.39 2006/11/04 23:20:01 hno Exp $ +# $Id: Makefile.in,v 1.39.2.1 2007/06/23 00:14:55 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -178,6 +178,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/icons/Makefile.in squid-2.6.STABLE14/icons/Makefile.in --- squid-2.6.STABLE13/icons/Makefile.in Sat Nov 4 16:20:02 2006 +++ squid-2.6.STABLE14/icons/Makefile.in Fri Jun 22 18:14:55 2007 @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.49 2006/11/04 23:20:02 hno Exp $ +# $Id: Makefile.in,v 1.49.2.1 2007/06/23 00:14:55 hno Exp $ # srcdir = @srcdir@ @@ -179,6 +179,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/include/autoconf.h.in squid-2.6.STABLE14/include/autoconf.h.in --- squid-2.6.STABLE13/include/autoconf.h.in Sat May 5 16:41:19 2007 +++ squid-2.6.STABLE14/include/autoconf.h.in Sat Jun 23 15:51:56 2007 @@ -663,16 +663,16 @@ /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT -/* Size of SIZEOF_INT16_T */ +/* The size of a `int16_t', as computed by sizeof. */ #undef SIZEOF_INT16_T -/* Size of SIZEOF_INT32_T */ +/* The size of a `int32_t', as computed by sizeof. */ #undef SIZEOF_INT32_T -/* Size of SIZEOF_INT64_T */ +/* The size of a `int64_t', as computed by sizeof. */ #undef SIZEOF_INT64_T -/* Size of SIZEOF_INT8_T */ +/* The size of a `int8_t', as computed by sizeof. */ #undef SIZEOF_INT8_T /* The size of a `long', as computed by sizeof. */ @@ -681,43 +681,43 @@ /* The size of a `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* Size of SIZEOF_OFF_T */ +/* The size of a `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT -/* Size of SIZEOF_SIZE_T */ +/* The size of a `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T -/* Size of SIZEOF_UINT16_T */ +/* The size of a `uint16_t', as computed by sizeof. */ #undef SIZEOF_UINT16_T -/* Size of SIZEOF_UINT32_T */ +/* The size of a `uint32_t', as computed by sizeof. */ #undef SIZEOF_UINT32_T -/* Size of SIZEOF_UINT64_T */ +/* The size of a `uint64_t', as computed by sizeof. */ #undef SIZEOF_UINT64_T -/* Size of SIZEOF_UINT8_T */ +/* The size of a `uint8_t', as computed by sizeof. */ #undef SIZEOF_UINT8_T -/* Size of SIZEOF_U_INT16_T */ +/* The size of a `u_int16_t', as computed by sizeof. */ #undef SIZEOF_U_INT16_T -/* Size of SIZEOF_U_INT32_T */ +/* The size of a `u_int32_t', as computed by sizeof. */ #undef SIZEOF_U_INT32_T -/* Size of SIZEOF_U_INT64_T */ +/* The size of a `u_int64_t', as computed by sizeof. */ #undef SIZEOF_U_INT64_T -/* Size of SIZEOF_U_INT8_T */ +/* The size of a `u_int8_t', as computed by sizeof. */ #undef SIZEOF_U_INT8_T /* The size of a `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P -/* Size of SIZEOF___INT64 */ +/* The size of a `__int64', as computed by sizeof. */ #undef SIZEOF___INT64 /* configure command line used to configure Squid */ @@ -849,7 +849,7 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const -/* Have int datatype */ +/* Define to 'int' if not defined */ #undef fd_mask /* Define to `__inline__' or `__inline' if that's what the C compiler @@ -858,31 +858,31 @@ #undef inline #endif -/* Have int datatype */ +/* Define to 'int' if not defined */ #undef int16_t -/* Have long datatype */ +/* Define to 'long' if not defined */ #undef int32_t -/* Have __int64 datatype */ +/* Define to '__int64' if not defined */ #undef int64_t -/* Have char datatype */ +/* Define to 'char' if not defined */ #undef int8_t -/* Have unsigned short datatype */ +/* Define to 'unsigned short' if not defined */ #undef mode_t /* message type for message queues */ #undef mtyp_t -/* Have int datatype */ +/* Define to 'int' if not defined */ #undef off_t -/* Have int datatype */ +/* Define to 'int' if not defined */ #undef pid_t -/* Have unsigned int datatype */ +/* Define to 'unsigned int' if not defined */ #undef size_t /* This makes warnings go away. If you have socklen_t defined in your @@ -890,29 +890,29 @@ defined to int. */ #undef socklen_t -/* Have int datatype */ +/* Define to 'int' if not defined */ #undef ssize_t -/* Have unsigned int datatype */ +/* Define to 'unsigned int' if not defined */ #undef u_int16_t -/* Have unsigned long datatype */ +/* Define to 'unsigned long' if not defined */ #undef u_int32_t -/* Have unsigned __int64 datatype */ +/* Define to 'unsigned __int64' if not defined */ #undef u_int64_t -/* Have unsigned char datatype */ +/* Define to 'unsigned char' if not defined */ #undef u_int8_t -/* Have unsigned int datatype */ +/* Define to 'unsigned int' if not defined */ #undef uint16_t -/* Have unsigned long datatype */ +/* Define to 'unsigned long' if not defined */ #undef uint32_t -/* Have unsigned __int64 datatype */ +/* Define to 'unsigned __int64' if not defined */ #undef uint64_t -/* Have unsigned char datatype */ +/* Define to 'unsigned char' if not defined */ #undef uint8_t diff -ruN squid-2.6.STABLE13/include/version.h squid-2.6.STABLE14/include/version.h --- squid-2.6.STABLE13/include/version.h Thu May 10 17:59:36 2007 +++ squid-2.6.STABLE14/include/version.h Sun Jul 15 08:21:59 2007 @@ -9,5 +9,5 @@ */ #ifndef SQUID_RELEASE_TIME -#define SQUID_RELEASE_TIME 1178841571 +#define SQUID_RELEASE_TIME 1184509316 #endif diff -ruN squid-2.6.STABLE13/lib/Makefile.in squid-2.6.STABLE14/lib/Makefile.in --- squid-2.6.STABLE13/lib/Makefile.in Sat Nov 4 16:20:02 2006 +++ squid-2.6.STABLE14/lib/Makefile.in Fri Jun 22 18:14:55 2007 @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.88 2006/11/04 23:20:02 hno Exp $ +# $Id: Makefile.in,v 1.88.2.1 2007/06/23 00:14:55 hno Exp $ # srcdir = @srcdir@ @@ -224,6 +224,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/lib/rfc1738.c squid-2.6.STABLE14/lib/rfc1738.c --- squid-2.6.STABLE13/lib/rfc1738.c Tue May 17 10:56:36 2005 +++ squid-2.6.STABLE14/lib/rfc1738.c Sat Jun 2 18:36:50 2007 @@ -1,5 +1,5 @@ /* - * $Id: rfc1738.c,v 1.24 2005/05/17 16:56:36 hno Exp $ + * $Id: rfc1738.c,v 1.24.2.1 2007/06/03 00:36:50 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -136,7 +136,7 @@ * allocated - KA */ if (do_escape == 1) { - (void) sprintf(q, "%%%02x", (unsigned char) *p); + (void) sprintf(q, "%%%02X", (unsigned char) *p); q += sizeof(char) * 2; } else { *q = *p; diff -ruN squid-2.6.STABLE13/lib/util.c squid-2.6.STABLE14/lib/util.c --- squid-2.6.STABLE13/lib/util.c Mon Sep 18 16:54:38 2006 +++ squid-2.6.STABLE14/lib/util.c Sat Jun 2 18:40:31 2007 @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.94 2006/09/18 22:54:38 hno Exp $ + * $Id: util.c,v 1.94.2.1 2007/06/03 00:40:31 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -643,7 +643,7 @@ { char *s = q; while (*s) { - *s = tolower((unsigned char) *s); + *s = xtolower(*s); s++; } } diff -ruN squid-2.6.STABLE13/lib/win32lib.c squid-2.6.STABLE14/lib/win32lib.c --- squid-2.6.STABLE13/lib/win32lib.c Sun Dec 10 06:36:24 2006 +++ squid-2.6.STABLE14/lib/win32lib.c Sat Jun 2 18:40:31 2007 @@ -1,6 +1,6 @@ /* - * $Id: win32lib.c,v 1.3 2006/12/10 13:36:24 serassio Exp $ + * $Id: win32lib.c,v 1.3.2.1 2007/06/03 00:40:31 hno Exp $ * * Windows support * AUTHOR: Guido Serassio @@ -117,7 +117,7 @@ s = nptr; do { c = *s++; - } while (isspace(c)); + } while (xisspace(c)); if (c == '-') { neg = 1; c = *s++; diff -ruN squid-2.6.STABLE13/scripts/Makefile.in squid-2.6.STABLE14/scripts/Makefile.in --- squid-2.6.STABLE13/scripts/Makefile.in Sat Nov 4 16:20:03 2006 +++ squid-2.6.STABLE14/scripts/Makefile.in Fri Jun 22 18:14:56 2007 @@ -176,6 +176,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/snmplib/Makefile.in squid-2.6.STABLE14/snmplib/Makefile.in --- squid-2.6.STABLE13/snmplib/Makefile.in Sat Nov 4 16:20:03 2006 +++ squid-2.6.STABLE14/snmplib/Makefile.in Fri Jun 22 18:14:56 2007 @@ -185,6 +185,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/snmplib/parse.c squid-2.6.STABLE14/snmplib/parse.c --- squid-2.6.STABLE13/snmplib/parse.c Fri Jun 2 11:32:44 2006 +++ squid-2.6.STABLE14/snmplib/parse.c Sat Jun 2 18:40:32 2007 @@ -490,7 +490,7 @@ *cp = 0; ch = last; /* skip all white space */ - while (isspace(ch) && ch != -1) { + while (xisspace(ch) && ch != -1) { ch = getc(fp); if (ch == '\n') Line++; @@ -506,10 +506,10 @@ do { if (ch == '\n') Line++; - if (isspace(ch) || ch == '(' || ch == ')' || + if (xisspace(ch) || ch == '(' || ch == ')' || ch == '{' || ch == '}' || ch == ',' || ch == '"') { - if (!isspace(ch) && *token == 0) { + if (!xisspace(ch) && *token == 0) { hash += ch; *cp++ = ch; last = ' '; diff -ruN squid-2.6.STABLE13/src/HttpHeaderTools.c squid-2.6.STABLE14/src/HttpHeaderTools.c --- squid-2.6.STABLE13/src/HttpHeaderTools.c Wed Jul 26 14:09:33 2006 +++ squid-2.6.STABLE14/src/HttpHeaderTools.c Sun Jul 15 03:52:17 2007 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.c,v 1.37 2006/07/26 20:09:33 hno Exp $ + * $Id: HttpHeaderTools.c,v 1.37.2.1 2007/07/15 09:52:17 hno Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -190,31 +190,17 @@ return 0; } -/* returns true iff "s" is a substring of a member of the list */ +/* returns true iff "s" is a substring of a member of the list, >1 if more than once */ int -strListIsSubstr(const String * list, const char *s, char del) +strIsSubstr(const String * list, const char *s) { - assert(list && del); - return strStr(*list, s) != 0; - - /* - * Note: the original code with a loop is broken because it uses strstr() - * instead of strnstr(). If 's' contains a 'del', strListIsSubstr() may - * return true when it should not. If 's' does not contain a 'del', the - * implementaion is equavalent to strstr()! Thus, we replace the loop with - * strstr() above until strnstr() is available. - */ - -#ifdef BROKEN_CODE - const char *pos = NULL; - const char *item; assert(list && s); - while (strListGetItem(list, del, &item, NULL, &pos)) { - if (strstr(item, s)) - return 1; - } - return 0; -#endif + const char *p = strStr(*list, s); + if (!p) + return 0; + if (strstr(p + 1, s) != NULL) + return 2; + return 1; } /* appends an item to the list */ diff -ruN squid-2.6.STABLE13/src/Makefile.am squid-2.6.STABLE14/src/Makefile.am --- squid-2.6.STABLE13/src/Makefile.am Sat May 5 16:06:55 2007 +++ squid-2.6.STABLE14/src/Makefile.am Fri Jun 22 06:07:35 2007 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.56.2.1 2007/05/05 22:06:55 hno Exp $ +# $Id: Makefile.am,v 1.56.2.2 2007/06/22 12:07:35 adrian Exp $ # # Uncomment and customize the following to suit your needs: # @@ -88,6 +88,9 @@ if USE_KQUEUE COMMLOOP_SOURCE = comm_kqueue.c endif +if USE_DEVPOLL +COMMLOOP_SOURCE = comm_devpoll.c +endif SUBDIRS = fs repl auth @@ -132,6 +135,7 @@ comm_select_win32.c \ comm_select_simple.c \ comm_kqueue.c \ + comm_devpoll.c \ comm_generic.c \ ipc.c \ ipc_win32.c \ diff -ruN squid-2.6.STABLE13/src/Makefile.in squid-2.6.STABLE14/src/Makefile.in --- squid-2.6.STABLE13/src/Makefile.in Sat May 5 16:06:55 2007 +++ squid-2.6.STABLE14/src/Makefile.in Fri Jun 22 18:14:56 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.281.2.1 2007/05/05 22:06:55 hno Exp $ +# $Id: Makefile.in,v 1.281.2.2 2007/06/23 00:14:56 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -83,8 +83,8 @@ pinger_DEPENDENCIES = am__squid_SOURCES_DIST = access_log.c acl.c asn.c authenticate.c \ cache_cf.c CacheDigest.c cache_manager.c carp.c cbdata.c \ - client_db.c client_side.c comm.c comm_epoll.c comm_kqueue.c \ - comm_poll.c comm_select_simple.c comm_select.c \ + client_db.c client_side.c comm.c comm_devpoll.c comm_epoll.c \ + comm_kqueue.c comm_poll.c comm_select_simple.c comm_select.c \ comm_select_win32.c debug.c defines.h delay_pools.c disk.c \ dns_internal.c dns.c enums.h errorpage.c event.c errormap.c \ external_acl.c fd.c filemap.c forward.c fqdncache.c ftp.c \ @@ -103,13 +103,14 @@ store_rebuild.c store_swapin.c store_swapmeta.c \ store_swapout.c structs.h tools.c typedefs.h unlinkd.c url.c \ urn.c useragent.c wais.c wccp.c wccp2.c whois.c win32.c -@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_FALSE@@USE_SELECT_SIMPLE_FALSE@@USE_SELECT_WIN32_TRUE@am__objects_1 = comm_select_win32.$(OBJEXT) -@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_SIMPLE_FALSE@@USE_SELECT_TRUE@am__objects_1 = comm_select.$(OBJEXT) -@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_SIMPLE_TRUE@am__objects_1 = comm_select_simple.$(OBJEXT) -@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_TRUE@am__objects_1 = comm_poll.$(OBJEXT) -@USE_EPOLL_FALSE@@USE_KQUEUE_TRUE@am__objects_1 = \ -@USE_EPOLL_FALSE@@USE_KQUEUE_TRUE@ comm_kqueue.$(OBJEXT) -@USE_EPOLL_TRUE@am__objects_1 = comm_epoll.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_FALSE@@USE_SELECT_SIMPLE_FALSE@@USE_SELECT_WIN32_TRUE@am__objects_1 = comm_select_win32.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_SIMPLE_FALSE@@USE_SELECT_TRUE@am__objects_1 = comm_select.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_FALSE@@USE_SELECT_SIMPLE_TRUE@am__objects_1 = comm_select_simple.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_FALSE@@USE_KQUEUE_FALSE@@USE_POLL_TRUE@am__objects_1 = comm_poll.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_FALSE@@USE_KQUEUE_TRUE@am__objects_1 = comm_kqueue.$(OBJEXT) +@USE_DEVPOLL_FALSE@@USE_EPOLL_TRUE@am__objects_1 = \ +@USE_DEVPOLL_FALSE@@USE_EPOLL_TRUE@ comm_epoll.$(OBJEXT) +@USE_DEVPOLL_TRUE@am__objects_1 = comm_devpoll.$(OBJEXT) @USE_DELAY_POOLS_TRUE@am__objects_2 = delay_pools.$(OBJEXT) @USE_DNSSERVER_FALSE@am__objects_3 = dns_internal.$(OBJEXT) @USE_DNSSERVER_TRUE@am__objects_3 = dns.$(OBJEXT) @@ -316,6 +317,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ @@ -400,6 +403,7 @@ @ENABLE_MINGW32SPECIFIC_TRUE@MINGWEXLIB = -lmingwex @ENABLE_MINGW32SPECIFIC_FALSE@IPC_SOURCE = ipc.c @ENABLE_MINGW32SPECIFIC_TRUE@IPC_SOURCE = ipc_win32.c +@USE_DEVPOLL_TRUE@COMMLOOP_SOURCE = comm_devpoll.c @USE_EPOLL_TRUE@COMMLOOP_SOURCE = comm_epoll.c @USE_KQUEUE_TRUE@COMMLOOP_SOURCE = comm_kqueue.c @USE_POLL_TRUE@COMMLOOP_SOURCE = comm_poll.c @@ -429,6 +433,7 @@ comm_select_win32.c \ comm_select_simple.c \ comm_kqueue.c \ + comm_devpoll.c \ comm_generic.c \ ipc.c \ ipc_win32.c \ @@ -769,6 +774,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client_db.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client_side.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm_devpoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm_epoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm_generic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comm_kqueue.Po@am__quote@ diff -ruN squid-2.6.STABLE13/src/access_log.c squid-2.6.STABLE14/src/access_log.c --- squid-2.6.STABLE13/src/access_log.c Sat Feb 3 14:59:24 2007 +++ squid-2.6.STABLE14/src/access_log.c Sat Jun 2 18:40:32 2007 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.95.2.1 2007/02/03 21:59:24 hno Exp $ + * $Id: access_log.c,v 1.95.2.2 2007/06/03 00:40:32 hno Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -799,7 +799,7 @@ lt->zero = 1; cur++; } - if (isdigit((int) *cur)) + if (xisdigit(*cur)) lt->width = strtol(cur, &cur, 10); if (*cur == '.') lt->precision = strtol(cur + 1, &cur, 10); diff -ruN squid-2.6.STABLE13/src/auth/Makefile.in squid-2.6.STABLE14/src/auth/Makefile.in --- squid-2.6.STABLE13/src/auth/Makefile.in Sat Nov 4 16:20:04 2006 +++ squid-2.6.STABLE14/src/auth/Makefile.in Fri Jun 22 18:14:58 2007 @@ -197,6 +197,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ @@ -259,7 +261,7 @@ # Makefile for authentication modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.38 2006/11/04 23:20:04 hno Exp $ +# $Id: Makefile.in,v 1.38.2.1 2007/06/23 00:14:58 hno Exp $ # AUTOMAKE_OPTIONS = subdir-objects EXTRA_LIBRARIES = libbasic.a libdigest.a libntlm.a libnegotiate.a diff -ruN squid-2.6.STABLE13/src/auth/negotiate/auth_negotiate.c squid-2.6.STABLE14/src/auth/negotiate/auth_negotiate.c --- squid-2.6.STABLE13/src/auth/negotiate/auth_negotiate.c Tue Feb 27 15:43:52 2007 +++ squid-2.6.STABLE14/src/auth/negotiate/auth_negotiate.c Sun Jul 15 07:57:02 2007 @@ -1,6 +1,6 @@ /* - * $Id: auth_negotiate.c,v 1.7.2.1 2007/02/27 22:43:52 hno Exp $ + * $Id: auth_negotiate.c,v 1.7.2.2 2007/07/15 13:57:02 hno Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins @@ -305,6 +305,8 @@ negotiate_request_t *negotiate_request; if (!negotiateConfig->authenticate) return; + if (!request->flags.proxy_keepalive && request->flags.must_keepalive) + return; /* New request, no user details */ if (auth_user_request == NULL) { debug(29, 9) ("authenticateNegotiateFixErrorHeader: Sending type:%d header: 'Negotiate'\n", type); @@ -698,6 +700,12 @@ if (!conn) { negotiate_request->auth_state = AUTHENTICATE_STATE_FAILED; debug(29, 1) ("authenticateNegotiateAuthenticateUser: attempt to perform authentication without a connection!\n"); + return; + } + if (!request->flags.proxy_keepalive) { + debug(29, 2) ("authenticateNegotiateAuthenticateUser: attempt to perform authentication without a persistent connection!\n"); + negotiate_request->auth_state = AUTHENTICATE_STATE_FAILED; + request->flags.must_keepalive = 1; return; } if (negotiate_request->waiting) { diff -ruN squid-2.6.STABLE13/src/auth/ntlm/auth_ntlm.c squid-2.6.STABLE14/src/auth/ntlm/auth_ntlm.c --- squid-2.6.STABLE13/src/auth/ntlm/auth_ntlm.c Tue Feb 27 15:43:52 2007 +++ squid-2.6.STABLE14/src/auth/ntlm/auth_ntlm.c Sun Jul 15 07:57:02 2007 @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.c,v 1.37.2.1 2007/02/27 22:43:52 hno Exp $ + * $Id: auth_ntlm.c,v 1.37.2.2 2007/07/15 13:57:02 hno Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins @@ -303,6 +303,8 @@ ntlm_request_t *ntlm_request; if (!ntlmConfig->authenticate) return; + if (!request->flags.proxy_keepalive && request->flags.must_keepalive) + return; /* New request, no user details */ if (auth_user_request == NULL) { debug(29, 9) ("authenticateNTLMFixErrorHeader: Sending type:%d header: 'NTLM'\n", type); @@ -657,6 +659,12 @@ if (!conn) { ntlm_request->auth_state = AUTHENTICATE_STATE_FAILED; debug(29, 1) ("authenticateNTLMAuthenticateUser: attempt to perform authentication without a connection!\n"); + return; + } + if (!request->flags.proxy_keepalive) { + debug(29, 2) ("authenticateNTLMAuthenticateUser: attempt to perform authentication without a persistent connection!\n"); + ntlm_request->auth_state = AUTHENTICATE_STATE_FAILED; + request->flags.must_keepalive = 1; return; } if (ntlm_request->waiting) { diff -ruN squid-2.6.STABLE13/src/cache_cf.c squid-2.6.STABLE14/src/cache_cf.c --- squid-2.6.STABLE13/src/cache_cf.c Mon Feb 26 15:45:24 2007 +++ squid-2.6.STABLE14/src/cache_cf.c Sat Jun 23 16:50:18 2007 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.463.2.1 2007/02/26 22:45:24 hno Exp $ + * $Id: cache_cf.c,v 1.463.2.3 2007/06/23 22:50:18 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -58,6 +58,8 @@ static void parse_cachedir_option_readonly(SwapDir * sd, const char *option, const char *value, int reconfiguring); static void dump_cachedir_option_readonly(StoreEntry * e, const char *option, SwapDir * sd); +static void parse_cachedir_option_minsize(SwapDir * sd, const char *option, const char *value, int reconfiguring); +static void dump_cachedir_option_minsize(StoreEntry * e, const char *option, SwapDir * sd); static void parse_cachedir_option_maxsize(SwapDir * sd, const char *option, const char *value, int reconfiguring); static void dump_cachedir_option_maxsize(StoreEntry * e, const char *option, SwapDir * sd); static void parse_logformat(logformat ** logformat_definitions); @@ -71,6 +73,7 @@ static struct cache_dir_option common_cachedir_options[] = { {"read-only", parse_cachedir_option_readonly, dump_cachedir_option_readonly}, + {"min-size", parse_cachedir_option_minsize, dump_cachedir_option_minsize}, {"max-size", parse_cachedir_option_maxsize, dump_cachedir_option_maxsize}, {NULL, NULL} }; @@ -1422,6 +1425,7 @@ sd = swap->swapDirs + swap->n_configured; sd->type = storefs_list[fs].typestr; /* defaults in case fs implementation fails to set these */ + sd->min_objsize = 0; sd->max_objsize = -1; sd->fs.blksize = 1024; /* parse the FS parameters and options */ @@ -1450,6 +1454,29 @@ } static void +parse_cachedir_option_minsize(SwapDir * sd, const char *option, const char *value, int reconfiguring) +{ + squid_off_t size; + + if (!value) + self_destruct(); + + size = strto_off_t(value, NULL, 10); + + if (reconfiguring && sd->min_objsize != size) + debug(3, 1) ("Cache dir '%s' min object size now %ld\n", sd->path, (long int) size); + + sd->min_objsize = size; +} + +static void +dump_cachedir_option_minsize(StoreEntry * e, const char *option, SwapDir * sd) +{ + if (sd->min_objsize != 0) + storeAppendPrintf(e, " %s=%ld", option, (long int) sd->min_objsize); +} + +static void parse_cachedir_option_maxsize(SwapDir * sd, const char *option, const char *value, int reconfiguring) { squid_off_t size; @@ -2280,7 +2307,7 @@ safe_free(*var); if (token == NULL) self_destruct(); - while (*token && isspace(*token)) + while (*token && xisspace(*token)) token++; if (!*token) self_destruct(); diff -ruN squid-2.6.STABLE13/src/cf.data.pre squid-2.6.STABLE14/src/cf.data.pre --- squid-2.6.STABLE13/src/cf.data.pre Tue Apr 24 15:30:03 2007 +++ squid-2.6.STABLE14/src/cf.data.pre Mon Jun 25 17:34:57 2007 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.382.2.2 2007/04/24 21:30:03 hno Exp $ +# $Id: cf.data.pre,v 1.382.2.7 2007/06/25 23:34:57 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -71,21 +71,15 @@ option. Most likely, you do not need to bind to a specific address, so you can use the port number alone. - The default port number is 3128. - If you are running Squid in accelerator mode, you probably want to listen on port 80 also, or instead. - The -a command line option will override the *first* port - number listed here. That option will NOT override an IP - address, however. - You may specify multiple socket addresses on multiple lines. - options are: + Options: transparent Support for transparent interception of - outgoing requests without browser settings + outgoing requests without browser settings. accel Accelerator mode. Also needs at least one of vhost/vport/defaultsite. @@ -93,21 +87,20 @@ defaultsite= Main web site name for accelerators. Implies accel. - vhost Accelerator using the Host header for + vhost Accelerator mode using the Host header for virtual domain support. Implies accel. vport Accelerator with IP based virtual host support. Implies accel. - vport= As above, but uses specified port number - rather than the http_port number. Implies accel. + vport=NN As above, but uses specified port number rather + than the http_port number. Implies accel. - urlgroup= Default urlgroup to mark requests - with (see also acl urlgroup and - url_rewrite_program) + urlgroup= Default urlgroup to mark requests with (see + also acl urlgroup and url_rewrite_program) - protocol= Protocol to reconstruct accelerated - requests with. Defaults to http. + protocol= Protocol to reconstruct accelerated requests with. + Defaults to http. no-connection-auth Prevent forwarding of Microsoft @@ -125,7 +118,7 @@ NOCOMMENT_START # Squid normally listens to port 3128 -http_port 3128 +http_port @DEFAULT_HTTP_PORT@ NOCOMMENT_END DOC_END @@ -155,16 +148,16 @@ defaultsite= The name of the https site presented on this port. Implies accel. - vhost Domain based virtual host support. Useful - in combination with a wildcard certificate or - other certificates valid for more than one domain. + vhost Accelerator mode using Host header for virtual + domain support. Requires a wildcard certificate + or other certificate valid for more than one domain. Implies accel. urlgroup= Default urlgroup to mark requests with (see also acl urlgroup and url_rewrite_program) - protocol= Protocol to reconstruct accelerated requests - with. Defaults to https. + protocol= Protocol to reconstruct accelerated requests with. + Defaults to https. cert= Path to SSL certificate (PEM format) @@ -213,7 +206,7 @@ Don't request client certificates immediately, but wait until acl processing requires a certificate (not yet implemented) - NO_DEFAULT_CA + NO_DEFAULT_CA Don't use the default CA lists built in to OpenSSL. NO_SESSION_REUSE @@ -301,6 +294,8 @@ LOC: Config.ssl_client.cafile TYPE: string DOC_START + file containing CA certificates to use when verifying server + certificates while proxying https:// URLs DOC_END NAME: sslproxy_capath @@ -309,6 +304,8 @@ LOC: Config.ssl_client.capath TYPE: string DOC_START + directory containing CA certificates to use when verifying + server certificates while proxying https:// URLs DOC_END NAME: sslproxy_flags @@ -317,6 +314,11 @@ LOC: Config.ssl_client.flags TYPE: string DOC_START + Various flags modifying the use of SSL while proxying https:// URLs: + DONT_VERIFY_PEER Accept certificates even if they fail to + verify. + NO_DEFAULT_CA Don't use the default CA list built in + to OpenSSL. DOC_END NAME: sslpassword_program @@ -352,7 +354,6 @@ "0". DOC_END - NAME: mcast_groups TYPE: wordlist LOC: Config.mcast_group_list @@ -380,7 +381,6 @@ By default, Squid doesn't listen on any multicast groups. DOC_END - NAME: udp_incoming_address TYPE: address LOC:Config.Addrs.udp_incoming @@ -580,7 +580,7 @@ cache as one participating in a CARP array. The 'f' values for all CARP parents must add up to 1.0. - + 'originserver' causes this parent peer to be contacted as a origin server. Meant to be used in accelerator setups. @@ -599,7 +599,7 @@ URL from the peer, and only consider the peer as alive if this monitoring is successful (default none) - use 'monitorsize=min[-max]' to limit the size range of + use 'monitorsize=min[-max]' to limit the size range of 'monitorurl' replies considered valid. Defaults to 0 to accept any size replies as valid. @@ -661,7 +661,7 @@ DONT_VERIFY_PEER Accept certificates even if they fail to verify. - NO_DEFAULT_CA + NO_DEFAULT_CA Don't use the default CA list built in to OpenSSL. @@ -718,7 +718,6 @@ section. DOC_END - NAME: neighbor_type_domain TYPE: hostdomaintype DEFAULT: none @@ -804,7 +803,6 @@ instead of to your parents. DOC_END - NAME: hierarchy_stoplist TYPE: wordlist DEFAULT: none @@ -821,7 +819,6 @@ NOCOMMENT_END DOC_END - NAME: cache no_cache TYPE: acl_access DEFAULT: none @@ -911,7 +908,6 @@ objects. DOC_END - NAME: cache_swap_low COMMENT: (percent, 0-100) TYPE: int @@ -1062,7 +1058,6 @@ See cache_replacement_policy for details. DOC_END - COMMENT_START LOGFILE PATHNAMES AND CACHE DIRECTORIES ----------------------------------------------------------------------------- @@ -1163,20 +1158,20 @@ current stripe. A value of "n" closer to 100 will cause COSS to waste less disk space by having multiple copies of an object on disk, but will increase the chances of overwriting a popular - object as COSS overwrites stripes. A value of "n" close to 0 + object as COSS overwrites stripes. A value of "n" close to 0 will cause COSS to keep all current objects in the current COSS stripe at the expense of the hit rate. The default value of 50 will allow any given object to be stored on disk a maximum of 2 times. - max-stripe-waste=n defines the maximum amount of space that COSS + max-stripe-waste=n defines the maximum amount of space that COSS will waste in a given stripe (in bytes). When COSS writes data to disk, it will potentially waste up to "max-size" worth of disk space for each 1MB of data written. If "max-size" is set to a large value (ie >256k), this could potentially result in large amounts of wasted disk space. Setting this value to a lower value (ie 64k or 32k) will result in a COSS disk refusing to cache - larger objects until the COSS stripe has been filled to within + larger objects until the COSS stripe has been filled to within "max-stripe-waste" of the maximum size (1MB). membufs=n defines the number of "memory-only" stripes that COSS @@ -1187,18 +1182,23 @@ number of memory-only buffers that COSS will use. The default value is 10, which will use a maximum of 10MB of memory for buffers. - maxfullbufs=n defines the maximum number of stripes a COSS partition + maxfullbufs=n defines the maximum number of stripes a COSS partition will have in memory waiting to be freed (either because the disk is - under load and the stripe is unwritten, or because clients are still - transferring data from objects using the memory). In order to try - and maintain a good hit rate under load, COSS will reserve the last - 2 full stripes for object hits. (ie a COSS cache_dir will reject + under load and the stripe is unwritten, or because clients are still + transferring data from objects using the memory). In order to try + and maintain a good hit rate under load, COSS will reserve the last + 2 full stripes for object hits. (ie a COSS cache_dir will reject new objects when the number of full stripes is 2 less than maxfullbufs) Common options: read-only, this cache_dir is read only. + min-size=n, refers to the min object size this storedir will accept. + It's used to restrict a storedir to only store large objects + (e.g. aufs) while other storedirs are optimized for smaller objects + (e.g. COSS). Defaults to 0. + max-size=n, refers to the max object size this storedir supports. It is used to initially choose the storedir to dump the object. Note: To make optimal use of the max-size limits you should order @@ -1221,7 +1221,7 @@ Defines an access log format. The is a string with embedded % format codes - + % format codes all follow the same basic structure where all but the formatcode is optional. Output strings are automatically escaped as required according to their context and the output format @@ -1229,7 +1229,7 @@ output format is desired. % ["|[|'|#] [-] [[0]width] [{argument}] formatcode - + " output in quoted string format [ output in squid text log format as used by log_mime_hdrs # output in URL quoted format @@ -1296,7 +1296,7 @@ must be defined in a logformat directive) those entries which match ALL the acl's specified (which must be defined in acl clauses). If no acl is specified, all requests will be logged to this file. - + To disable logging of a request use the filepath "none", in which case a logformat name should not be specified. @@ -1316,7 +1316,6 @@ logged to this file with the "debug_options" tag below. DOC_END - NAME: cache_store_log TYPE: string DEFAULT: @DEFAULT_STORE_LOG@ @@ -1329,8 +1328,7 @@ disable it. DOC_END - -NAME: cache_swap_log cache_swap_state +NAME: cache_swap_state cache_swap_log TYPE: string LOC: Config.Log.swap DEFAULT: none @@ -1364,7 +1362,6 @@ better to keep these log files in each 'cache_dir' directory. DOC_END - NAME: emulate_httpd_log COMMENT: on|off TYPE: onoff @@ -1399,7 +1396,6 @@ information if you do. DOC_END - NAME: log_mime_hdrs COMMENT: on|off TYPE: onoff @@ -1413,7 +1409,6 @@ formats). To enable this logging set log_mime_hdrs to 'on'. DOC_END - NAME: useragent_log TYPE: string LOC: Config.Log.useragent @@ -1425,7 +1420,6 @@ is disabled. DOC_END - NAME: referer_log referrer_log TYPE: string LOC: Config.Log.referer @@ -1439,7 +1433,6 @@ and we accept both. DOC_END - NAME: pid_filename TYPE: string DEFAULT: @DEFAULT_PID_FILE@ @@ -1448,7 +1441,6 @@ A filename to write the process-id to. To disable, enter "none". DOC_END - NAME: debug_options TYPE: eol DEFAULT: ALL,1 @@ -1462,7 +1454,6 @@ "ALL,1". DOC_END - NAME: log_fqdn COMMENT: on|off TYPE: onoff @@ -1476,7 +1467,6 @@ browsing. DOC_END - NAME: client_netmask TYPE: address LOC: Config.Addrs.client_netmask @@ -1488,7 +1478,6 @@ the last digit set to '0'. DOC_END - COMMENT_START OPTIONS FOR EXTERNAL SUPPORT PROGRAMS ----------------------------------------------------------------------------- @@ -1708,7 +1697,6 @@ Specify the location of the executable for the pinger process. DOC_END - NAME: url_rewrite_program redirect_program TYPE: programline LOC: Config.Program.url_rewrite.command @@ -1727,7 +1715,7 @@ The rewriter can also indicate that a client-side redirect should be performed to the new URL. This is done by prefixing the returned URL with "301:" (moved permanently) or 302: (moved temporarily). - + It can also return a "urlgroup" that can subsequently be matched in cache_peer_access and similar ACL driven rules. An urlgroup is returned by prefixing the returned url with "!urlgroup!" @@ -1831,7 +1819,6 @@ headers are sent. DOC_END - NAME: auth_param TYPE: authparam LOC: Config.authConfig @@ -1893,7 +1880,7 @@ auth_param basic program @DEFAULT_PREFIX@/libexec/ncsa_auth @DEFAULT_PREFIX@/etc/passwd "children" numberofchildren - The number of authenticator processes to spawn. If you start too few + The number of authenticator processes to spawn. If you start too few squid will have to wait for them to process a backlog of credential verifications, slowing it down. When credential verifications are done via a (slow) network you are likely to need lots of @@ -1959,9 +1946,8 @@ auth_param digest program @DEFAULT_PREFIX@/libexec/digest_auth_pw @DEFAULT_PREFIX@/etc/digpass - "children" numberofchildren - The number of authenticator processes to spawn. If you start too few + The number of authenticator processes to spawn. If you start too few squid will have to wait for them to process a backlog of credential verifications, slowing it down. When credential verifications are done via a (slow) network you are likely to need lots of @@ -2029,7 +2015,7 @@ auth_param ntlm program /path/to/samba/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp "children" numberofchildren - The number of authenticator processes to spawn. If you start too few + The number of authenticator processes to spawn. If you start too few squid will have to wait for them to process a backlog of credential verifications, slowing it down. When credential verifications are done via a (slow) network you are likely to need lots of @@ -2059,7 +2045,7 @@ auth_param negotiate program /path/to/samba/bin/ntlm_auth --helper-protocol=gss-spnego "children" numberofchildren - The number of authenticator processes to spawn. If you start too few + The number of authenticator processes to spawn. If you start too few squid will have to wait for them to process a backlog of credential verifications, slowing it down. When credential verifications are done via a (slow) network you are likely to need lots of @@ -2324,21 +2310,21 @@ ignore-no-cache ignores any ``Pragma: no-cache'' and ``Cache-control: no-cache'' headers received from a server. - The HTTP RFC never allows the use of this (Pragma) header - from a server, only a client, though plenty of servers + The HTTP RFC never allows the use of this (Pragma) header + from a server, only a client, though plenty of servers send it anyway. - - ignore-private ignores any ``Cache-control: private'' - headers received from a server. Doing this VIOLATES - the HTTP standard. Enabling this feature could make you + + ignore-private ignores any ``Cache-control: private'' + headers received from a server. Doing this VIOLATES + the HTTP standard. Enabling this feature could make you liable for problems which it causes. - + ignore-auth caches responses to requests with authorization, - irrespective of ``Cache-control'' headers received from - a server. Doing this VIOLATES the HTTP standard. Enabling - this feature could make you liable for problems which + as if the originserver had sent ``Cache-control: public'' + in the response header. Doing this VIOLATES the HTTP standard. + Enabling this feature could make you liable for problems which it causes. - + Basically a cached object is: FRESH if expires < now, else STALE @@ -2434,7 +2420,6 @@ negative caching of DNS lookups. DOC_END - NAME: positive_dns_ttl COMMENT: time-units TYPE: time_t @@ -2446,7 +2431,6 @@ larger than negative_dns_ttl. DOC_END - NAME: negative_dns_ttl COMMENT: time-units TYPE: time_t @@ -2559,7 +2543,6 @@ default is 15 minutes. DOC_END - NAME: request_timeout TYPE: time_t LOC: Config.Timeout.request @@ -2569,7 +2552,6 @@ connection establishment. DOC_END - NAME: persistent_request_timeout TYPE: time_t LOC: Config.Timeout.persistent_request @@ -2579,7 +2561,6 @@ connection after the previous request completes. DOC_END - NAME: client_lifetime COMMENT: time-units TYPE: time_t @@ -2639,7 +2620,6 @@ many ident requests going at once. DOC_END - NAME: shutdown_lifetime COMMENT: time-units TYPE: time_t @@ -3012,19 +2992,8 @@ If none of the access lines cause a match the opposite of the last line will apply. Thus it is good practice to end the rules with an "allow all" or "deny all" entry. - -NOCOMMENT_START -#Recommended minimum configuration: -# -# Insert your own rules here. -# -# -# and finally allow by default -http_reply_access allow all -NOCOMMENT_END DOC_END - NAME: icp_access TYPE: acl_access LOC: Config.accessList.icp @@ -3081,7 +3050,6 @@ htcp_clr_access allow htcp_clr_peer DOC_END - NAME: miss_access TYPE: acl_access LOC: Config.accessList.miss @@ -3106,7 +3074,6 @@ NOCOMMENT_END DOC_END - NAME: cache_peer_access TYPE: peer_access DEFAULT: none @@ -3168,7 +3135,7 @@ tcp_outgoing_tos 0x20 good_service_net TOS/DSCP values really only have local significance - so you should - know what you're specifying. For more information, see RFC2474 and + know what you're specifying. For more information, see RFC2474 and RFC3260. The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or @@ -3283,7 +3250,6 @@ mail if the cache dies. The default is "webmaster". DOC_END - NAME: mail_from TYPE: string DEFAULT: none @@ -3291,11 +3257,10 @@ DOC_START From: email-address for mail sent when the cache dies. The default is to use 'appname@unique_hostname'. - Default appname value is "squid", can be changed into + Default appname value is "squid", can be changed into src/globals.h before building squid. DOC_END - NAME: mail_program TYPE: eol DEFAULT: mail @@ -3308,7 +3273,6 @@ Optional command line options can be specified. DOC_END - NAME: cache_effective_user TYPE: string DEFAULT: nobody @@ -3323,7 +3287,6 @@ cache_effective_user. DOC_END - NAME: cache_effective_group TYPE: string DEFAULT: none @@ -3338,7 +3301,6 @@ group. DOC_END - NAME: httpd_suppress_version_string COMMENT: on|off TYPE: onoff @@ -3348,7 +3310,6 @@ Suppress Squid version string info in HTTP headers and HTML error pages. DOC_END - NAME: visible_hostname TYPE: string LOC: Config.visibleHostname @@ -3361,7 +3322,6 @@ names with this setting. DOC_END - NAME: unique_hostname TYPE: string LOC: Config.uniqueHostname @@ -3372,7 +3332,6 @@ 'unique_hostname' so forwarding loops can be detected. DOC_END - NAME: hostname_aliases TYPE: wordlist LOC: Config.hostnameAliases @@ -3435,7 +3394,6 @@ NOCOMMENT_END DOC_END - NAME: announce_host TYPE: string DEFAULT: tracker.ircache.net @@ -3477,1104 +3435,1220 @@ discovery can not work on traffic towards the clients. This is the case when the intercepting device does not fully track connections and fails to forward ICMP must fragment messages - to the cache server. - + to the cache server. + If you have such setup and experience that certain clients sporadically hang or never complete requests set this to on. DOC_END COMMENT_START - MISCELLANEOUS + DELAY POOL PARAMETERS ----------------------------------------------------------------------------- COMMENT_END -NAME: dns_testnames -TYPE: wordlist -LOC: Config.dns_testname_list +NAME: delay_pools +TYPE: delay_pool_count +DEFAULT: 0 +IFDEF: DELAY_POOLS +LOC: Config.Delay +DOC_START + This represents the number of delay pools to be used. For example, + if you have one class 2 delay pool and one class 3 delays pool, you + have a total of 2 delay pools. +DOC_END + +NAME: delay_class +TYPE: delay_pool_class DEFAULT: none -DEFAULT_IF_NONE: netscape.com internic.net nlanr.net microsoft.com +IFDEF: DELAY_POOLS +LOC: Config.Delay DOC_START - The DNS tests exit as soon as the first site is successfully looked up + This defines the class of each delay pool. There must be exactly one + delay_class line for each delay pool. For example, to define two + delay pools, one of class 2 and one of class 3, the settings above + and here would be: - This test can be disabled with the -D command line option. -DOC_END +Example: + delay_pools 2 # 2 delay pools + delay_class 1 2 # pool 1 is a class 2 pool + delay_class 2 3 # pool 2 is a class 3 pool + The delay pool classes are: -NAME: logfile_rotate -TYPE: int -DEFAULT: 10 -LOC: Config.Log.rotateNumber -DOC_START - Specifies the number of logfile rotations to make when you - type 'squid -k rotate'. The default is 10, which will rotate - with extensions 0 through 9. Setting logfile_rotate to 0 will - disable the rotation, but the logfiles are still closed and - re-opened. This will enable you to rename the logfiles - yourself just before sending the rotate signal. + class 1 Everything is limited by a single aggregate + bucket. - Note, the 'squid -k rotate' command normally sends a USR1 - signal to the running squid process. In certain situations - (e.g. on Linux with Async I/O), USR1 is used for other - purposes, so -k rotate uses another signal. It is best to get - in the habit of using 'squid -k rotate' instead of 'kill -USR1 - '. -DOC_END + class 2 Everything is limited by a single aggregate + bucket as well as an "individual" bucket chosen + from bits 25 through 32 of the IP address. + class 3 Everything is limited by a single aggregate + bucket as well as a "network" bucket chosen + from bits 17 through 24 of the IP address and a + "individual" bucket chosen from bits 17 through + 32 of the IP address. -NAME: append_domain -TYPE: string -LOC: Config.appendDomain + NOTE: If an IP address is a.b.c.d + -> bits 25 through 32 are "d" + -> bits 17 through 24 are "c" + -> bits 17 through 32 are "c * 256 + d" +DOC_END + +NAME: delay_access +TYPE: delay_pool_access DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay DOC_START - Appends local domain name to hostnames without any dots in - them. append_domain must begin with a period. - - Be warned there are now Internet names with no dots in - them using only top-domain names, so setting this may - cause some Internet sites to become unavailable. + This is used to determine which delay pool a request falls into. -Example: - append_domain .yourdomain.com -DOC_END + delay_access is sorted per pool and the matching starts with pool 1, + then pool 2, ..., and finally pool N. The first delay pool where the + request is allowed is selected for the request. If it does not allow + the request to any pool then the request is not delayed (default). + For example, if you want some_big_clients in delay + pool 1 and lotsa_little_clients in delay pool 2: -NAME: tcp_recv_bufsize -COMMENT: (bytes) -TYPE: b_size_t -DEFAULT: 0 bytes -LOC: Config.tcpRcvBufsz -DOC_START - Size of receive buffer to set for TCP sockets. Probably just - as easy to change your kernel's default. Set to zero to use - the default buffer size. +Example: + delay_access 1 allow some_big_clients + delay_access 1 deny all + delay_access 2 allow lotsa_little_clients + delay_access 2 deny all DOC_END -NAME: error_map -TYPE: errormap -LOC: Config.errorMapList +NAME: delay_parameters +TYPE: delay_pool_rates DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay DOC_START - Map errors to custom messages + This defines the parameters for a delay pool. Each delay pool has + a number of "buckets" associated with it, as explained in the + description of delay_class. For a class 1 delay pool, the syntax is: - error_map message_url http_status ... +delay_parameters pool aggregate - http_status ... is a list of HTTP status codes or Squid error - messages. + For a class 2 delay pool: - Use in accelerators to substitute the error messages returned - by servers with other custom errors. +delay_parameters pool aggregate individual - error_map http://your.server/error/404.shtml 404 - - Requests for error messages is a GET request for the configured - URL with the following special headers + For a class 3 delay pool: - X-Error-Status: The received HTTP status code (i.e. 404) - X-Request-URI: The requested URI where the error occurred - - In Addition the following headers are forwarded from the client - request: - - User-Agent, Cookie, X-Forwarded-For, Via, Authorization, - Accept, Referer - - And the following headers from the server reply: +delay_parameters pool aggregate network individual - Server, Via, Location, Content-Location - - The reply returned to the client will carry the original HTTP - headers from the real error message, but with the reply body - of the configured error message. + The variables here are: -DOC_END + pool a pool number - ie, a number between 1 and the + number specified in delay_pools as used in + delay_class lines. -NAME: err_html_text -TYPE: eol -LOC: Config.errHtmlText -DEFAULT: none -DOC_START - HTML text to include in error messages. Make this a "mailto" - URL to your admin address, or maybe just a link to your - organizations Web page. + aggregate the "delay parameters" for the aggregate bucket + (class 1, 2, 3). - To include this in your error messages, you must rewrite - the error template files (found in the "errors" directory). - Wherever you want the 'err_html_text' line to appear, - insert a %L tag in the error template file. -DOC_END + individual the "delay parameters" for the individual + buckets (class 2, 3). -NAME: deny_info -TYPE: denyinfo -LOC: Config.denyInfoList -DEFAULT: none -DOC_START - Usage: deny_info err_page_name acl - or deny_info http://... acl - Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys + network the "delay parameters" for the network buckets + (class 3). - This can be used to return a ERR_ page for requests which - do not pass the 'http_access' rules. A single ACL will cause - the http_access check to fail. If a 'deny_info' line exists - for that ACL Squid returns a corresponding error page. + A pair of delay parameters is written restore/maximum, where restore is + the number of bytes (not bits - modem and network speeds are usually + quoted in bits) per second placed into the bucket, and maximum is the + maximum number of bytes which can be in the bucket at any time. - You may use ERR_ pages that come with Squid or create your own pages - and put them into the configured errors/ directory. + For example, if delay pool number 1 is a class 2 delay pool as in the + above example, and is being used to strictly limit each host to 64kbps + (plus overheads), with no overall limit, the line is: - Alternatively you can specify an error URL. The browsers will - get redirected (302) to the specified URL. %s in the redirection - URL will be replaced by the requested URL. +delay_parameters 1 -1/-1 8000/8000 - Alternatively you can tell Squid to reset the TCP connection - by specifying TCP_RESET. -DOC_END + Note that the figure -1 is used to represent "unlimited". -NAME: memory_pools -COMMENT: on|off -TYPE: onoff -DEFAULT: on -LOC: Config.onoff.mem_pools -DOC_START - If set, Squid will keep pools of allocated (but unused) memory - available for future use. If memory is a premium on your - system and you believe your malloc library outperforms Squid - routines, disable this. -DOC_END - -NAME: memory_pools_limit -COMMENT: (bytes) -TYPE: b_size_t -DEFAULT: 5 MB -LOC: Config.MemPools.limit -DOC_START - Used only with memory_pools on: - memory_pools_limit 50 MB - - If set to a non-zero value, Squid will keep at most the specified - limit of allocated (but unused) memory in memory pools. All free() - requests that exceed this limit will be handled by your malloc - library. Squid does not pre-allocate any memory, just safe-keeps - objects that otherwise would be free()d. Thus, it is safe to set - memory_pools_limit to a reasonably high value even if your - configuration will use less memory. - - If set to zero, Squid will keep all memory it can. That is, there - will be no limit on the total amount of memory used for safe-keeping. + And, if delay pool number 2 is a class 3 delay pool as in the above + example, and you want to limit it to a total of 256kbps (strict limit) + with each 8-bit network permitted 64kbps (strict limit) and each + individual host permitted 4800bps with a bucket maximum size of 64kb + to permit a decent web page to be downloaded at a decent speed + (if the network is not being limited due to overuse) but slow down + large downloads more significantly: - To disable memory allocation optimization, do not set - memory_pools_limit to 0. Set memory_pools to "off" instead. +delay_parameters 2 32000/32000 8000/8000 600/8000 - An overhead for maintaining memory pools is not taken into account - when the limit is checked. This overhead is close to four bytes per - object kept. However, pools may actually _save_ memory because of - reduced memory thrashing in your malloc library. + There must be one delay_parameters line for each delay pool. DOC_END -NAME: via -IFDEF: HTTP_VIOLATIONS -COMMENT: on|off -TYPE: onoff -DEFAULT: on -LOC: Config.onoff.via +NAME: delay_initial_bucket_level +COMMENT: (percent, 0-100) +TYPE: ushort +DEFAULT: 50 +IFDEF: DELAY_POOLS +LOC: Config.Delay.initial DOC_START - If set (default), Squid will include a Via header in requests and - replies. + The initial bucket percentage is used to determine how much is put + in each bucket when squid starts, is reconfigured, or first notices + a host accessing it (in class 2 and class 3, individual hosts and + networks only have buckets associated with them once they have been + "seen" by squid). DOC_END -NAME: forwarded_for -COMMENT: on|off -TYPE: onoff -DEFAULT: on -LOC: opt_forwarded_for +COMMENT_START + WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS + ----------------------------------------------------------------------------- +COMMENT_END + +NAME: wccp_router +TYPE: address +LOC: Config.Wccp.router +DEFAULT: 0.0.0.0 +IFDEF: USE_WCCP +DOC_NONE +NAME: wccp2_router +TYPE: sockaddr_in_list +LOC: Config.Wccp2.router +DEFAULT: none +IFDEF: USE_WCCPv2 DOC_START - If set, Squid will include your system's IP address or name - in the HTTP requests it forwards. By default it looks like - this: + Use this option to define your WCCP ``home'' router for + Squid. - X-Forwarded-For: 192.1.2.3 + wccp_router supports a single WCCP(v1) router - If you disable this, it will appear as + wccp2_router supports multiple WCCPv2 routers - X-Forwarded-For: unknown + only one of the two may be used at the same time and defines + which version of WCCP to use. DOC_END +NAME: wccp_version +TYPE: int +LOC: Config.Wccp.version +DEFAULT: 4 +IFDEF: USE_WCCP +DOC_START + This directive is only relevant if you need to set up WCCP(v1) + to some very old and end-of-life Cisco routers. In all other + setups it must be left unset or at the default setting. + It defines an internal version in the WCCP(v1) protocol, + with version 4 being the officially documented protocol. + + According to some users, Cisco IOS 11.2 and earlier only + support WCCP version 3. If you're using that or an earlier + version of IOS, you may need to change this value to 3, otherwise + do not specify this parameter. +DOC_END -NAME: log_icp_queries -COMMENT: on|off +NAME: wccp2_rebuild_wait TYPE: onoff +LOC: Config.Wccp2.rebuildwait DEFAULT: on -LOC: Config.onoff.log_udp +IFDEF: USE_WCCPv2 DOC_START - If set, ICP queries are logged to access.log. You may wish - do disable this if your ICP load is VERY high to speed things - up or to simplify log analysis. + If this is enabled Squid will wait for the cache dir rebuild to finish + before sending the first wccp2 HereIAm packet DOC_END -NAME: icp_hit_stale -COMMENT: on|off -TYPE: onoff -DEFAULT: off -LOC: Config.onoff.icp_hit_stale +NAME: wccp2_forwarding_method +TYPE: int +LOC: Config.Wccp2.forwarding_method +DEFAULT: 1 +IFDEF: USE_WCCPv2 DOC_START - If you want to return ICP_HIT for stale cache objects, set this - option to 'on'. If you have sibling relationships with caches - in other administrative domains, this should be 'off'. If you only - have sibling relationships with caches under your control, - it is probably okay to set this to 'on'. - If set to 'on', your siblings should use the option "allow-miss" - on their cache_peer lines for connecting to you. -DOC_END + WCCP2 allows the setting of forwarding methods between the + router/switch and the cache. Valid values are as follows: + 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) + 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) -NAME: minimum_direct_hops + Currently (as of IOS 12.4) cisco routers only support GRE. + Cisco switches only support the L2 redirect assignment method. +DOC_END + +NAME: wccp2_return_method TYPE: int -DEFAULT: 4 -LOC: Config.minDirectHops +LOC: Config.Wccp2.return_method +DEFAULT: 1 +IFDEF: USE_WCCPv2 DOC_START - If using the ICMP pinging stuff, do direct fetches for sites - which are no more than this many hops away. + WCCP2 allows the setting of return methods between the + router/switch and the cache for packets that the cache + decides not to handle. Valid values are as follows: + + 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) + 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) + + Currently (as of IOS 12.4) cisco routers only support GRE. + Cisco switches only support the L2 redirect assignment. + + If the "ip wccp redirect exclude in" command has been + enabled on the cache interface, then it is still safe for + the proxy server to use a l2 redirect method even if this + option is set to GRE. DOC_END -NAME: minimum_direct_rtt +NAME: wccp2_assignment_method TYPE: int -DEFAULT: 400 -LOC: Config.minDirectRtt +LOC: Config.Wccp2.assignment_method +DEFAULT: 1 +IFDEF: USE_WCCPv2 DOC_START - If using the ICMP pinging stuff, do direct fetches for sites - which are no more than this many rtt milliseconds away. + WCCP2 allows the setting of methods to assign the WCCP hash + Valid values are as follows: + + 1 - Hash assignment + 2 - Mask assignment + + As a general rule, cisco routers support the hash assignment method + and cisco switches support the mask assignment method. DOC_END -NAME: cachemgr_passwd -TYPE: cachemgrpasswd +NAME: wccp2_service +TYPE: wccp2_service +LOC: Config.Wccp2.info DEFAULT: none -LOC: Config.passwd_list +DEFAULT_IF_NONE: standard 0 +IFDEF: USE_WCCPv2 DOC_START - Specify passwords for cachemgr operations. - - Usage: cachemgr_passwd password action action ... + WCCP2 allows for multiple traffic services. There are two + types: "standard" and "dynamic". The standard type defines + one service id - http (id 0). The dynamic service ids can be from + 51 to 255 inclusive. In order to use a dynamic service id + one must define the type of traffic to be redirected; this is done + using the wccp2_service_info option. - Some valid actions are (see cache manager menu for a full list): - 5min - 60min - asndb - authenticator - cbdata - client_list - comm_incoming - config * - counters - delay - digest_stats - dns - events - filedescriptors - fqdncache - histograms - http_headers - info - io - ipcache - mem - menu - netdb - non_peers - objects - offline_toggle * - pconn - peer_select - redirector - refresh - server_list - shutdown * - store_digest - storedir - utilization - via_headers - vm_objects + The "standard" type does not require a wccp2_service_info option, + just specifying the service id will suffice. - * Indicates actions which will not be performed without a - valid password, others can be performed if not listed here. + MD5 service authentication can be enabled by adding + "password=" to the end of this service declaration. - To disable an action, set the password to "disable". - To allow performing an action without a password, set the - password to "none". + Examples: - Use the keyword "all" to set the same password for all actions. + wccp2_service standard 0 # for the 'web-cache' standard service + wccp2_service dynamic 80 # a dynamic service type which will be + # fleshed out with subsequent options. + wccp2_service standard 0 password=foo -Example: - cachemgr_passwd secret shutdown - cachemgr_passwd lesssssssecret info stats/objects - cachemgr_passwd disable all DOC_END -NAME: store_avg_object_size -COMMENT: (kbytes) -TYPE: kb_size_t -DEFAULT: 13 KB -LOC: Config.Store.avgObjectSize +NAME: wccp2_service_info +TYPE: wccp2_service_info +LOC: Config.Wccp2.info +DEFAULT: none +IFDEF: USE_WCCPv2 DOC_START - Average object size, used to estimate number of objects your - cache can hold. The default is 13 KB. + Dynamic WCCPv2 services require further information to define the + traffic you wish to have diverted. + + The format is: + + wccp2_service_info protocol= flags=,.. + priority= ports=,.. + + The relevant WCCPv2 flags: + + src_ip_hash, dst_ip_hash + + source_port_hash, dest_port_hash + + src_ip_alt_hash, dst_ip_alt_hash + + src_port_alt_hash, dst_port_alt_hash + + ports_source + + The port list can be one to eight entries. + + Example: + + wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source + priority=240 ports=80 + + Note: the service id must have been defined by a previous + 'wccp2_service dynamic ' entry. DOC_END -NAME: store_objects_per_bucket +NAME: wccp2_weight TYPE: int -DEFAULT: 20 -LOC: Config.Store.objectsPerBucket +LOC: Config.Wccp2.weight +DEFAULT: 10000 +IFDEF: USE_WCCPv2 DOC_START - Target number of objects per bucket in the store hash table. - Lowering this value increases the total number of buckets and - also the storage maintenance rate. The default is 50. + Each cache server gets assigned a set of the destination + hash proportional to their weight. DOC_END -NAME: client_db -COMMENT: on|off -TYPE: onoff -DEFAULT: on -LOC: Config.onoff.client_db +NAME: wccp_address +TYPE: address +LOC: Config.Wccp.address +DEFAULT: 0.0.0.0 +IFDEF: USE_WCCP +DOC_NONE +NAME: wccp2_address +TYPE: address +LOC: Config.Wccp2.address +DEFAULT: 0.0.0.0 +IFDEF: USE_WCCPv2 DOC_START - If you want to disable collecting per-client statistics, - turn off client_db here. + Use this option if you require WCCP to use a specific + interface address. + + The default behavior is to not bind to any specific address. DOC_END +COMMENT_START + PERSISTENT CONNECTION HANDLING + ----------------------------------------------------------------------------- + + Also see "pconn_timeout" in the TIMEOUTS section +COMMENT_END -NAME: netdb_low -TYPE: int -DEFAULT: 900 -LOC: Config.Netdb.low +NAME: client_persistent_connections +TYPE: onoff +LOC: Config.onoff.client_pconns +DEFAULT: on DOC_NONE -NAME: netdb_high -TYPE: int -DEFAULT: 1000 -LOC: Config.Netdb.high +NAME: server_persistent_connections +TYPE: onoff +LOC: Config.onoff.server_pconns +DEFAULT: on DOC_START - The low and high water marks for the ICMP measurement - database. These are counts, not percents. The defaults are - 900 and 1000. When the high water mark is reached, database - entries will be deleted until the low mark is reached. + Persistent connection support for clients and servers. By + default, Squid uses persistent connections (when allowed) + with its clients and servers. You can use these options to + disable persistent connections with clients and/or servers. DOC_END - -NAME: netdb_ping_period -TYPE: time_t -LOC: Config.Netdb.period -DEFAULT: 5 minutes +NAME: persistent_connection_after_error +TYPE: onoff +LOC: Config.onoff.error_pconns +DEFAULT: off DOC_START - The minimum period for measuring a site. There will be at - least this much delay between successive pings to the same - network. The default is five minutes. + With this directive the use of persistent connections after + HTTP errors can be disabled. Useful if you have clients + who fail to handle errors on persistent connections proper. DOC_END - -NAME: query_icmp -COMMENT: on|off +NAME: detect_broken_pconn TYPE: onoff +LOC: Config.onoff.detect_broken_server_pconns DEFAULT: off -LOC: Config.onoff.query_icmp DOC_START - If you want to ask your peers to include ICMP data in their ICP - replies, enable this option. + Some servers have been found to incorrectly signal the use + of HTTP/1.0 persistent connections even on replies not + compatible, causing significant delays. This server problem + has mostly been seen on redirects. - If your peer has configured Squid (during compilation) with - '--enable-icmp' that peer will send ICMP pings to origin server - sites of the URLs it receives. If you enable this option the - ICP replies from that peer will include the ICMP data (if available). - Then, when choosing a parent cache, Squid will choose the parent with - the minimal RTT to the origin server. When this happens, the - hierarchy field of the access.log will be - "CLOSEST_PARENT_MISS". This option is off by default. + By enabling this directive Squid attempts to detect such + broken replies and automatically assume the reply is finished + after 10 seconds timeout. DOC_END -NAME: test_reachability -COMMENT: on|off +COMMENT_START + CACHE DIGEST OPTIONS + ----------------------------------------------------------------------------- +COMMENT_END + +NAME: digest_generation +IFDEF: USE_CACHE_DIGESTS TYPE: onoff -DEFAULT: off -LOC: Config.onoff.test_reachability +LOC: Config.onoff.digest_generation +DEFAULT: on DOC_START - When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH - instead of ICP_MISS if the target host is NOT in the ICMP - database, or has a zero RTT. + This controls whether the server will generate a Cache Digest + of its contents. By default, Cache Digest generation is + enabled if Squid is compiled with USE_CACHE_DIGESTS defined. DOC_END -NAME: buffered_logs -COMMENT: on|off -TYPE: onoff -DEFAULT: off -LOC: Config.onoff.buffered_logs +NAME: digest_bits_per_entry +IFDEF: USE_CACHE_DIGESTS +TYPE: int +LOC: Config.digest.bits_per_entry +DEFAULT: 5 DOC_START - cache.log log file is written with stdio functions, and as such - it can be buffered or unbuffered. By default it will be unbuffered. - Buffering it can speed up the writing slightly (though you are - unlikely to need to worry unless you run with tons of debugging - enabled in which case performance will suffer badly anyway..). + This is the number of bits of the server's Cache Digest which + will be associated with the Digest entry for a given HTTP + Method and URL (public key) combination. The default is 5. DOC_END -NAME: reload_into_ims -IFDEF: HTTP_VIOLATIONS -COMMENT: on|off -TYPE: onoff -DEFAULT: off -LOC: Config.onoff.reload_into_ims +NAME: digest_rebuild_period +IFDEF: USE_CACHE_DIGESTS +COMMENT: (seconds) +TYPE: time_t +LOC: Config.digest.rebuild_period +DEFAULT: 1 hour DOC_START - When you enable this option, client no-cache or ``reload'' - requests will be changed to If-Modified-Since requests. - Doing this VIOLATES the HTTP standard. Enabling this - feature could make you liable for problems which it - causes. - - see also refresh_pattern for a more selective approach. + This is the number of seconds between Cache Digest rebuilds. DOC_END -NAME: always_direct -TYPE: acl_access -LOC: Config.accessList.AlwaysDirect -DEFAULT: none +NAME: digest_rewrite_period +COMMENT: (seconds) +IFDEF: USE_CACHE_DIGESTS +TYPE: time_t +LOC: Config.digest.rewrite_period +DEFAULT: 1 hour DOC_START - Usage: always_direct allow|deny [!]aclname ... + This is the number of seconds between Cache Digest writes to + disk. +DOC_END - Here you can use ACL elements to specify requests which should - ALWAYS be forwarded by Squid to the origin servers without using - any peers. For example, to always directly forward requests for - local servers ignoring any parents or siblings you may have use - something like: +NAME: digest_swapout_chunk_size +COMMENT: (bytes) +TYPE: b_size_t +IFDEF: USE_CACHE_DIGESTS +LOC: Config.digest.swapout_chunk_size +DEFAULT: 4096 bytes +DOC_START + This is the number of bytes of the Cache Digest to write to + disk at a time. It defaults to 4096 bytes (4KB), the Squid + default swap page. +DOC_END - acl local-servers dstdomain my.domain.net - always_direct allow local-servers +NAME: digest_rebuild_chunk_percentage +COMMENT: (percent, 0-100) +IFDEF: USE_CACHE_DIGESTS +TYPE: int +LOC: Config.digest.rebuild_chunk_percentage +DEFAULT: 10 +DOC_START + This is the percentage of the Cache Digest to be scanned at a + time. By default it is set to 10% of the Cache Digest. +DOC_END - To always forward FTP requests directly, use +COMMENT_START + MISCELLANEOUS + ----------------------------------------------------------------------------- +COMMENT_END - acl FTP proto FTP - always_direct allow FTP +NAME: dns_testnames +TYPE: wordlist +LOC: Config.dns_testname_list +DEFAULT: none +DEFAULT_IF_NONE: netscape.com internic.net nlanr.net microsoft.com +DOC_START + The DNS tests exit as soon as the first site is successfully looked up - NOTE: There is a similar, but opposite option named - 'never_direct'. You need to be aware that "always_direct deny - foo" is NOT the same thing as "never_direct allow foo". You - may need to use a deny rule to exclude a more-specific case of - some other rule. Example: + This test can be disabled with the -D command line option. +DOC_END - acl local-external dstdomain external.foo.net - acl local-servers dstdomain .foo.net - always_direct deny local-external - always_direct allow local-servers - - NOTE: If your goal is to make the client forward the request - directly to the origin server bypassing Squid then this needs - to be done in the client configuration. Squid configuration - can only tell Squid how Squid should fetch the object. - - NOTE: This directive is not related to caching. The replies - is cached as usual even if you use always_direct. To not cache - the replies see no_cache. +NAME: logfile_rotate +TYPE: int +DEFAULT: 10 +LOC: Config.Log.rotateNumber +DOC_START + Specifies the number of logfile rotations to make when you + type 'squid -k rotate'. The default is 10, which will rotate + with extensions 0 through 9. Setting logfile_rotate to 0 will + disable the rotation, but the logfiles are still closed and + re-opened. This will enable you to rename the logfiles + yourself just before sending the rotate signal. - This option replaces some v1.1 options such as local_domain - and local_ip. + Note, the 'squid -k rotate' command normally sends a USR1 + signal to the running squid process. In certain situations + (e.g. on Linux with Async I/O), USR1 is used for other + purposes, so -k rotate uses another signal. It is best to get + in the habit of using 'squid -k rotate' instead of 'kill -USR1 + '. DOC_END -NAME: never_direct -TYPE: acl_access -LOC: Config.accessList.NeverDirect +NAME: append_domain +TYPE: string +LOC: Config.appendDomain DEFAULT: none DOC_START - Usage: never_direct allow|deny [!]aclname ... - - never_direct is the opposite of always_direct. Please read - the description for always_direct if you have not already. - - With 'never_direct' you can use ACL elements to specify - requests which should NEVER be forwarded directly to origin - servers. For example, to force the use of a proxy for all - requests, except those in your local domain use something like: - - acl local-servers dstdomain .foo.net - acl all src 0.0.0.0/0.0.0.0 - never_direct deny local-servers - never_direct allow all + Appends local domain name to hostnames without any dots in + them. append_domain must begin with a period. - or if Squid is inside a firewall and there are local intranet - servers inside the firewall use something like: + Be warned there are now Internet names with no dots in + them using only top-domain names, so setting this may + cause some Internet sites to become unavailable. - acl local-intranet dstdomain .foo.net - acl local-external dstdomain external.foo.net - always_direct deny local-external - always_direct allow local-intranet - never_direct allow all +Example: + append_domain .yourdomain.com +DOC_END - This option replaces some v1.1 options such as inside_firewall - and firewall_ip. +NAME: tcp_recv_bufsize +COMMENT: (bytes) +TYPE: b_size_t +DEFAULT: 0 bytes +LOC: Config.tcpRcvBufsz +DOC_START + Size of receive buffer to set for TCP sockets. Probably just + as easy to change your kernel's default. Set to zero to use + the default buffer size. DOC_END -NAME: header_access -IFDEF: HTTP_VIOLATIONS -TYPE: http_header_access[] -LOC: Config.header_access +NAME: error_map +TYPE: errormap +LOC: Config.errorMapList DEFAULT: none DOC_START - Usage: header_access header_name allow|deny [!]aclname ... + Map errors to custom messages - WARNING: Doing this VIOLATES the HTTP standard. Enabling - this feature could make you liable for problems which it - causes. + error_map message_url http_status ... - This option replaces the old 'anonymize_headers' and the - older 'http_anonymizer' option with something that is much - more configurable. This new method creates a list of ACLs - for each header, allowing you very fine-tuned header - mangling. + http_status ... is a list of HTTP status codes or Squid error + messages. - You can only specify known headers for the header name. - Other headers are reclassified as 'Other'. You can also - refer to all the headers with 'All'. + Use in accelerators to substitute the error messages returned + by servers with other custom errors. - For example, to achieve the same behavior as the old - 'http_anonymizer standard' option, you should use: + error_map http://your.server/error/404.shtml 404 - header_access From deny all - header_access Referer deny all - header_access Server deny all - header_access User-Agent deny all - header_access WWW-Authenticate deny all - header_access Link deny all + Requests for error messages is a GET request for the configured + URL with the following special headers - Or, to reproduce the old 'http_anonymizer paranoid' feature - you should use: + X-Error-Status: The received HTTP status code (i.e. 404) + X-Request-URI: The requested URI where the error occurred - header_access Allow allow all - header_access Authorization allow all - header_access WWW-Authenticate allow all - header_access Proxy-Authorization allow all - header_access Proxy-Authenticate allow all - header_access Cache-Control allow all - header_access Content-Encoding allow all - header_access Content-Length allow all - header_access Content-Type allow all - header_access Date allow all - header_access Expires allow all - header_access Host allow all - header_access If-Modified-Since allow all - header_access Last-Modified allow all - header_access Location allow all - header_access Pragma allow all - header_access Accept allow all - header_access Accept-Charset allow all - header_access Accept-Encoding allow all - header_access Accept-Language allow all - header_access Content-Language allow all - header_access Mime-Version allow all - header_access Retry-After allow all - header_access Title allow all - header_access Connection allow all - header_access Proxy-Connection allow all - header_access All deny all + In Addition the following headers are forwarded from the client + request: + + User-Agent, Cookie, X-Forwarded-For, Via, Authorization, + Accept, Referer + + And the following headers from the server reply: + + Server, Via, Location, Content-Location + + The reply returned to the client will carry the original HTTP + headers from the real error message, but with the reply body + of the configured error message. - By default, all headers are allowed (no anonymizing is - performed). DOC_END -NAME: header_replace -IFDEF: HTTP_VIOLATIONS -TYPE: http_header_replace[] -LOC: Config.header_access +NAME: err_html_text +TYPE: eol +LOC: Config.errHtmlText DEFAULT: none DOC_START - Usage: header_replace header_name message - Example: header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) - - This option allows you to change the contents of headers - denied with header_access above, by replacing them with - some fixed string. This replaces the old fake_user_agent - option. + HTML text to include in error messages. Make this a "mailto" + URL to your admin address, or maybe just a link to your + organizations Web page. - By default, headers are removed if denied. + To include this in your error messages, you must rewrite + the error template files (found in the "errors" directory). + Wherever you want the 'err_html_text' line to appear, + insert a %L tag in the error template file. DOC_END -NAME: icon_directory -TYPE: string -LOC: Config.icons.directory -DEFAULT: @DEFAULT_ICON_DIR@ +NAME: deny_info +TYPE: denyinfo +LOC: Config.denyInfoList +DEFAULT: none DOC_START - Where the icons are stored. These are normally kept in - @DEFAULT_ICON_DIR@ + Usage: deny_info err_page_name acl + or deny_info http://... acl + Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys + + This can be used to return a ERR_ page for requests which + do not pass the 'http_access' rules. A single ACL will cause + the http_access check to fail. If a 'deny_info' line exists + for that ACL Squid returns a corresponding error page. + + You may use ERR_ pages that come with Squid or create your own pages + and put them into the configured errors/ directory. + + Alternatively you can specify an error URL. The browsers will + get redirected (302) to the specified URL. %s in the redirection + URL will be replaced by the requested URL. + + Alternatively you can tell Squid to reset the TCP connection + by specifying TCP_RESET. DOC_END -NAME: global_internal_static +NAME: memory_pools +COMMENT: on|off TYPE: onoff -LOC: Config.onoff.global_internal_static DEFAULT: on +LOC: Config.onoff.mem_pools DOC_START - This directive controls is Squid should intercept all requests for - /squid-internal-static/ no matter which host the URL is requesting - (default on setting), or if nothing special should be done for - such URLs (off setting). The purpose of this directive is to make - icons etc work better in complex cache hierarchies where it may - not always be possible for all corners in the cache mesh to reach - the server generating a directory listing. + If set, Squid will keep pools of allocated (but unused) memory + available for future use. If memory is a premium on your + system and you believe your malloc library outperforms Squid + routines, disable this. DOC_END -NAME: short_icon_urls -TYPE: onoff -LOC: Config.icons.use_short_names -DEFAULT: off +NAME: memory_pools_limit +COMMENT: (bytes) +TYPE: b_size_t +DEFAULT: 5 MB +LOC: Config.MemPools.limit DOC_START - If this is enabled Squid will use short URLs for icons. + Used only with memory_pools on: + memory_pools_limit 50 MB - If off the URLs for icons will always be absolute URLs - including the proxy name and port. + If set to a non-zero value, Squid will keep at most the specified + limit of allocated (but unused) memory in memory pools. All free() + requests that exceed this limit will be handled by your malloc + library. Squid does not pre-allocate any memory, just safe-keeps + objects that otherwise would be free()d. Thus, it is safe to set + memory_pools_limit to a reasonably high value even if your + configuration will use less memory. + + If set to zero, Squid will keep all memory it can. That is, there + will be no limit on the total amount of memory used for safe-keeping. + + To disable memory allocation optimization, do not set + memory_pools_limit to 0. Set memory_pools to "off" instead. + + An overhead for maintaining memory pools is not taken into account + when the limit is checked. This overhead is close to four bytes per + object kept. However, pools may actually _save_ memory because of + reduced memory thrashing in your malloc library. DOC_END -NAME: error_directory -TYPE: string -LOC: Config.errorDirectory -DEFAULT: @DEFAULT_ERROR_DIR@ +NAME: via +IFDEF: HTTP_VIOLATIONS +COMMENT: on|off +TYPE: onoff +DEFAULT: on +LOC: Config.onoff.via DOC_START - If you wish to create your own versions of the default - (English) error files, either to customize them to suit your - language or company copy the template English files to another - directory and point this tag at them. + If set (default), Squid will include a Via header in requests and + replies. DOC_END -NAME: maximum_single_addr_tries -TYPE: int -LOC: Config.retry.maxtries -DEFAULT: 1 +NAME: forwarded_for +COMMENT: on|off +TYPE: onoff +DEFAULT: on +LOC: opt_forwarded_for DOC_START - This sets the maximum number of connection attempts for a - host that only has one address (for multiple-address hosts, - each address is tried once). + If set, Squid will include your system's IP address or name + in the HTTP requests it forwards. By default it looks like + this: - The default value is one attempt, the (not recommended) - maximum is 255 tries. A warning message will be generated - if it is set to a value greater than ten. + X-Forwarded-For: 192.1.2.3 - Note: This is in addition to the request re-forwarding which - takes place if Squid fails to get a satisfying response. + If you disable this, it will appear as + + X-Forwarded-For: unknown DOC_END -NAME: retry_on_error +NAME: log_icp_queries +COMMENT: on|off TYPE: onoff -LOC: Config.retry.onerror -DEFAULT: off +DEFAULT: on +LOC: Config.onoff.log_udp DOC_START - If set to on Squid will automatically retry requests when - receiving an error response. This is mainly useful if you - are in a complex cache hierarchy to work around access - control errors. + If set, ICP queries are logged to access.log. You may wish + do disable this if your ICP load is VERY high to speed things + up or to simplify log analysis. DOC_END -NAME: snmp_port -TYPE: ushort -LOC: Config.Port.snmp -DEFAULT: 3401 -IFDEF: SQUID_SNMP +NAME: icp_hit_stale +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.icp_hit_stale DOC_START - Squid can now serve statistics and status information via SNMP. - By default it listens to port 3401 on the machine. If you don't - wish to use SNMP, set this to "0". + If you want to return ICP_HIT for stale cache objects, set this + option to 'on'. If you have sibling relationships with caches + in other administrative domains, this should be 'off'. If you only + have sibling relationships with caches under your control, + it is probably okay to set this to 'on'. + If set to 'on', your siblings should use the option "allow-miss" + on their cache_peer lines for connecting to you. DOC_END -NAME: snmp_access -TYPE: acl_access -LOC: Config.accessList.snmp -DEFAULT: none -DEFAULT_IF_NONE: deny all -IFDEF: SQUID_SNMP +NAME: minimum_direct_hops +TYPE: int +DEFAULT: 4 +LOC: Config.minDirectHops DOC_START - Allowing or denying access to the SNMP port. - - All access to the agent is denied by default. - usage: - - snmp_access allow|deny [!]aclname ... + If using the ICMP pinging stuff, do direct fetches for sites + which are no more than this many hops away. +DOC_END -Example: - snmp_access allow snmppublic localhost - snmp_access deny all +NAME: minimum_direct_rtt +TYPE: int +DEFAULT: 400 +LOC: Config.minDirectRtt +DOC_START + If using the ICMP pinging stuff, do direct fetches for sites + which are no more than this many rtt milliseconds away. DOC_END -NAME: snmp_incoming_address -TYPE: address -LOC: Config.Addrs.snmp_incoming -DEFAULT: 0.0.0.0 -IFDEF: SQUID_SNMP -DOC_NONE -NAME: snmp_outgoing_address -TYPE: address -LOC: Config.Addrs.snmp_outgoing -DEFAULT: 255.255.255.255 -IFDEF: SQUID_SNMP +NAME: cachemgr_passwd +TYPE: cachemgrpasswd +DEFAULT: none +LOC: Config.passwd_list DOC_START - Just like 'udp_incoming_address' above, but for the SNMP port. + Specify passwords for cachemgr operations. - snmp_incoming_address is used for the SNMP socket receiving - messages from SNMP agents. - snmp_outgoing_address is used for SNMP packets returned to SNMP - agents. + Usage: cachemgr_passwd password action action ... - The default snmp_incoming_address (0.0.0.0) is to listen on all - available network interfaces. + Some valid actions are (see cache manager menu for a full list): + 5min + 60min + asndb + authenticator + cbdata + client_list + comm_incoming + config * + counters + delay + digest_stats + dns + events + filedescriptors + fqdncache + histograms + http_headers + info + io + ipcache + mem + menu + netdb + non_peers + objects + offline_toggle * + pconn + peer_select + redirector + refresh + server_list + shutdown * + store_digest + storedir + utilization + via_headers + vm_objects - If snmp_outgoing_address is set to 255.255.255.255 (the default) - it will use the same socket as snmp_incoming_address. Only - change this if you want to have SNMP replies sent using another - address than where this Squid listens for SNMP queries. + * Indicates actions which will not be performed without a + valid password, others can be performed if not listed here. - NOTE, snmp_incoming_address and snmp_outgoing_address can not have - the same value since they both use port 3401. -DOC_END + To disable an action, set the password to "disable". + To allow performing an action without a password, set the + password to "none". -NAME: as_whois_server -TYPE: string -LOC: Config.as_whois_server -DEFAULT: whois.ra.net -DEFAULT_IF_NONE: whois.ra.net -DOC_START - WHOIS server to query for AS numbers. NOTE: AS numbers are - queried only when Squid starts up, not for every request. + Use the keyword "all" to set the same password for all actions. + +Example: + cachemgr_passwd secret shutdown + cachemgr_passwd lesssssssecret info stats/objects + cachemgr_passwd disable all DOC_END -NAME: wccp_router -TYPE: address -LOC: Config.Wccp.router -DEFAULT: 0.0.0.0 -IFDEF: USE_WCCP -DOC_NONE -NAME: wccp2_router -TYPE: sockaddr_in_list -LOC: Config.Wccp2.router -DEFAULT: none -IFDEF: USE_WCCPv2 +NAME: store_avg_object_size +COMMENT: (kbytes) +TYPE: kb_size_t +DEFAULT: 13 KB +LOC: Config.Store.avgObjectSize DOC_START - Use this option to define your WCCP ``home'' router for - Squid. - - wccp_router supports a single WCCP(v1) router - - wccp2_router supports multiple WCCPv2 routers - - only one of the two may be used at the same time and defines - which version of WCCP to use. + Average object size, used to estimate number of objects your + cache can hold. The default is 13 KB. DOC_END -NAME: wccp_version +NAME: store_objects_per_bucket TYPE: int -LOC: Config.Wccp.version -DEFAULT: 4 -IFDEF: USE_WCCP +DEFAULT: 20 +LOC: Config.Store.objectsPerBucket DOC_START - This directive is only relevant if you need to set up WCCP(v1) - to some very old and end-of-life Cisco routers. In all other - setups it must be left unset or at the default setting. - It defines an internal version in the WCCP(v1) protocol, - with version 4 being the officially documented protocol. - - According to some users, Cisco IOS 11.2 and earlier only - support WCCP version 3. If you're using that or an earlier - version of IOS, you may need to change this value to 3, otherwise - do not specify this parameter. + Target number of objects per bucket in the store hash table. + Lowering this value increases the total number of buckets and + also the storage maintenance rate. The default is 50. DOC_END -NAME: wccp2_rebuild_wait +NAME: client_db +COMMENT: on|off TYPE: onoff -LOC: Config.Wccp2.rebuildwait DEFAULT: on -IFDEF: USE_WCCPv2 +LOC: Config.onoff.client_db DOC_START - If this is enabled Squid will wait for the cache dir rebuild to finish - before sending the first wccp2 HereIAm packet + If you want to disable collecting per-client statistics, + turn off client_db here. DOC_END -NAME: wccp2_forwarding_method +NAME: netdb_low TYPE: int -LOC: Config.Wccp2.forwarding_method -DEFAULT: 1 -IFDEF: USE_WCCPv2 -DOC_START - WCCP2 allows the setting of forwarding methods between the - router/switch and the cache. Valid values are as follows: - - 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) - 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) - - Currently (as of IOS 12.4) cisco routers only support GRE. - Cisco switches only support the L2 redirect assignment method. -DOC_END +DEFAULT: 900 +LOC: Config.Netdb.low +DOC_NONE -NAME: wccp2_return_method +NAME: netdb_high TYPE: int -LOC: Config.Wccp2.return_method -DEFAULT: 1 -IFDEF: USE_WCCPv2 +DEFAULT: 1000 +LOC: Config.Netdb.high DOC_START - WCCP2 allows the setting of return methods between the - router/switch and the cache for packets that the cache - decides not to handle. Valid values are as follows: - - 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) - 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) - - Currently (as of IOS 12.4) cisco routers only support GRE. - Cisco switches only support the L2 redirect assignment. - - If the "ip wccp redirect exclude in" command has been - enabled on the cache interface, then it is still safe for - the proxy server to use a l2 redirect method even if this - option is set to GRE. + The low and high water marks for the ICMP measurement + database. These are counts, not percents. The defaults are + 900 and 1000. When the high water mark is reached, database + entries will be deleted until the low mark is reached. DOC_END -NAME: wccp2_assignment_method -TYPE: int -LOC: Config.Wccp2.assignment_method -DEFAULT: 1 -IFDEF: USE_WCCPv2 +NAME: netdb_ping_period +TYPE: time_t +LOC: Config.Netdb.period +DEFAULT: 5 minutes DOC_START - WCCP2 allows the setting of methods to assign the WCCP hash - Valid values are as follows: - - 1 - Hash assignment - 2 - Mask assignment - - As a general rule, cisco routers support the hash assignment method - and cisco switches support the mask assignment method. + The minimum period for measuring a site. There will be at + least this much delay between successive pings to the same + network. The default is five minutes. DOC_END -NAME: wccp2_service -TYPE: wccp2_service -LOC: Config.Wccp2.info -DEFAULT: none -DEFAULT_IF_NONE: standard 0 -IFDEF: USE_WCCPv2 +NAME: query_icmp +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.query_icmp DOC_START - WCCP2 allows for multiple traffic services. There are two - types: "standard" and "dynamic". The standard type defines - one service id - http (id 0). The dynamic service ids can be from - 51 to 255 inclusive. In order to use a dynamic service id - one must define the type of traffic to be redirected; this is done - using the wccp2_service_info option. + If you want to ask your peers to include ICMP data in their ICP + replies, enable this option. - The "standard" type does not require a wccp2_service_info option, - just specifying the service id will suffice. + If your peer has configured Squid (during compilation) with + '--enable-icmp' that peer will send ICMP pings to origin server + sites of the URLs it receives. If you enable this option the + ICP replies from that peer will include the ICMP data (if available). + Then, when choosing a parent cache, Squid will choose the parent with + the minimal RTT to the origin server. When this happens, the + hierarchy field of the access.log will be + "CLOSEST_PARENT_MISS". This option is off by default. +DOC_END - MD5 service authentication can be enabled by adding - "password=" to the end of this service declaration. +NAME: test_reachability +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.test_reachability +DOC_START + When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH + instead of ICP_MISS if the target host is NOT in the ICMP + database, or has a zero RTT. +DOC_END - Examples: +NAME: buffered_logs +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.buffered_logs +DOC_START + cache.log log file is written with stdio functions, and as such + it can be buffered or unbuffered. By default it will be unbuffered. + Buffering it can speed up the writing slightly (though you are + unlikely to need to worry unless you run with tons of debugging + enabled in which case performance will suffer badly anyway..). +DOC_END - wccp2_service standard 0 # for the 'web-cache' standard service - wccp2_service dynamic 80 # a dynamic service type which will be - # fleshed out with subsequent options. - wccp2_service standard 0 password=foo +NAME: reload_into_ims +IFDEF: HTTP_VIOLATIONS +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.reload_into_ims +DOC_START + When you enable this option, client no-cache or ``reload'' + requests will be changed to If-Modified-Since requests. + Doing this VIOLATES the HTTP standard. Enabling this + feature could make you liable for problems which it + causes. + see also refresh_pattern for a more selective approach. DOC_END -NAME: wccp2_service_info -TYPE: wccp2_service_info -LOC: Config.Wccp2.info +NAME: always_direct +TYPE: acl_access +LOC: Config.accessList.AlwaysDirect DEFAULT: none -IFDEF: USE_WCCPv2 DOC_START - Dynamic WCCPv2 services require further information to define the - traffic you wish to have diverted. + Usage: always_direct allow|deny [!]aclname ... - The format is: + Here you can use ACL elements to specify requests which should + ALWAYS be forwarded by Squid to the origin servers without using + any peers. For example, to always directly forward requests for + local servers ignoring any parents or siblings you may have use + something like: - wccp2_service_info protocol= flags=,.. - priority= ports=,.. + acl local-servers dstdomain my.domain.net + always_direct allow local-servers - The relevant WCCPv2 flags: - + src_ip_hash, dst_ip_hash - + source_port_hash, dest_port_hash - + src_ip_alt_hash, dst_ip_alt_hash - + src_port_alt_hash, dst_port_alt_hash - + ports_source + To always forward FTP requests directly, use - The port list can be one to eight entries. + acl FTP proto FTP + always_direct allow FTP - Example: + NOTE: There is a similar, but opposite option named + 'never_direct'. You need to be aware that "always_direct deny + foo" is NOT the same thing as "never_direct allow foo". You + may need to use a deny rule to exclude a more-specific case of + some other rule. Example: - wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source - priority=240 ports=80 + acl local-external dstdomain external.foo.net + acl local-servers dstdomain .foo.net + always_direct deny local-external + always_direct allow local-servers - Note: the service id must have been defined by a previous - 'wccp2_service dynamic ' entry. -DOC_END + NOTE: If your goal is to make the client forward the request + directly to the origin server bypassing Squid then this needs + to be done in the client configuration. Squid configuration + can only tell Squid how Squid should fetch the object. -NAME: wccp2_weight -TYPE: int -LOC: Config.Wccp2.weight -DEFAULT: 10000 -IFDEF: USE_WCCPv2 -DOC_START - Each cache server gets assigned a set of the destination - hash proportional to their weight. + NOTE: This directive is not related to caching. The replies + is cached as usual even if you use always_direct. To not cache + the replies see no_cache. + + This option replaces some v1.1 options such as local_domain + and local_ip. DOC_END -NAME: wccp_address -TYPE: address -LOC: Config.Wccp.address -DEFAULT: 0.0.0.0 -IFDEF: USE_WCCP -DOC_NONE -NAME: wccp2_address -TYPE: address -LOC: Config.Wccp2.address -DEFAULT: 0.0.0.0 -IFDEF: USE_WCCPv2 +NAME: never_direct +TYPE: acl_access +LOC: Config.accessList.NeverDirect +DEFAULT: none DOC_START - Use this option if you require WCCP to use a specific - interface address. + Usage: never_direct allow|deny [!]aclname ... - The default behavior is to not bind to any specific address. -DOC_END + never_direct is the opposite of always_direct. Please read + the description for always_direct if you have not already. + With 'never_direct' you can use ACL elements to specify + requests which should NEVER be forwarded directly to origin + servers. For example, to force the use of a proxy for all + requests, except those in your local domain use something like: -COMMENT_START - DELAY POOL PARAMETERS (all require DELAY_POOLS compilation option) - ----------------------------------------------------------------------------- -COMMENT_END + acl local-servers dstdomain .foo.net + acl all src 0.0.0.0/0.0.0.0 + never_direct deny local-servers + never_direct allow all -NAME: delay_pools -TYPE: delay_pool_count -DEFAULT: 0 -IFDEF: DELAY_POOLS -LOC: Config.Delay -DOC_START - This represents the number of delay pools to be used. For example, - if you have one class 2 delay pool and one class 3 delays pool, you - have a total of 2 delay pools. + or if Squid is inside a firewall and there are local intranet + servers inside the firewall use something like: + + acl local-intranet dstdomain .foo.net + acl local-external dstdomain external.foo.net + always_direct deny local-external + always_direct allow local-intranet + never_direct allow all + + This option replaces some v1.1 options such as inside_firewall + and firewall_ip. DOC_END -NAME: delay_class -TYPE: delay_pool_class +NAME: header_access +IFDEF: HTTP_VIOLATIONS +TYPE: http_header_access[] +LOC: Config.header_access DEFAULT: none -IFDEF: DELAY_POOLS -LOC: Config.Delay DOC_START - This defines the class of each delay pool. There must be exactly one - delay_class line for each delay pool. For example, to define two - delay pools, one of class 2 and one of class 3, the settings above - and here would be: + Usage: header_access header_name allow|deny [!]aclname ... -Example: - delay_pools 2 # 2 delay pools - delay_class 1 2 # pool 1 is a class 2 pool - delay_class 2 3 # pool 2 is a class 3 pool + WARNING: Doing this VIOLATES the HTTP standard. Enabling + this feature could make you liable for problems which it + causes. - The delay pool classes are: + This option replaces the old 'anonymize_headers' and the + older 'http_anonymizer' option with something that is much + more configurable. This new method creates a list of ACLs + for each header, allowing you very fine-tuned header + mangling. - class 1 Everything is limited by a single aggregate - bucket. + You can only specify known headers for the header name. + Other headers are reclassified as 'Other'. You can also + refer to all the headers with 'All'. - class 2 Everything is limited by a single aggregate - bucket as well as an "individual" bucket chosen - from bits 25 through 32 of the IP address. + For example, to achieve the same behavior as the old + 'http_anonymizer standard' option, you should use: - class 3 Everything is limited by a single aggregate - bucket as well as a "network" bucket chosen - from bits 17 through 24 of the IP address and a - "individual" bucket chosen from bits 17 through - 32 of the IP address. + header_access From deny all + header_access Referer deny all + header_access Server deny all + header_access User-Agent deny all + header_access WWW-Authenticate deny all + header_access Link deny all - NOTE: If an IP address is a.b.c.d - -> bits 25 through 32 are "d" - -> bits 17 through 24 are "c" - -> bits 17 through 32 are "c * 256 + d" + Or, to reproduce the old 'http_anonymizer paranoid' feature + you should use: + + header_access Allow allow all + header_access Authorization allow all + header_access WWW-Authenticate allow all + header_access Proxy-Authorization allow all + header_access Proxy-Authenticate allow all + header_access Cache-Control allow all + header_access Content-Encoding allow all + header_access Content-Length allow all + header_access Content-Type allow all + header_access Date allow all + header_access Expires allow all + header_access Host allow all + header_access If-Modified-Since allow all + header_access Last-Modified allow all + header_access Location allow all + header_access Pragma allow all + header_access Accept allow all + header_access Accept-Charset allow all + header_access Accept-Encoding allow all + header_access Accept-Language allow all + header_access Content-Language allow all + header_access Mime-Version allow all + header_access Retry-After allow all + header_access Title allow all + header_access Connection allow all + header_access Proxy-Connection allow all + header_access All deny all + + By default, all headers are allowed (no anonymizing is + performed). DOC_END -NAME: delay_access -TYPE: delay_pool_access +NAME: header_replace +IFDEF: HTTP_VIOLATIONS +TYPE: http_header_replace[] +LOC: Config.header_access DEFAULT: none -IFDEF: DELAY_POOLS -LOC: Config.Delay DOC_START - This is used to determine which delay pool a request falls into. + Usage: header_replace header_name message + Example: header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) - delay_access is sorted per pool and the matching starts with pool 1, - then pool 2, ..., and finally pool N. The first delay pool where the - request is allowed is selected for the request. If it does not allow - the request to any pool then the request is not delayed (default). + This option allows you to change the contents of headers + denied with header_access above, by replacing them with + some fixed string. This replaces the old fake_user_agent + option. - For example, if you want some_big_clients in delay - pool 1 and lotsa_little_clients in delay pool 2: + By default, headers are removed if denied. +DOC_END -Example: - delay_access 1 allow some_big_clients - delay_access 1 deny all - delay_access 2 allow lotsa_little_clients - delay_access 2 deny all +NAME: icon_directory +TYPE: string +LOC: Config.icons.directory +DEFAULT: @DEFAULT_ICON_DIR@ +DOC_START + Where the icons are stored. These are normally kept in + @DEFAULT_ICON_DIR@ DOC_END -NAME: delay_parameters -TYPE: delay_pool_rates -DEFAULT: none -IFDEF: DELAY_POOLS -LOC: Config.Delay +NAME: global_internal_static +TYPE: onoff +LOC: Config.onoff.global_internal_static +DEFAULT: on DOC_START - This defines the parameters for a delay pool. Each delay pool has - a number of "buckets" associated with it, as explained in the - description of delay_class. For a class 1 delay pool, the syntax is: + This directive controls is Squid should intercept all requests for + /squid-internal-static/ no matter which host the URL is requesting + (default on setting), or if nothing special should be done for + such URLs (off setting). The purpose of this directive is to make + icons etc work better in complex cache hierarchies where it may + not always be possible for all corners in the cache mesh to reach + the server generating a directory listing. +DOC_END -delay_parameters pool aggregate +NAME: short_icon_urls +TYPE: onoff +LOC: Config.icons.use_short_names +DEFAULT: off +DOC_START + If this is enabled Squid will use short URLs for icons. - For a class 2 delay pool: + If off the URLs for icons will always be absolute URLs + including the proxy name and port. +DOC_END -delay_parameters pool aggregate individual +NAME: error_directory +TYPE: string +LOC: Config.errorDirectory +DEFAULT: @DEFAULT_ERROR_DIR@ +DOC_START + If you wish to create your own versions of the default + (English) error files, either to customize them to suit your + language or company copy the template English files to another + directory and point this tag at them. +DOC_END - For a class 3 delay pool: +NAME: maximum_single_addr_tries +TYPE: int +LOC: Config.retry.maxtries +DEFAULT: 1 +DOC_START + This sets the maximum number of connection attempts for a + host that only has one address (for multiple-address hosts, + each address is tried once). -delay_parameters pool aggregate network individual + The default value is one attempt, the (not recommended) + maximum is 255 tries. A warning message will be generated + if it is set to a value greater than ten. - The variables here are: + Note: This is in addition to the request re-forwarding which + takes place if Squid fails to get a satisfying response. +DOC_END - pool a pool number - ie, a number between 1 and the - number specified in delay_pools as used in - delay_class lines. +NAME: retry_on_error +TYPE: onoff +LOC: Config.retry.onerror +DEFAULT: off +DOC_START + If set to on Squid will automatically retry requests when + receiving an error response. This is mainly useful if you + are in a complex cache hierarchy to work around access + control errors. +DOC_END - aggregate the "delay parameters" for the aggregate bucket - (class 1, 2, 3). +NAME: snmp_port +TYPE: ushort +LOC: Config.Port.snmp +DEFAULT: 3401 +IFDEF: SQUID_SNMP +DOC_START + Squid can now serve statistics and status information via SNMP. + By default it listens to port 3401 on the machine. If you don't + wish to use SNMP, set this to "0". +DOC_END - individual the "delay parameters" for the individual - buckets (class 2, 3). +NAME: snmp_access +TYPE: acl_access +LOC: Config.accessList.snmp +DEFAULT: none +DEFAULT_IF_NONE: deny all +IFDEF: SQUID_SNMP +DOC_START + Allowing or denying access to the SNMP port. - network the "delay parameters" for the network buckets - (class 3). + All access to the agent is denied by default. + usage: - A pair of delay parameters is written restore/maximum, where restore is - the number of bytes (not bits - modem and network speeds are usually - quoted in bits) per second placed into the bucket, and maximum is the - maximum number of bytes which can be in the bucket at any time. + snmp_access allow|deny [!]aclname ... - For example, if delay pool number 1 is a class 2 delay pool as in the - above example, and is being used to strictly limit each host to 64kbps - (plus overheads), with no overall limit, the line is: +Example: + snmp_access allow snmppublic localhost + snmp_access deny all +DOC_END -delay_parameters 1 -1/-1 8000/8000 +NAME: snmp_incoming_address +TYPE: address +LOC: Config.Addrs.snmp_incoming +DEFAULT: 0.0.0.0 +IFDEF: SQUID_SNMP +DOC_NONE +NAME: snmp_outgoing_address +TYPE: address +LOC: Config.Addrs.snmp_outgoing +DEFAULT: 255.255.255.255 +IFDEF: SQUID_SNMP +DOC_START + Just like 'udp_incoming_address' above, but for the SNMP port. - Note that the figure -1 is used to represent "unlimited". + snmp_incoming_address is used for the SNMP socket receiving + messages from SNMP agents. + snmp_outgoing_address is used for SNMP packets returned to SNMP + agents. - And, if delay pool number 2 is a class 3 delay pool as in the above - example, and you want to limit it to a total of 256kbps (strict limit) - with each 8-bit network permitted 64kbps (strict limit) and each - individual host permitted 4800bps with a bucket maximum size of 64kb - to permit a decent web page to be downloaded at a decent speed - (if the network is not being limited due to overuse) but slow down - large downloads more significantly: + The default snmp_incoming_address (0.0.0.0) is to listen on all + available network interfaces. -delay_parameters 2 32000/32000 8000/8000 600/8000 + If snmp_outgoing_address is set to 255.255.255.255 (the default) + it will use the same socket as snmp_incoming_address. Only + change this if you want to have SNMP replies sent using another + address than where this Squid listens for SNMP queries. - There must be one delay_parameters line for each delay pool. + NOTE, snmp_incoming_address and snmp_outgoing_address can not have + the same value since they both use port 3401. DOC_END -NAME: delay_initial_bucket_level -COMMENT: (percent, 0-100) -TYPE: ushort -DEFAULT: 50 -IFDEF: DELAY_POOLS -LOC: Config.Delay.initial +NAME: as_whois_server +TYPE: string +LOC: Config.as_whois_server +DEFAULT: whois.ra.net +DEFAULT_IF_NONE: whois.ra.net DOC_START - The initial bucket percentage is used to determine how much is put - in each bucket when squid starts, is reconfigured, or first notices - a host accessing it (in class 2 and class 3, individual hosts and - networks only have buckets associated with them once they have been - "seen" by squid). + WHOIS server to query for AS numbers. NOTE: AS numbers are + queried only when Squid starts up, not for every request. DOC_END NAME: incoming_icp_average @@ -4822,72 +4896,6 @@ nameservers by setting this option to 'off'. DOC_END -NAME: digest_generation -IFDEF: USE_CACHE_DIGESTS -TYPE: onoff -LOC: Config.onoff.digest_generation -DEFAULT: on -DOC_START - This controls whether the server will generate a Cache Digest - of its contents. By default, Cache Digest generation is - enabled if Squid is compiled with USE_CACHE_DIGESTS defined. -DOC_END - -NAME: digest_bits_per_entry -IFDEF: USE_CACHE_DIGESTS -TYPE: int -LOC: Config.digest.bits_per_entry -DEFAULT: 5 -DOC_START - This is the number of bits of the server's Cache Digest which - will be associated with the Digest entry for a given HTTP - Method and URL (public key) combination. The default is 5. -DOC_END - -NAME: digest_rebuild_period -IFDEF: USE_CACHE_DIGESTS -COMMENT: (seconds) -TYPE: time_t -LOC: Config.digest.rebuild_period -DEFAULT: 1 hour -DOC_START - This is the number of seconds between Cache Digest rebuilds. -DOC_END - -NAME: digest_rewrite_period -COMMENT: (seconds) -IFDEF: USE_CACHE_DIGESTS -TYPE: time_t -LOC: Config.digest.rewrite_period -DEFAULT: 1 hour -DOC_START - This is the number of seconds between Cache Digest writes to - disk. -DOC_END - -NAME: digest_swapout_chunk_size -COMMENT: (bytes) -TYPE: b_size_t -IFDEF: USE_CACHE_DIGESTS -LOC: Config.digest.swapout_chunk_size -DEFAULT: 4096 bytes -DOC_START - This is the number of bytes of the Cache Digest to write to - disk at a time. It defaults to 4096 bytes (4KB), the Squid - default swap page. -DOC_END - -NAME: digest_rebuild_chunk_percentage -COMMENT: (percent, 0-100) -IFDEF: USE_CACHE_DIGESTS -TYPE: int -LOC: Config.digest.rebuild_chunk_percentage -DEFAULT: 10 -DOC_START - This is the percentage of the Cache Digest to be scanned at a - time. By default it is set to 10% of the Cache Digest. -DOC_END - NAME: chroot TYPE: string LOC: Config.chroot_dir @@ -4900,54 +4908,12 @@ error. DOC_END -NAME: client_persistent_connections -TYPE: onoff -LOC: Config.onoff.client_pconns -DEFAULT: on -DOC_NONE - -NAME: server_persistent_connections -TYPE: onoff -LOC: Config.onoff.server_pconns -DEFAULT: on -DOC_START - Persistent connection support for clients and servers. By - default, Squid uses persistent connections (when allowed) - with its clients and servers. You can use these options to - disable persistent connections with clients and/or servers. -DOC_END - -NAME: persistent_connection_after_error -TYPE: onoff -LOC: Config.onoff.error_pconns -DEFAULT: off -DOC_START - With this directive the use of persistent connections after - HTTP errors can be disabled. Useful if you have clients - who fail to handle errors on persistent connections proper. -DOC_END - -NAME: detect_broken_pconn -TYPE: onoff -LOC: Config.onoff.detect_broken_server_pconns -DEFAULT: off -DOC_START - Some servers have been found to incorrectly signal the use - of HTTP/1.0 persistent connections even on replies not - compatible, causing significant delays. This server problem - has mostly been seen on redirects. - - By enabling this directive Squid attempts to detect such - broken replies and automatically assume the reply is finished - after 10 seconds timeout. -DOC_END - NAME: balance_on_multiple_ip TYPE: onoff LOC: Config.onoff.balance_on_multiple_ip DEFAULT: on DOC_START - Some load balancing servers based on round robin DNS have been + Some load balancing servers based on round robin DNS have been found not to preserve user session state across requests to different IP addresses. diff -ruN squid-2.6.STABLE13/src/client_side.c squid-2.6.STABLE14/src/client_side.c --- squid-2.6.STABLE13/src/client_side.c Tue Mar 20 15:26:34 2007 +++ squid-2.6.STABLE14/src/client_side.c Sun Jul 15 03:52:17 2007 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.693.2.12 2007/03/20 21:26:34 hno Exp $ + * $Id: client_side.c,v 1.693.2.13 2007/07/15 09:52:17 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1520,16 +1520,19 @@ } } if (httpHeaderHas(req_hdr, HDR_VIA)) { - String s = httpHeaderGetList(req_hdr, HDR_VIA); /* * ThisCache cannot be a member of Via header, "1.0 ThisCache" can. * Note ThisCache2 has a space prepended to the hostname so we don't * accidentally match super-domains. */ - if (strListIsSubstr(&s, ThisCache2, ',')) { + String s = httpHeaderGetList(req_hdr, HDR_VIA); + int n = strIsSubstr(&s, ThisCache2); + if (n) { debugObj(33, 1, "WARNING: Forwarding loop detected for:\n", request, (ObjPackMethod) & httpRequestPackDebug); request->flags.loopdetect = 1; + if (n > 1) + request->flags.loopdetect_twice = 1; } #if FORW_VIA_DB fvdbCountVia(strBuf(s)); @@ -1615,6 +1618,8 @@ { request_t *req = http->request; method_t method = req->method; + if (req->flags.loopdetect) + return 0; if (req->protocol == PROTO_HTTP) return httpCachable(method); /* FTP is always cachable */ @@ -3415,11 +3420,11 @@ return; } /* - * Deny loops when running in accelerator/transproxy mode. + * Deny double loops */ - if (r->flags.loopdetect && (http->flags.accel || http->flags.transparent)) { - http->al.http.code = HTTP_FORBIDDEN; - err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, http->orig_request); + if (r->flags.loopdetect_twice) { + http->al.http.code = HTTP_GATEWAY_TIMEOUT; + err = errorCon(ERR_CANNOT_FORWARD, HTTP_GATEWAY_TIMEOUT, http->orig_request); http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, r->method, null_request_flags); errorAppendEntry(http->entry, err); diff -ruN squid-2.6.STABLE13/src/comm_devpoll.c squid-2.6.STABLE14/src/comm_devpoll.c --- squid-2.6.STABLE13/src/comm_devpoll.c Wed Dec 31 17:00:00 1969 +++ squid-2.6.STABLE14/src/comm_devpoll.c Sat Jun 23 15:26:22 2007 @@ -0,0 +1,234 @@ + +/* + * $Id: comm_devpoll.c,v 1.3.2.2 2007/06/23 21:26:22 hno Exp $ + * + * DEBUG: section 5 Socket Functions + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" +#include "comm_generic.c" + +#include + +#define DEVPOLL_UPDATESIZE 1024 +#define DEVPOLL_QUERYSIZE 1024 + +static int devpoll_fd; +static struct timespec zero_timespec; + +/* + * This is a very simple driver for Solaris /dev/poll. + * + * The updates are batched, one trip through the comm loop. + * (like libevent.) We keep a pointer into the structs so we + * can zero out an entry in the poll list if its active. + */ + +/* Current state */ +struct _devpoll_state { + char state; + int update_offset; +}; + +/* The update list */ +struct { + struct pollfd *pfds; + int cur; + int size; +} devpoll_update; + +static struct _devpoll_state *devpoll_state; +static struct dvpoll do_poll; +static int dpoll_nfds; + +static void +do_select_init() +{ + devpoll_fd = open("/dev/poll", O_RDWR); + if (devpoll_fd < 0) + fatalf("comm_select_init: can't open /dev/poll: %s\n", xstrerror()); + + zero_timespec.tv_sec = 0; + zero_timespec.tv_nsec = 0; + + /* This tracks the FD devpoll offset+state */ + devpoll_state = xcalloc(Squid_MaxFD, sizeof(struct _devpoll_state)); + + /* And this is the stuff we use to read events */ + do_poll.dp_fds = xcalloc(DEVPOLL_QUERYSIZE, sizeof(struct pollfd)); + dpoll_nfds = DEVPOLL_QUERYSIZE; + + devpoll_update.pfds = xcalloc(DEVPOLL_UPDATESIZE, sizeof(struct pollfd)); + devpoll_update.cur = -1; + devpoll_update.size = DEVPOLL_UPDATESIZE; + + fd_open(devpoll_fd, FD_UNKNOWN, "devpoll ctl"); + commSetCloseOnExec(devpoll_fd); +} + +static void +comm_flush_updates(void) +{ + int i; + if (devpoll_update.cur == -1) + return; + + debug(5, 5) ("comm_flush_updates: %d fds queued\n", devpoll_update.cur + 1); + + i = write(devpoll_fd, devpoll_update.pfds, (devpoll_update.cur + 1) * sizeof(struct pollfd)); + assert(i > 0); + assert(i == sizeof(struct pollfd) * (devpoll_update.cur + 1)); + devpoll_update.cur = -1; +} + +/* + * We could be "optimal" and -change- an existing entry if they + * just add a bit - since the devpoll interface OR's multiple fd + * updates. We'll need to POLLREMOVE entries which has a bit cleared + * but for now I'll do whats "easier" and add the smart logic + * later. + */ +static void +comm_update_fd(int fd, int events) +{ + debug(5, 5) ("comm_update_fd: fd %d: events %d\n", fd, events); + if (devpoll_update.cur != -1 && (devpoll_update.cur == devpoll_update.size)) + comm_flush_updates(); + devpoll_update.cur++; + debug(5, 5) (" -> new slot (%d)\n", devpoll_update.cur); + devpoll_state[fd].update_offset = devpoll_update.cur; + devpoll_update.pfds[devpoll_update.cur].fd = fd; + devpoll_update.pfds[devpoll_update.cur].events = events; + devpoll_update.pfds[devpoll_update.cur].revents = 0; +} + +void +comm_select_postinit() +{ + debug(5, 1) ("Using /dev/poll for the IO loop\n"); +} + +static void +do_select_shutdown() +{ + fd_close(devpoll_fd); + close(devpoll_fd); + devpoll_fd = -1; + xfree(devpoll_state); +} + +void +comm_select_status(StoreEntry * sentry) +{ + storeAppendPrintf(sentry, "\tIO loop method: /dev/poll\n"); +} + +void +commOpen(int fd) +{ + debug(5, 5) ("commOpen: %d\n", fd); + devpoll_state[fd].state = 0; + devpoll_state[fd].update_offset = -1; +} + +void +commClose(int fd) +{ + debug(5, 5) ("commClose: %d\n", fd); + comm_update_fd(fd, POLLREMOVE); +} + +void +commSetEvents(int fd, int need_read, int need_write) +{ + int st_new = (need_read ? POLLIN : 0) | (need_write ? POLLOUT : 0); + int st_change; + + if (fd_table[fd].flags.closing) + return; + + debug(5, 5) ("commSetEvents(fd=%d, read=%d, write=%d)\n", fd, need_read, need_write); + + st_change = devpoll_state[fd].state ^ st_new; + if (!st_change) + return; + + comm_update_fd(fd, POLLREMOVE); + if (st_new) + comm_update_fd(fd, st_new); + devpoll_state[fd].state = st_new; +} + +static int +do_comm_select(int msec) +{ + int i; + int num; + + statCounter.syscalls.polls++; + + do_poll.dp_timeout = msec; + do_poll.dp_nfds = dpoll_nfds; + /* dp_fds is already allocated */ + + debug(5, 5) ("do_comm_select: begin\n"); + comm_flush_updates(); + + num = ioctl(devpoll_fd, DP_POLL, &do_poll); + debug(5, 5) ("do_comm_select: ioctl() returned %d fds\n", num); + + if (num < 0) { + getCurrentTime(); + if (ignoreErrno(errno)) + return COMM_OK; + + debug(5, 1) ("comm_select: devpoll ioctl(DP_POLL) failure: %s\n", xstrerror()); + return COMM_ERROR; + } + statHistCount(&statCounter.select_fds_hist, num); + if (num == 0) + return COMM_TIMEOUT; + + for (i = 0; i < num; i++) { + int fd = (int) do_poll.dp_fds[i].fd; + if (do_poll.dp_fds[i].revents & (POLLERR | POLLHUP | POLLNVAL)) { + debug(5, 1) ("comm_select: devpoll event error: fd %d\n", fd); + continue; /* XXX! */ + } + if (do_poll.dp_fds[i].revents & POLLIN) { + comm_call_handlers(fd, 1, 0); + } + if (do_poll.dp_fds[i].revents & POLLOUT) { + comm_call_handlers(fd, 0, 1); + } + } + + return COMM_OK; +} diff -ruN squid-2.6.STABLE13/src/comm_epoll.c squid-2.6.STABLE14/src/comm_epoll.c --- squid-2.6.STABLE13/src/comm_epoll.c Mon Oct 23 05:22:21 2006 +++ squid-2.6.STABLE14/src/comm_epoll.c Fri Jun 22 06:07:35 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_epoll.c,v 1.27 2006/10/23 11:22:21 hno Exp $ + * $Id: comm_epoll.c,v 1.27.2.1 2007/06/22 12:07:35 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -96,6 +96,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: epoll\n"); +} + +void +commOpen(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/comm_kqueue.c squid-2.6.STABLE14/src/comm_kqueue.c --- squid-2.6.STABLE13/src/comm_kqueue.c Mon Mar 12 16:23:04 2007 +++ squid-2.6.STABLE14/src/comm_kqueue.c Fri Jun 22 06:07:35 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_kqueue.c,v 1.10.2.1 2007/03/12 22:23:04 hno Exp $ + * $Id: comm_kqueue.c,v 1.10.2.2 2007/06/22 12:07:35 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -86,6 +86,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: kqueue\n"); +} + +void +commOpen(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/comm_poll.c squid-2.6.STABLE14/src/comm_poll.c --- squid-2.6.STABLE13/src/comm_poll.c Fri Oct 27 18:34:54 2006 +++ squid-2.6.STABLE14/src/comm_poll.c Fri Jun 22 06:07:35 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_poll.c,v 1.23 2006/10/28 00:34:54 hno Exp $ + * $Id: comm_poll.c,v 1.23.2.1 2007/06/22 12:07:35 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -73,6 +73,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: poll\n"); +} + +void +commOpen(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/comm_select.c squid-2.6.STABLE14/src/comm_select.c --- squid-2.6.STABLE13/src/comm_select.c Thu Dec 28 15:11:26 2006 +++ squid-2.6.STABLE14/src/comm_select.c Fri Jun 22 06:07:35 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_select.c,v 1.80 2006/12/28 22:11:26 hno Exp $ + * $Id: comm_select.c,v 1.80.2.1 2007/06/22 12:07:35 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -91,6 +91,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: select\n"); +} + +void +commClose(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/comm_select_simple.c squid-2.6.STABLE14/src/comm_select_simple.c --- squid-2.6.STABLE13/src/comm_select_simple.c Thu Dec 28 15:11:26 2006 +++ squid-2.6.STABLE14/src/comm_select_simple.c Fri Jun 22 06:07:35 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_select_simple.c,v 1.3 2006/12/28 22:11:26 hno Exp $ + * $Id: comm_select_simple.c,v 1.3.2.1 2007/06/22 12:07:35 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -71,6 +71,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: select in POSIX mode\n"); +} + +void +commOpen(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/comm_select_win32.c squid-2.6.STABLE14/src/comm_select_win32.c --- squid-2.6.STABLE13/src/comm_select_win32.c Thu Dec 28 15:11:26 2006 +++ squid-2.6.STABLE14/src/comm_select_win32.c Fri Jun 22 06:07:36 2007 @@ -1,6 +1,6 @@ /* - * $Id: comm_select_win32.c,v 1.7 2006/12/28 22:11:26 hno Exp $ + * $Id: comm_select_win32.c,v 1.7.2.1 2007/06/22 12:07:36 adrian Exp $ * * DEBUG: section 5 Socket Functions * @@ -68,6 +68,17 @@ comm_select_status(StoreEntry * sentry) { storeAppendPrintf(sentry, "\tIO loop method: select\n"); +} + +void +commOpen(int fd) +{ +} + +void +commClose(int fd) +{ + commSetEvents(fd, 0, 0); } void diff -ruN squid-2.6.STABLE13/src/dns_internal.c squid-2.6.STABLE14/src/dns_internal.c --- squid-2.6.STABLE13/src/dns_internal.c Sun Dec 17 03:51:44 2006 +++ squid-2.6.STABLE14/src/dns_internal.c Sat Jun 23 15:34:09 2007 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.61 2006/12/17 10:51:44 serassio Exp $ + * $Id: dns_internal.c,v 1.61.2.1 2007/06/23 21:34:09 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -812,6 +812,10 @@ q->attempt++; } rfc1035MessageDestroy(message); + if (q->hash.key) { + hash_remove_link(idns_lookup_hash, &q->hash); + q->hash.key = NULL; + } q->start_t = current_time; q->id = idnsQueryID(); rfc1035SetQueryID(q->buf, q->id); diff -ruN squid-2.6.STABLE13/src/event.c squid-2.6.STABLE14/src/event.c --- squid-2.6.STABLE13/src/event.c Sat Jul 8 05:32:04 2006 +++ squid-2.6.STABLE14/src/event.c Sat Jun 2 18:39:25 2007 @@ -1,6 +1,6 @@ /* - * $Id: event.c,v 1.37 2006/07/08 11:32:04 hno Exp $ + * $Id: event.c,v 1.37.2.1 2007/06/03 00:39:25 hno Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -175,8 +175,8 @@ eventNextTime(void) { if (!tasks) - return (int) 10; - return (int) ((tasks->when - current_dtime) * 1000); + return 10000; + return ceil((tasks->when - current_dtime) * 1000); } void diff -ruN squid-2.6.STABLE13/src/fd.c squid-2.6.STABLE14/src/fd.c --- squid-2.6.STABLE13/src/fd.c Mon Oct 23 05:25:29 2006 +++ squid-2.6.STABLE14/src/fd.c Mon Jun 25 17:41:09 2007 @@ -1,6 +1,6 @@ /* - * $Id: fd.c,v 1.55 2006/10/23 11:25:29 hno Exp $ + * $Id: fd.c,v 1.55.2.2 2007/06/25 23:41:09 hno Exp $ * * DEBUG: section 51 Filedescriptor Functions * AUTHOR: Duane Wessels @@ -90,7 +90,7 @@ assert(F->write_handler == NULL); } debug(51, 3) ("fd_close FD %d %s\n", fd, F->desc); - commSetEvents(fd, 0, 0); + commClose(fd); F->flags.open = 0; #if DELAY_POOLS if (F->slow_id) @@ -154,6 +154,7 @@ debug(51, 3) ("fd_open FD %d %s\n", fd, desc); F->type = type; F->flags.open = 1; + commOpen(fd); #ifdef _SQUID_MSWIN_ F->win32.handle = _get_osfhandle(fd); switch (type) { @@ -273,6 +274,8 @@ debug(51, 0) ("WARNING: This machine has a serious shortage of filedescriptors.\n"); new = x; } + if (Squid_MaxFD - new < XMIN(256, Squid_MaxFD / 2)) + fatalf("Too few filedescriptors available in the system (%d usable of %d).\n", Squid_MaxFD - new, Squid_MaxFD); debug(51, 0) ("Reserved FD adjusted from %d to %d due to failures\n", RESERVED_FD, new); RESERVED_FD = new; diff -ruN squid-2.6.STABLE13/src/fs/Makefile.in squid-2.6.STABLE14/src/fs/Makefile.in --- squid-2.6.STABLE13/src/fs/Makefile.in Sat Nov 4 16:20:05 2006 +++ squid-2.6.STABLE14/src/fs/Makefile.in Fri Jun 22 18:14:58 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.41 2006/11/04 23:20:05 hno Exp $ +# $Id: Makefile.in,v 1.41.2.1 2007/06/23 00:14:58 hno Exp $ # @@ -229,6 +229,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/src/ftp.c squid-2.6.STABLE14/src/ftp.c --- squid-2.6.STABLE13/src/ftp.c Mon Mar 26 17:41:43 2007 +++ squid-2.6.STABLE14/src/ftp.c Sat Jun 2 18:40:32 2007 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.342.2.2 2007/03/26 23:41:43 hno Exp $ + * $Id: ftp.c,v 1.342.2.3 2007/06/03 00:40:32 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1033,7 +1033,7 @@ const char *t; if ((t = strRChr(request->urlpath, ';')) != NULL) { if (strncasecmp(t + 1, "type=", 5) == 0) { - ftpState->typecode = (char) toupper((int) *(t + 6)); + ftpState->typecode = (char) xtoupper(*(t + 6)); strCutPtr(request->urlpath, t); } } diff -ruN squid-2.6.STABLE13/src/helper.c squid-2.6.STABLE14/src/helper.c --- squid-2.6.STABLE13/src/helper.c Wed Mar 14 06:08:42 2007 +++ squid-2.6.STABLE14/src/helper.c Sat Jun 2 18:40:32 2007 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.62.2.2 2007/03/14 12:08:42 hno Exp $ + * $Id: helper.c,v 1.62.2.3 2007/06/03 00:40:32 hno Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -756,7 +756,7 @@ i = strtol(msg, &msg, 10); if (msg == srv->rbuf || errno) i = -1; - while (*msg && isspace((int) *msg)) + while (*msg && xisspace(*msg)) msg++; } if ((!hlp->concurrency) || (i >= 0 && i < hlp->concurrency)) diff -ruN squid-2.6.STABLE13/src/main.c squid-2.6.STABLE14/src/main.c --- squid-2.6.STABLE13/src/main.c Mon Mar 12 16:25:40 2007 +++ squid-2.6.STABLE14/src/main.c Sat Jun 23 15:33:24 2007 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.393.2.2 2007/03/12 22:25:40 hno Exp $ + * $Id: main.c,v 1.393.2.3 2007/06/23 21:33:24 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -1053,6 +1053,10 @@ case SIGKILL: exit(0); break; + case SIGINT: + case SIGTERM: + syslog(LOG_ALERT, "Exiting due to unexpected forced shutdown"); + exit(1); default: break; } diff -ruN squid-2.6.STABLE13/src/protos.h squid-2.6.STABLE14/src/protos.h --- squid-2.6.STABLE13/src/protos.h Mon Mar 26 17:14:09 2007 +++ squid-2.6.STABLE14/src/protos.h Sun Jul 15 03:52:17 2007 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.520.2.1 2007/03/26 23:14:09 hno Exp $ + * $Id: protos.h,v 1.520.2.3 2007/07/15 09:52:17 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -193,6 +193,8 @@ extern int comm_select(int); extern void commUpdateEvents(int fd); extern void commSetEvents(int fd, int need_read, int need_write); +extern void commClose(int fd); +extern void commOpen(int fd); extern void commUpdateReadHandler(int, PF *, void *); extern void commUpdateWriteHandler(int, PF *, void *); extern void comm_quick_poll_required(void); @@ -400,7 +402,7 @@ extern void strListAdd(String * str, const char *item, char del); extern void strListAddUnique(String * str, const char *item, char del); extern int strListIsMember(const String * str, const char *item, char del); -extern int strListIsSubstr(const String * list, const char *s, char del); +extern int strIsSubstr(const String * list, const char *s); extern int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos); extern const char *getStringPrefix(const char *str, const char *end); extern int httpHeaderParseInt(const char *start, int *val); diff -ruN squid-2.6.STABLE13/src/refresh.c squid-2.6.STABLE14/src/refresh.c --- squid-2.6.STABLE13/src/refresh.c Thu Apr 26 17:10:54 2007 +++ squid-2.6.STABLE14/src/refresh.c Sat Jun 2 18:37:30 2007 @@ -1,6 +1,6 @@ /* - * $Id: refresh.c,v 1.63.2.1 2007/04/26 23:10:54 hno Exp $ + * $Id: refresh.c,v 1.63.2.2 2007/06/03 00:37:30 hno Exp $ * * DEBUG: section 22 Refresh Calculation * AUTHOR: Harvest Derived @@ -201,12 +201,12 @@ * If we are here, staleness is determined by the refresh_pattern * configured minimum age. */ - if (age <= R->min) { - debug(22, 3) ("FRESH: age %d <= min %d\n", (int) age, (int) R->min); + if (age < R->min) { + debug(22, 3) ("FRESH: age %d < min %d\n", (int) age, (int) R->min); sf->min = 1; return -1; } - debug(22, 3) ("STALE: age %d > min %d\n", (int) age, (int) R->min); + debug(22, 3) ("STALE: age %d >= min %d\n", (int) age, (int) R->min); return (age - R->min); } diff -ruN squid-2.6.STABLE13/src/repl/Makefile.in squid-2.6.STABLE14/src/repl/Makefile.in --- squid-2.6.STABLE13/src/repl/Makefile.in Sat Nov 4 16:20:05 2006 +++ squid-2.6.STABLE14/src/repl/Makefile.in Fri Jun 22 18:14:58 2007 @@ -16,7 +16,7 @@ # Makefile for storage modules in the Squid Object Cache server # -# $Id: Makefile.in,v 1.38 2006/11/04 23:20:05 hno Exp $ +# $Id: Makefile.in,v 1.38.2.1 2007/06/23 00:14:58 hno Exp $ # srcdir = @srcdir@ @@ -193,6 +193,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/src/snmp_core.c squid-2.6.STABLE14/src/snmp_core.c --- squid-2.6.STABLE13/src/snmp_core.c Tue Nov 28 16:16:48 2006 +++ squid-2.6.STABLE14/src/snmp_core.c Sun Jul 15 03:51:18 2007 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.63 2006/11/28 23:16:48 hno Exp $ + * $Id: snmp_core.c,v 1.63.2.1 2007/07/15 09:51:18 hno Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -792,7 +792,7 @@ *len += 1; } else { identifier = name[*len - 1]; - while ((identifier != index[loop]) && (loop < TIME_INDEX_LEN)) + while ((loop < TIME_INDEX_LEN) && (identifier != index[loop])) loop++; if (loop < TIME_INDEX_LEN - 1) { instance = xmalloc(sizeof(name) * (*len)); diff -ruN squid-2.6.STABLE13/src/store_dir.c squid-2.6.STABLE14/src/store_dir.c --- squid-2.6.STABLE13/src/store_dir.c Sat May 5 16:41:21 2007 +++ squid-2.6.STABLE14/src/store_dir.c Sat Jun 23 16:50:18 2007 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.143.2.2 2007/05/05 22:41:21 hno Exp $ + * $Id: store_dir.c,v 1.143.2.3 2007/06/23 22:50:18 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -131,23 +131,18 @@ storeDirValidSwapDirSize(int swapdir, squid_off_t objsize) { /* - * If the swapdir's max_obj_size is -1, then it definitely can + * If the object size is -1, then if the storedir max_objsize isn't -1 + * we can't store it (min_objsize intentionally ignored here) */ - if (Config.cacheSwap.swapDirs[swapdir].max_objsize == -1) - return 1; - - /* - * If the object size is -1, then if the storedir isn't -1 we - * can't store it - */ - if ((objsize == -1) && - (Config.cacheSwap.swapDirs[swapdir].max_objsize != -1)) - return 0; + if (objsize == -1) + return Config.cacheSwap.swapDirs[swapdir].max_objsize == -1; /* - * Else, make sure that the max object size is larger than objsize + * Else, make sure that min_objsize <= objsize < max_objsize */ - if (Config.cacheSwap.swapDirs[swapdir].max_objsize > objsize) + if ((Config.cacheSwap.swapDirs[swapdir].min_objsize <= objsize) && + ((Config.cacheSwap.swapDirs[swapdir].max_objsize > objsize) || + (Config.cacheSwap.swapDirs[swapdir].max_objsize == -1))) return 1; else return 0; @@ -337,6 +332,11 @@ storeAppendPrintf(sentry, "FS Block Size %d Bytes\n", SD->fs.blksize); SD->statfs(SD, sentry); + storeAppendPrintf(sentry, "Accepted object sizes: %" PRINTF_OFF_T " - ", SD->min_objsize); + if (SD->max_objsize == -1) + storeAppendPrintf(sentry, "(unlimited) bytes\n"); + else + storeAppendPrintf(sentry, "%" PRINTF_OFF_T " bytes\n", SD->max_objsize); if (SD->repl) { storeAppendPrintf(sentry, "Removal policy: %s\n", SD->repl->_type); if (SD->repl->Stats) diff -ruN squid-2.6.STABLE13/src/structs.h squid-2.6.STABLE14/src/structs.h --- squid-2.6.STABLE13/src/structs.h Thu Apr 26 17:11:51 2007 +++ squid-2.6.STABLE14/src/structs.h Sun Jul 15 03:52:18 2007 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.507.2.5 2007/04/26 23:11:51 hno Exp $ + * $Id: structs.h,v 1.507.2.7 2007/07/15 09:52:18 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1755,6 +1755,7 @@ int max_size; char *path; int index; /* This entry's index into the swapDirs array */ + squid_off_t min_objsize; squid_off_t max_objsize; RemovalPolicy *repl; int removals; @@ -1814,6 +1815,7 @@ unsigned int cachable:1; unsigned int hierarchical:1; unsigned int loopdetect:1; + unsigned int loopdetect_twice:1; unsigned int proxy_keepalive:1; unsigned int proxying:1; /* this should be killed, also in httpstateflags */ unsigned int refresh:1; diff -ruN squid-2.6.STABLE13/src/tools.c squid-2.6.STABLE14/src/tools.c --- squid-2.6.STABLE13/src/tools.c Sat Nov 4 10:09:45 2006 +++ squid-2.6.STABLE14/src/tools.c Sat Jun 2 18:40:32 2007 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.250 2006/11/04 17:09:45 hno Exp $ + * $Id: tools.c,v 1.250.2.1 2007/06/03 00:40:32 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1211,7 +1211,7 @@ p = (unsigned char *) *t; if (!p) goto error; - while (*p && isspace(*p)) + while (*p && xisspace(*p)) p++; if (!*p) goto error; @@ -1240,7 +1240,7 @@ p++; break; default: - if (!quoted && isspace(*p)) { + if (!quoted && xisspace(*p)) { p++; goto done; } diff -ruN squid-2.6.STABLE13/tools/Makefile.in squid-2.6.STABLE14/tools/Makefile.in --- squid-2.6.STABLE13/tools/Makefile.in Sat Nov 4 16:20:05 2006 +++ squid-2.6.STABLE14/tools/Makefile.in Fri Jun 22 18:14:59 2007 @@ -17,7 +17,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.12 2006/11/04 23:20:05 hno Exp $ +# $Id: Makefile.in,v 1.12.2.1 2007/06/23 00:14:59 hno Exp $ # # Uncomment and customize the following to suit your needs: # @@ -214,6 +214,8 @@ USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@ USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@ USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@ +USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@ +USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@ USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@ USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@ USE_EPOLL_FALSE = @USE_EPOLL_FALSE@ diff -ruN squid-2.6.STABLE13/tools/cachemgr.c squid-2.6.STABLE14/tools/cachemgr.c --- squid-2.6.STABLE13/tools/cachemgr.c Sun Sep 10 14:06:44 2006 +++ squid-2.6.STABLE14/tools/cachemgr.c Mon Jun 25 17:39:04 2007 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.5 2006/09/10 20:06:44 serassio Exp $ + * $Id: cachemgr.c,v 1.5.2.1 2007/06/25 23:39:04 hno Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -592,7 +592,7 @@ printf("\n"); printf("CacheMgr@%s: %s\n", req->hostname, action); - printf("\n"); + printf("\n"); printf("\n"); if (parse_menu) { printf("

    Cache Manager menu for %s:

    ",